Home
last modified time | relevance | path

Searched refs:BN_BITS2 (Results 1 - 25 of 45) sorted by relevance

12

/third_party/node/deps/openssl/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()
100 * |n % BN_BITS2|, but not |n / BN_BITS2|. Or in other words pre-condition
101 * for constant-time-ness is |n < BN_BITS2| or |n / BN_BITS2| being
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 in bn_lshift_fixed_top()
[all...]
H A Dbn_lib.c105 #if BN_BITS2 > 32 in BN_num_bits_word()
108 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
115 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
121 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
127 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
133 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
139 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()
270 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
[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()
168 * in reply to ((((BN_ULLONG)n0)<<BN_BITS2)|n1)/d0 (I fail to
360 q = (BN_ULONG)(((((BN_ULLONG) n0) << BN_BITS2) | n1) / d0); in bn_div_fixed_top()
375 if (t2 <= ((((BN_ULLONG) rem) << BN_BITS2) | n in bn_div_fixed_top()
[all...]
H A Dbn_gf2m.c55 * Product of two polynomials a, b each with degree < BN_BITS2 - 1, result is
227 * Product of two polynomials a, b each with degree < 2 * BN_BITS2 - 1,
228 * result is a polynomial r with degree < 4 * BN_BITS2 - 1 The caller MUST
321 dN = p[0] / BN_BITS2; in BN_GF2m_mod_arr()
333 d0 = n % BN_BITS2; in BN_GF2m_mod_arr()
334 d1 = BN_BITS2 - d0; in BN_GF2m_mod_arr()
335 n /= BN_BITS2; in BN_GF2m_mod_arr()
343 d0 = p[0] % BN_BITS2; in BN_GF2m_mod_arr()
344 d1 = BN_BITS2 - d0; in BN_GF2m_mod_arr()
353 d0 = p[0] % BN_BITS2; in BN_GF2m_mod_arr()
[all...]
H A Dbn_local.h214 # define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2)
246 BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit
478 # define Hw(t) (((BN_ULONG)((t)>>BN_BITS2))&BN_MASK2)
568 # define LHBITS(a) (((a)>>BN_BITS2)&BN_MASKl)
569 # define LL2HBITS(a) ((BN_ULLONG)((a)&BN_MASKl)<<BN_BITS2)
668 if (bits > (INT_MAX - BN_BITS2 + 1)) in bn_expand()
671 if (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax) in bn_expand()
674 return bn_expand2((a),(bits+BN_BITS2 in bn_expand()
[all...]
H A Dbn_mont.c121 * Add multiples of |n| to |r| until R = 2^(nl * BN_BITS2) divides it. On in bn_from_montgomery_word()
294 mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2; in BN_MONT_CTX_set()
296 # if defined(OPENSSL_BN_ASM_MONT) && (BN_BITS2<=32) in BN_MONT_CTX_set()
298 * Only certain BN_BITS2<=32 platforms actually make use of n0[1], in BN_MONT_CTX_set()
305 if (!(BN_set_bit(R, 2 * BN_BITS2))) in BN_MONT_CTX_set()
318 if (!BN_lshift(Ri, Ri, 2 * BN_BITS2)) in BN_MONT_CTX_set()
342 if (!(BN_set_bit(R, BN_BITS2))) in BN_MONT_CTX_set()
353 if (!BN_lshift(Ri, Ri, BN_BITS2)) in BN_MONT_CTX_set()
[all...]
H A Dbn_word.c54 ret = (BN_ULLONG) (((ret << (BN_ULLONG) BN_BITS2) | a->d[i]) % in BN_mod_word()
76 j = BN_BITS2 - BN_num_bits_word(w); in BN_div_word()
H A Dbn_print.c41 for (j = BN_BITS2 - 4; j >= 0; j -= 4) { in BN_print()
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()
285 ll >>= BN_BITS2; in bn_add_words() local
288 ll >>= BN_BITS2; in bn_add_words() local
291 ll >>= BN_BITS2; in bn_add_words() local
294 ll >>= BN_BITS2; in bn_add_words() local
304 ll >>= BN_BITS2; in bn_add_words() local
/third_party/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()
100 * |n % BN_BITS2|, but not |n / BN_BITS2|. Or in other words pre-condition
101 * for constant-time-ness is |n < BN_BITS2| or |n / BN_BITS2| being
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 in bn_lshift_fixed_top()
[all...]
H A Dbn_lib.c105 #if BN_BITS2 > 32 in BN_num_bits_word()
108 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
115 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
121 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
127 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
133 mask = (0 - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word()
139 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()
270 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
[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()
168 * in reply to ((((BN_ULLONG)n0)<<BN_BITS2)|n1)/d0 (I fail to
360 q = (BN_ULONG)(((((BN_ULLONG) n0) << BN_BITS2) | n1) / d0); in bn_div_fixed_top()
375 if (t2 <= ((((BN_ULLONG) rem) << BN_BITS2) | n in bn_div_fixed_top()
[all...]
H A Dbn_gf2m.c56 * Product of two polynomials a, b each with degree < BN_BITS2 - 1, result is
228 * Product of two polynomials a, b each with degree < 2 * BN_BITS2 - 1,
229 * result is a polynomial r with degree < 4 * BN_BITS2 - 1 The caller MUST
322 dN = p[0] / BN_BITS2; in BN_GF2m_mod_arr()
334 d0 = n % BN_BITS2; in BN_GF2m_mod_arr()
335 d1 = BN_BITS2 - d0; in BN_GF2m_mod_arr()
336 n /= BN_BITS2; in BN_GF2m_mod_arr()
344 d0 = p[0] % BN_BITS2; in BN_GF2m_mod_arr()
345 d1 = BN_BITS2 - d0; in BN_GF2m_mod_arr()
354 d0 = p[0] % BN_BITS2; in BN_GF2m_mod_arr()
[all...]
H A Dbn_local.h214 # define bn_check_size(bn, bits) bn_wcheck_size(bn, ((bits+BN_BITS2-1))/BN_BITS2)
246 BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit
478 # define Hw(t) (((BN_ULONG)((t)>>BN_BITS2))&BN_MASK2)
568 # define LHBITS(a) (((a)>>BN_BITS2)&BN_MASKl)
569 # define LL2HBITS(a) ((BN_ULLONG)((a)&BN_MASKl)<<BN_BITS2)
668 if (bits > (INT_MAX - BN_BITS2 + 1)) in bn_expand()
671 if (((bits+BN_BITS2-1)/BN_BITS2) <= (a)->dmax) in bn_expand()
674 return bn_expand2((a),(bits+BN_BITS2 in bn_expand()
[all...]
H A Dbn_mont.c121 * Add multiples of |n| to |r| until R = 2^(nl * BN_BITS2) divides it. On in bn_from_montgomery_word()
294 mont->ri = (BN_num_bits(mod) + (BN_BITS2 - 1)) / BN_BITS2 * BN_BITS2; in BN_MONT_CTX_set()
296 # if defined(OPENSSL_BN_ASM_MONT) && (BN_BITS2<=32) in BN_MONT_CTX_set()
298 * Only certain BN_BITS2<=32 platforms actually make use of n0[1], in BN_MONT_CTX_set()
305 if (!(BN_set_bit(R, 2 * BN_BITS2))) in BN_MONT_CTX_set()
318 if (!BN_lshift(Ri, Ri, 2 * BN_BITS2)) in BN_MONT_CTX_set()
342 if (!(BN_set_bit(R, BN_BITS2))) in BN_MONT_CTX_set()
353 if (!BN_lshift(Ri, Ri, BN_BITS2)) in BN_MONT_CTX_set()
[all...]
H A Dbn_word.c54 ret = (BN_ULLONG) (((ret << (BN_ULLONG) BN_BITS2) | a->d[i]) % in BN_mod_word()
76 j = BN_BITS2 - BN_num_bits_word(w); in BN_div_word()
H A Dbn_print.c41 for (j = BN_BITS2 - 4; j >= 0; j -= 4) { in BN_print()
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()
285 ll >>= BN_BITS2; in bn_add_words() local
288 ll >>= BN_BITS2; in bn_add_words() local
291 ll >>= BN_BITS2; in bn_add_words() local
294 ll >>= BN_BITS2; in bn_add_words() local
304 ll >>= BN_BITS2; in bn_add_words() local
/third_party/node/deps/openssl/openssl/crypto/ec/
H A Dec2_smpl.c89 if (bn_wexpand(dest->a, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) == in ossl_ec_GF2m_simple_group_copy()
92 if (bn_wexpand(dest->b, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) == in ossl_ec_GF2m_simple_group_copy()
119 if (bn_wexpand(group->a, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2) in ossl_ec_GF2m_simple_group_set_curve()
127 if (bn_wexpand(group->b, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2) in ossl_ec_GF2m_simple_group_set_curve()
/third_party/openssl/crypto/ec/
H A Dec2_smpl.c89 if (bn_wexpand(dest->a, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) == in ossl_ec_GF2m_simple_group_copy()
92 if (bn_wexpand(dest->b, (int)(dest->poly[0] + BN_BITS2 - 1) / BN_BITS2) == in ossl_ec_GF2m_simple_group_copy()
119 if (bn_wexpand(group->a, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2) in ossl_ec_GF2m_simple_group_set_curve()
127 if (bn_wexpand(group->b, (int)(group->poly[0] + BN_BITS2 - 1) / BN_BITS2) in ossl_ec_GF2m_simple_group_set_curve()
/third_party/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()
/third_party/openssl/ohos_lite/include/openssl/
H A Dbn.h48 # define BN_BITS2 (BN_BYTES * 8) macro
49 # define BN_BITS (BN_BITS2 * 2)
50 # define BN_TBIT ((BN_ULONG)1 << (BN_BITS2 - 1))
/third_party/node/deps/openssl/openssl/crypto/
H A Dsparse_array.c35 #elif OPENSSL_SA_BLOCK_BITS < 2 || OPENSSL_SA_BLOCK_BITS > (BN_BITS2 - 1)

Completed in 18 milliseconds

12