Home
last modified time | relevance | path

Searched refs:BN_BITS2 (Results 1 – 25 of 26) sorted by relevance

12

/src/crypto/openssl/crypto/bn/
H A Dbn_shift.c37 c = t >> (BN_BITS2 - 1); in BN_lshift1()
68 c = t << (BN_BITS2 - 1); in BN_rshift1()
73 c = t << (BN_BITS2 - 1); in BN_rshift1()
116 nw = n / BN_BITS2; in bn_lshift_fixed_top()
121 lb = (unsigned int)n % BN_BITS2; in bn_lshift_fixed_top()
122 rb = BN_BITS2 - lb; in bn_lshift_fixed_top()
123 rb %= BN_BITS2; /* say no to undefined behaviour */ in bn_lshift_fixed_top()
185 nw = n / BN_BITS2; in bn_rshift_fixed_top()
192 rb = (unsigned int)n % BN_BITS2; in bn_rshift_fixed_top()
193 lb = BN_BITS2 - rb; in bn_rshift_fixed_top()
[all …]
H A Dbn_lib.c106 #if BN_BITS2 > 32 in BN_num_bits_word()
109 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
116 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
122 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
128 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
134 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
140 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
163 ret += BN_BITS2 & (~mask & ~past_i); in bn_num_bits_consttime()
199 return ((i * BN_BITS2) + BN_num_bits_word(a->d[i])); in BN_num_bits()
268 if (words > (INT_MAX / (4 * BN_BITS2))) { in bn_expand_internal()
[all …]
H A Dbn_nist.c13 #define BN_NIST_192_TOP (192 + BN_BITS2 - 1) / BN_BITS2
14 #define BN_NIST_224_TOP (224 + BN_BITS2 - 1) / BN_BITS2
15 #define BN_NIST_256_TOP (256 + BN_BITS2 - 1) / BN_BITS2
16 #define BN_NIST_384_TOP (384 + BN_BITS2 - 1) / BN_BITS2
17 #define BN_NIST_521_TOP (521 + BN_BITS2 - 1) / BN_BITS2
20 #if BN_BITS2 == 64
103 #elif BN_BITS2 == 32
283 #if BN_BITS2 == 64
524 #if BN_BITS2 == 64 in BN_nist_mod_224()
537 #if defined(NIST_INT64) && BN_BITS2 != 64 in BN_nist_mod_224()
[all …]
H A Dbn_div.c98 #if BN_BITS2 == 64 && defined(__SIZEOF_INT128__) && __SIZEOF_INT128__ == 16
117 BN_ULLONG R = ((BN_ULLONG)m[0] << BN_BITS2) | m[-1]; in bn_div_3_words()
118 BN_ULLONG D = ((BN_ULLONG)d0 << BN_BITS2) | d1; in bn_div_3_words()
122 for (i = 0; i < BN_BITS2; i++) { in bn_div_3_words()
131 mask = 0 - (Q >> (BN_BITS2 - 1)); /* does it overflow? */ in bn_div_3_words()
147 lshift = BN_BITS2 - rshift; in bn_left_align()
148 rshift %= BN_BITS2; /* say no to undefined behaviour */ in bn_left_align()
362 q = (BN_ULONG)(((((BN_ULLONG)n0) << BN_BITS2) | n1) / d0); in bn_div_fixed_top()
377 if (t2 <= ((((BN_ULLONG)rem) << BN_BITS2) | n2)) in bn_div_fixed_top()
H A Dbn_mont.c292 mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2; in BN_MONT_CTX_set()
294 #if defined(OPENSSL_BN_ASM_MONT) && (BN_BITS2 <= 32) in BN_MONT_CTX_set()
303 if (!(BN_set_bit(R, 2 * BN_BITS2))) in BN_MONT_CTX_set()
316 if (!BN_lshift(Ri, Ri, 2 * BN_BITS2)) in BN_MONT_CTX_set()
340 if (!(BN_set_bit(R, BN_BITS2))) in BN_MONT_CTX_set()
351 if (!BN_lshift(Ri, Ri, BN_BITS2)) in BN_MONT_CTX_set()
477 #if (BN_BITS2 <= 32) && defined(OPENSSL_BN_ASM_MONT) in ossl_bn_mont_ctx_set()
480 #elif BN_BITS2 <= 32 in ossl_bn_mont_ctx_set()
H A Dbn_gf2m.c313 dN = p[0] / BN_BITS2; in BN_GF2m_mod_arr()
325 d0 = n % BN_BITS2; in BN_GF2m_mod_arr()
326 d1 = BN_BITS2 - d0; in BN_GF2m_mod_arr()
327 n /= BN_BITS2; in BN_GF2m_mod_arr()
335 d0 = p[0] % BN_BITS2; in BN_GF2m_mod_arr()
336 d1 = BN_BITS2 - d0; in BN_GF2m_mod_arr()
345 d0 = p[0] % BN_BITS2; in BN_GF2m_mod_arr()
349 d1 = BN_BITS2 - d0; in BN_GF2m_mod_arr()
362 n = p[k] / BN_BITS2; in BN_GF2m_mod_arr()
363 d0 = p[k] % BN_BITS2; in BN_GF2m_mod_arr()
[all …]
H A Dbn_local.h210 #define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits + BN_BITS2 - 1)) / BN_BITS2)
474 #define Hw(t) (((BN_ULONG)((t) >> BN_BITS2)) & BN_MASK2)
573 #define LHBITS(a) (((a) >> BN_BITS2) & BN_MASKl)
574 #define LL2HBITS(a) ((BN_ULLONG)((a) & BN_MASKl) << BN_BITS2)
681 if (bits > (INT_MAX - BN_BITS2 + 1)) in bn_expand()
684 if (((bits + BN_BITS2 - 1) / BN_BITS2) <= (a)->dmax) in bn_expand()
687 return bn_expand2((a), (bits + BN_BITS2 - 1) / BN_BITS2); in bn_expand()
H A Dbn_word.c54 ret = (BN_ULLONG)(((ret << (BN_ULLONG)BN_BITS2) | a->d[i]) % (BN_ULLONG)w); in BN_mod_word()
75 j = BN_BITS2 - BN_num_bits_word(w); in BN_div_word()
H A Dbn_asm.c200 return ((BN_ULONG)(((((BN_ULLONG)h) << BN_BITS2) | l) / (BN_ULLONG)d)); in bn_div_words()
216 assert((i == BN_BITS2) || (h <= (BN_ULONG)1 << i)); in bn_div_words()
218 i = BN_BITS2 - i; in bn_div_words()
224 h = (h << i) | (l >> (BN_BITS2 - i)); in bn_div_words()
284 ll >>= BN_BITS2; in bn_add_words()
287 ll >>= BN_BITS2; in bn_add_words()
290 ll >>= BN_BITS2; in bn_add_words()
293 ll >>= BN_BITS2; in bn_add_words()
303 ll >>= BN_BITS2; in bn_add_words()
H A Dbn_print.c41 for (j = BN_BITS2 - 4; j >= 0; j -= 4) { in BN_print()
H A Dbn_exp.c398 if (m->d[j - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) { in BN_mod_exp_mont()
492 wordpos = bitpos / BN_BITS2; in bn_get_bits()
493 bitpos %= BN_BITS2; in bn_get_bits()
499 ret |= a->d[wordpos] << (BN_BITS2 - bitpos); in bn_get_bits()
636 bits = p->top * BN_BITS2; in bn_mod_exp_mont_fixed_top()
751 if (m->d[top - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) { in bn_mod_exp_mont_fixed_top()
H A Dbn_gcd.c626 pow2_shifts *= BN_BITS2; in BN_gcd()
628 for (j = 0; j < BN_BITS2; j++) { in BN_gcd()
H A Dbn_conv.c30 for (j = BN_BITS2 - 8; j >= 0; j -= 8) { in BN_bn2hex()
H A Drsaz_exp_x2.c702 i = idx / BN_BITS2;
703 j = idx % BN_BITS2;
H A Dbn_rsa_fips186_4.c31 #if BN_BITS2 == 64
H A Dbn_mod.c58 BN_ULONG storage[1024 / BN_BITS2]; in bn_mod_add_fixed_top()
H A Dbn_prime.c32 #if BN_BITS2 == 64
H A Dbn_dh.c16 #if BN_BITS2 == 64
/src/crypto/openssl/test/
H A Dexptest.c23 #define NUM_BITS (BN_BITS2 * 4)
178 c = (c % BN_BITS) - BN_BITS2; in test_mod_exp()
185 c = (c % BN_BITS) - BN_BITS2; in test_mod_exp()
192 c = (c % BN_BITS) - BN_BITS2; in test_mod_exp()
/src/crypto/openssl/crypto/ec/
H A Dec2_smpl.c89 if (bn_wexpand(dest->a, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) == NULL) in ossl_ec_GF2m_simple_group_copy()
91 if (bn_wexpand(dest->b, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) == NULL) in ossl_ec_GF2m_simple_group_copy()
117 if (bn_wexpand(group->a, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2) in ossl_ec_GF2m_simple_group_set_curve()
125 if (bn_wexpand(group->b, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2) in ossl_ec_GF2m_simple_group_set_curve()
H A Decp_nistz256.c34 #if BN_BITS2 != 64
41 #define P256_LIMBS (256 / BN_BITS2)
190 in >>= BN_BITS2 - 1; in is_zero()
H A Decp_sm2p256.c24 #define P256_LIMBS (256 / BN_BITS2)
/src/crypto/openssl/crypto/
H A Dsparse_array.c35 #elif OPENSSL_SA_BLOCK_BITS < 2 || OPENSSL_SA_BLOCK_BITS > (BN_BITS2 - 1)
/src/crypto/openssl/include/openssl/
H A Dbn.h54 #define BN_BITS2 (BN_BYTES * 8) macro
55 #define BN_BITS (BN_BITS2 * 2)
56 #define BN_TBIT ((BN_ULONG)1 << (BN_BITS2 - 1))
/src/crypto/openssl/doc/internal/man3/
H A Dbn_mul_words.pod74 BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit chunks. */

12