Home | History | Annotate | Download | only in pre_gen

Lines Matching full:used

235   /* get old used count */
236 olduse = x->used;
239 if (x->alloc < n->used + 1) {
240 if ((res = mp_grow (x, n->used + 1)) != MP_OKAY) {
258 /* copy the digits of a into W[0..a->used-1] */
259 for (ix = 0; ix < x->used; ix++) {
263 /* zero the high words of W[a->used..m->used*2] */
264 for (; ix < n->used * 2 + 1; ix++) {
272 for (ix = 0; ix < n->used; ix++) {
294 * first m->used words of W[] have the carries fixed
308 for (iy = 0; iy < n->used; iy++) {
333 for (; ix <= n->used * 2 + 1; ix++) {
348 _W = W + n->used;
350 for (ix = 0; ix < n->used + 1; ix++) {
355 * m->used+1 we'll have to clear the digits
362 /* set the max used and clamp */
363 x->used = n->used + 1;
428 pa = MIN(digs, a->used + b->used);
438 ty = MIN(b->used-1, ix);
446 while (tx++ < a->used && ty-- >= 0) { ... }
448 iy = MIN(a->used-tx, ty+1);
464 olduse = c->used;
465 c->used = pa;
513 * This is used in the Barrett reduction since for one of the multiplications
525 pa = a->used + b->used;
533 pa = a->used + b->used;
540 ty = MIN(b->used-1, ix);
548 while (tx++ < a->used && ty-- >= 0) { ... }
550 iy = MIN(a->used-tx, ty+1);
565 olduse = c->used;
566 c->used = pa;
628 pa = a->used + a->used;
646 ty = MIN(a->used-1, ix);
654 while (tx++ < a->used && ty-- >= 0) { ... }
656 iy = MIN(a->used-tx, ty+1);
685 olduse = b->used;
686 b->used = a->used+a->used;
747 /* set the used count of where the bit will go */
748 a->used = b / DIGIT_BIT + 1;
893 if (c->alloc < a->used + 1) {
894 if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) {
900 if (a->sign == MP_NEG && (a->used > 1 || a->dp[0] >= b)) {
916 /* old number of used digits in c */
917 oldused = c->used;
938 for (ix = 1; ix < a->used; ix++) {
948 c->used = a->used + 1;
951 c->used = 1;
954 if (a->used == 1) {
1053 if (a->used > b->used) {
1057 px = b->used;
1063 px = a->used;
1072 for (; ix < t.used; ix++) {
1109 * This is used to ensure that leading zero digits are
1110 * trimed and the leading "used" digit will be non-zero
1117 /* decrease used while the most significant digit is
1120 while (a->used > 0 && a->dp[a->used - 1] == 0) {
1121 --(a->used);
1124 /* reset the sign flag if used == 0 */
1125 if (a->used == 0) {
1164 for (i = 0; i < a->used; i++) {
1173 a->alloc = a->used = 0;
1297 if (a->used > 1) {
1343 if (a->used > b->used) {
1347 if (a->used < b->used) {
1352 tmpa = a->dp + (a->used - 1);
1355 tmpb = b->dp + (a->used - 1);
1358 for (n = 0; n < a->used; ++n, --tmpa, --tmpb) {
1411 for (x = 0; x < a->used && a->dp[x] == 0; x++);
1464 if (b->alloc < a->used) {
1465 if ((res = mp_grow (b, a->used)) != MP_OKAY) {
1483 for (n = 0; n < a->used; n++) {
1488 for (; n < b->used; n++) {
1493 /* copy used count and sign */
1494 b->used = a->used;
1532 if (a->used == 0) {
1537 r = (a->used - 1) * DIGIT_BIT;
1540 q = a->dp[a->used - 1];
1681 if ((res = mp_init_size (&q, a->used + 2)) != MP_OKAY) {
1684 q.used = a->used + 2;
1720 /* note hac does 0 based, so if used==5 then its 0,1,2,3,4, e.g. use 4 */
1721 n = x.used - 1;
1722 t = y.used - 1;
1741 if (i > x.used) {
1772 t1.used = 2;
1781 t2.used = 3;
1818 x.sign = x.used == 0 ? MP_ZPOS : a->sign;
1875 if (b->alloc < a->used) {
1876 if ((res = mp_grow (b, a->used)) != MP_OKAY) {
1881 oldused = b->used;
1882 b->used = a->used;
1887 tmpa = a->dp + b->used - 1;
1890 tmpb = b->dp + b->used - 1;
1894 for (x = b->used - 1; x >= 0; x--) {
1906 tmpb = b->dp + b->used;
1907 for (x = b->used; x < oldused; x++) {
1993 tmpc = c->dp + (c->used - 1);
1997 for (x = c->used - 1; x >= 0; x--) {
2054 if ((res = mp_init_size(&q, a->used)) != MP_OKAY) {
2058 q.used = a->used;
2061 for (ix = a->used - 1; ix >= 0; ix--) {
2181 if ((res = mp_init_size(&q, a->used)) != MP_OKAY) {
2185 q.used = a->used;
2188 for (ix = a->used - 1; ix >= 0; ix--) {
2245 if (a->used < 2) {
2252 for (ix = 1; ix < a->used; ix++) {
2308 m = n->used;
2342 for (i = m + 1; i < x->used; i++) {
2716 if (((P->used * 2 + 1) < MP_WARRAY) &&
2717 P->used < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) {
2814 digidx = X->used - 1;
2837 * does lower the # of trivial squaring/reductions used
2911 /* fixup result if Montgomery reduction is used
3288 if (a->used == 0) {
3293 i = MIN(a->used,(int)((sizeof(unsigned long)*CHAR_BIT+DIGIT_BIT-1)/DIGIT_BIT))-1;
3408 /* set the used to zero, allocated digits to the default precision
3410 a->used = 0;
3627 a->used = 0;
3927 /* digits used? (TSD) */
3928 if (arg->used == 0) {
4125 * Note that a1b1 and a0b0 are used twice and only need to be
4150 B = MIN (a->used, b->used);
4158 if (mp_init_size (&x1, a->used - B) != MP_OKAY)
4162 if (mp_init_size (&y1, b->used - B) != MP_OKAY)
4174 x0.used = y0.used = B;
4175 x1.used = a->used - B;
4176 y1.used = b->used - B;
4196 for (x = B; x < a->used; x++) {
4201 for (x = B; x < b->used; x++) {
4298 B = a->used;
4306 if (mp_init_size (&x1, a->used - B) != MP_OKAY)
4310 if (mp_init_size (&t1, a->used * 2) != MP_OKAY)
4312 if (mp_init_size (&t2, a->used * 2) != MP_OKAY)
4316 if (mp_init_size (&x1x1, (a->used - B) * 2) != MP_OKAY)
4332 for (x = B; x < a->used; x++) {
4337 x0.used = B;
4338 x1.used = a->used - B;
4483 if (a->alloc < a->used + b) {
4484 if ((res = mp_grow (a, a->used + b)) != MP_OKAY) {
4492 /* increment the used by the shift amount then copy upwards */
4493 a->used += b;
4496 top = a->dp + a->used - 1;
4499 bottom = a->dp + a->used - 1 - b;
4505 for (x = a->used - 1; x >= b; x--) {
4608 if (b >= (int) (a->used * DIGIT_BIT)) {
4619 for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) {
4698 if (b->used > 1) {
4699 if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) {
4755 /* can the fast reduction [comba] method be used?
4761 digs = n->used * 2 + 1;
4763 n->used <
4774 x->used = digs;
4776 for (ix = 0; ix < n->used; ix++) {
4803 for (iy = 0; iy < n->used; iy++) {
4826 /* at this point the n.used'th least
4829 * right by n.used digits and the
4833 /* x = x/b**n.used */
4835 mp_rshd (x, n->used);
4941 if (MIN (a->used, b->used) >= TOOM_MUL_CUTOFF) {
4947 if (MIN (a->used, b->used) >= KARATSUBA_MUL_CUTOFF) {
4954 * The fast multiplier can be used if the output will
4958 int digs = a->used + b->used + 1;
4962 MIN(a->used, b->used) <=
4974 c->sign = (c->used > 0) ? neg : MP_ZPOS;
5009 if (b->alloc < a->used + 1) {
5010 if ((res = mp_grow (b, a->used + 1)) != MP_OKAY) {
5015 oldused = b->used;
5016 b->used = a->used;
5029 for (x = 0; x < a->used; x++) {
5049 ++(b->used);
5055 tmpb = b->dp + b->used;
5056 for (x = b->used; x < oldused; x++) {
5102 if (c->alloc < (int)(c->used + b/DIGIT_BIT + 1)) {
5103 if ((res = mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) {
5132 for (x = 0; x < c->used; x++) {
5146 c->dp[(c->used)++] = r;
5187 if (c->alloc < a->used + 1) {
5188 if ((res = mp_grow (c, a->used + 1)) != MP_OKAY) {
5193 /* get the original destinations used count */
5194 olduse = c->used;
5209 for (ix = 0; ix < a->used; ix++) {
5229 /* set used count */
5230 c->used = a->used + 1;
5491 if (a->used > b->used) {
5495 px = b->used;
5501 px = a->used;
5937 /* init temp used for Miller-Rabin Testing */
6294 /* chars used in radix conversions */
6538 a->used += 1;
6542 a->used += 2;
6581 int res, um = m->used;
6908 /* determines if mp_reduce_2k can be used */
6914 if (a->used == 0) {
6916 } else if (a->used == 1) {
6918 } else if (a->used > 1) {
6964 /* determines if reduce_2k_l can be used */
6969 if (a->used == 0) {
6971 } else if (a->used == 1) {
6973 } else if (a->used > 1) {
6975 for (iy = ix = 0; ix < a->used; ix++) {
6980 return (iy >= (a->used/2)) ? MP_YES : MP_NO;
7019 if ((res = mp_2expt (a, b->used * 2 * DIGIT_BIT)) != MP_OKAY) {
7060 /* if b > used then simply zero it and return */
7061 if (a->used <= b) {
7087 for (x = 0; x < (a->used - b); x++) {
7092 for (; x < a->used; x++) {
7098 a->used -= b;
7131 a->used = (a->dp[0] != 0) ? 1 : 0;
7180 a->used += 1;
7215 if (a->alloc != a->used && a->used > 0) {
7216 if ((tmp = OPT_CAST(mp_digit) XREALLOC (a->dp, sizeof (mp_digit) * a->used)) == NULL) {
7220 used;
7289 if (a->used >= TOOM_SQR_CUTOFF) {
7295 if (a->used >= KARATSUBA_SQR_CUTOFF) {
7302 if ((a->used * 2 + 1) < MP_WARRAY &&
7303 a->used <
7414 mp_rshd (&t1,t1.used/2);
7544 if (c->alloc < a->used + 1) {
7545 if ((res = mp_grow(c, a->used + 1)) != MP_OKAY) {
7565 oldused = c->used;
7570 if ((a->used == 1 && a->dp[0] <= b) || a->used == 0) {
7571 if (a->used == 1) {
7580 c->used = 1;
7584 c->used = a->used;
7592 for (ix = 1; ix < a->used; ix++) {
7858 B = MIN(a->used, b->used) / 3;
8139 B = a->used / 3;
8566 if (a->used > b->used) {
8570 px = b->used;
8576 px = a->used;
8621 a->used = 0;
8719 /* reverse an array, used for radix code */
8772 if (a->used > b->used) {
8773 min = b->used;
8774 max = a->used;
8777 min = a->used;
8778 max = b->used;
8789 /* get old used digit count and set new one */
8790 olduse = c->used;
8791 c->used = max + 1;
8841 for (i = c->used; i < olduse; i++) {
8928 /* create mu, used for Barrett reduction */
8999 digidx = X->used - 1;
9022 * does lower the # of trivial squaring/reductions used
9145 MIN (a->used, b->used) <
9153 t.used = digs;
9156 pa = a->used;
9162 pb = MIN (b->used, digs - ix);
9165 /* copy of the digit from a used within the nested loop */
9239 if (((a->used + b->used + 1) < MP_WARRAY)
9240 && MIN (a->used, b->used) < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) {
9245 if ((res = mp_init_size (&t, a->used + b->used + 1)) != MP_OKAY) {
9248 t.used = a->used + b->used + 1;
9250 pa = a->used;
9251 pb = b->used;
9318 pa = a->used;
9323 /* default used is maximum possible size */
9324 t.used = 2*pa + 1;
9405 min = b->used;
9406 max = a->used;
9414 olduse = c->used;
9415 c->used = max;
9455 /* clear digits above used (since we may not have grown result above) */
9456 for (i = c->used; i < olduse; i++) {
9500 int KARATSUBA_MUL_CUTOFF = 80, /* Min. number of digits before Karatsuba multiplication is used. */
9501 KARATSUBA_SQR_CUTOFF = 120, /* Min. number of digits before Karatsuba squaring is used. */