Home
last modified time | relevance | path

Searched refs:mp_digit (Results 1 – 25 of 75) sorted by relevance

123

/external/dropbear/libtommath/
Dtommath.h64 typedef unsigned char mp_digit; typedef
67 typedef unsigned short mp_digit;
76 typedef unsigned long mp_digit;
94 typedef unsigned long mp_digit;
127 #define DIGIT_BIT ((int)((CHAR_BIT * sizeof(mp_digit) - 1))) /* bits per digit */
131 #define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
181 mp_digit *dp;
229 void mp_set(mp_int *a, mp_digit b);
238 int mp_init_set (mp_int * a, mp_digit b);
331 int mp_cmp_d(mp_int *a, mp_digit b);
[all …]
Dbn_mp_div_d.c18 static int s_is_power_of_two(mp_digit b, int *p) in s_is_power_of_two()
23 if (b == (((mp_digit)1)<<x)) { in s_is_power_of_two()
32 int mp_div_d (mp_int * a, mp_digit b, mp_int * c, mp_digit * d) in mp_div_d()
36 mp_digit t; in mp_div_d()
58 *d = a->dp[0] & ((((mp_digit)1)<<ix) - 1); in mp_div_d()
85 t = (mp_digit)(w / b); in mp_div_d()
90 q.dp[ix] = (mp_digit)t; in mp_div_d()
94 *d = (mp_digit)w; in mp_div_d()
Dbn_s_mp_sqr.c24 mp_digit u, tmpx, *tmpt; in s_mp_sqr()
41 t.dp[ix+ix] = (mp_digit) (r & ((mp_word) MP_MASK)); in s_mp_sqr()
44 u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); in s_mp_sqr()
62 *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); in s_mp_sqr()
65 u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); in s_mp_sqr()
68 while (u != ((mp_digit) 0)) { in s_mp_sqr()
70 *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); in s_mp_sqr()
71 u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); in s_mp_sqr()
Dbn_fast_mp_montgomery_reduce.c26 int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) in fast_mp_montgomery_reduce()
46 register mp_digit *tmpx; in fast_mp_montgomery_reduce()
75 register mp_digit mu; in fast_mp_montgomery_reduce()
76 mu = (mp_digit) (((W[ix] & MP_MASK) * rho) & MP_MASK); in fast_mp_montgomery_reduce()
94 register mp_digit *tmpn; in fast_mp_montgomery_reduce()
118 register mp_digit *tmpx; in fast_mp_montgomery_reduce()
147 *tmpx++ = (mp_digit)(*_W++ & ((mp_word) MP_MASK)); in fast_mp_montgomery_reduce()
Dbn_mp_montgomery_reduce.c20 mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) in mp_montgomery_reduce()
23 mp_digit mu; in mp_montgomery_reduce()
55 mu = (mp_digit) (((mp_word)x->dp[ix]) * ((mp_word)rho) & MP_MASK); in mp_montgomery_reduce()
60 register mp_digit *tmpn, *tmpx, u; in mp_montgomery_reduce()
79 u = (mp_digit)(r >> ((mp_word) DIGIT_BIT)); in mp_montgomery_reduce()
82 *tmpx++ = (mp_digit)(r & ((mp_word) MP_MASK)); in mp_montgomery_reduce()
Dbn_s_mp_sub.c38 register mp_digit u, *tmpa, *tmpb, *tmpc; in s_mp_sub()
57 u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1)); in s_mp_sub()
69 u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1)); in s_mp_sub()
Dbn_mp_mod_2d.c47 (mp_digit) ((((mp_digit) 1) << (((mp_digit) b) % DIGIT_BIT)) - ((mp_digit) 1)); in mp_mod_2d()
Dbn_mp_mul_d.c20 mp_mul_d (mp_int * a, mp_digit b, mp_int * c) in mp_mul_d()
22 mp_digit u, *tmpa, *tmpc; in mp_mul_d()
54 *tmpc++ = (mp_digit) (r & ((mp_word) MP_MASK)); in mp_mul_d()
57 u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); in mp_mul_d()
Dbn_mp_dr_reduce.c33 mp_dr_reduce (mp_int * x, mp_int * n, mp_digit k) in mp_dr_reduce()
37 mp_digit mu, *tmpx1, *tmpx2; in mp_dr_reduce()
66 *tmpx1++ = (mp_digit)(r & MP_MASK); in mp_dr_reduce()
67 mu = (mp_digit)(r >> ((mp_word)DIGIT_BIT)); in mp_dr_reduce()
Dbn_mp_div_3.c20 mp_div_3 (mp_int * a, mp_int *c, mp_digit * d) in mp_div_3()
24 mp_digit b; in mp_div_3()
57 q.dp[ix] = (mp_digit)t; in mp_div_3()
62 *d = (mp_digit)w; in mp_div_3()
Dbn_mp_mul_2d.c21 mp_digit d; in mp_mul_2d()
45 d = (mp_digit) (b % DIGIT_BIT); in mp_mul_2d()
47 register mp_digit *tmpc, shift, mask, r, rr; in mp_mul_2d()
51 mask = (((mp_digit)1) << d) - 1; in mp_mul_2d()
Dbn_s_mp_mul_digs.c26 mp_digit u; in s_mp_mul_digs()
28 mp_digit tmpx, *tmpt, *tmpy; in s_mp_mul_digs()
69 *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); in s_mp_mul_digs()
72 u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); in s_mp_mul_digs()
Dbn_fast_s_mp_mul_digs.c37 mp_digit W[MP_WARRAY]; in fast_s_mp_mul_digs()
55 mp_digit *tmpx, *tmpy; in fast_s_mp_mul_digs()
77 W[ix] = ((mp_digit)_W) & MP_MASK; in fast_s_mp_mul_digs()
88 register mp_digit *tmpc; in fast_s_mp_mul_digs()
Dbn_mp_sub_d.c20 mp_sub_d (mp_int * a, mp_digit b, mp_int * c) in mp_sub_d()
22 mp_digit *tmpa, *tmpc, mu; in mp_sub_d()
70 mu = *tmpc >> (sizeof(mp_digit) * CHAR_BIT - 1); in mp_sub_d()
76 mu = *tmpc >> (sizeof(mp_digit) * CHAR_BIT - 1); in mp_sub_d()
Dbn_mp_div_2d.c21 mp_digit D, r, rr; in mp_div_2d()
59 D = (mp_digit) (b % DIGIT_BIT); in mp_div_2d()
61 register mp_digit *tmpc, mask, shift; in mp_div_2d()
64 mask = (((mp_digit)1) << D) - 1; in mp_div_2d()
Dbn_s_mp_mul_high_digs.c26 mp_digit u; in s_mp_mul_high_digs()
28 mp_digit tmpx, *tmpt, *tmpy; in s_mp_mul_high_digs()
65 *tmpt++ = (mp_digit) (r & ((mp_word) MP_MASK)); in s_mp_mul_high_digs()
68 u = (mp_digit) (r >> ((mp_word) DIGIT_BIT)); in s_mp_mul_high_digs()
Dbn_fast_s_mp_mul_high_digs.c30 mp_digit W[MP_WARRAY]; in fast_s_mp_mul_high_digs()
46 mp_digit *tmpx, *tmpy; in fast_s_mp_mul_high_digs()
67 W[ix] = ((mp_digit)_W) & MP_MASK; in fast_s_mp_mul_high_digs()
78 register mp_digit *tmpc; in fast_s_mp_mul_high_digs()
Dbn_fast_s_mp_sqr.c31 mp_digit W[MP_WARRAY], *tmpx; in fast_s_mp_sqr()
47 mp_digit *tmpy; in fast_s_mp_sqr()
85 W[ix] = (mp_digit)(_W & MP_MASK); in fast_s_mp_sqr()
96 mp_digit *tmpb; in fast_s_mp_sqr()
Dbn_mp_count_bits.c23 mp_digit q; in mp_count_bits()
35 while (q > ((mp_digit) 0)) { in mp_count_bits()
37 q >>= ((mp_digit) 1); in mp_count_bits()
/external/dropbear/libtommath/etc/
Dpprime.c14 static mp_digit
36 mp_digit r, x, y, next; in gen_prime()
42 r = 3; fwrite(&r, 1, sizeof(mp_digit), out); in gen_prime()
43 r = 5; fwrite(&r, 1, sizeof(mp_digit), out); in gen_prime()
44 r = 7; fwrite(&r, 1, sizeof(mp_digit), out); in gen_prime()
45 r = 11; fwrite(&r, 1, sizeof(mp_digit), out); in gen_prime()
46 r = 13; fwrite(&r, 1, sizeof(mp_digit), out); in gen_prime()
47 r = 17; fwrite(&r, 1, sizeof(mp_digit), out); in gen_prime()
48 r = 19; fwrite(&r, 1, sizeof(mp_digit), out); in gen_prime()
49 r = 23; fwrite(&r, 1, sizeof(mp_digit), out); in gen_prime()
[all …]
/external/wpa_supplicant_6/wpa_supplicant/src/tls/
Dlibtommath.c69 typedef unsigned long mp_digit; typedef
81 #define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
117 mp_digit *dp;
143 static void mp_set(mp_int * a, mp_digit b);
180 static int mp_mul_d (mp_int * a, mp_digit b, mp_int * c);
237 register mp_digit u, *tmpa, *tmpb, *tmpc; in s_mp_add()
258 u = *tmpc >> ((mp_digit)DIGIT_BIT); in s_mp_add()
273 u = *tmpc >> ((mp_digit)DIGIT_BIT); in s_mp_add()
313 register mp_digit u, *tmpa, *tmpb, *tmpc; in s_mp_sub()
332 u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1)); in s_mp_sub()
[all …]
/external/wpa_supplicant/
Dlibtommath.c46 typedef unsigned long mp_digit; typedef
58 #define MP_MASK ((((mp_digit)1)<<((mp_digit)DIGIT_BIT))-((mp_digit)1))
94 mp_digit *dp;
116 static void mp_set(mp_int * a, mp_digit b);
197 register mp_digit u, *tmpa, *tmpb, *tmpc; in s_mp_add()
218 u = *tmpc >> ((mp_digit)DIGIT_BIT); in s_mp_add()
233 u = *tmpc >> ((mp_digit)DIGIT_BIT); in s_mp_add()
273 register mp_digit u, *tmpa, *tmpb, *tmpc; in s_mp_sub()
292 u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1)); in s_mp_sub()
304 u = *tmpc >> ((mp_digit)(CHAR_BIT * sizeof (mp_digit) - 1)); in s_mp_sub()
[all …]
/external/dropbear/libtommath/mtest/
Dmpi.c133 void s_mp_setz(mp_digit *dp, mp_size count); /* zero digits */
134 void s_mp_copy(mp_digit *sp, mp_digit *dp, mp_size count); /* copy */
146 #define s_mp_setz(dp, count) memset(dp, 0, (count) * sizeof(mp_digit))
153 #define s_mp_copy(sp, dp, count) memcpy(dp, sp, (count) * sizeof(mp_digit))
169 void s_mp_div_2d(mp_int *mp, mp_digit d); /* divide by 2^d in place */
170 void s_mp_mod_2d(mp_int *mp, mp_digit d); /* modulo 2^d in place */
171 mp_err s_mp_mul_2d(mp_int *mp, mp_digit d); /* multiply by 2^d in place*/
174 mp_digit s_mp_norm(mp_int *a, mp_int *b); /* normalize for division */
175 mp_err s_mp_add_d(mp_int *mp, mp_digit d); /* unsigned digit addition */
176 mp_err s_mp_sub_d(mp_int *mp, mp_digit d); /* unsigned digit subtract */
[all …]
Dmpi.h78 mp_digit *dp; /* the digits themselves */
99 void mp_set(mp_int *mp, mp_digit d);
107 mp_err mp_add_d(mp_int *a, mp_digit d, mp_int *b);
108 mp_err mp_sub_d(mp_int *a, mp_digit d, mp_int *b);
109 mp_err mp_mul_d(mp_int *a, mp_digit d, mp_int *b);
111 mp_err mp_div_d(mp_int *a, mp_digit d, mp_int *q, mp_digit *r);
113 mp_err mp_expt_d(mp_int *a, mp_digit d, mp_int *c);
127 mp_err mp_mul_2d(mp_int *a, mp_digit d, mp_int *c);
134 mp_err mp_div_2d(mp_int *a, mp_digit d, mp_int *q, mp_int *r);
136 mp_err mp_2expt(mp_int *a, mp_digit k);
[all …]
/external/dropbear/libtommath/pre_gen/
Dmpi.c230 int fast_mp_montgomery_reduce (mp_int * x, mp_int * n, mp_digit rho) in fast_mp_montgomery_reduce()
250 register mp_digit *tmpx; in fast_mp_montgomery_reduce()
279 register mp_digit mu; in fast_mp_montgomery_reduce()
280 mu = (mp_digit) (((W[ix] & MP_MASK) * rho) & MP_MASK); in fast_mp_montgomery_reduce()
298 register mp_digit *tmpn; in fast_mp_montgomery_reduce()
322 register mp_digit *tmpx; in fast_mp_montgomery_reduce()
351 *tmpx++ = (mp_digit)(*_W++ & ((mp_word) MP_MASK)); in fast_mp_montgomery_reduce()
417 mp_digit W[MP_WARRAY]; in fast_s_mp_mul_digs()
435 mp_digit *tmpx, *tmpy; in fast_s_mp_mul_digs()
457 W[ix] = ((mp_digit)_W) & MP_MASK; in fast_s_mp_mul_digs()
[all …]

123