| line |
true |
false |
branch |
|
62
|
0 |
4545796 |
if (size > PSTM_MAX_SIZE) |
|
67
|
0 |
4545796 |
if (a->dp == NULL) |
|
76
|
78676491 |
4545796 |
for (x = 0; x < size; x++) |
|
106
|
0 |
27 |
if (size > PSTM_MAX_SIZE) |
|
111
|
27 |
0 |
if (a->alloc < size) |
|
119
|
0 |
27 |
if (tmp == NULL) |
|
129
|
27 |
27 |
for (; i < a->alloc; i++) |
|
146
|
20801529 |
1553874 |
if (a == b) |
|
151
|
0 |
1553874 |
if (b->alloc < a->used) |
|
153
|
0 |
0 |
if ((res = pstm_grow(b, a->used)) != PSTM_OKAY) |
|
169
|
14211836 |
1553874 |
for (n = 0; n < a->used; n++) |
|
174
|
107 |
1553874 |
for (; n < b->used; n++) |
|
192
|
0 |
35032 |
if (pstm_copy(a, b) != PSTM_OKAY) |
|
211
|
114678588 |
63767 |
while (a->used > 0 && a->dp[a->used - 1] == 0) |
|
|
29826091 |
84852497 |
while (a->used > 0 && a->dp[a->used - 1] == 0) |
|
216
|
63767 |
84852497 |
if (a->used == 0) |
|
231
|
4769630 |
0 |
if (a != NULL && a->dp != NULL) |
|
|
4545796 |
223834 |
if (a != NULL && a->dp != NULL) |
|
234
|
33705479 |
4545796 |
for (i = 0; i < a->used; i++) |
|
255
|
1117973 |
0 |
if (mp0) |
|
258
|
1117973 |
0 |
if (mp1) |
|
261
|
4477 |
1113496 |
if (mp2) |
|
264
|
0 |
4477 |
if (mp3) |
|
267
|
0 |
0 |
if (mp4) |
|
270
|
0 |
0 |
if (mp5) |
|
273
|
0 |
0 |
if (mp6) |
|
276
|
0 |
0 |
if (mp7) |
|
302
|
8306713 |
914205 |
for (n = 0; n < a->alloc; n++) |
|
318
|
469170 |
48358717 |
if (a->used > b->used) |
|
322
|
563774 |
47794943 |
else if (a->used < b->used) |
|
331
|
48375109 |
7214 |
for (n = 0; n < a->used; ++n, --tmpa, --tmpb) |
|
333
|
19643635 |
28731474 |
if (*tmpa > *tmpb) |
|
337
|
28144094 |
587380 |
else if (*tmpa < *tmpb) |
|
352
|
0 |
15811863 |
if (a->sign != b->sign) |
|
354
|
0 |
0 |
if (a->sign == PSTM_NEG) |
|
364
|
0 |
15811863 |
if (a->sign == PSTM_NEG) |
|
382
|
495752 |
7027657 |
if ((b && a->used == 0) || a->sign == PSTM_NEG) |
|
|
495752 |
0 |
if ((b && a->used == 0) || a->sign == PSTM_NEG) |
|
|
3497506 |
4025903 |
if ((b && a->used == 0) || a->sign == PSTM_NEG) |
|
387
|
3985823 |
40080 |
if (a->used > 1) |
|
392
|
37938 |
2142 |
if (a->dp[0] > b) |
|
396
|
0 |
2142 |
else if (a->dp[0] < b) |
|
504
|
0 |
19896 |
if (a->alloc < a->used) |
|
506
|
0 |
0 |
if (pstm_grow(a, a->used) != PSTM_OKAY) |
|
512
|
2742974 |
19896 |
for (; len > 0; len--) |
|
514
|
0 |
2742974 |
if (pstm_mul_2d(a, 8, a) != PSTM_OKAY) |
|
537
|
7686 |
0 |
if (len < 1 || *(p++) != ASN_INTEGER || |
|
538
|
0 |
7556 |
getAsnLength(&p, len - 1, &vlen) < 0 || (len - 1) < vlen) |
|
543
|
0 |
7556 |
if (pstm_init_for_read_unsigned_bin(pool, a, vlen) != PSTM_OKAY) |
|
547
|
0 |
7556 |
if (pstm_read_unsigned_bin(a, p, vlen) != 0) |
|
574
|
0 |
862516 |
if (pstm_init_size(pool, &tmp, sizeof(pstm_digit)) != PSTM_OKAY) |
|
610
|
6665 |
0 |
if (radix < 2 || radix > 64) |
|
|
0 |
6665 |
if (radix < 2 || radix > 64) |
|
616
|
0 |
6665 |
if (*buf == '-') |
|
630
|
868964 |
217 |
while (len > 0) |
|
636
|
868964 |
0 |
ch = ((radix < 36) ? |
|
639
|
11823828 |
6448 |
for (y = 0; y < 64; y++) |
|
641
|
862516 |
10961312 |
if (ch == pstm_s_rmap[y]) |
|
651
|
862516 |
6448 |
if (y < radix) |
|
664
|
6665 |
0 |
if (pstm_iszero(a) != PS_TRUE) |
|
679
|
0 |
67007 |
if (a->used == 0) |
|
689
|
2318116 |
67007 |
while (q > ((pstm_digit) 0)) |
|
727
|
0 |
0 |
if (b >= a->used) |
|
733
|
0 |
0 |
for (y = 0; y < a->used - b; y++) |
|
738
|
0 |
0 |
for (; y < a->used; y++) |
|
759
|
0 |
24330 |
if (b <= 0) |
|
764
|
0 |
24330 |
if (a->alloc < a->used + b) |
|
766
|
0 |
0 |
if ((res = pstm_grow(a, a->used + b)) != PSTM_OKAY) |
|
784
|
145017 |
24330 |
for (x = a->used - 1; x >= b; x--) |
|
790
|
241470 |
24330 |
for (x = 0; x < b; x++) |
|
809
|
0 |
2142 |
if (b < 0) |
|
815
|
0 |
2142 |
if (z >= PSTM_MAX_SIZE) |
|
823
|
0 |
2142 |
if (a->used > a->alloc) |
|
825
|
0 |
0 |
if (pstm_grow(a, a->used) != PSTM_OKAY) |
|
847
|
0 |
119842 |
if (b->alloc < a->used + 1) |
|
849
|
0 |
0 |
if ((res = pstm_grow(b, a->used + 1)) != PSTM_OKAY) |
|
868
|
136968 |
119842 |
for (x = 0; x < a->used; x++) |
|
885
|
2 |
119840 |
if (r != 0 && b->used != (PSTM_MAX_SIZE - 1)) |
|
|
2 |
0 |
if (r != 0 && b->used != (PSTM_MAX_SIZE - 1)) |
|
893
|
0 |
119842 |
for (x = b->used; x < oldused; x++) |
|
913
|
0 |
20061548 |
if (b->used > a->used) |
|
917
|
0 |
20061548 |
if (c->alloc < a->used) |
|
919
|
0 |
0 |
if ((x = pstm_grow(c, a->used)) != PSTM_OKAY) |
|
928
|
212035736 |
20061548 |
for (x = 0; x < oldbused; x++) |
|
934
|
1069086 |
20061548 |
for (; x < a->used; x++) |
|
940
|
18934 |
20061548 |
for (; x < oldused; x++) |
|
965
|
38528 |
12967244 |
if (b->used > y) |
|
972
|
0 |
13005772 |
if (c->used > c->alloc) |
|
974
|
0 |
0 |
if (pstm_grow(c, c->used) != PSTM_OKAY) |
|
981
|
124881850 |
13005772 |
for (x = 0; x < y; x++) |
|
983
|
0 |
124881850 |
if (a->used <= x) |
|
991
|
26565442 |
98316408 |
if (b->used <= x) |
|
1003
|
3429 |
13002343 |
if (t != 0 && x < PSTM_MAX_SIZE) |
|
|
3429 |
0 |
if (t != 0 && x < PSTM_MAX_SIZE) |
|
1005
|
0 |
3429 |
if (c->used == c->alloc) |
|
1007
|
0 |
0 |
if (pstm_grow(c, c->alloc + 1) != PSTM_OKAY) |
|
1017
|
34 |
13005772 |
for (; x < oldused; x++) |
|
1039
|
769020 |
16558179 |
if (sa != sb) |
|
1046
|
0 |
769020 |
if ((res = s_pstm_add(a, b, c)) != PSTM_OKAY) |
|
1057
|
12291989 |
4266190 |
if (pstm_cmp_mag(a, b) != PSTM_LT) |
|
1062
|
0 |
12291989 |
if ((res = pstm_sub_s(a, b, c)) != PSTM_OKAY) |
|
1072
|
0 |
4266190 |
if ((res = pstm_sub_s(b, a, c)) != PSTM_OKAY) |
|
1091
|
0 |
0 |
if (pstm_init_size(pool, &tmp, sizeof(pstm_digit)) != PSTM_OKAY) |
|
1118
|
0 |
2142 |
if ((b & 1) == 0) |
|
1148
|
2 |
2140 |
if (!bits) |
|
1154
|
2142 |
0 |
if (b->used > 1) |
|
1156
|
0 |
2142 |
if ((x = pstm_2expt(a, (b->used - 1) * DIGIT_BIT + bits - 1)) != |
|
1168
|
119842 |
2142 |
for (x = bits - 1; x < (uint16_t) DIGIT_BIT; x++) |
|
1170
|
0 |
119842 |
if (pstm_mul_2(a, a) != PSTM_OKAY) |
|
1174
|
2142 |
117700 |
if (pstm_cmp_mag(a, b) != PSTM_LT) |
|
1176
|
0 |
2142 |
if (pstm_sub_s(a, b, a) != PSTM_OKAY) |
|
1195
|
0 |
2775864 |
if (pstm_copy(a, c) != PSTM_OKAY) |
|
1201
|
24330 |
2751534 |
if (b >= DIGIT_BIT) |
|
1203
|
0 |
24330 |
if (pstm_lshd(c, b / DIGIT_BIT) != PSTM_OKAY) |
|
1211
|
2775758 |
106 |
if (b != 0) |
|
1215
|
42862592 |
2775758 |
for (x = 0; x < c->used; x++) |
|
1222
|
3612 |
2772146 |
if (carry && x < PSTM_MAX_SIZE) |
|
|
3612 |
0 |
if (carry && x < PSTM_MAX_SIZE) |
|
1224
|
0 |
3612 |
if (c->used == c->alloc) |
|
1226
|
0 |
0 |
if (pstm_grow(c, c->alloc + 1) != PSTM_OKAY) |
|
1247
|
0 |
0 |
if (b <= 0) |
|
1254
|
0 |
0 |
if (pstm_copy(a, c) != PSTM_OKAY) |
|
1260
|
0 |
0 |
if (b >= (DIGIT_BIT * a->used)) |
|
1266
|
0 |
0 |
for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) |
|
1287
|
0 |
862516 |
if (c->alloc < a->used + 1) |
|
1289
|
0 |
0 |
if ((res = pstm_grow(c, a->used + 1)) != PSTM_OKAY) |
|
1298
|
3877764 |
862516 |
for (x = 0; x < a->used; x++) |
|
1304
|
52615 |
809901 |
if (w != 0 && (a->used != PSTM_MAX_SIZE)) |
|
|
52615 |
0 |
if (w != 0 && (a->used != PSTM_MAX_SIZE)) |
|
1309
|
0 |
862516 |
for (; x < oldused; x++) |
|
1335
|
0 |
18025665 |
if (b <= 0) |
|
1337
|
0 |
0 |
if (pstm_copy(a, c) != PSTM_OKAY) |
|
1341
|
0 |
0 |
if (d != NULL) |
|
1348
|
0 |
18025665 |
if (pstm_copy(a, c) != PSTM_OKAY) |
|
1355
|
0 |
18025665 |
if (b >= (int16_t) DIGIT_BIT) |
|
1362
|
18025665 |
0 |
if (D != 0) |
|
1377
|
215059119 |
18025665 |
for (x = c->used - 1; x >= 0; x--) |
|
1395
|
0 |
18025665 |
if (d != NULL) |
|
1397
|
0 |
0 |
if (pstm_mod_2d(a, b, d) != PSTM_OKAY) |
|
1414
|
0 |
4502187 |
if (b->alloc < a->used) |
|
1416
|
0 |
0 |
if (pstm_grow(b, a->used) != PSTM_OKAY) |
|
1434
|
32675042 |
4502187 |
for (x = b->used - 1; x >= 0; x--) |
|
1448
|
0 |
4502187 |
for (x = b->used; x < oldused; x++) |
|
1468
|
0 |
27302 |
if (a == b) |
|
1474
|
0 |
27302 |
if (toSqr) |
|
1481
|
0 |
0 |
if ((b->used * 2) + 2 >= x) |
|
1486
|
0 |
27302 |
if ((res = pstm_init_size(pool, a, x)) != PSTM_OKAY) |
|
1592
|
0 |
18587 |
if (pstm_iszero(b) == PSTM_YES) |
|
1598
|
2142 |
16445 |
if (pstm_cmp_mag(a, b) == PSTM_LT) |
|
1600
|
2142 |
0 |
if (d != NULL) |
|
1608
|
0 |
2142 |
if (c != NULL) |
|
1617
|
0 |
16445 |
if (res != PSTM_OKAY) |
|
1622
|
0 |
16445 |
if (res != PSTM_OKAY) |
|
1628
|
0 |
16445 |
if (res != PSTM_OKAY) |
|
1635
|
0 |
16445 |
if (res != PSTM_OKAY) |
|
1645
|
16445 |
0 |
if (((res = pstm_abs(a, &ta)) != PSTM_OKAY) || |
|
|
16445 |
0 |
if (((res = pstm_abs(a, &ta)) != PSTM_OKAY) || |
|
1646
|
16445 |
0 |
((res = pstm_abs(b, &tb)) != PSTM_OKAY) || |
|
1647
|
16445 |
0 |
((res = pstm_mul_2d(&tb, n, &tb)) != PSTM_OKAY) || |
|
1653
|
8224657 |
16445 |
while (n-- >= 0) |
|
1655
|
4152279 |
4072378 |
if (pstm_cmp(&tb, &ta) != PSTM_GT) |
|
1657
|
4152279 |
0 |
if (((res = pstm_sub(&ta, &tb, &ta)) != PSTM_OKAY) || |
|
|
4152279 |
0 |
if (((res = pstm_sub(&ta, &tb, &ta)) != PSTM_OKAY) || |
|
1663
|
8224657 |
0 |
if (((res = pstm_div_2d(pool, &tb, 1, &tb, NULL)) != |
|
1664
|
8224657 |
0 |
PSTM_OKAY) || |
|
1675
|
0 |
16445 |
if (c != NULL) |
|
1678
|
0 |
0 |
c->sign = (pstm_iszero(c) == PSTM_YES) ? PSTM_ZPOS : n2; |
|
1680
|
16445 |
0 |
if (d != NULL) |
|
1683
|
16445 |
0 |
d->sign = (pstm_iszero(d) == PSTM_YES) ? PSTM_ZPOS : n; |
|
1981
|
0 |
18587 |
if ((err = pstm_init_size(pool, &t, b->alloc)) != PSTM_OKAY) |
|
1985
|
0 |
18587 |
if ((err = pstm_div(pool, a, b, NULL, &t)) != PSTM_OKAY) |
|
1990
|
626 |
17961 |
if (t.sign != b->sign) |
|
2020
|
1147 |
6426 |
if ((a == d) && (size < a->alloc)) |
|
|
1147 |
0 |
if ((a == d) && (size < a->alloc)) |
|
2024
|
0 |
7573 |
if ((res = pstm_init_size(pool, &tmp, size)) != PSTM_OKAY) |
|
2028
|
0 |
7573 |
if ((res = pstm_mul_comba(pool, a, b, &tmp, NULL, 0)) != PSTM_OKAY) |
|
2056
|
5648 |
0 |
switch (x) |
|
2070
|
5648 |
0 |
if (P->dp[0] & 1) |
|
2079
|
3354 |
2294 |
if (G->used <= P->used) |
|
2088
|
0 |
2294 |
if ((err = pstm_init_size(pool, &tmp_int, P->used)) != PSTM_OKAY) |
|
2096
|
0 |
2294 |
if (err != PSTM_OKAY) |
|
2104
|
0 |
5648 |
if (Y->used > Y->alloc) |
|
2106
|
0 |
0 |
if (pstm_grow(Y, Y->used) != PSTM_OKAY) |
|
2130
|
0 |
0 |
if (x < 50) |
|
2140
|
0 |
0 |
if ((err = pstm_montgomery_setup(P, &mp)) != PSTM_OKAY) |
|
2146
|
0 |
0 |
if ((err = pstm_init_size(pool, &res, (P->used * 2) + 1)) != PSTM_OKAY) |
|
2156
|
0 |
0 |
if ((err = pstm_montgomery_calc_normalization(&res, P)) != PSTM_OKAY) |
|
2164
|
0 |
0 |
if ((err = pstm_init_size(pool, &M[1], res.used)) != PSTM_OKAY) |
|
2170
|
0 |
0 |
if (pstm_cmp_mag(P, G) != PSTM_GT) |
|
2173
|
0 |
0 |
if ((err = pstm_mod(pool, G, P, &M[1])) != PSTM_OKAY) |
|
2180
|
0 |
0 |
if ((err = pstm_copy(G, &M[1])) != PSTM_OKAY) |
|
2185
|
0 |
0 |
if ((err = pstm_mulmod(pool, &M[1], &res, P, &M[1])) != PSTM_OKAY) |
|
2191
|
0 |
0 |
if ((paD = psMalloc(pool, paDlen)) == NULL) |
|
2197
|
0 |
0 |
if (pstm_init_copy(pool, &M[1 << (winsize - 1)], &M[1], 1) != PSTM_OKAY) |
|
2202
|
0 |
0 |
for (x = 0; x < (winsize - 1); x++) |
|
2204
|
0 |
0 |
if ((err = pstm_sqr_comba(pool, &M[1 << (winsize - 1)], |
|
2209
|
0 |
0 |
if ((err = pstm_montgomery_reduce(pool, &M[1 << (winsize - 1)], P, mp, |
|
2216
|
0 |
0 |
for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) |
|
2218
|
0 |
0 |
if ((err = pstm_init_size(pool, &M[x], M[1 << (winsize - 1)].alloc + 1)) |
|
2221
|
0 |
0 |
for (y = 1 << (winsize - 1); y < x; y++) |
|
2230
|
0 |
0 |
for (x = (1 << (winsize - 1)) + 1; x < (1 << winsize); x++) |
|
2232
|
0 |
0 |
if ((err = pstm_mul_comba(pool, &M[x - 1], &M[1], &M[x], paD, paDlen)) |
|
2237
|
0 |
0 |
if ((err = pstm_montgomery_reduce(pool, &M[x], P, mp, paD, paDlen)) != |
|
2255
|
0 |
0 |
if (--bitcnt == 0) |
|
2258
|
0 |
0 |
if (digidx == -1) |
|
2276
|
0 |
0 |
if (mode == 0 && y == 0) |
|
|
0 |
0 |
if (mode == 0 && y == 0) |
|
2282
|
0 |
0 |
if (mode == 1 && y == 0) |
|
|
0 |
0 |
if (mode == 1 && y == 0) |
|
2284
|
0 |
0 |
if ((err = pstm_sqr_comba(pool, &res, &res, paD, paDlen)) != |
|
2289
|
0 |
0 |
if ((err = pstm_montgomery_reduce(pool, &res, P, mp, paD, paDlen)) |
|
2301
|
0 |
0 |
if (bitcpy == winsize) |
|
2304
|
0 |
0 |
for (x = 0; x < winsize; x++) |
|
2306
|
0 |
0 |
if ((err = pstm_sqr_comba(pool, &res, &res, paD, paDlen)) != |
|
2311
|
0 |
0 |
if ((err = pstm_montgomery_reduce(pool, &res, P, mp, paD, |
|
2319
|
0 |
0 |
if ((err = pstm_mul_comba(pool, &res, &M[bitbuf], &res, paD, |
|
2324
|
0 |
0 |
if ((err = pstm_montgomery_reduce(pool, &res, P, mp, paD, paDlen)) |
|
2338
|
0 |
0 |
if (mode == 2 && bitcpy > 0) |
|
|
0 |
0 |
if (mode == 2 && bitcpy > 0) |
|
2341
|
0 |
0 |
for (x = 0; x < bitcpy; x++) |
|
2343
|
0 |
0 |
if ((err = pstm_sqr_comba(pool, &res, &res, paD, paDlen)) != |
|
2348
|
0 |
0 |
if ((err = pstm_montgomery_reduce(pool, &res, P, mp, paD, paDlen)) |
|
2356
|
0 |
0 |
if ((bitbuf & (1 << winsize)) != 0) |
|
2359
|
0 |
0 |
if ((err = pstm_mul_comba(pool, &res, &M[1], &res, paD, paDlen)) |
|
2364
|
0 |
0 |
if ((err = pstm_montgomery_reduce(pool, &res, P, mp, paD, |
|
2377
|
0 |
0 |
if ((err = pstm_montgomery_reduce(pool, &res, P, mp, paD, paDlen)) != |
|
2383
|
0 |
0 |
if ((err = pstm_copy(&res, Y)) != PSTM_OKAY) |
|
2389
|
0 |
0 |
for (x = 1 << (winsize - 1); x < (1 << winsize); x++) |
|
2415
|
12236752 |
3499590 |
if (sa == sb) |
|
2419
|
0 |
12236752 |
if ((res = s_pstm_add(a, b, c)) != PSTM_OKAY) |
|
2431
|
3499353 |
237 |
if (pstm_cmp_mag(a, b) == PSTM_LT) |
|
2434
|
0 |
3499353 |
if ((res = pstm_sub_s(b, a, c)) != PSTM_OKAY) |
|
2442
|
0 |
237 |
if ((res = pstm_sub_s(a, b, c)) != PSTM_OKAY) |
|
2462
|
0 |
0 |
if ((res = pstm_init_copy(pool, &t, a, 0)) != PSTM_OKAY) |
|
2468
|
0 |
0 |
while (pstm_iszero(&t) == 0) |
|
2471
|
0 |
0 |
if ((res = pstm_div_2d(pool, &t, 8, &t, NULL)) != PSTM_OKAY) |
|
2490
|
0 |
11040 |
if (len == 0) |
|
2496
|
784507 |
11040 |
while (ix < iy) |
|
2518
|
0 |
11040 |
if ((res = pstm_init_copy(pool, &t, a, 0)) != PSTM_OKAY) |
|
2523
|
1576351 |
11040 |
while (pstm_iszero(&t) == 0) |
|
2526
|
0 |
1576351 |
if ((res = pstm_div_2d(pool, &t, 8, &t, NULL)) != PSTM_OKAY) |
|
2555
|
0 |
0 |
if (b->sign == PSTM_NEG || pstm_iszero(b) == 1) |
|
|
0 |
0 |
if (b->sign == PSTM_NEG || pstm_iszero(b) == 1) |
|
2561
|
0 |
0 |
if (pstm_init_size(pool, &x, b->used) != PSTM_OKAY) |
|
2567
|
0 |
0 |
if ((res = pstm_mod(pool, a, b, &x)) != PSTM_OKAY) |
|
2572
|
0 |
0 |
if (pstm_init_copy(pool, &y, b, 0) != PSTM_OKAY) |
|
2578
|
0 |
0 |
if (pstm_iseven(&x) == 1 && pstm_iseven(&y) == 1) |
|
|
0 |
0 |
if (pstm_iseven(&x) == 1 && pstm_iseven(&y) == 1) |
|
|
0 |
0 |
if (pstm_iseven(&x) == 1 && pstm_iseven(&y) == 1) |
|
|
0 |
0 |
if (pstm_iseven(&x) == 1 && pstm_iseven(&y) == 1) |
|
|
0 |
0 |
if (pstm_iseven(&x) == 1 && pstm_iseven(&y) == 1) |
|
|
0 |
0 |
if (pstm_iseven(&x) == 1 && pstm_iseven(&y) == 1) |
|
2585
|
0 |
0 |
if ((res = pstm_init_copy(pool, &u, &x, 0)) != PSTM_OKAY) |
|
2589
|
0 |
0 |
if ((res = pstm_init_copy(pool, &v, &y, 0)) != PSTM_OKAY) |
|
2594
|
0 |
0 |
if ((res = pstm_init_size(pool, &A, sizeof(pstm_digit))) != PSTM_OKAY) |
|
2599
|
0 |
0 |
if ((res = pstm_init_size(pool, &D, sizeof(pstm_digit))) != PSTM_OKAY) |
|
2606
|
0 |
0 |
if ((res = pstm_init(pool, &B)) != PSTM_OKAY) |
|
2610
|
0 |
0 |
if ((res = pstm_init(pool, &C)) != PSTM_OKAY) |
|
2617
|
0 |
0 |
while (pstm_iseven(&u) == 1) |
|
|
0 |
0 |
while (pstm_iseven(&u) == 1) |
|
|
0 |
0 |
while (pstm_iseven(&u) == 1) |
|
2620
|
0 |
0 |
if ((res = pstm_div_2(&u, &u)) != PSTM_OKAY) |
|
2626
|
0 |
0 |
if (pstm_isodd(&A) == 1 || pstm_isodd(&B) == 1) |
|
|
0 |
0 |
if (pstm_isodd(&A) == 1 || pstm_isodd(&B) == 1) |
|
|
0 |
0 |
if (pstm_isodd(&A) == 1 || pstm_isodd(&B) == 1) |
|
|
0 |
0 |
if (pstm_isodd(&A) == 1 || pstm_isodd(&B) == 1) |
|
|
0 |
0 |
if (pstm_isodd(&A) == 1 || pstm_isodd(&B) == 1) |
|
|
0 |
0 |
if (pstm_isodd(&A) == 1 || pstm_isodd(&B) == 1) |
|
2629
|
0 |
0 |
if ((res = pstm_add(&A, &y, &A)) != PSTM_OKAY) |
|
2633
|
0 |
0 |
if ((res = pstm_sub(&B, &x, &B)) != PSTM_OKAY) |
|
2639
|
0 |
0 |
if ((res = pstm_div_2(&A, &A)) != PSTM_OKAY) |
|
2643
|
0 |
0 |
if ((res = pstm_div_2(&B, &B)) != PSTM_OKAY) |
|
2650
|
0 |
0 |
while (pstm_iseven(&v) == 1) |
|
|
0 |
0 |
while (pstm_iseven(&v) == 1) |
|
|
0 |
0 |
while (pstm_iseven(&v) == 1) |
|
2653
|
0 |
0 |
if ((res = pstm_div_2(&v, &v)) != PSTM_OKAY) |
|
2659
|
0 |
0 |
if (pstm_isodd(&C) == 1 || pstm_isodd(&D) == 1) |
|
|
0 |
0 |
if (pstm_isodd(&C) == 1 || pstm_isodd(&D) == 1) |
|
|
0 |
0 |
if (pstm_isodd(&C) == 1 || pstm_isodd(&D) == 1) |
|
|
0 |
0 |
if (pstm_isodd(&C) == 1 || pstm_isodd(&D) == 1) |
|
|
0 |
0 |
if (pstm_isodd(&C) == 1 || pstm_isodd(&D) == 1) |
|
|
0 |
0 |
if (pstm_isodd(&C) == 1 || pstm_isodd(&D) == 1) |
|
2662
|
0 |
0 |
if ((res = pstm_add(&C, &y, &C)) != PSTM_OKAY) |
|
2666
|
0 |
0 |
if ((res = pstm_sub(&D, &x, &D)) != PSTM_OKAY) |
|
2672
|
0 |
0 |
if ((res = pstm_div_2(&C, &C)) != PSTM_OKAY) |
|
2676
|
0 |
0 |
if ((res = pstm_div_2(&D, &D)) != PSTM_OKAY) |
|
2683
|
0 |
0 |
if (pstm_cmp(&u, &v) != PSTM_LT) |
|
2686
|
0 |
0 |
if ((res = pstm_sub(&u, &v, &u)) != PSTM_OKAY) |
|
2690
|
0 |
0 |
if ((res = pstm_sub(&A, &C, &A)) != PSTM_OKAY) |
|
2694
|
0 |
0 |
if ((res = pstm_sub(&B, &D, &B)) != PSTM_OKAY) |
|
2702
|
0 |
0 |
if ((res = pstm_sub(&v, &u, &v)) != PSTM_OKAY) |
|
2706
|
0 |
0 |
if ((res = pstm_sub(&C, &A, &C)) != PSTM_OKAY) |
|
2710
|
0 |
0 |
if ((res = pstm_sub(&D, &B, &D)) != PSTM_OKAY) |
|
2717
|
0 |
0 |
if (pstm_iszero(&u) == 0) |
|
2725
|
0 |
0 |
if (pstm_cmp_d(&v, 1) != PSTM_EQ) |
|
2732
|
0 |
0 |
while (pstm_cmp_d(&C, 0) == PSTM_LT) |
|
2734
|
0 |
0 |
if ((res = pstm_add(&C, b, &C)) != PSTM_OKAY) |
|
2741
|
0 |
0 |
while (pstm_cmp_mag(&C, b) != PSTM_LT) |
|
2743
|
0 |
0 |
if ((res = pstm_sub(&C, b, &C)) != PSTM_OKAY) |
|
2750
|
0 |
0 |
if ((res = pstm_copy(&C, c)) != PSTM_OKAY) |
|
2780
|
2142 |
0 |
if (pstm_iseven(b) == 1) |
|
|
0 |
2142 |
if (pstm_iseven(b) == 1) |
|
|
0 |
2142 |
if (pstm_iseven(b) == 1) |
|
2786
|
0 |
2142 |
if ((res = pstm_init_copy(pool, &x, b, 0)) != PSTM_OKAY) |
|
2791
|
0 |
2142 |
if ((res = pstm_init_size(pool, &y, a->alloc)) != PSTM_OKAY) |
|
2797
|
0 |
2142 |
if ((res = pstm_abs(a, &y)) != PSTM_OKAY) |
|
2803
|
0 |
2142 |
if ((res = pstm_init_copy(pool, &u, &x, 0)) != PSTM_OKAY) |
|
2807
|
0 |
2142 |
if ((res = pstm_init_copy(pool, &v, &y, 0)) != PSTM_OKAY) |
|
2811
|
0 |
2142 |
if ((res = pstm_init(pool, &B)) != PSTM_OKAY) |
|
2815
|
0 |
2142 |
if ((res = pstm_init(pool, &D)) != PSTM_OKAY) |
|
2825
|
1580818 |
0 |
while (pstm_iseven(&u) == 1) |
|
|
786098 |
794720 |
while (pstm_iseven(&u) == 1) |
|
|
786098 |
794720 |
while (pstm_iseven(&u) == 1) |
|
2828
|
0 |
786098 |
if ((res = pstm_div_2(&u, &u)) != PSTM_OKAY) |
|
2834
|
786098 |
0 |
if (pstm_isodd(&B) == 1) |
|
|
422198 |
363900 |
if (pstm_isodd(&B) == 1) |
|
|
422198 |
363900 |
if (pstm_isodd(&B) == 1) |
|
2836
|
0 |
422198 |
if ((res = pstm_sub(&B, &x, &B)) != PSTM_OKAY) |
|
2842
|
0 |
786098 |
if ((res = pstm_div_2(&B, &B)) != PSTM_OKAY) |
|
2849
|
1581745 |
0 |
while (pstm_iseven(&v) == 1) |
|
|
787025 |
794720 |
while (pstm_iseven(&v) == 1) |
|
|
787025 |
794720 |
while (pstm_iseven(&v) == 1) |
|
2852
|
0 |
787025 |
if ((res = pstm_div_2(&v, &v)) != PSTM_OKAY) |
|
2857
|
787025 |
0 |
if (pstm_isodd(&D) == 1) |
|
|
681074 |
105951 |
if (pstm_isodd(&D) == 1) |
|
|
681074 |
105951 |
if (pstm_isodd(&D) == 1) |
|
2860
|
0 |
681074 |
if ((res = pstm_sub(&D, &x, &D)) != PSTM_OKAY) |
|
2866
|
0 |
787025 |
if ((res = pstm_div_2(&D, &D)) != PSTM_OKAY) |
|
2873
|
402891 |
391829 |
if (pstm_cmp(&u, &v) != PSTM_LT) |
|
2876
|
0 |
402891 |
if ((res = pstm_sub(&u, &v, &u)) != PSTM_OKAY) |
|
2880
|
0 |
402891 |
if ((res = pstm_sub(&B, &D, &B)) != PSTM_OKAY) |
|
2888
|
0 |
391829 |
if ((res = pstm_sub(&v, &u, &v)) != PSTM_OKAY) |
|
2892
|
0 |
391829 |
if ((res = pstm_sub(&D, &B, &D)) != PSTM_OKAY) |
|
2899
|
0 |
794720 |
if (sanity++ > 4096) |
|
2904
|
792578 |
2142 |
if (pstm_iszero(&u) == 0) |
|
2912
|
0 |
2142 |
if (pstm_cmp_d(&v, 1) != PSTM_EQ) |
|
2920
|
1221 |
2142 |
while (D.sign == PSTM_NEG) |
|
2922
|
0 |
1221 |
if ((res = pstm_add(&D, b, &D)) != PSTM_OKAY) |
|
2927
|
0 |
2142 |
if ((res = pstm_copy(&D, c)) != PSTM_OKAY) |