Home
last modified time | relevance | path

Searched refs:DIGIT_BIT (Results 1 – 25 of 43) sorted by relevance

12

/netbsd/crypto/external/bsd/heimdal/dist/lib/hcrypto/libtommath/
H A Dbn_mp_mul_2d.c33 if (c->alloc < (int)(c->used + b/DIGIT_BIT + 1)) { in mp_mul_2d()
34 if ((res = mp_grow (c, c->used + b / DIGIT_BIT + 1)) != MP_OKAY) { in mp_mul_2d()
40 if (b >= (int)DIGIT_BIT) { in mp_mul_2d()
41 if ((res = mp_lshd (c, b / DIGIT_BIT)) != MP_OKAY) { in mp_mul_2d()
47 d = (mp_digit) (b % DIGIT_BIT); in mp_mul_2d()
56 shift = DIGIT_BIT - d; in mp_mul_2d()
H A Dbn_mp_mod_2d.c33 if (b >= (int) (a->used * DIGIT_BIT)) { in mp_mod_2d()
44 for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) { in mp_mod_2d()
48 c->dp[b / DIGIT_BIT] &= in mp_mod_2d()
49 (mp_digit) ((((mp_digit) 1) << (((mp_digit) b) % DIGIT_BIT)) - ((mp_digit) 1)); in mp_mod_2d()
H A Dbn_mp_2expt.c34 if ((res = mp_grow (a, b / DIGIT_BIT + 1)) != MP_OKAY) { in mp_2expt()
39 a->used = b / DIGIT_BIT + 1; in mp_2expt()
42 a->dp[b / DIGIT_BIT] = ((mp_digit)1) << (b % DIGIT_BIT); in mp_2expt()
H A Dbn_mp_div_2d.c56 if (b >= (int)DIGIT_BIT) { in mp_div_2d()
57 mp_rshd (c, b / DIGIT_BIT); in mp_div_2d()
61 D = (mp_digit) (b % DIGIT_BIT); in mp_div_2d()
69 shift = DIGIT_BIT - D; in mp_div_2d()
H A Dbn_mp_get_int.c31 i = MIN(a->used,(int)((sizeof(unsigned long)*CHAR_BIT+DIGIT_BIT-1)/DIGIT_BIT))-1; in mp_get_int()
37 res = (res << DIGIT_BIT) | DIGIT(a,i); in mp_get_int()
H A Dbn_mp_montgomery_calc_normalization.c31 bits = mp_count_bits (b) % DIGIT_BIT; in mp_montgomery_calc_normalization()
34 if ((res = mp_2expt (a, (b->used - 1) * DIGIT_BIT + bits - 1)) != MP_OKAY) { in mp_montgomery_calc_normalization()
44 for (x = bits - 1; x < (int)DIGIT_BIT; x++) { in mp_montgomery_calc_normalization()
H A Dbn_mp_div_3.c30 b = (((mp_word)1) << ((mp_word)DIGIT_BIT)) / ((mp_word)3); in mp_div_3()
40 w = (w << ((mp_word)DIGIT_BIT)) | ((mp_word)a->dp[ix]); in mp_div_3()
44 t = (w * ((mp_word)b)) >> ((mp_word)DIGIT_BIT); in mp_div_3()
H A Dbn_mp_montgomery_reduce.c36 (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { in mp_montgomery_reduce()
81 u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); in mp_montgomery_reduce()
92 u = *tmpx >> DIGIT_BIT; in mp_montgomery_reduce()
H A Dbn_s_mp_sqr.c46 u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); in s_mp_sqr()
67 u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); in s_mp_sqr()
73 u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); in s_mp_sqr()
H A Dtommath.h81 #define DIGIT_BIT 60
101 #define DIGIT_BIT 31
104 #define DIGIT_BIT 28
128 #ifndef DIGIT_BIT
129 #define DIGIT_BIT ((int)((CHAR_BIT * sizeof(mp_digit) - 1))) /* bits per digit */ macro
132 #define MP_DIGIT_BIT DIGIT_BIT
133 #define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
178 #define MP_WARRAY (1 << (sizeof(mp_word) * CHAR_BIT - 2 * DIGIT_BIT + 1))
H A Dbn_mp_div.c154 norm = mp_count_bits(&y) % DIGIT_BIT; in mp_div()
155 if (norm < (int)(DIGIT_BIT-1)) { in mp_div()
156 norm = (DIGIT_BIT-1) - norm; in mp_div()
195 q.dp[i - t - 1] = ((((mp_digit)1) << DIGIT_BIT) - 1); in mp_div()
198 tmp = ((mp_word) x.dp[i]) << ((mp_word) DIGIT_BIT); in mp_div()
H A Dbn_mp_expt_d.c33 for (x = 0; x < (int) DIGIT_BIT; x++) { in mp_expt_d()
41 if ((b & (mp_digit) (((mp_digit)1) << (DIGIT_BIT - 1))) != 0) { in mp_expt_d()
H A Dbn_mp_toom_mul.c43 if ((res = mp_mod_2d(a, DIGIT_BIT * B, &a0)) != MP_OKAY) { in mp_toom_mul()
51 mp_mod_2d(&a1, DIGIT_BIT * B, &a1); in mp_toom_mul()
59 if ((res = mp_mod_2d(b, DIGIT_BIT * B, &b0)) != MP_OKAY) { in mp_toom_mul()
67 mp_mod_2d(&b1, DIGIT_BIT * B, &b1); in mp_toom_mul()
H A Dbn_mp_add_d.c69 mu = *tmpc >> DIGIT_BIT; in mp_add_d()
75 mu = *tmpc >> DIGIT_BIT; in mp_add_d()
H A Dbn_s_mp_add.c73 u = *tmpc >> ((mp_digit)DIGIT_BIT); in s_mp_add()
88 u = *tmpc >> ((mp_digit)DIGIT_BIT); in s_mp_add()
H A Dbn_s_mp_mul_digs.c35 (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { in s_mp_mul_digs()
74 u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); in s_mp_mul_digs()
H A Dbn_mp_reduce.c38 if (((unsigned long) um) > (((mp_digit)1) << (DIGIT_BIT - 1))) { in mp_reduce()
63 if ((res = mp_mod_2d (x, DIGIT_BIT * (um + 1), x)) != MP_OKAY) { in mp_reduce()
H A Dbn_s_mp_mul_high_digs.c35 && MIN (a->used, b->used) < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { in s_mp_mul_high_digs()
70 u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); in s_mp_mul_high_digs()
H A Dbn_mp_div_d.c29 for (x = 0; x < DIGIT_BIT; x++) { in s_is_power_of_two()
89 w = (w << ((mp_word)DIGIT_BIT)) | ((mp_word)a->dp[ix]); in mp_div_d()
H A Dbn_mp_exptmod_fast.c102 P->used < (1 << ((CHAR_BIT * sizeof (mp_word)) - (2 * DIGIT_BIT)))) { in mp_exptmod_fast()
212 bitcnt = (int)DIGIT_BIT; in mp_exptmod_fast()
216 y = (mp_digit)(buf >> (DIGIT_BIT - 1)) & 1; in mp_exptmod_fast()
H A Dbn_fast_mp_montgomery_reduce.c112 W[ix + 1] += W[ix] >> ((mp_word) DIGIT_BIT); in fast_mp_montgomery_reduce()
132 *_W++ += *_W1++ >> ((mp_word) DIGIT_BIT); in fast_mp_montgomery_reduce()
/netbsd/external/bsd/wpa/dist/src/tls/
H A Dlibtommath.c76 #define DIGIT_BIT 60 macro
82 #define DIGIT_BIT 28 macro
1060 if (b >= (int)DIGIT_BIT) { in mp_div_2d()
1061 mp_rshd (c, b / DIGIT_BIT); in mp_div_2d()
1073 shift = DIGIT_BIT - D; in mp_div_2d()
1403 if (b >= (int)DIGIT_BIT) { in mp_mul_2d()
1419 shift = DIGIT_BIT - d; in mp_mul_2d()
1595 for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) { in mp_mod_2d()
1599 c->dp[b / DIGIT_BIT] &= in mp_mod_2d()
2231 a->used = b / DIGIT_BIT + 1; in mp_2expt()
[all …]
/netbsd/crypto/external/bsd/netpgp/dist/src/libbn/
H A Dbignum.c79 #define DIGIT_BIT 28 macro
301 if (b >= (int)DIGIT_BIT) { in mp_mul_2d()
317 shift = DIGIT_BIT - d; in mp_mul_2d()
387 r = (a->used - 1) * DIGIT_BIT; in mp_count_bits()
961 for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) { in mp_mod_2d()
965 c->dp[b / DIGIT_BIT] &= in mp_mod_2d()
1007 if (b >= (int)DIGIT_BIT) { in mp_div_2d()
1020 shift = DIGIT_BIT - D; in mp_div_2d()
1729 a->dp[b / DIGIT_BIT] = ((mp_digit)1) << (b % DIGIT_BIT); in mp_2expt()
4789 x *= DIGIT_BIT; in mp_cnt_lsb()
[all …]
/netbsd/crypto/external/bsd/netpgp/dist/src/netpgpverify/
H A Dbignum.c76 #define DIGIT_BIT 28 macro
275 if (b >= (int)DIGIT_BIT) { in lshift_bits()
291 shift = DIGIT_BIT - d; in lshift_bits()
887 for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) { in modulo_2_to_power()
891 c->dp[b / DIGIT_BIT] &= in modulo_2_to_power()
934 if (b >= (int)DIGIT_BIT) { in rshift_bits()
947 shift = DIGIT_BIT - D; in rshift_bits()
1665 a->dp[b / DIGIT_BIT] = ((mp_digit)1) << (b % DIGIT_BIT); in mp_2expt()
4609 mu = *tmpc >> DIGIT_BIT; in add_single_digit()
4741 x *= DIGIT_BIT; in mp_cnt_lsb()
[all …]
/netbsd/sbin/nvmectl/
H A Dbignum.c72 #define DIGIT_BIT 28 macro
271 if (b >= (int)DIGIT_BIT) { in lshift_bits()
287 shift = DIGIT_BIT - d; in lshift_bits()
883 for (x = (b / DIGIT_BIT) + ((b % DIGIT_BIT) == 0 ? 0 : 1); x < c->used; x++) { in modulo_2_to_power()
887 c->dp[b / DIGIT_BIT] &= in modulo_2_to_power()
930 if (b >= (int)DIGIT_BIT) { in rshift_bits()
943 shift = DIGIT_BIT - D; in rshift_bits()
1661 a->dp[b / DIGIT_BIT] = ((mp_digit)1) << (b % DIGIT_BIT); in mp_2expt()
4586 mu = *tmpc >> DIGIT_BIT; in add_single_digit()
4718 x *= DIGIT_BIT; in mp_cnt_lsb()
[all …]

12