Lines Matching refs:USED
38 This table is used to compute output lengths for the mp_toradix()
68 can be contained in an mp_digit. Thus, an mp_word is used. These
122 otherwise, suitable macro definitions will be used. This works
288 USED(mp) = 1;
314 if((DIGITS(mp) = s_mp_alloc(USED(from), sizeof(mp_digit))) == NULL)
317 s_mp_copy(DIGITS(from), DIGITS(mp), USED(from));
318 USED(mp) = USED(from);
319 ALLOC(mp) = USED(from);
350 all the used digits of 'from', we'll re-use it to avoid hitting
355 if(ALLOC(to) >= USED(from)) {
356 s_mp_setz(DIGITS(to) + USED(from), ALLOC(to) - USED(from));
357 s_mp_copy(DIGITS(from), DIGITS(to), USED(from));
360 if((tmp = s_mp_alloc(USED(from), sizeof(mp_digit))) == NULL)
363 s_mp_copy(DIGITS(from), tmp, USED(from));
373 ALLOC(to) = USED(from);
377 USED(to) = USED(from);
417 Release the storage used by an mp_int, and void its fields so that
435 USED(mp) = 0;
469 USED(mp) = 1;
946 if(USED(c) == 1 && DIGIT(c, 0) == 0)
1032 if(USED(c) == 1 && DIGIT(c, 0) == 0)
1136 Compute q = a / b and r = a mod b. Input parameters may be re-used
1283 for(dig = 0; dig < (USED(b) - 1); dig++) {
1471 if((res = mp_init_size(&t, USED(a))) != MP_OKAY)
1478 s_mp_rshd(&x, (USED(&x)/2)+1);
1639 mp_size ub = USED(b);
1659 s_mp_lshd(&mu, 2 * USED(m));
1780 else if(USED(a) == 1 && DIGIT(a, 0) == 0)
1860 frequently this wil get used anyway. For small positive constants,
2059 based on the Stein algorithm used for mp_gcd()
2243 for(ix = USED(mp) - 1; ix >= 0; ix--) {
2352 if(USED(mp) == 1 && DIGIT(mp, 0) == 0)
2355 count = (USED(mp) - 1) * sizeof(mp_digit);
2356 topdig = DIGIT(mp, USED(mp) - 1);
2379 end = dp + USED(mp) - 1;
2434 len = DIGIT_BIT * (USED(mp) - 1);
2435 d = DIGIT(mp, USED(mp) - 1);
2665 s_mp_copy(DIGITS(mp), tmp, USED(mp));
2683 /* Make sure the used size of mp is at least 'min', growing if needed */
2686 if(min > USED(mp)) {
2694 USED(mp) = min;
2775 mp_size du = USED(mp);
2781 USED(mp) = du;
2825 if((res = s_mp_pad(mp, USED(mp) + p)) != MP_OKAY)
2828 pos = USED(mp) - 1;
2862 if(p >= USED(mp)) {
2864 USED(mp) = 1;
2871 for(ix = p; ix < USED(mp); ix++)
2876 while(ix < USED(mp))
2906 for(ix = 0; ix < USED(mp); ix++) {
2922 USED(mp) += 1;
2944 if(ndig >= USED(mp))
2952 for(ix = ndig + 1; ix < USED(mp); ix++)
2972 mp_size used;
2978 dp = DIGITS(mp); used = USED(mp);
2985 if((dp[used - 1] >> (DIGIT_BIT - d)) & mask) {
2986 if((res = s_mp_grow(mp, used + 1)) != MP_OKAY)
2993 for(ix = 0; ix < used; ix++) {
3003 dp[used] = save;
3004 USED(mp) += 1;
3019 full division code (used in Barrett reduction, see below)
3032 for(ix = USED(mp) - 1; ix >= 0; ix--) {
3064 t = DIGIT(b, USED(b) - 1);
3091 mp_size ix = 1, used = USED(mp);
3098 while(ix < used && k) {
3108 if((res = s_mp_pad(mp, USED(mp) + 1)) != MP_OKAY)
3126 mp_size ix = 1, used = USED(mp);
3135 while(b && ix < used) {
3173 max = USED(a);
3192 USED(a) = max + 1;
3224 if((res = mp_init_size(", USED(mp))) != MP_OKAY)
3227 USED(") = USED(mp); /* so clamping will work below */
3231 for(ix = USED(mp) - 1; ix >= 0; ix--) {
3269 used = USED(b);
3273 if((used > USED(a)) && (res = s_mp_pad(a, used)) != MP_OKAY)
3285 for(ix = 0; ix < used; ++ix) {
3294 used = USED(a);
3295 while(w && ix < used) {
3307 if((res = s_mp_pad(a, used + 1)) != MP_OKAY)
3326 mp_size ix, used = USED(b);
3337 for(ix = 0; ix < used; ++ix) {
3343 used = USED(a);
3344 while(ix < used) {
3372 mp_size um = USED(m);
3428 mp_size ix, jx, ua = USED(a), ub = USED(b);
3435 USED(&tmp) = ua + ub;
3516 mp_size ix, jx, kx, used = USED(a);
3519 if((res = mp_init_size(&tmp, 2 * used)) != MP_OKAY)
3523 USED(&tmp) = 2 * used;
3529 for(ix = 0; ix < used; ++ix, ++pa1) {
3548 for(jx = ix + 1, pa2 = DIGITS(a) + jx; jx < used; ++jx, ++pa2) {
3647 if((res = mp_init_size(", USED(a))) != MP_OKAY)
3651 if((res = mp_init_size(&t, USED(a))) != MP_OKAY)
3655 if((res = mp_init_size(&rem, USED(a))) != MP_OKAY)
3662 ix = USED(a) - 1;
3683 q = DIGIT(&rem, USED(&rem) - 1);
3684 if(q <= DIGIT(b, USED(b) - 1) && USED(&rem) > 1)
3685 q = (q << DIGIT_BIT) | DIGIT(&rem, USED(&rem) - 2);
3687 q /= DIGIT(b, USED(b) - 1);
3781 mp_size ua = USED(a), ub = USED(b);
3812 mp_size ua = USED(a);
3838 mp_size uv = USED(v);