Home | History | Annotate | Download | only in nvmectl

Lines Matching refs:mp_digit

73 #define MP_MASK          ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
99 static int signed_subtract_word(mp_int *a, mp_digit b, mp_int *c);
127 mp_digit *tmp;
159 mp_digit *top, *bottom;
254 mp_digit d;
278 d = (mp_digit) (b % DIGIT_BIT);
280 mp_digit *tmpc, shift, mask, carry, rr;
284 mask = (((mp_digit)1) << d) - 1;
349 mp_digit q;
360 for (q = a->dp[a->used - 1]; q > ((mp_digit) 0) ; r++) {
361 q >>= ((mp_digit) 1);
371 mp_digit *tmpa, *tmpb;
565 mp_digit carry, *tmpa, *tmpb, *tmpc;
586 carry = *tmpc >> ((mp_digit)DIGIT_BIT);
601 carry = *tmpc >> ((mp_digit)DIGIT_BIT);
641 mp_digit carry, *tmpa, *tmpb, *tmpc;
660 carry = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof(mp_digit) - 1));
672 carry = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof(mp_digit) - 1));
760 multiply_digit(mp_int * a, mp_digit b, mp_int * c)
762 mp_digit carry, *tmpa, *tmpc;
794 *tmpc++ = (mp_digit) (r & ((mp_word) MP_MASK));
797 carry = (mp_digit) (r >> ((mp_word) DIGIT_BIT));
888 (mp_digit) ((((mp_digit) 1) << (((mp_digit) b) % DIGIT_BIT)) - ((mp_digit) 1));
897 mp_digit D, r, rr;
935 D = (mp_digit) (b % DIGIT_BIT);
937 mp_digit *tmpc, mask, shift;
940 mask = (((mp_digit)1) << D) - 1;
1074 q.dp[i - t - 1] = ((((mp_digit)1) << DIGIT_BIT) - 1);
1083 q.dp[i - t - 1] = (mp_digit) (tmp & (mp_word) (MP_MASK));
1201 set_word(mp_int * a, mp_digit b)
1224 mp_digit r, rr, *tmpa, *tmpb;
1258 compare_digit(mp_int * a, mp_digit b)
1661 a->dp[b / DIGIT_BIT] = ((mp_digit)1) << (b % DIGIT_BIT);
1697 mp_digit r, rr, *tmpa, *tmpb;
1712 rr = *tmpa >> ((mp_digit)(DIGIT_BIT - 1));
1715 *tmpb++ = ((*tmpa++ << ((mp_digit)1)) | r) & MP_MASK;
1744 third(mp_int * a, mp_int *c, mp_digit * d)
1748 mp_digit b;
1781 q.dp[ix] = (mp_digit)t;
1786 *d = (mp_digit)w;
2140 mp_digit *tmpa, *tmpb, *tmpx, *tmpy;
2252 mp_digit W[MP_WARRAY];
2270 mp_digit *tmpx, *tmpy;
2292 W[ix] = ((mp_digit)_W) & MP_MASK;
2303 mp_digit *tmpc;
2346 mp_digit u;
2348 mp_digit tmpx, *tmpt, *tmpy;
2387 *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK));
2390 u = (mp_digit) (r >> ((mp_word) DIGIT_BIT));
2449 mp_digit W[MP_WARRAY];
2465 mp_digit *tmpx, *tmpy;
2486 W[ix] = ((mp_digit)_W) & MP_MASK;
2497 mp_digit *tmpc;
2526 mp_digit carry;
2528 mp_digit tmpx, *tmpt, *tmpy;
2562 *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK));
2565 carry = (mp_digit) (r >> ((mp_word) DIGIT_BIT));
2598 if (((unsigned long) um) > (((mp_digit)1) << (DIGIT_BIT - 1))) {
3052 mp_digit W[MP_WARRAY], *tmpx;
3068 mp_digit *tmpy;
3106 W[ix] = (mp_digit)(_W & MP_MASK);
3117 mp_digit *tmpb;
3143 mp_digit carry, tmpx, *tmpt;
3160 t.dp[ix+ix] = (mp_digit) (r & ((mp_word) MP_MASK));
3163 carry = (mp_digit)(r >> ((mp_word) DIGIT_BIT));
3181 *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK));
3184 carry = (mp_digit)(r >> ((mp_word) DIGIT_BIT));
3187 while (carry != ((mp_digit) 0)) {
3189 *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK));
3190 carry = (mp_digit)(r >> ((mp_word) DIGIT_BIT));
3250 mp_digit buf;
3362 y = (unsigned)(buf >> (mp_digit)(DIGIT_BIT - 1)) & 1;
3363 buf <<= (mp_digit)1;
3485 mp_digit iz;
3504 if (iz > (mp_digit)MP_MASK) {
3544 mp_montgomery_setup(mp_int * n, mp_digit * rho)
3546 mp_digit x, b;
3566 if (/*CONSTCOND*/sizeof(mp_digit) == 8) {
3589 fast_mp_montgomery_reduce(mp_int * x, mp_int * n, mp_digit rho)
3610 mp_digit *tmpx;
3636 * by casting the value down to a mp_digit. Note this requires
3639 mp_digit mu;
3640 mu = (mp_digit) (((W[ix] & MP_MASK) * rho) & MP_MASK);
3658 mp_digit *tmpn;
3682 mp_digit *tmpx;
3700 * array of mp_word to mp_digit than calling rshift_digits
3711 *tmpx++ = (mp_digit)(*_W++ & ((mp_word) MP_MASK));
3739 mp_montgomery_reduce(mp_int * x, mp_int * n, mp_digit rho)
3742 mp_digit mu;
3772 mu = (mp_digit) (((mp_word)x->dp[ix]) * ((mp_word)rho) & MP_MASK);
3777 mp_digit *tmpn, *tmpx, carry;
3796 carry = (mp_digit)(r >> ((mp_word) DIGIT_BIT));
3799 *tmpx++ = (mp_digit)(r & ((mp_word) MP_MASK));
3838 diminished_radix_setup(mp_int *a, mp_digit *d)
3841 * the number of bits in a mp_digit [e.g. DIGIT_BIT==31]
3843 *d = (mp_digit)((((mp_word)1) << ((mp_word)DIGIT_BIT)) -
3866 diminished_radix_reduce(mp_int * x, mp_int * n, mp_digit k)
3870 mp_digit mu, *tmpx1, *tmpx2;
3899 *tmpx1++ = (mp_digit)(r & MP_MASK);
3900 mu = (mp_digit)(r >> ((mp_word)DIGIT_BIT));
3930 mp_reduce_2k_setup(mp_int *a, mp_digit *d)
3961 mp_reduce_2k(mp_int *a, mp_int *n, mp_digit d)
4060 mp_digit buf, mp;
4067 int (*redux)(mp_int*,mp_int*,mp_digit);
4188 y = (int)(mp_digit)((mp_digit)buf >> (unsigned)(DIGIT_BIT - 1)) & 1;
4189 buf <<= (mp_digit)1;
4377 is_power_of_two(mp_digit b, int *p)
4387 if (b == (((mp_digit)1)<<x)) {
4397 signed_divide_word(mp_int *a, mp_digit b, mp_int *c, mp_digit *d)
4401 mp_digit t;
4423 *d = a->dp[0] & ((((mp_digit)1)<<ix) - 1);
4448 t = (mp_digit)(w / b);
4453 q.dp[ix] = (mp_digit)t;
4457 *d = (mp_digit)w;
4469 static const mp_digit ltm_prime_tab[] = {
4516 mp_digit res;
4539 add_single_digit(mp_int *a, mp_digit b, mp_int *c)
4542 mp_digit *tmpa, *tmpc, mu;
4629 signed_subtract_word(mp_int *a, mp_digit b, mp_int *c)
4631 mp_digit *tmpa, *tmpc, mu;
4679 mu = *tmpc >> (sizeof(mp_digit) * CHAR_BIT - 1);
4685 mu = *tmpc >> (sizeof(mp_digit) * CHAR_BIT - 1);
4707 mp_digit q, qq;
4901 mp_digit d;
4939 if ((res = signed_divide_word(&t, (mp_digit) radix, &t, &d)) != MP_OKAY) {
4963 mp_digit d;
5001 if ((res = signed_divide_word(&t, (mp_digit) radix, &t, &d)) != MP_OKAY) {
5398 mp_digit ad;
5399 mp_digit bd;
5633 rnd->dp[rnd->used - 1] |= (((mp_digit)1)<<((mp_digit)DIGIT_BIT));
5636 rnd->dp[rnd->used - 1] |= (((mp_digit)1)<<((mp_digit)DIGIT_BIT));
5637 rnd->dp[rnd->used - 1] |= (((mp_digit)1)<<((mp_digit)(DIGIT_BIT - 1)));
5673 static mp_digit digit = 1UL;