Home
last modified time | relevance | path

Searched refs:BN_ULONG (Results 1 – 25 of 29) sorted by relevance

12

/external/boringssl/src/crypto/bn/
Dinternal.h163 #define TOBN(hi, lo) ((BN_ULONG)(hi) << 32 | (lo)) in OPENSSL_MSVC_PRAGMA()
193 (BN_ULONG *)(x), sizeof(x) / sizeof(BN_ULONG), \ in OPENSSL_MSVC_PRAGMA()
194 sizeof(x) / sizeof(BN_ULONG), 0, BN_FLG_STATIC_DATA \ in OPENSSL_MSVC_PRAGMA()
198 #define Lw(t) (((BN_ULONG)(t))&BN_MASK2) in OPENSSL_MSVC_PRAGMA()
199 #define Hw(t) (((BN_ULONG)((t)>>BN_BITS2))&BN_MASK2) in OPENSSL_MSVC_PRAGMA()
204 int bn_set_words(BIGNUM *bn, const BN_ULONG *words, size_t num); in OPENSSL_MSVC_PRAGMA()
206 BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w); in OPENSSL_MSVC_PRAGMA()
207 BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w); in OPENSSL_MSVC_PRAGMA()
208 void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, int num); in OPENSSL_MSVC_PRAGMA()
209 BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,int num); in OPENSSL_MSVC_PRAGMA()
[all …]
Dgeneric.c98 BN_ULONG high, low, ret, tmp = (a); \
111 BN_ULONG high, low, ret, ta = (a); \
121 BN_ULONG tmp = (a); \
127 BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, in bn_mul_add_words()
128 BN_ULONG w) { in bn_mul_add_words()
129 BN_ULONG c1 = 0; in bn_mul_add_words()
156 BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w) { in bn_mul_words()
157 BN_ULONG c1 = 0; in bn_mul_words()
182 void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n) { in bn_sqr_words()
206 BN_ULONG bn_add_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b, in bn_add_words()
[all …]
Dmul.c69 static void bn_mul_normal(BN_ULONG *r, BN_ULONG *a, int na, BN_ULONG *b, in bn_mul_normal()
71 BN_ULONG *rr; in bn_mul_normal()
75 BN_ULONG *ltmp; in bn_mul_normal()
126 static BN_ULONG bn_sub_part_words(BN_ULONG *r, const BN_ULONG *a, in bn_sub_part_words()
127 const BN_ULONG *b, int cl, int dl) { in bn_sub_part_words()
128 BN_ULONG c, t; in bn_sub_part_words()
278 BN_ULONG bn_sub_part_words(BN_ULONG *r, const BN_ULONG *a, const BN_ULONG *b,
296 static void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, in bn_mul_recursive()
297 int dna, int dnb, BN_ULONG *t) { in bn_mul_recursive()
301 BN_ULONG ln, lo, *p; in bn_mul_recursive()
[all …]
Ddiv.c70 static BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) { in bn_div_words()
71 BN_ULONG dh, dl, q, ret = 0, th, tl, t; in bn_div_words()
79 assert((i == BN_BITS2) || (h <= (BN_ULONG)1 << i)); in bn_div_words()
140 static inline void bn_div_rem_words(BN_ULONG *quotient_out, BN_ULONG *rem_out, in bn_div_rem_words()
141 BN_ULONG n0, BN_ULONG n1, BN_ULONG d0) { in bn_div_rem_words()
173 *quotient_out = (BN_ULONG)(n / d0); in bn_div_rem_words()
196 BN_ULONG *resp, *wnump; in BN_div()
197 BN_ULONG d0, d1; in BN_div()
299 BN_ULONG q, l0; in BN_div()
302 BN_ULONG n0, n1, rem = 0; in BN_div()
[all …]
Drsaz_exp.h48 void RSAZ_1024_mod_exp_avx2(BN_ULONG result[16],
49 const BN_ULONG base_norm[16], const BN_ULONG exponent[16],
50 const BN_ULONG m_norm[16], const BN_ULONG RR[16], BN_ULONG k0);
Dprime.c499 BN_ULONG mod = BN_mod_word(a, primes[i]); in BN_is_prime_fasttest_ex()
500 if (mod == (BN_ULONG)-1) { in BN_is_prime_fasttest_ex()
639 static BN_ULONG get_word(const BIGNUM *bn) { in get_word()
649 BN_ULONG delta; in probable_prime()
650 BN_ULONG maxdelta = BN_MASK2 - primes[NUMPRIMES - 1]; in probable_prime()
660 BN_ULONG mod = BN_mod_word(rnd, (BN_ULONG)primes[i]); in probable_prime()
661 if (mod == (BN_ULONG)-1) { in probable_prime()
669 BN_ULONG size_limit; in probable_prime()
672 size_limit = ~((BN_ULONG)0) - get_word(rnd); in probable_prime()
674 size_limit = (((BN_ULONG)1) << bits) - get_word(rnd) - 1; in probable_prime()
[all …]
Dcmp.c66 BN_ULONG t1, t2, *ap, *bp; in BN_ucmp()
89 BN_ULONG t1, t2; in BN_cmp()
135 int bn_cmp_words(const BN_ULONG *a, const BN_ULONG *b, int n) { in bn_cmp_words()
137 BN_ULONG aa, bb; in bn_cmp_words()
155 int bn_cmp_part_words(const BN_ULONG *a, const BN_ULONG *b, int cl, int dl) { in bn_cmp_part_words()
177 int BN_abs_is_word(const BIGNUM *bn, BN_ULONG w) { in BN_abs_is_word()
188 int BN_cmp_word(const BIGNUM *a, BN_ULONG b) { in BN_cmp_word()
207 int BN_is_word(const BIGNUM *bn, BN_ULONG w) { in BN_is_word()
Dbn.c169 static const BN_ULONG kOneLimbs[1] = { 1 }; in BN_value_one()
177 unsigned BN_num_bits_word(BN_ULONG l) { in BN_num_bits_word()
247 int BN_set_word(BIGNUM *bn, BN_ULONG value) { in BN_set_word()
268 return BN_set_word(bn, (BN_ULONG)value); in BN_set_u64()
276 bn->d[0] = (BN_ULONG)value; in BN_set_u64()
277 bn->d[1] = (BN_ULONG)(value >> 32); in BN_set_u64()
285 int bn_set_words(BIGNUM *bn, const BN_ULONG *words, size_t num) { in bn_set_words()
289 OPENSSL_memmove(bn->d, words, num * sizeof(BN_ULONG)); in bn_set_words()
310 BN_ULONG *a; in bn_wexpand()
326 a = OPENSSL_malloc(sizeof(BN_ULONG) * words); in bn_wexpand()
[all …]
Dexponentiation.c127 void bn_mul_mont_gather5(BN_ULONG *rp, const BN_ULONG *ap, const void *table,
128 const BN_ULONG *np, const BN_ULONG *n0, int num,
130 void bn_scatter5(const BN_ULONG *inp, size_t num, void *table, size_t power);
131 void bn_gather5(BN_ULONG *out, size_t num, void *table, size_t power);
132 void bn_power5(BN_ULONG *rp, const BN_ULONG *ap, const void *table,
133 const BN_ULONG *np, const BN_ULONG *n0, int num, int power);
134 int bn_from_montgomery(BN_ULONG *rp, const BN_ULONG *ap,
135 const BN_ULONG *not_used, const BN_ULONG *np,
136 const BN_ULONG *n0, int num);
653 if (m->d[j - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) { in BN_mod_exp_mont()
[all …]
Dconvert.c75 BN_ULONG word = 0; in BN_bin2bn()
159 BN_ULONG l; in BN_bn2bin()
188 static BN_ULONG constant_time_select_ulong(int v, BN_ULONG x, BN_ULONG y) { in constant_time_select_ulong()
189 BN_ULONG mask = v; in constant_time_select_ulong()
206 static BN_ULONG read_word_padded(const BIGNUM *in, size_t i) { in read_word_padded()
208 BN_ULONG l = in->d[constant_time_select_ulong( in read_word_padded()
228 BN_ULONG l = read_word_padded(in, len / BN_BYTES); in BN_bn2bin_padded()
243 BN_ULONG l = read_word_padded(in, i / BN_BYTES); in BN_bn2bin_padded()
309 BN_ULONG word = 0; in decode_hex()
314 BN_ULONG hex; in decode_hex()
[all …]
Drsaz_exp.c58 void rsaz_1024_mul_avx2(void *ret,const void *a,const void *b,const void *n,BN_ULONG k);
59 void rsaz_1024_sqr_avx2(void *ret,const void *a,const void *n,BN_ULONG k,int cnt);
64 alignas(64) static const BN_ULONG one[40] =
66 alignas(64) static const BN_ULONG two80[40] =
69 void RSAZ_1024_mod_exp_avx2(BN_ULONG result_norm[16], in RSAZ_1024_mod_exp_avx2()
70 const BN_ULONG base_norm[16], const BN_ULONG exponent[16], in RSAZ_1024_mod_exp_avx2()
71 const BN_ULONG m_norm[16], const BN_ULONG RR[16], BN_ULONG k0) in RSAZ_1024_mod_exp_avx2()
Dshift.c68 BN_ULONG *t, *f; in BN_lshift()
69 BN_ULONG l; in BN_lshift()
105 BN_ULONG *ap, *rp, t, c; in BN_lshift1()
137 BN_ULONG *t, *f; in BN_rshift()
138 BN_ULONG l, tmp; in BN_rshift()
193 BN_ULONG *ap, *rp, t, c; in BN_rshift1()
248 a->d[i] |= (((BN_ULONG)1) << j); in BN_set_bit()
266 a->d[i] &= (~(((BN_ULONG)1) << j)); in BN_clear_bit()
Dmontgomery.c173 OPENSSL_COMPILE_ASSERT(sizeof(BN_ULONG) * BN_MONT_CTX_N0_LIMBS ==
203 mont->n0[0] = (BN_ULONG)n0; in BN_MONT_CTX_set()
205 mont->n0[1] = (BN_ULONG)(n0 >> BN_BITS2); in BN_MONT_CTX_set()
265 BN_ULONG *ap, *np, *rp, n0, v, carry; in BN_from_montgomery_word()
286 OPENSSL_memset(&rp[r->top], 0, (max - r->top) * sizeof(BN_ULONG)); in BN_from_montgomery_word()
310 BN_ULONG *nrp; in BN_from_montgomery_word()
317 nrp = (BN_ULONG *)(((uintptr_t)rp & ~m) | ((uintptr_t)ap & m)); in BN_from_montgomery_word()
320 BN_ULONG t1, t2, t3, t4; in BN_from_montgomery_word()
Dadd.c106 BN_ULONG *ap, *bp, *rp, carry, t1, t2; in BN_uadd()
162 int BN_add_word(BIGNUM *a, BN_ULONG w) { in BN_add_word()
163 BN_ULONG l; in BN_add_word()
263 register BN_ULONG t1, t2, *ap, *bp, *rp; in BN_usub()
327 int BN_sub_word(BIGNUM *a, BN_ULONG w) { in BN_sub_word()
Dbn_test.cc126 BN_ULONG word = BN_get_word(ret.get()); in GetInt()
238 BN_ULONG b_word = BN_get_word(b.get()); in TestSum()
239 if (!BN_is_negative(b.get()) && b_word != (BN_ULONG)-1) { in TestSum()
436 BN_ULONG b_word = BN_get_word(b.get()); in TestQuotient()
437 if (!BN_is_negative(b.get()) && b_word != (BN_ULONG)-1) { in TestQuotient()
438 BN_ULONG remainder_word = BN_get_word(remainder.get()); in TestQuotient()
439 assert(remainder_word != (BN_ULONG)-1); in TestQuotient()
443 BN_ULONG ret_word = BN_div_word(ret.get(), b_word); in TestQuotient()
1367 if (BN_div_word(a.get(), 2) == (BN_ULONG)-1) { in TestNegativeZero()
1509 static const BN_ULONG kMaxWord = (BN_ULONG)-1; in TestCmpWord()
[all …]
Dkronecker.c59 #define BN_lsw(n) (((n)->top == 0) ? (BN_ULONG) 0 : (n)->d[0])
/external/boringssl/src/crypto/ec/
Dp256-x86_64.h41 void ecp_nistz256_neg(BN_ULONG res[P256_LIMBS], const BN_ULONG a[P256_LIMBS]);
44 void ecp_nistz256_mul_mont(BN_ULONG res[P256_LIMBS],
45 const BN_ULONG a[P256_LIMBS],
46 const BN_ULONG b[P256_LIMBS]);
49 void ecp_nistz256_sqr_mont(BN_ULONG res[P256_LIMBS],
50 const BN_ULONG a[P256_LIMBS]);
54 static inline void ecp_nistz256_from_mont(BN_ULONG res[P256_LIMBS], in ecp_nistz256_from_mont()
55 const BN_ULONG in[P256_LIMBS]) { in ecp_nistz256_from_mont()
56 static const BN_ULONG ONE[P256_LIMBS] = { 1 }; in ecp_nistz256_from_mont()
68 BN_ULONG X[P256_LIMBS];
[all …]
Dp256-x86_64.c45 static const BN_ULONG ONE[P256_LIMBS] = {
81 static void copy_conditional(BN_ULONG dst[P256_LIMBS], in copy_conditional()
82 const BN_ULONG src[P256_LIMBS], BN_ULONG move) { in copy_conditional()
83 BN_ULONG mask1 = ((BN_ULONG)0) - move; in copy_conditional()
84 BN_ULONG mask2 = ~mask1; in copy_conditional()
115 static BN_ULONG is_not_zero(BN_ULONG in) { in is_not_zero()
124 static void ecp_nistz256_mod_inverse_mont(BN_ULONG r[P256_LIMBS], in ecp_nistz256_mod_inverse_mont()
125 const BN_ULONG in[P256_LIMBS]) { in ecp_nistz256_mod_inverse_mont()
129 BN_ULONG p2[P256_LIMBS]; in ecp_nistz256_mod_inverse_mont()
130 BN_ULONG p4[P256_LIMBS]; in ecp_nistz256_mod_inverse_mont()
[all …]
Dp256-x86_64_test.cc94 static bool GetFieldElement(FileTest *t, BN_ULONG out[P256_LIMBS], in GetFieldElement()
108 OPENSSL_memset(out, 0, P256_LIMBS * sizeof(BN_ULONG)); in GetFieldElement()
117 static std::string FieldElementToString(const BN_ULONG a[P256_LIMBS]) { in FieldElementToString()
128 const BN_ULONG expected[P256_LIMBS], in ExpectFieldElementsEqual()
129 const BN_ULONG actual[P256_LIMBS]) { in ExpectFieldElementsEqual()
130 if (OPENSSL_memcmp(expected, actual, sizeof(BN_ULONG) * P256_LIMBS) == 0) { in ExpectFieldElementsEqual()
192 OPENSSL_memcpy(out->X, x->d, sizeof(BN_ULONG) * x->top); in PointToAffine()
193 OPENSSL_memcpy(out->Y, y->d, sizeof(BN_ULONG) * y->top); in PointToAffine()
226 BN_ULONG a[P256_LIMBS], b[P256_LIMBS]; in TestNegate()
233 BN_ULONG ret[P256_LIMBS]; in TestNegate()
[all …]
/external/boringssl/src/crypto/bn/asm/
Dx86_64-gcc.c73 register BN_ULONG high, low; \
88 register BN_ULONG high, low; \
100 BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, in bn_mul_add_words()
101 BN_ULONG w) { in bn_mul_add_words()
102 BN_ULONG c1 = 0; in bn_mul_add_words()
133 BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w) { in bn_mul_words()
134 BN_ULONG c1 = 0; in bn_mul_words()
163 void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n) { in bn_sqr_words()
190 BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, in bn_add_words()
192 BN_ULONG ret; in bn_add_words()
[all …]
/external/boringssl/src/crypto/dh/
Dparams.c60 static const BN_ULONG dh1024_160_p[] = {
70 static const BN_ULONG dh1024_160_g[] = {
80 static const BN_ULONG dh1024_160_q[] = {
84 static const BN_ULONG dh2048_224_p[] = {
103 static const BN_ULONG dh2048_224_g[] = {
122 static const BN_ULONG dh2048_224_q[] = {
127 static const BN_ULONG dh2048_256_p[] = {
145 static const BN_ULONG dh2048_256_g[] = {
163 static const BN_ULONG dh2048_256_q[] = {
221 static const BN_ULONG kPrime1536Data[] = { in BN_get_rfc3526_prime_1536()
Dcheck.c123 BN_ULONG l; in DH_check()
174 if (l == (BN_ULONG)-1) { in DH_check()
182 if (l == (BN_ULONG)-1) { in DH_check()
/external/boringssl/src/include/openssl/
Dbn.h149 #define BN_ULONG uint64_t macro
156 #define BN_ULONG uint32_t
217 OPENSSL_EXPORT int BN_set_word(BIGNUM *bn, BN_ULONG value);
306 OPENSSL_EXPORT BN_ULONG BN_get_word(const BIGNUM *bn);
394 OPENSSL_EXPORT int BN_add_word(BIGNUM *a, BN_ULONG w);
407 OPENSSL_EXPORT int BN_sub_word(BIGNUM *a, BN_ULONG w);
416 OPENSSL_EXPORT int BN_mul_word(BIGNUM *bn, BN_ULONG w);
434 OPENSSL_EXPORT BN_ULONG BN_div_word(BIGNUM *numerator, BN_ULONG divisor);
451 OPENSSL_EXPORT int BN_cmp_word(const BIGNUM *a, BN_ULONG b);
465 OPENSSL_EXPORT int BN_abs_is_word(const BIGNUM *bn, BN_ULONG w);
[all …]
/external/google-tv-pairing-protocol/cpp/src/polo/util/
Dpoloutil.cc67 BN_ULONG value = bn->d[0]; in BigEndianBytesToInt()
/external/boringssl/src/crypto/asn1/
Da_object.c179 BN_ULONG t = BN_div_word(bl, 0x80L); in a2d_ASN1_OBJECT()
180 if (t == (BN_ULONG)-1) in a2d_ASN1_OBJECT()

12