/external/boringssl/src/crypto/fipsmodule/bn/ |
D | shift.c | 78 nw = n / BN_BITS2; in BN_lshift() 82 lb = n % BN_BITS2; in BN_lshift() 83 rb = BN_BITS2 - lb; in BN_lshift() 126 c = t >> (BN_BITS2 - 1); in BN_lshift1() 138 unsigned shift_bits = shift % BN_BITS2; in bn_rshift_words() 139 size_t shift_words = shift / BN_BITS2; in bn_rshift_words() 149 (a[i] >> shift_bits) | (a[i + 1] << (BN_BITS2 - shift_bits)); in bn_rshift_words() 184 unsigned max_bits = BN_BITS2 * r->width; in bn_rshift_secret_shift() 205 r[i] = (a[i] >> 1) | (a[i + 1] << (BN_BITS2 - 1)); in bn_rshift1_words() 226 int i = n / BN_BITS2; in BN_set_bit() [all …]
|
D | bn.c | 73 #define BN_MAX_WORDS (INT_MAX / (4 * BN_BITS2)) 177 #if BN_BITS2 > 32 in BN_num_bits_word() 183 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 193 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 199 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 205 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 211 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 217 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 229 return (width - 1) * BN_BITS2 + BN_num_bits_word(bn->d[width - 1]); in BN_num_bits() 261 #if BN_BITS2 == 64 in BN_set_u64() [all …]
|
D | montgomery_inv.c | 31 #define LG_LITTLE_R (BN_MONT_CTX_N0_LIMBS * BN_BITS2) 75 n_mod_r |= (uint64_t)n->d[1] << BN_BITS2; in bn_mont_n0() 118 #if BN_BITS2 == 64 && defined(BN_ULLONG) in bn_neg_inv_mod_r_u64() 155 #if BN_BITS2 == 64 && defined(BN_ULLONG) in bn_neg_inv_mod_r_u64()
|
D | random.c | 145 if (bits > INT_MAX - (BN_BITS2 - 1)) { in BN_rand() 150 int words = (bits + BN_BITS2 - 1) / BN_BITS2; in BN_rand() 151 int bit = (bits - 1) % BN_BITS2; in BN_rand() 154 BN_ULONG mask = bit < BN_BITS2 - 1 ? (kOne << (bit + 1)) - 1 : BN_MASK2; in BN_rand() 168 rnd->d[words - 2] |= kOne << (BN_BITS2 - 1); in BN_rand()
|
D | div.c | 79 assert((i == BN_BITS2) || (h <= (BN_ULONG)1 << i)); in bn_div_words() 81 i = BN_BITS2 - i; in bn_div_words() 88 h = (h << i) | (l >> (BN_BITS2 - i)); in bn_div_words() 169 BN_ULLONG n = (((BN_ULLONG)n0) << BN_BITS2) | n1; in bn_div_rem_words() 236 norm_shift = BN_BITS2 - (BN_num_bits(divisor) % BN_BITS2); in BN_div() 242 norm_shift += BN_BITS2; in BN_div() 328 if (t2 <= ((((BN_ULLONG)rm) << BN_BITS2) | wnump[-2])) { in BN_div() 510 initial_words = (divisor_min_bits - 1) / BN_BITS2; in bn_div_consttime() 519 for (int bit = BN_BITS2 - 1; bit >= 0; bit--) { in bn_div_consttime() 768 j = BN_BITS2 - BN_num_bits_word(w); in BN_div_word() [all …]
|
D | montgomery.c | 203 mont->n0[1] = (BN_ULONG)(n0 >> BN_BITS2); in bn_mont_ctx_set_N_and_n0() 229 unsigned lgBigR = mont->N.width * BN_BITS2; in BN_MONT_CTX_set() 254 unsigned lgBigR = mont->N.width * BN_BITS2; in BN_MONT_CTX_new_consttime() 369 if (n->width > 0 && (n->d[n->width - 1] >> (BN_BITS2 - 1)) != 0) { in bn_one_to_montgomery() 429 if (num >= (128 / BN_BITS2) && in BN_mod_mul_montgomery() 486 if (num >= (128 / BN_BITS2)) { in bn_mod_mul_montgomery_small()
|
D | div_extra.c | 77 #if BN_BITS2 == 32 in bn_mod_u16_consttime() 79 #elif BN_BITS2 == 64 in bn_mod_u16_consttime()
|
D | gcd_extra.c | 38 a[num - 1] |= carry << (BN_BITS2-1); in maybe_rshift1_words_carry() 75 unsigned x_bits = x->width * BN_BITS2, y_bits = y->width * BN_BITS2; in bn_gcd_consttime() 245 size_t a_bits = a_width * BN_BITS2, n_bits = n_width * BN_BITS2; in bn_mod_inverse_consttime()
|
/external/rust/crates/quiche/deps/boringssl/src/crypto/fipsmodule/bn/ |
D | shift.c | 78 nw = n / BN_BITS2; in BN_lshift() 82 lb = n % BN_BITS2; in BN_lshift() 83 rb = BN_BITS2 - lb; in BN_lshift() 126 c = t >> (BN_BITS2 - 1); in BN_lshift1() 138 unsigned shift_bits = shift % BN_BITS2; in bn_rshift_words() 139 size_t shift_words = shift / BN_BITS2; in bn_rshift_words() 149 (a[i] >> shift_bits) | (a[i + 1] << (BN_BITS2 - shift_bits)); in bn_rshift_words() 184 unsigned max_bits = BN_BITS2 * r->width; in bn_rshift_secret_shift() 205 r[i] = (a[i] >> 1) | (a[i + 1] << (BN_BITS2 - 1)); in bn_rshift1_words() 226 int i = n / BN_BITS2; in BN_set_bit() [all …]
|
D | bn.c | 170 #if BN_BITS2 > 32 in BN_num_bits_word() 176 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 186 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 192 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 198 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 204 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 210 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 222 return (width - 1) * BN_BITS2 + BN_num_bits_word(bn->d[width - 1]); in BN_num_bits() 254 #if BN_BITS2 == 64 in BN_set_u64() 256 #elif BN_BITS2 == 32 in BN_set_u64() [all …]
|
D | montgomery_inv.c | 32 #define LG_LITTLE_R (BN_MONT_CTX_N0_LIMBS * BN_BITS2) 76 n_mod_r |= (uint64_t)n->d[1] << BN_BITS2; in bn_mont_n0() 119 #if BN_BITS2 == 64 && defined(BN_ULLONG) in bn_neg_inv_mod_r_u64() 156 #if BN_BITS2 == 64 && defined(BN_ULLONG) in bn_neg_inv_mod_r_u64()
|
D | random.c | 144 if (bits > INT_MAX - (BN_BITS2 - 1)) { in BN_rand() 149 int words = (bits + BN_BITS2 - 1) / BN_BITS2; in BN_rand() 150 int bit = (bits - 1) % BN_BITS2; in BN_rand() 153 BN_ULONG mask = bit < BN_BITS2 - 1 ? (kOne << (bit + 1)) - 1 : BN_MASK2; in BN_rand() 164 rnd->d[words - 2] |= kOne << (BN_BITS2 - 1); in BN_rand()
|
D | div.c | 79 assert((i == BN_BITS2) || (h <= (BN_ULONG)1 << i)); in bn_div_words() 81 i = BN_BITS2 - i; in bn_div_words() 88 h = (h << i) | (l >> (BN_BITS2 - i)); in bn_div_words() 169 BN_ULLONG n = (((BN_ULLONG)n0) << BN_BITS2) | n1; in bn_div_rem_words() 236 norm_shift = BN_BITS2 - (BN_num_bits(divisor) % BN_BITS2); in BN_div() 242 norm_shift += BN_BITS2; in BN_div() 328 if (t2 <= ((((BN_ULLONG)rm) << BN_BITS2) | wnump[-2])) { in BN_div() 510 initial_words = (divisor_min_bits - 1) / BN_BITS2; in bn_div_consttime() 519 for (int bit = BN_BITS2 - 1; bit >= 0; bit--) { in bn_div_consttime() 768 j = BN_BITS2 - BN_num_bits_word(w); in BN_div_word() [all …]
|
D | montgomery.c | 201 mont->n0[1] = (BN_ULONG)(n0 >> BN_BITS2); in bn_mont_ctx_set_N_and_n0() 227 unsigned lgBigR = mont->N.width * BN_BITS2; in BN_MONT_CTX_set() 252 unsigned lgBigR = mont->N.width * BN_BITS2; in BN_MONT_CTX_new_consttime() 367 if (n->width > 0 && (n->d[n->width - 1] >> (BN_BITS2 - 1)) != 0) { in bn_one_to_montgomery() 427 if (num >= (128 / BN_BITS2) && in BN_mod_mul_montgomery() 481 if (num >= (128 / BN_BITS2)) { in bn_mod_mul_montgomery_small()
|
D | div_extra.c | 77 #if BN_BITS2 == 32 in bn_mod_u16_consttime() 79 #elif BN_BITS2 == 64 in bn_mod_u16_consttime()
|
D | gcd_extra.c | 38 a[num - 1] |= carry << (BN_BITS2-1); in maybe_rshift1_words_carry() 75 unsigned x_bits = x->width * BN_BITS2, y_bits = y->width * BN_BITS2; in bn_gcd_consttime() 243 unsigned a_bits = a_width * BN_BITS2, n_bits = n_width * BN_BITS2; in bn_mod_inverse_consttime()
|
/external/cronet/third_party/boringssl/src/crypto/fipsmodule/bn/ |
D | shift.c | 78 nw = n / BN_BITS2; in BN_lshift() 82 lb = n % BN_BITS2; in BN_lshift() 83 rb = BN_BITS2 - lb; in BN_lshift() 126 c = t >> (BN_BITS2 - 1); in BN_lshift1() 138 unsigned shift_bits = shift % BN_BITS2; in bn_rshift_words() 139 size_t shift_words = shift / BN_BITS2; in bn_rshift_words() 149 (a[i] >> shift_bits) | (a[i + 1] << (BN_BITS2 - shift_bits)); in bn_rshift_words() 184 unsigned max_bits = BN_BITS2 * r->width; in bn_rshift_secret_shift() 205 r[i] = (a[i] >> 1) | (a[i + 1] << (BN_BITS2 - 1)); in bn_rshift1_words() 226 int i = n / BN_BITS2; in BN_set_bit() [all …]
|
D | bn.c | 73 #define BN_MAX_WORDS (INT_MAX / (4 * BN_BITS2)) 177 #if BN_BITS2 > 32 in BN_num_bits_word() 183 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 193 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 199 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 205 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 211 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 217 mask = (0u - (mask >> (BN_BITS2 - 1))); in BN_num_bits_word() 229 return (width - 1) * BN_BITS2 + BN_num_bits_word(bn->d[width - 1]); in BN_num_bits() 261 #if BN_BITS2 == 64 in BN_set_u64() [all …]
|
D | montgomery_inv.c | 31 #define LG_LITTLE_R (BN_MONT_CTX_N0_LIMBS * BN_BITS2) 75 n_mod_r |= (uint64_t)n->d[1] << BN_BITS2; in bn_mont_n0() 118 #if BN_BITS2 == 64 && defined(BN_ULLONG) in bn_neg_inv_mod_r_u64() 155 #if BN_BITS2 == 64 && defined(BN_ULLONG) in bn_neg_inv_mod_r_u64()
|
D | random.c | 145 if (bits > INT_MAX - (BN_BITS2 - 1)) { in BN_rand() 150 int words = (bits + BN_BITS2 - 1) / BN_BITS2; in BN_rand() 151 int bit = (bits - 1) % BN_BITS2; in BN_rand() 154 BN_ULONG mask = bit < BN_BITS2 - 1 ? (kOne << (bit + 1)) - 1 : BN_MASK2; in BN_rand() 168 rnd->d[words - 2] |= kOne << (BN_BITS2 - 1); in BN_rand()
|
D | div.c | 79 assert((i == BN_BITS2) || (h <= (BN_ULONG)1 << i)); in bn_div_words() 81 i = BN_BITS2 - i; in bn_div_words() 88 h = (h << i) | (l >> (BN_BITS2 - i)); in bn_div_words() 169 BN_ULLONG n = (((BN_ULLONG)n0) << BN_BITS2) | n1; in bn_div_rem_words() 236 norm_shift = BN_BITS2 - (BN_num_bits(divisor) % BN_BITS2); in BN_div() 242 norm_shift += BN_BITS2; in BN_div() 328 if (t2 <= ((((BN_ULLONG)rm) << BN_BITS2) | wnump[-2])) { in BN_div() 510 initial_words = (divisor_min_bits - 1) / BN_BITS2; in bn_div_consttime() 519 for (int bit = BN_BITS2 - 1; bit >= 0; bit--) { in bn_div_consttime() 768 j = BN_BITS2 - BN_num_bits_word(w); in BN_div_word() [all …]
|
D | montgomery.c | 203 mont->n0[1] = (BN_ULONG)(n0 >> BN_BITS2); in bn_mont_ctx_set_N_and_n0() 229 unsigned lgBigR = mont->N.width * BN_BITS2; in BN_MONT_CTX_set() 254 unsigned lgBigR = mont->N.width * BN_BITS2; in BN_MONT_CTX_new_consttime() 369 if (n->width > 0 && (n->d[n->width - 1] >> (BN_BITS2 - 1)) != 0) { in bn_one_to_montgomery() 429 if (num >= (128 / BN_BITS2) && in BN_mod_mul_montgomery() 486 if (num >= (128 / BN_BITS2)) { in bn_mod_mul_montgomery_small()
|
D | div_extra.c | 77 #if BN_BITS2 == 32 in bn_mod_u16_consttime() 79 #elif BN_BITS2 == 64 in bn_mod_u16_consttime()
|
/external/rust/crates/ring/crypto/fipsmodule/bn/ |
D | montgomery_inv.c | 25 #define LG_LITTLE_R (BN_MONT_CTX_N0_LIMBS * BN_BITS2) 63 #if BN_BITS2 == 64 && defined(BN_ULLONG) in bn_neg_inv_mod_r_u64() 100 #if BN_BITS2 == 64 && defined(BN_ULLONG) in bn_neg_inv_mod_r_u64()
|
D | internal.h | 146 #define BN_BITS2 64 macro 154 #define BN_BITS2 32 macro 193 *high_out = (BN_ULONG)(result >> BN_BITS2); in bn_umult_lohi()
|