Lines Matching refs:used
119 int used, alloc, sign; member
125 #define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
126 #define mp_iseven(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
127 #define mp_isodd(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
131 #define s_mp_mul(a, b, c) s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1)
220 if (a->used > b->used) { in s_mp_add()
221 min = b->used; in s_mp_add()
222 max = a->used; in s_mp_add()
225 min = a->used; in s_mp_add()
226 max = b->used; in s_mp_add()
238 olduse = c->used; in s_mp_add()
239 c->used = max + 1; in s_mp_add()
289 for (i = c->used; i < olduse; i++) { in s_mp_add()
305 min = b->used; in s_mp_sub()
306 max = a->used; in s_mp_sub()
314 olduse = c->used; in s_mp_sub()
315 c->used = max; in s_mp_sub()
356 for (i = c->used; i < olduse; i++) { in s_mp_sub()
384 a->used = 0; in mp_init()
400 for (i = 0; i < a->used; i++) { in mp_clear()
409 a->alloc = a->used = 0; in mp_clear()
492 if (MIN (a->used, b->used) >= TOOM_MUL_CUTOFF) { in mp_mul()
498 if (MIN (a->used, b->used) >= KARATSUBA_MUL_CUTOFF) { in mp_mul()
510 int digs = a->used + b->used + 1; in mp_mul()
513 MIN(a->used, b->used) <= in mp_mul()
526 c->sign = (c->used > 0) ? neg : MP_ZPOS; in mp_mul()
708 if (a->used > 1) { in mp_cmp_d()
925 if (a->used > b->used) { in mp_cmp_mag()
929 if (a->used < b->used) { in mp_cmp_mag()
934 tmpa = a->dp + (a->used - 1); in mp_cmp_mag()
937 tmpb = b->dp + (a->used - 1); in mp_cmp_mag()
940 for (n = 0; n < a->used; ++n, --tmpa, --tmpb) { in mp_cmp_mag()
976 a->used += 1; in mp_read_unsigned_bin()
980 a->used += 2; in mp_read_unsigned_bin()
1068 tmpc = c->dp + (c->used - 1); in mp_div_2d()
1072 for (x = c->used - 1; x >= 0; x--) { in mp_div_2d()
1111 a->used = 0; in mp_zero()
1131 if (b->alloc < a->used) { in mp_copy()
1132 if ((res = mp_grow (b, a->used)) != MP_OKAY) { in mp_copy()
1150 for (n = 0; n < a->used; n++) { in mp_copy()
1155 for (; n < b->used; n++) { in mp_copy()
1161 b->used = a->used; in mp_copy()
1178 if (a->used <= b) { in mp_rshd()
1204 for (x = 0; x < (a->used - b); x++) { in mp_rshd()
1209 for (; x < a->used; x++) { in mp_rshd()
1215 a->used -= b; in mp_rshd()
1244 while (a->used > 0 && a->dp[a->used - 1] == 0) { in mp_clamp()
1245 --(a->used); in mp_clamp()
1249 if (a->used == 0) { in mp_clamp()
1321 a->used = (a->dp[0] != 0) ? 1 : 0; in mp_set()
1332 if (b->alloc < a->used) { in mp_div_2()
1333 if ((res = mp_grow (b, a->used)) != MP_OKAY) { in mp_div_2()
1338 oldused = b->used; in mp_div_2()
1339 b->used = a->used; in mp_div_2()
1344 tmpa = a->dp + b->used - 1; in mp_div_2()
1347 tmpb = b->dp + b->used - 1; in mp_div_2()
1351 for (x = b->used - 1; x >= 0; x--) { in mp_div_2()
1363 tmpb = b->dp + b->used; in mp_div_2()
1364 for (x = b->used; x < oldused; x++) { in mp_div_2()
1388 if (c->alloc < (int)(c->used + b/DIGIT_BIT + 1)) { in mp_mul_2d()
1389 if ((res = mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) { in mp_mul_2d()
1418 for (x = 0; x < c->used; x++) { in mp_mul_2d()
1432 c->dp[(c->used)++] = r; in mp_mul_2d()
1504 if (a->alloc < a->used + b) { in mp_lshd()
1505 if ((res = mp_grow (a, a->used + b)) != MP_OKAY) { in mp_lshd()
1514 a->used += b; in mp_lshd()
1517 top = a->dp + a->used - 1; in mp_lshd()
1520 bottom = a->dp + a->used - 1 - b; in mp_lshd()
1526 for (x = a->used - 1; x >= b; x--) { in mp_lshd()
1547 if (a->used == 0) { in mp_count_bits()
1552 r = (a->used - 1) * DIGIT_BIT; in mp_count_bits()
1555 q = a->dp[a->used - 1]; in mp_count_bits()
1576 if (b >= (int) (a->used * DIGIT_BIT)) { in mp_mod_2d()
1587 for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) { in mp_mod_2d()
1706 if ((res = mp_init_size (&q, a->used + 2)) != MP_OKAY) { in mp_div()
1709 q.used = a->used + 2; in mp_div()
1746 n = x.used - 1; in mp_div()
1747 t = y.used - 1; in mp_div()
1766 if (i > x.used) { in mp_div()
1797 t1.used = 2; in mp_div()
1806 t2.used = 3; in mp_div()
1843 x.sign = x.used == 0 ? MP_ZPOS : a->sign; in mp_div()
1994 digidx = X->used - 1; in s_mp_exptmod()
2109 if (a->used >= TOOM_SQR_CUTOFF) { in mp_sqr()
2115 if (a->used >= KARATSUBA_SQR_CUTOFF) { in mp_sqr()
2122 if ((a->used * 2 + 1) < MP_WARRAY && in mp_sqr()
2123 a->used < in mp_sqr()
2223 a->used = b / DIGIT_BIT + 1; in mp_2expt()
2239 if ((res = mp_2expt (a, b->used * 2 * DIGIT_BIT)) != MP_OKAY) { in mp_reduce_setup()
2253 int res, um = m->used; in mp_reduce()
2344 MIN (a->used, b->used) < in s_mp_mul_digs()
2353 t.used = digs; in s_mp_mul_digs()
2356 pa = a->used; in s_mp_mul_digs()
2362 pb = MIN (b->used, digs - ix); in s_mp_mul_digs()
2432 pa = MIN(digs, a->used + b->used); in fast_s_mp_mul_digs()
2443 ty = MIN(b->used-1, ix); in fast_s_mp_mul_digs()
2453 iy = MIN(a->used-tx, ty+1); in fast_s_mp_mul_digs()
2469 olduse = c->used; in fast_s_mp_mul_digs()
2470 c->used = pa; in fast_s_mp_mul_digs()
2506 a->used = 0; in mp_init_size()
2527 pa = a->used; in s_mp_sqr()
2533 t.used = 2*pa + 1; in s_mp_sqr()
2596 if (((a->used + b->used + 1) < MP_WARRAY) in s_mp_mul_high_digs()
2597 && MIN (a->used, b->used) < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { in s_mp_mul_high_digs()
2602 if ((res = mp_init_size (&t, a->used + b->used + 1)) != MP_OKAY) { in s_mp_mul_high_digs()
2605 t.used = a->used + b->used + 1; in s_mp_mul_high_digs()
2607 pa = a->used; in s_mp_mul_high_digs()
2608 pb = b->used; in s_mp_mul_high_digs()
2699 olduse = x->used; in fast_mp_montgomery_reduce()
2702 if (x->alloc < n->used + 1) { in fast_mp_montgomery_reduce()
2703 if ((res = mp_grow (x, n->used + 1)) != MP_OKAY) { in fast_mp_montgomery_reduce()
2722 for (ix = 0; ix < x->used; ix++) { in fast_mp_montgomery_reduce()
2727 for (; ix < n->used * 2 + 1; ix++) { in fast_mp_montgomery_reduce()
2735 for (ix = 0; ix < n->used; ix++) { in fast_mp_montgomery_reduce()
2771 for (iy = 0; iy < n->used; iy++) { in fast_mp_montgomery_reduce()
2796 for (; ix <= n->used * 2 + 1; ix++) { in fast_mp_montgomery_reduce()
2811 _W = W + n->used; in fast_mp_montgomery_reduce()
2813 for (ix = 0; ix < n->used + 1; ix++) { in fast_mp_montgomery_reduce()
2826 x->used = n->used + 1; in fast_mp_montgomery_reduce()
2845 if (b->alloc < a->used + 1) { in mp_mul_2()
2846 if ((res = mp_grow (b, a->used + 1)) != MP_OKAY) { in mp_mul_2()
2851 oldused = b->used; in mp_mul_2()
2852 b->used = a->used; in mp_mul_2()
2865 for (x = 0; x < a->used; x++) { in mp_mul_2()
2885 ++(b->used); in mp_mul_2()
2891 tmpb = b->dp + b->used; in mp_mul_2()
2892 for (x = b->used; x < oldused; x++) { in mp_mul_2()
2916 if (b->used > 1) { in mp_montgomery_calc_normalization()
2917 if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) { in mp_montgomery_calc_normalization()
3019 if (((P->used * 2 + 1) < MP_WARRAY) && in mp_exptmod_fast()
3020 P->used < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { in mp_exptmod_fast()
3117 digidx = X->used - 1; in mp_exptmod_fast()
3257 pa = a->used + a->used; in fast_s_mp_sqr()
3275 ty = MIN(a->used-1, ix); in fast_s_mp_sqr()
3285 iy = MIN(a->used-tx, ty+1); in fast_s_mp_sqr()
3314 olduse = b->used; in fast_s_mp_sqr()
3315 b->used = a->used+a->used; in fast_s_mp_sqr()
3345 if (c->alloc < a->used + 1) { in mp_mul_d()
3346 if ((res = mp_grow (c, a->used + 1)) != MP_OKAY) { in mp_mul_d()
3352 olduse = c->used; in mp_mul_d()
3367 for (ix = 0; ix < a->used; ix++) { in mp_mul_d()
3388 c->used = a->used + 1; in mp_mul_d()