Home | History | Annotate | Download | only in tls

Lines Matching refs:used

127     int used, alloc, sign;
133 #define mp_iszero(a) (((a)->used == 0) ? MP_YES : MP_NO)
134 #define mp_iseven(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 0)) ? MP_YES : MP_NO)
135 #define mp_isodd(a) (((a)->used > 0 && (((a)->dp[0] & 1) == 1)) ? MP_YES : MP_NO)
139 #define s_mp_mul(a, b, c) s_mp_mul_digs(a, b, c, (a)->used + (b)->used + 1)
201 /* reverse an array, used for radix code */
228 if (a->used > b->used) {
229 min = b->used;
230 max = a->used;
233 min = a->used;
234 max = b->used;
245 /* get old used digit count and set new one */
246 olduse = c->used;
247 c->used = max + 1;
297 for (i = c->used; i < olduse; i++) {
313 min = b->used;
314 max = a->used;
322 olduse = c->used;
323 c->used = max;
363 /* clear digits above used (since we may not have grown result above) */
364 for (i = c->used; i < olduse; i++) {
390 /* set the used to zero, allocated digits to the default precision
392 a->used = 0;
408 for (i = 0; i < a->used; i++) {
417 a->alloc = a->used = 0;
500 if (MIN (a->used, b->used) >= TOOM_MUL_CUTOFF) {
506 if (MIN (a->used, b->used) >= KARATSUBA_MUL_CUTOFF) {
513 * The fast multiplier can be used if the output will
518 int digs = a->used + b->used + 1;
521 MIN(a->used, b->used) <=
534 c->sign = (c->used > 0) ? neg : MP_ZPOS;
716 if (a->used > 1) {
933 if (a->used > b->used) {
937 if (a->used < b->used) {
942 tmpa = a->dp + (a->used - 1);
945 tmpb = b->dp + (a->used - 1);
948 for (n = 0; n < a->used; ++n, --tmpa, --tmpb) {
984 a->used += 1;
988 a->used += 2;
1076 tmpc = c->dp + (c->used - 1);
1080 for (x = c->used - 1; x >= 0; x--) {
1119 a->used = 0;
1139 if (b->alloc < a->used) {
1140 if ((res = mp_grow (b, a->used)) != MP_OKAY) {
1158 for (n = 0; n < a->used; n++) {
1163 for (; n < b->used; n++) {
1168 /* copy used count and sign */
1169 b->used = a->used;
1185 /* if b > used then simply zero it and return */
1186 if (a->used <= b) {
1212 for (x = 0; x < (a->used - b); x++) {
1217 for (; x < a->used; x++) {
1223 a->used -= b;
1242 * This is used to ensure that leading zero digits are
1243 * trimed and the leading "used" digit will be non-zero
1249 /* decrease used while the most significant digit is
1252 while (a->used > 0 && a->dp[a->used - 1] == 0) {
1253 --(a->used);
1256 /* reset the sign flag if used == 0 */
1257 if (a->used == 0) {
1329 a->used = (a->dp[0] != 0) ? 1 : 0;
1340 if (b->alloc < a->used) {
1341 if ((res = mp_grow (b, a->used)) != MP_OKAY) {
1346 oldused = b->used;
1347 b->used = a->used;
1352 tmpa = a->dp + b->used - 1;
1355 tmpb = b->dp + b->used - 1;
1359 for (x = b->used - 1; x >= 0; x--) {
1371 tmpb = b->dp + b->used;
1372 for (x = b->used; x < oldused; x++) {
1396 if (c->alloc < (int)(c->used + b/DIGIT_BIT + 1)) {
1397 if ((res = mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) {
1426 for (x = 0; x < c->used; x++) {
1440 c->dp[(c->used)++] = r;
1512 if (a->alloc < a->used + b) {
1513 if ((res = mp_grow (a, a->used + b)) != MP_OKAY) {
1521 /* increment the used by the shift amount then copy upwards */
1522 a->used += b;
1525 top = a->dp + a->used - 1;
1528 bottom = a->dp + a->used - 1 - b;
1534 for (x = a->used - 1; x >= b; x--) {
1555 if (a->used == 0) {
1560 r = (a->used - 1) * DIGIT_BIT;
1563 q = a->dp[a->used - 1];
1584 if (b >= (int) (a->used * DIGIT_BIT)) {
1595 for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) {
1714 if ((res = mp_init_size (&q, a->used + 2)) != MP_OKAY) {
1717 q.used = a->used + 2;
1753 /* note hac does 0 based, so if used==5 then its 0,1,2,3,4, e.g. use 4 */
1754 n = x.used - 1;
1755 t = y.used - 1;
1774 if (i > x.used) {
1805 t1.used = 2;
1814 t2.used = 3;
1851 x.sign = x.used == 0 ? MP_ZPOS : a->sign;
1931 /* create mu, used for Barrett reduction */
2002 digidx = X->used - 1;
2025 * does lower the # of trivial squaring/reductions used
2117 if (a->used >= TOOM_SQR_CUTOFF) {
2123 if (a->used >= KARATSUBA_SQR_CUTOFF) {
2130 if ((a->used * 2 + 1) < MP_WARRAY &&
2131 a->used <
2230 /* set the used count of where the bit will go */
2231 a->used = b / DIGIT_BIT + 1;
2247 if ((res = mp_2expt (a, b->used * 2 * DIGIT_BIT)) != MP_OKAY) {
2261 int res, um = m->used;
2352 MIN (a->used, b->used) <
2361 t.used = digs;
2364 pa = a->used;
2370 pb = MIN (b->used, digs - ix);
2373 /* copy of the digit from a used within the nested loop */
2440 pa = MIN(digs, a->used + b->used);
2450 ty = MIN(b->used-1, ix);
2458 while (tx++ < a->used && ty-- >= 0) { ... }
2460 iy = MIN(a->used-tx, ty+1);
2476 olduse = c->used;
2477 c->used = pa;
2513 a->used = 0;
2534 pa = a->used;
2539 /* default used is maximum possible size */
2540 t.used = 2*pa + 1;
2603 if (((a->used + b->used + 1) < MP_WARRAY)
2604 && MIN (a->used, b->used) < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) {
2609 if ((res = mp_init_size (&t, a->used + b->used + 1)) != MP_OKAY) {
2612 t.used = a->used + b->used + 1;
2614 pa = a->used;
2615 pb = b->used;
2705 /* get old used count */
2706 olduse = x->used;
2709 if (x->alloc < n->used + 1) {
2710 if ((res = mp_grow (x, n->used + 1)) != MP_OKAY) {
2728 /* copy the digits of a into W[0..a->used-1] */
2729 for (ix = 0; ix < x->used; ix++) {
2733 /* zero the high words of W[a->used..m->used*2] */
2734 for (; ix < n->used * 2 + 1; ix++) {
2742 for (ix = 0; ix < n->used; ix++) {
2764 * first m->used words of W[] have the carries fixed
2778 for (iy = 0; iy < n->used; iy++) {
2803 for (; ix <= n->used * 2 + 1; ix++) {
2818 _W = W + n->used;
2820 for (ix = 0; ix < n->used + 1; ix++) {
2825 * m->used+1 we'll have to clear the digits
2832 /* set the max used and clamp */
2833 x->used = n->used + 1;
2852 if (b->alloc < a->used + 1) {
2853 if ((res = mp_grow (b, a->used + 1)) != MP_OKAY) {
2858 oldused = b->used;
2859 b->used = a->used;
2872 for (x = 0; x < a->used; x++) {
2892 ++(b->used);
2898 tmpb = b->dp + b->used;
2899 for (x = b->used; x < oldused; x++) {
2923 if (b->used > 1) {
2924 if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) {
3026 if (((P->used * 2 + 1) < MP_WARRAY) &&
3027 P->used < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) {
3124 digidx = X->used - 1;
3147 * does lower the # of trivial squaring/reductions used
3221 /* fixup result if Montgomery reduction is used
3264 pa = a->used + a->used;
3282 ty = MIN(a->used-1, ix);
3290 while (tx++ < a->used && ty-- >= 0) { ... }
3292 iy = MIN(a->used-tx, ty+1);
3321 olduse = b->used;
3322 b->used = a->used+a->used;
3352 if (c->alloc < a->used + 1) {
3353 if ((res = mp_grow (c, a->used + 1)) != MP_OKAY) {
3358 /* get the original destinations used count */
3359 olduse = c->used;
3374 for (ix = 0; ix < a->used; ix++) {
3394 /* set used count */
3395 c->used = a->used + 1;