• Home
  • Raw
  • Download

Lines Matching refs:used

236   olduse = x->used;  in fast_mp_montgomery_reduce()
239 if (x->alloc < n->used + 1) { in fast_mp_montgomery_reduce()
240 if ((res = mp_grow (x, n->used + 1)) != MP_OKAY) { in fast_mp_montgomery_reduce()
259 for (ix = 0; ix < x->used; ix++) { in fast_mp_montgomery_reduce()
264 for (; ix < n->used * 2 + 1; ix++) { in fast_mp_montgomery_reduce()
272 for (ix = 0; ix < n->used; ix++) { in fast_mp_montgomery_reduce()
308 for (iy = 0; iy < n->used; iy++) { in fast_mp_montgomery_reduce()
333 for (; ix <= n->used * 2 + 1; ix++) { in fast_mp_montgomery_reduce()
348 _W = W + n->used; in fast_mp_montgomery_reduce()
350 for (ix = 0; ix < n->used + 1; ix++) { in fast_mp_montgomery_reduce()
363 x->used = n->used + 1; in fast_mp_montgomery_reduce()
428 pa = MIN(digs, a->used + b->used); in fast_s_mp_mul_digs()
438 ty = MIN(b->used-1, ix); in fast_s_mp_mul_digs()
448 iy = MIN(a->used-tx, ty+1); in fast_s_mp_mul_digs()
464 olduse = c->used; in fast_s_mp_mul_digs()
465 c->used = pa; in fast_s_mp_mul_digs()
525 pa = a->used + b->used; in fast_s_mp_mul_high_digs()
533 pa = a->used + b->used; in fast_s_mp_mul_high_digs()
540 ty = MIN(b->used-1, ix); in fast_s_mp_mul_high_digs()
550 iy = MIN(a->used-tx, ty+1); in fast_s_mp_mul_high_digs()
565 olduse = c->used; in fast_s_mp_mul_high_digs()
566 c->used = pa; in fast_s_mp_mul_high_digs()
628 pa = a->used + a->used; in fast_s_mp_sqr()
646 ty = MIN(a->used-1, ix); in fast_s_mp_sqr()
656 iy = MIN(a->used-tx, ty+1); in fast_s_mp_sqr()
685 olduse = b->used; in fast_s_mp_sqr()
686 b->used = a->used+a->used; in fast_s_mp_sqr()
748 a->used = b / DIGIT_BIT + 1; in mp_2expt()
893 if (c->alloc < a->used + 1) { in mp_add_d()
894 if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) { in mp_add_d()
900 if (a->sign == MP_NEG && (a->used > 1 || a->dp[0] >= b)) { in mp_add_d()
917 oldused = c->used; in mp_add_d()
938 for (ix = 1; ix < a->used; ix++) { in mp_add_d()
948 c->used = a->used + 1; in mp_add_d()
951 c->used = 1; in mp_add_d()
954 if (a->used == 1) { in mp_add_d()
1053 if (a->used > b->used) { in mp_and()
1057 px = b->used; in mp_and()
1063 px = a->used; in mp_and()
1072 for (; ix < t.used; ix++) { in mp_and()
1120 while (a->used > 0 && a->dp[a->used - 1] == 0) { in mp_clamp()
1121 --(a->used); in mp_clamp()
1125 if (a->used == 0) { in mp_clamp()
1164 for (i = 0; i < a->used; i++) { in mp_clear()
1173 a->alloc = a->used = 0; in mp_clear()
1297 if (a->used > 1) { in mp_cmp_d()
1343 if (a->used > b->used) { in mp_cmp_mag()
1347 if (a->used < b->used) { in mp_cmp_mag()
1352 tmpa = a->dp + (a->used - 1); in mp_cmp_mag()
1355 tmpb = b->dp + (a->used - 1); in mp_cmp_mag()
1358 for (n = 0; n < a->used; ++n, --tmpa, --tmpb) { in mp_cmp_mag()
1411 for (x = 0; x < a->used && a->dp[x] == 0; x++); in mp_cnt_lsb()
1464 if (b->alloc < a->used) { in mp_copy()
1465 if ((res = mp_grow (b, a->used)) != MP_OKAY) { in mp_copy()
1483 for (n = 0; n < a->used; n++) { in mp_copy()
1488 for (; n < b->used; n++) { in mp_copy()
1494 b->used = a->used; in mp_copy()
1532 if (a->used == 0) { in mp_count_bits()
1537 r = (a->used - 1) * DIGIT_BIT; in mp_count_bits()
1540 q = a->dp[a->used - 1]; in mp_count_bits()
1681 if ((res = mp_init_size (&q, a->used + 2)) != MP_OKAY) { in mp_div()
1684 q.used = a->used + 2; in mp_div()
1721 n = x.used - 1; in mp_div()
1722 t = y.used - 1; in mp_div()
1741 if (i > x.used) { in mp_div()
1772 t1.used = 2; in mp_div()
1781 t2.used = 3; in mp_div()
1818 x.sign = x.used == 0 ? MP_ZPOS : a->sign; in mp_div()
1875 if (b->alloc < a->used) { in mp_div_2()
1876 if ((res = mp_grow (b, a->used)) != MP_OKAY) { in mp_div_2()
1881 oldused = b->used; in mp_div_2()
1882 b->used = a->used; in mp_div_2()
1887 tmpa = a->dp + b->used - 1; in mp_div_2()
1890 tmpb = b->dp + b->used - 1; in mp_div_2()
1894 for (x = b->used - 1; x >= 0; x--) { in mp_div_2()
1906 tmpb = b->dp + b->used; in mp_div_2()
1907 for (x = b->used; x < oldused; x++) { in mp_div_2()
1993 tmpc = c->dp + (c->used - 1); in mp_div_2d()
1997 for (x = c->used - 1; x >= 0; x--) { in mp_div_2d()
2054 if ((res = mp_init_size(&q, a->used)) != MP_OKAY) { in mp_div_3()
2058 q.used = a->used; in mp_div_3()
2061 for (ix = a->used - 1; ix >= 0; ix--) { in mp_div_3()
2181 if ((res = mp_init_size(&q, a->used)) != MP_OKAY) { in mp_div_d()
2185 q.used = a->used; in mp_div_d()
2188 for (ix = a->used - 1; ix >= 0; ix--) { in mp_div_d()
2245 if (a->used < 2) { in mp_dr_is_modulus()
2252 for (ix = 1; ix < a->used; ix++) { in mp_dr_is_modulus()
2308 m = n->used; in mp_dr_reduce()
2342 for (i = m + 1; i < x->used; i++) { in mp_dr_reduce()
2716 if (((P->used * 2 + 1) < MP_WARRAY) && in mp_exptmod_fast()
2717 P->used < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { in mp_exptmod_fast()
2814 digidx = X->used - 1; in mp_exptmod_fast()
3288 if (a->used == 0) { in mp_get_int()
3293 i = MIN(a->used,(int)((sizeof(unsigned long)*CHAR_BIT+DIGIT_BIT-1)/DIGIT_BIT))-1; in mp_get_int()
3410 a->used = 0; in mp_init()
3627 a->used = 0; in mp_init_size()
3928 if (arg->used == 0) { in mp_is_square()
4150 B = MIN (a->used, b->used); in mp_karatsuba_mul()
4158 if (mp_init_size (&x1, a->used - B) != MP_OKAY) in mp_karatsuba_mul()
4162 if (mp_init_size (&y1, b->used - B) != MP_OKAY) in mp_karatsuba_mul()
4174 x0.used = y0.used = B; in mp_karatsuba_mul()
4175 x1.used = a->used - B; in mp_karatsuba_mul()
4176 y1.used = b->used - B; in mp_karatsuba_mul()
4196 for (x = B; x < a->used; x++) { in mp_karatsuba_mul()
4201 for (x = B; x < b->used; x++) { in mp_karatsuba_mul()
4298 B = a->used; in mp_karatsuba_sqr()
4306 if (mp_init_size (&x1, a->used - B) != MP_OKAY) in mp_karatsuba_sqr()
4310 if (mp_init_size (&t1, a->used * 2) != MP_OKAY) in mp_karatsuba_sqr()
4312 if (mp_init_size (&t2, a->used * 2) != MP_OKAY) in mp_karatsuba_sqr()
4316 if (mp_init_size (&x1x1, (a->used - B) * 2) != MP_OKAY) in mp_karatsuba_sqr()
4332 for (x = B; x < a->used; x++) { in mp_karatsuba_sqr()
4337 x0.used = B; in mp_karatsuba_sqr()
4338 x1.used = a->used - B; in mp_karatsuba_sqr()
4483 if (a->alloc < a->used + b) { in mp_lshd()
4484 if ((res = mp_grow (a, a->used + b)) != MP_OKAY) { in mp_lshd()
4493 a->used += b; in mp_lshd()
4496 top = a->dp + a->used - 1; in mp_lshd()
4499 bottom = a->dp + a->used - 1 - b; in mp_lshd()
4505 for (x = a->used - 1; x >= b; x--) { in mp_lshd()
4608 if (b >= (int) (a->used * DIGIT_BIT)) { in mp_mod_2d()
4619 for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) { in mp_mod_2d()
4698 if (b->used > 1) { in mp_montgomery_calc_normalization()
4699 if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) { in mp_montgomery_calc_normalization()
4761 digs = n->used * 2 + 1; in mp_montgomery_reduce()
4763 n->used < in mp_montgomery_reduce()
4774 x->used = digs; in mp_montgomery_reduce()
4776 for (ix = 0; ix < n->used; ix++) { in mp_montgomery_reduce()
4803 for (iy = 0; iy < n->used; iy++) { in mp_montgomery_reduce()
4835 mp_rshd (x, n->used); in mp_montgomery_reduce()
4941 if (MIN (a->used, b->used) >= TOOM_MUL_CUTOFF) { in mp_mul()
4947 if (MIN (a->used, b->used) >= KARATSUBA_MUL_CUTOFF) { in mp_mul()
4958 int digs = a->used + b->used + 1; in mp_mul()
4962 MIN(a->used, b->used) <= in mp_mul()
4974 c->sign = (c->used > 0) ? neg : MP_ZPOS; in mp_mul()
5009 if (b->alloc < a->used + 1) { in mp_mul_2()
5010 if ((res = mp_grow (b, a->used + 1)) != MP_OKAY) { in mp_mul_2()
5015 oldused = b->used; in mp_mul_2()
5016 b->used = a->used; in mp_mul_2()
5029 for (x = 0; x < a->used; x++) { in mp_mul_2()
5049 ++(b->used); in mp_mul_2()
5055 tmpb = b->dp + b->used; in mp_mul_2()
5056 for (x = b->used; x < oldused; x++) { in mp_mul_2()
5102 if (c->alloc < (int)(c->used + b/DIGIT_BIT + 1)) { in mp_mul_2d()
5103 if ((res = mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) { in mp_mul_2d()
5132 for (x = 0; x < c->used; x++) { in mp_mul_2d()
5146 c->dp[(c->used)++] = r; in mp_mul_2d()
5187 if (c->alloc < a->used + 1) { in mp_mul_d()
5188 if ((res = mp_grow (c, a->used + 1)) != MP_OKAY) { in mp_mul_d()
5194 olduse = c->used; in mp_mul_d()
5209 for (ix = 0; ix < a->used; ix++) { in mp_mul_d()
5230 c->used = a->used + 1; in mp_mul_d()
5491 if (a->used > b->used) { in mp_or()
5495 px = b->used; in mp_or()
5501 px = a->used; in mp_or()
6538 a->used += 1; in mp_read_unsigned_bin()
6542 a->used += 2; in mp_read_unsigned_bin()
6581 int res, um = m->used; in mp_reduce()
6914 if (a->used == 0) { in mp_reduce_is_2k()
6916 } else if (a->used == 1) { in mp_reduce_is_2k()
6918 } else if (a->used > 1) { in mp_reduce_is_2k()
6969 if (a->used == 0) { in mp_reduce_is_2k_l()
6971 } else if (a->used == 1) { in mp_reduce_is_2k_l()
6973 } else if (a->used > 1) { in mp_reduce_is_2k_l()
6975 for (iy = ix = 0; ix < a->used; ix++) { in mp_reduce_is_2k_l()
6980 return (iy >= (a->used/2)) ? MP_YES : MP_NO; in mp_reduce_is_2k_l()
7019 if ((res = mp_2expt (a, b->used * 2 * DIGIT_BIT)) != MP_OKAY) { in mp_reduce_setup()
7061 if (a->used <= b) { in mp_rshd()
7087 for (x = 0; x < (a->used - b); x++) { in mp_rshd()
7092 for (; x < a->used; x++) { in mp_rshd()
7098 a->used -= b; in mp_rshd()
7131 a->used = (a->dp[0] != 0) ? 1 : 0; in mp_set()
7180 a->used += 1; in mp_set_int()
7215 if (a->alloc != a->used && a->used > 0) { in mp_shrink()
7216 if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * a->used)) == NULL) { in mp_shrink()
7220 a->alloc = a->used; in mp_shrink()
7289 if (a->used >= TOOM_SQR_CUTOFF) { in mp_sqr()
7295 if (a->used >= KARATSUBA_SQR_CUTOFF) { in mp_sqr()
7302 if ((a->used * 2 + 1) < MP_WARRAY && in mp_sqr()
7303 a->used < in mp_sqr()
7414 mp_rshd (&t1,t1.used/2); in mp_sqrt()
7544 if (c->alloc < a->used + 1) { in mp_sub_d()
7545 if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) { in mp_sub_d()
7565 oldused = c->used; in mp_sub_d()
7570 if ((a->used == 1 && a->dp[0] <= b) || a->used == 0) { in mp_sub_d()
7571 if (a->used == 1) { in mp_sub_d()
7580 c->used = 1; in mp_sub_d()
7584 c->used = a->used; in mp_sub_d()
7592 for (ix = 1; ix < a->used; ix++) { in mp_sub_d()
7858 B = MIN(a->used, b->used) / 3; in mp_toom_mul()
8139 B = a->used / 3; in mp_toom_sqr()
8566 if (a->used > b->used) { in mp_xor()
8570 px = b->used; in mp_xor()
8576 px = a->used; in mp_xor()
8621 a->used = 0; in mp_zero()
8772 if (a->used > b->used) { in s_mp_add()
8773 min = b->used; in s_mp_add()
8774 max = a->used; in s_mp_add()
8777 min = a->used; in s_mp_add()
8778 max = b->used; in s_mp_add()
8790 olduse = c->used; in s_mp_add()
8791 c->used = max + 1; in s_mp_add()
8841 for (i = c->used; i < olduse; i++) { in s_mp_add()
8999 digidx = X->used - 1; in s_mp_exptmod()
9145 MIN (a->used, b->used) < in s_mp_mul_digs()
9153 t.used = digs; in s_mp_mul_digs()
9156 pa = a->used; in s_mp_mul_digs()
9162 pb = MIN (b->used, digs - ix); in s_mp_mul_digs()
9239 if (((a->used + b->used + 1) < MP_WARRAY) in s_mp_mul_high_digs()
9240 && MIN (a->used, b->used) < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { in s_mp_mul_high_digs()
9245 if ((res = mp_init_size (&t, a->used + b->used + 1)) != MP_OKAY) { in s_mp_mul_high_digs()
9248 t.used = a->used + b->used + 1; in s_mp_mul_high_digs()
9250 pa = a->used; in s_mp_mul_high_digs()
9251 pb = b->used; in s_mp_mul_high_digs()
9318 pa = a->used; in s_mp_sqr()
9324 t.used = 2*pa + 1; in s_mp_sqr()
9405 min = b->used; in s_mp_sub()
9406 max = a->used; in s_mp_sub()
9414 olduse = c->used; in s_mp_sub()
9415 c->used = max; in s_mp_sub()
9456 for (i = c->used; i < olduse; i++) { in s_mp_sub()