Home
last modified time | relevance | path

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

123

/freebsd/crypto/openssl/crypto/bn/
H A Dbn_sparc.c16 int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, in bn_mul_mont()
17 const BN_ULONG *np, const BN_ULONG *n0, int num) in bn_mul_mont()
19 int bn_mul_mont_vis3(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, in bn_mul_mont()
20 const BN_ULONG *np, const BN_ULONG *n0, int num); in bn_mul_mont()
21 int bn_mul_mont_fpu(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, in bn_mul_mont()
22 const BN_ULONG *np, const BN_ULONG *n0, int num); in bn_mul_mont()
23 int bn_mul_mont_int(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, in bn_mul_mont()
24 const BN_ULONG *np, const BN_ULONG *n0, int num); in bn_mul_mont()
30 typedef int (*bn_mul_mont_f) (BN_ULONG *rp, const BN_ULONG *ap, in bn_mul_mont()
31 const BN_ULONG *bp, in bn_mul_mont()
[all …]
H A Drsaz_exp_x2.c47 static void to_words52(BN_ULONG *out, int out_len, const BN_ULONG *in,
49 static void from_words52(BN_ULONG *bn_out, int out_bitsize, const BN_ULONG *in);
50 static ossl_inline void set_bit(BN_ULONG *a, int idx);
58 typedef void (*AMM52)(BN_ULONG *res, const BN_ULONG *base,
59 const BN_ULONG *exp, const BN_ULONG *m, BN_ULONG k0);
60 typedef void (*EXP52_x2)(BN_ULONG *res, const BN_ULONG *base,
61 const BN_ULONG *exp[2], const BN_ULONG *m,
62 const BN_ULONG *rr, const BN_ULONG k0[2]);
77 void ossl_rsaz_amm52x20_x1_256(BN_ULONG *res, const BN_ULONG *base,
78 const BN_ULONG *exp, const BN_ULONG *m,
[all …]
H A Drsaz_exp.h28 void RSAZ_1024_mod_exp_avx2(BN_ULONG result[16],
29 const BN_ULONG base_norm[16],
30 const BN_ULONG exponent[16],
31 const BN_ULONG m_norm[16], const BN_ULONG RR[16],
32 BN_ULONG k0);
35 void RSAZ_512_mod_exp(BN_ULONG result[8],
36 const BN_ULONG base_norm[8], const BN_ULONG exponent[8],
37 const BN_ULONG m_norm[8], BN_ULONG k0,
38 const BN_ULONG RR[8]);
43 int ossl_rsaz_mod_exp_avx512_x2(BN_ULONG *res1,
[all …]
H A Dbn_local.h190 BN_ULONG *_not_const; \
235 BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num,
236 BN_ULONG w);
237 BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w);
238 void bn_sqr_words(BN_ULONG *rp, const BN_ULONG *ap, int num);
239 BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d);
240 BN_ULONG bn_add_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
242 BN_ULONG bn_sub_words(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp,
246 BN_ULONG *d; /* Pointer to an array of 'BN_BITS2' bit
263 BN_ULONG n0[2]; /* least significant word(s) of Ni; (type
[all …]
H A Dbn_asm.c17 BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, in bn_mul_add_words()
18 BN_ULONG w) in bn_mul_add_words()
20 BN_ULONG c1 = 0; in bn_mul_add_words()
47 BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w) in bn_mul_words()
49 BN_ULONG c1 = 0; in bn_mul_words()
75 void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n) in bn_sqr_words()
103 BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, in bn_mul_add_words()
104 BN_ULONG w) in bn_mul_add_words()
106 BN_ULONG c = 0; in bn_mul_add_words()
107 BN_ULONG bl, bh; in bn_mul_add_words()
[all …]
H A Dbn_ppc.c15 int bn_mul_mont(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, in bn_mul_mont()
16 const BN_ULONG *np, const BN_ULONG *n0, int num) in bn_mul_mont()
18 int bn_mul_mont_int(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, in bn_mul_mont()
19 const BN_ULONG *np, const BN_ULONG *n0, int num); in bn_mul_mont()
20 int bn_mul4x_mont_int(BN_ULONG *rp, const BN_ULONG *ap, const BN_ULONG *bp, in bn_mul_mont()
21 const BN_ULONG *np, const BN_ULONG *n0, int num); in bn_mul_mont()
H A DREADME.pod18 BN_ULONG bn_mul_words(BN_ULONG *rp, BN_ULONG *ap, int num, BN_ULONG w);
19 BN_ULONG bn_mul_add_words(BN_ULONG *rp, BN_ULONG *ap, int num,
20 BN_ULONG w);
21 void bn_sqr_words(BN_ULONG *rp, BN_ULONG *ap, int num);
22 BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d);
23 BN_ULONG bn_add_words(BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,
25 BN_ULONG bn_sub_words(BN_ULONG *rp, BN_ULONG *ap, BN_ULONG *bp,
28 void bn_mul_comba4(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b);
29 void bn_mul_comba8(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b);
30 void bn_sqr_comba4(BN_ULONG *r, BN_ULONG *a);
[all …]
H A Dbn_word.c13 BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w) in BN_mod_word()
16 BN_ULONG ret = 0; in BN_mod_word()
23 return (BN_ULONG)-1; in BN_mod_word()
30 if (w > ((BN_ULONG)1 << BN_BITS4)) { in BN_mod_word()
33 return (BN_ULONG)-1; in BN_mod_word()
58 return (BN_ULONG)ret; in BN_mod_word()
61 BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w) in BN_div_word()
63 BN_ULONG ret = 0; in BN_div_word()
71 return (BN_ULONG)-1; in BN_div_word()
79 return (BN_ULONG)-1; in BN_div_word()
[all …]
H A Drsaz_exp.c27 const void *n, BN_ULONG k);
28 void rsaz_1024_sqr_avx2(void *ret, const void *a, const void *n, BN_ULONG k,
46 ALIGN64 static const BN_ULONG one[40] = {
51 ALIGN64 static const BN_ULONG two80[40] = {
56 void RSAZ_1024_mod_exp_avx2(BN_ULONG result_norm[16],
57 const BN_ULONG base_norm[16],
58 const BN_ULONG exponent[16],
59 const BN_ULONG m_norm[16], const BN_ULONG RR[16],
60 BN_ULONG k0)
69 BN_ULONG tmp[16];
[all …]
H A Dbn_exp.c148 BN_ULONG A = a->d[0]; in BN_mod_exp()
401 if (m->d[j - 1] & (((BN_ULONG)1) << (BN_BITS2 - 1))) { in BN_mod_exp_mont()
489 static BN_ULONG bn_get_bits(const BIGNUM *a, int bitpos) in bn_get_bits()
491 BN_ULONG ret = 0; in bn_get_bits()
521 BN_ULONG *table = (BN_ULONG *)buf; in MOD_EXP_CTIME_COPY_TO_PREBUF()
547 volatile BN_ULONG *table = (volatile BN_ULONG *)buf; in MOD_EXP_CTIME_COPY_FROM_PREBUF()
554 BN_ULONG acc = 0; in MOD_EXP_CTIME_COPY_FROM_PREBUF()
558 ((BN_ULONG)0 - (constant_time_eq_int(j,idx)&1)); in MOD_EXP_CTIME_COPY_FROM_PREBUF()
565 BN_ULONG y0, y1, y2, y3; in MOD_EXP_CTIME_COPY_FROM_PREBUF()
570 y0 = (BN_ULONG)0 - (constant_time_eq_int(i,0)&1); in MOD_EXP_CTIME_COPY_FROM_PREBUF()
[all …]
H A Dbn_nist.c21 static const BN_ULONG _nist_p_192[][BN_NIST_192_TOP] = {
27 static const BN_ULONG _nist_p_192_sqr[] = {
32 static const BN_ULONG _nist_p_224[][BN_NIST_224_TOP] = {
40 static const BN_ULONG _nist_p_224_sqr[] = {
47 static const BN_ULONG _nist_p_256[][BN_NIST_256_TOP] = {
60 static const BN_ULONG _nist_p_256_sqr[] = {
67 static const BN_ULONG _nist_p_384[][BN_NIST_384_TOP] = {
80 static const BN_ULONG _nist_p_384_sqr[] = {
87 static const BN_ULONG _nist_p_521[] =
95 static const BN_ULONG _nist_p_521_sqr[] = {
[all …]
H A Dbn_srp.c32 static const BN_ULONG bn_group_1024_value[] = {
52 (BN_ULONG *)bn_group_1024_value,
59 static const BN_ULONG bn_group_1536_value[] = {
87 (BN_ULONG *)bn_group_1536_value,
94 static const BN_ULONG bn_group_2048_value[] = {
130 (BN_ULONG *)bn_group_2048_value,
137 static const BN_ULONG bn_group_3072_value[] = {
189 (BN_ULONG *)bn_group_3072_value,
196 static const BN_ULONG bn_group_4096_value[] = {
264 (BN_ULONG *)bn_group_4096_value,
[all …]
H A Dbn_mul.c27 BN_ULONG bn_sub_part_words(BN_ULONG *r, in bn_sub_part_words()
28 const BN_ULONG *a, const BN_ULONG *b, in bn_sub_part_words()
31 BN_ULONG c, t; in bn_sub_part_words()
175 void bn_mul_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n2, in bn_mul_recursive()
176 int dna, int dnb, BN_ULONG *t) in bn_mul_recursive()
181 BN_ULONG ln, lo, *p; in bn_mul_recursive()
204 sizeof(BN_ULONG) * -(dna + dnb)); in bn_mul_recursive()
307 if (ln < (BN_ULONG)c1) { in bn_mul_recursive()
322 void bn_mul_part_recursive(BN_ULONG *r, BN_ULONG *a, BN_ULONG *b, int n, in bn_mul_part_recursive()
323 int tna, int tnb, BN_ULONG *t) in bn_mul_part_recursive()
[all …]
H A Dbn_sqr.c54 BN_ULONG t[8]; in bn_sqr_fixed_top()
61 BN_ULONG t[16]; in bn_sqr_fixed_top()
69 BN_ULONG t[BN_SQR_RECURSIVE_SIZE_NORMAL * 2]; in bn_sqr_fixed_top()
74 j = BN_num_bits_word((BN_ULONG)al); in bn_sqr_fixed_top()
109 void bn_sqr_normal(BN_ULONG *r, const BN_ULONG *a, int n, BN_ULONG *tmp) in bn_sqr_normal()
112 const BN_ULONG *ap; in bn_sqr_normal()
113 BN_ULONG *rp; in bn_sqr_normal()
156 void bn_sqr_recursive(BN_ULONG *r, const BN_ULONG *a, int n2, BN_ULONG *t) in bn_sqr_recursive()
160 BN_ULONG ln, lo, *p; in bn_sqr_recursive()
229 if (ln < (BN_ULONG)c1) { in bn_sqr_recursive()
H A Dbn_div.c91 BN_ULONG bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0);
115 static BN_ULONG bn_div_3_words(const BN_ULONG *m, BN_ULONG d1, BN_ULONG d0) in bn_div_3_words()
119 BN_ULONG Q = 0, mask; in bn_div_3_words()
143 BN_ULONG *d = num->d, n, m, rmask; in bn_left_align()
149 rmask = (BN_ULONG)0 - rshift; /* rmask = 0 - (rshift != 0) */ in bn_left_align()
269 BN_ULONG *resp, *wnum, *wnumtop; in bn_div_fixed_top()
270 BN_ULONG d0, d1; in bn_div_fixed_top()
310 memset(&(snum->d[num_n]), 0, (div_n - num_n + 1) * sizeof(BN_ULONG)); in bn_div_fixed_top()
340 BN_ULONG q, l0; in bn_div_fixed_top()
348 BN_ULONG n0, n1, rem = 0; in bn_div_fixed_top()
[all …]
H A Dbn_dh.c17 # define BN_DEF(lo, hi) (BN_ULONG)hi << 32 | lo
33 static const BN_ULONG modp_1536_p[] = {
48 static const BN_ULONG modp_1536_q[] = {
71 static const BN_ULONG modp_2048_p[] = {
90 static const BN_ULONG modp_2048_q[] = {
116 static const BN_ULONG modp_3072_p[] = {
143 static const BN_ULONG modp_3072_q[] = {
177 static const BN_ULONG modp_4096_p[] = {
212 static const BN_ULONG modp_4096_q[] = {
254 static const BN_ULONG modp_6144_p[] = {
[all …]
H A Dbn_lib.c84 static const BN_ULONG data_one = 1L; in BN_value_one()
86 { (BN_ULONG *)&data_one, 1, 1, 0, BN_FLG_STATIC_DATA }; in BN_value_one()
100 int BN_num_bits_word(BN_ULONG l) in BN_num_bits_word()
102 BN_ULONG x, mask; in BN_num_bits_word()
266 static BN_ULONG *bn_expand_internal(const BIGNUM *b, int words) in bn_expand_internal()
268 BN_ULONG *a = NULL; in bn_expand_internal()
305 BN_ULONG *a = bn_expand_internal(b, words); in bn_expand2()
368 BN_ULONG *tmp_d; in BN_swap()
410 BN_ULONG BN_get_word(const BIGNUM *a) in BN_get_word()
420 int BN_set_word(BIGNUM *a, BN_ULONG
[all...]
H A Dbn_prime.c30 #define square(x) ((BN_ULONG)(x) * (BN_ULONG)(x))
33 # define BN_DEF(lo, hi) (BN_ULONG)hi<<32|lo
44 static const BN_ULONG small_prime_factors[] = {
53 (BN_ULONG)0x000017b1
58 (BN_ULONG *)small_prime_factors,
297 BN_ULONG mod = BN_mod_word(w, primes[i]); in bn_is_prime_int()
298 if (mod == (BN_ULONG)-1) in bn_is_prime_int()
482 BN_ULONG delta; in probable_prime()
484 BN_ULONG maxdelta = BN_MASK2 - primes[trial_divisions - 1]; in probable_prime()
494 BN_ULONG mod = BN_mod_word(rnd, (BN_ULONG)primes[i]); in probable_prime()
[all …]
H A Dbn_gf2m.c60 static void bn_GF2m_mul_1x1(BN_ULONG *r1, BN_ULONG *r0, const BN_ULONG a, in bn_GF2m_mul_1x1()
61 const BN_ULONG b) in bn_GF2m_mul_1x1()
63 register BN_ULONG h, l, s; in bn_GF2m_mul_1x1()
64 BN_ULONG tab[8], top2b = a >> 30; in bn_GF2m_mul_1x1()
65 register BN_ULONG a1, a2, a4; in bn_GF2m_mul_1x1()
129 static void bn_GF2m_mul_1x1(BN_ULONG *r1, BN_ULONG *r0, const BN_ULONG a, in bn_GF2m_mul_1x1()
130 const BN_ULONG b) in bn_GF2m_mul_1x1()
132 register BN_ULONG h, l, s; in bn_GF2m_mul_1x1()
133 BN_ULONG tab[16], top3b = a >> 61; in bn_GF2m_mul_1x1()
134 register BN_ULONG a1, a2, a4, a8; in bn_GF2m_mul_1x1()
[all …]
H A Dbn_mod.c57 BN_ULONG storage[1024 / BN_BITS2]; in bn_mod_add_fixed_top()
58 BN_ULONG carry, temp, mask, *rp, *tp = storage; in bn_mod_add_fixed_top()
59 const BN_ULONG *ap, *bp; in bn_mod_add_fixed_top()
65 tp = OPENSSL_malloc(mtop * sizeof(BN_ULONG)); in bn_mod_add_fixed_top()
76 mask = (BN_ULONG)0 - ((i - a->top) >> (8 * sizeof(i) - 1)); in bn_mod_add_fixed_top()
80 mask = (BN_ULONG)0 - ((i - b->top) >> (8 * sizeof(i) - 1)); in bn_mod_add_fixed_top()
92 ((volatile BN_ULONG *)tp)[i] = 0; in bn_mod_add_fixed_top()
141 BN_ULONG borrow, carry, ta, tb, mask, *rp; in bn_mod_sub_fixed_top()
142 const BN_ULONG *ap, *bp; in bn_mod_sub_fixed_top()
152 mask = (BN_ULONG)0 - ((i - a->top) >> (8 * sizeof(i) - 1)); in bn_mod_sub_fixed_top()
[all …]
H A Dbn_shift.c16 register BN_ULONG *ap, *rp, t, c; in BN_lshift1()
47 BN_ULONG *ap, *rp, t, c; in BN_rshift1()
108 BN_ULONG *t, *f; in bn_lshift_fixed_top()
109 BN_ULONG l, m, rmask = 0; in bn_lshift_fixed_top()
124 rmask = (BN_ULONG)0 - rb; /* rmask = 0 - (rb != 0) */ in bn_lshift_fixed_top()
180 BN_ULONG *t, *f; in bn_rshift_fixed_top()
181 BN_ULONG l, m, mask; in bn_rshift_fixed_top()
195 mask = (BN_ULONG)0 - lb; /* mask = 0 - (lb != 0) */ in bn_rshift_fixed_top()
/freebsd/crypto/openssl/crypto/ec/
H A Decp_nistz256.c37 # define TOBN(hi,lo) ((BN_ULONG)hi<<32|lo)
54 BN_ULONG X[P256_LIMBS];
55 BN_ULONG Y[P256_LIMBS];
56 BN_ULONG Z[P256_LIMBS];
60 BN_ULONG X[P256_LIMBS];
61 BN_ULONG Y[P256_LIMBS];
99 void ecp_nistz256_add(BN_ULONG res[P256_LIMBS],
100 const BN_ULONG a[P256_LIMBS],
101 const BN_ULONG b[P256_LIMBS]);
103 void ecp_nistz256_mul_by_2(BN_ULONG res[P256_LIMBS],
[all …]
/freebsd/crypto/openssl/crypto/bn/asm/
H A Dx86_64-gcc.c75 register BN_ULONG high,low; \
92 register BN_ULONG high,low; \
110 BN_ULONG bn_mul_add_words(BN_ULONG *rp, const BN_ULONG *ap, int num, in bn_mul_add_words()
111 BN_ULONG w) in bn_mul_add_words()
113 BN_ULONG c1 = 0; in bn_mul_add_words()
141 BN_ULONG bn_mul_words(BN_ULONG *rp, const BN_ULONG *ap, int num, BN_ULONG w) in bn_mul_words()
143 BN_ULONG c1 = 0; in bn_mul_words()
169 void bn_sqr_words(BN_ULONG *r, const BN_ULONG *a, int n) in bn_sqr_words()
194 BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) in bn_div_words()
196 BN_ULONG ret, waste; in bn_div_words()
[all …]
/freebsd/crypto/openssl/doc/man3/
H A DBN_add_word.pod12 int BN_add_word(BIGNUM *a, BN_ULONG w);
14 int BN_sub_word(BIGNUM *a, BN_ULONG w);
16 int BN_mul_word(BIGNUM *a, BN_ULONG w);
18 BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
20 BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
46 B<(BN_ULONG)-1> if an error occurred.
/freebsd/usr.bin/factor/
H A Dfactor.c83 typedef u_long BN_ULONG; typedef
94 static BN_ULONG BN_div_word(BIGNUM *, BN_ULONG);
189 if (BN_mod_word(val, (BN_ULONG)*fact) == 0) in pr_fact()
216 BN_div_word(val, (BN_ULONG)*fact); in pr_fact()
217 } while (BN_mod_word(val, (BN_ULONG)*fact) == 0); in pr_fact()
346 static BN_ULONG
347 BN_div_word(BIGNUM *a, BN_ULONG b) in BN_div_word()
349 BN_ULONG mod; in BN_div_word()

123