Home
last modified time | relevance | path

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

/illumos-gate/usr/src/common/mpi/
H A Dmp_gf2m-priv.h51 extern const mp_digit mp_gf2m_sqr_tb[16];
84 void s_bmul_1x1(mp_digit *rh, mp_digit *rl, const mp_digit a, const mp_digit b);
90 void s_bmul_2x2(mp_digit *r, const mp_digit a1, const mp_digit a0, const mp_digit b1,
91 const mp_digit b0);
97 void s_bmul_3x3(mp_digit *r, const mp_digit a2, const mp_digit a1, const mp_digit a0,
98 const mp_digit b2, const mp_digit b1, const mp_digit b0);
104 void s_bmul_4x4(mp_digit *r, const mp_digit a3, const mp_digit a2, const mp_digit a1,
105 const mp_digit a0, const mp_digit b3, const mp_digit b2, const mp_digit b1,
106 const mp_digit b0);
H A Dmpi-priv.h124 #define CARRYOUT(W) (mp_digit)((W)>>DIGIT_BIT)
125 #define ACCUM(W) (mp_digit)(W)
157 void s_mp_setz(mp_digit *dp, mp_size count); /* zero digits */
158 void s_mp_copy(const mp_digit *sp, mp_digit *dp, mp_size count); /* copy */
173 #define s_mp_setz(dp, count) memset(dp, 0, (count) * sizeof(mp_digit))
180 #define s_mp_copy(sp, dp, count) memcpy(dp, sp, (count) * sizeof(mp_digit))
204 mp_err s_mp_mul_2d(mp_int *mp, mp_digit d); /* multiply by 2^d in place */
205 void s_mp_div_2d(mp_int *mp, mp_digit d); /* divide by 2^d in place */
206 void s_mp_mod_2d(mp_int *mp, mp_digit d); /* modulo 2^d in place */
209 mp_err s_mp_norm(mp_int *a, mp_int *b, mp_digit *pd);
[all …]
H A Dmp_gf2m.c51 const mp_digit mp_gf2m_sqr_tb[16] =
63 s_bmul_1x1(mp_digit *rh, mp_digit *rl, const mp_digit a, const mp_digit b) in s_bmul_1x1()
65 register mp_digit h, l, s; in s_bmul_1x1()
66 mp_digit tab[8], top2b = a >> 30; in s_bmul_1x1()
67 register mp_digit a1, a2, a4; in s_bmul_1x1()
95 s_bmul_1x1(mp_digit *rh, mp_digit *rl, const mp_digit a, const mp_digit b) in s_bmul_1x1()
97 register mp_digit h, l, s; in s_bmul_1x1()
98 mp_digit tab[16], top3b = a >> 61; in s_bmul_1x1()
99 register mp_digit a1, a2, a4, a8; in s_bmul_1x1()
140 s_bmul_2x2(mp_digit *r, const mp_digit a1, const mp_digit a0, const mp_digit b1, in s_bmul_2x2()
[all …]
H A Dmpi.c155 if((DIGITS(mp) = s_mp_alloc(prec, sizeof(mp_digit), kmflag)) == NULL) in mp_init_size()
186 if((DIGITS(mp) = s_mp_alloc(ALLOC(from), sizeof(mp_digit), FLAG(from))) == NULL) in mp_init_copy()
220 mp_digit *tmp; in mp_copy()
234 if((tmp = s_mp_alloc(ALLOC(from), sizeof(mp_digit), FLAG(from))) == NULL) in mp_copy()
340 void mp_set(mp_int *mp, mp_digit d) in mp_set()
366 if (sizeof v <= sizeof(mp_digit)) { in mp_set_int()
373 res = s_mp_add_d(mp, (mp_digit)((v >> (ix * CHAR_BIT)) & UCHAR_MAX)); in mp_set_int()
400 if (sizeof z <= sizeof(mp_digit)) { in mp_set_ulong()
407 res = s_mp_add_d(mp, (mp_digit)((z >> (ix * CHAR_BIT)) & UCHAR_MAX)); in mp_set_ulong()
429 mp_err mp_add_d(const mp_int *a, mp_digit d, mp_int *b) in mp_add_d()
[all …]
H A Dmpprime.h55 extern const mp_digit prime_tab[];
59 mp_err mpp_divis_d(mp_int *a, mp_digit d);
66 mp_err mpp_divis_vector(mp_int *a, const mp_digit *vec, int size, int *which);
67 mp_err mpp_divis_primes(mp_int *a, mp_digit *np);
68 mp_err mpp_fermat(mp_int *a, mp_digit w);
69 mp_err mpp_fermat_list(mp_int *a, const mp_digit *primes, mp_size nPrimes);
71 mp_err mpp_sieve(mp_int *trial, const mp_digit *primes, mp_size nPrimes,
H A Dmpi.h155 typedef unsigned long mp_digit; typedef
166 typedef unsigned long long mp_digit; typedef
177 typedef unsigned int mp_digit; typedef
217 #define MP_DIGIT_BIT (CHAR_BIT*sizeof(mp_digit))
222 #define MP_HALF_RADIX (1+(mp_digit)MP_HALF_DIGIT_MAX)
245 mp_digit *dp; /* the digits themselves */
260 void mp_set(mp_int *mp, mp_digit d);
266 mp_err mp_add_d(const mp_int *a, mp_digit d, mp_int *b);
267 mp_err mp_sub_d(const mp_int *a, mp_digit d, mp_int *b);
268 mp_err mp_mul_d(const mp_int *a, mp_digit d, mp_int *b);
[all …]
H A Dmplogic.c83 mp_err mpl_rsh(const mp_int *a, mp_int *b, mp_digit d) in mpl_rsh()
102 mp_err mpl_lsh(const mp_int *a, mp_int *b, mp_digit d) in mpl_lsh()
128 mp_digit mask; in mpl_set_bit()
140 mask = (mp_digit)1 << bitNum; in mpl_set_bit()
183 mp_digit * digit = MP_DIGITS(a) + lsWndx; in mpl_get_bits()
184 mp_digit mask = ((1 << numBits) - 1); in mpl_get_bits()
212 mp_digit d; in mpl_significant_bits()
H A Dmpmontg.c105 mp_digit m_i = MP_DIGIT(T, i) * mmm->n0prime; in s_mp_redc()
133 mp_digit *pb; in s_mp_mul_mont()
134 mp_digit m_i; in s_mp_mul_mont()
162 mp_digit b_i = *pb++; in s_mp_mul_mont()
H A Dmpprime.c90 mp_digit next = 0; in mpp_random()
96 for(jx = 0; jx < sizeof(mp_digit); jx++) { in mpp_random()
H A Dmplogic.h76 mp_err mpl_rsh(const mp_int *a, mp_int *b, mp_digit d); /* right shift */
77 mp_err mpl_lsh(const mp_int *a, mp_int *b, mp_digit d); /* left shift */
/illumos-gate/usr/src/common/crypto/ecc/
H A Decp_192.c63 mp_digit r3; in ec_GFp_nistp192_mod()
65 mp_digit carry; in ec_GFp_nistp192_mod()
68 mp_digit a5a = 0, a5b = 0, a4a = 0, a4b = 0, a3a = 0, a3b = 0; in ec_GFp_nistp192_mod()
69 mp_digit r0a, r0b, r1a, r1b, r2a, r2b; in ec_GFp_nistp192_mod()
71 mp_digit a5 = 0, a4 = 0, a3 = 0; in ec_GFp_nistp192_mod()
72 mp_digit r0, r1, r2; in ec_GFp_nistp192_mod()
309 mp_digit a0 = 0, a1 = 0, a2 = 0; in ec_GFp_nistp192_add()
310 mp_digit r0 = 0, r1 = 0, r2 = 0; in ec_GFp_nistp192_add()
311 mp_digit carry; in ec_GFp_nistp192_add()
394 mp_digit b0 = 0, b1 = 0, b2 = 0; in ec_GFp_nistp192_sub()
[all …]
H A Decl_gf.c274 mp_digit a0 = 0, a1 = 0, a2 = 0; in ec_GFp_add_3()
275 mp_digit r0 = 0, r1 = 0, r2 = 0; in ec_GFp_add_3()
276 mp_digit carry; in ec_GFp_add_3()
361 mp_digit a0 = 0, a1 = 0, a2 = 0, a3 = 0; in ec_GFp_add_4()
362 mp_digit r0 = 0, r1 = 0, r2 = 0, r3 = 0; in ec_GFp_add_4()
363 mp_digit carry; in ec_GFp_add_4()
461 mp_digit a0 = 0, a1 = 0, a2 = 0, a3 = 0, a4 = 0; in ec_GFp_add_5()
462 mp_digit r0 = 0, r1 = 0, r2 = 0, r3 = 0, r4 = 0; in ec_GFp_add_5()
463 mp_digit carry; in ec_GFp_add_5()
546 mp_digit a0 = 0, a1 = 0, a2 = 0, a3 = 0, a4 = 0, a5 = 0; in ec_GFp_add_6()
[all …]
H A Decp_256.c62 mp_digit carry; in ec_GFp_nistp256_mod()
65 mp_digit a8=0, a9=0, a10=0, a11=0, a12=0, a13=0, a14=0, a15=0; in ec_GFp_nistp256_mod()
66 mp_digit r0, r1, r2, r3, r4, r5, r6, r7; in ec_GFp_nistp256_mod()
69 mp_digit a4=0, a5=0, a6=0, a7=0; in ec_GFp_nistp256_mod()
70 mp_digit a4h, a4l, a5h, a5l, a6h, a6l, a7h, a7l; in ec_GFp_nistp256_mod()
71 mp_digit r0, r1, r2, r3; in ec_GFp_nistp256_mod()
207 mp_digit r8_d = r8; in ec_GFp_nistp256_mod()
221 mp_digit r8_d = -r8; in ec_GFp_nistp256_mod()
359 mp_digit r4_long = r4; in ec_GFp_nistp256_mod()
360 mp_digit r4l = (r4_long << 32); in ec_GFp_nistp256_mod()
[all …]
H A Decp_224.c65 mp_digit carry; in ec_GFp_nistp224_mod()
67 mp_digit a6a = 0, a6b = 0, in ec_GFp_nistp224_mod()
69 mp_digit r0a, r0b, r1a, r1b, r2a, r2b, r3a; in ec_GFp_nistp224_mod()
71 mp_digit a6 = 0, a5 = 0, a4 = 0, a3b = 0, a5a = 0; in ec_GFp_nistp224_mod()
72 mp_digit a6b = 0, a6a_a5b = 0, a5b = 0, a5a_a4b = 0, a4a_a3b = 0; in ec_GFp_nistp224_mod()
73 mp_digit r0, r1, r2, r3; in ec_GFp_nistp224_mod()
176 mp_digit maxInt = MP_DIGIT_MAX; in ec_GFp_nistp224_mod()
273 MP_ADD_CARRY(r1,((mp_digit)r3b) << 32, r1, 0, carry); in ec_GFp_nistp224_mod()
H A Dec2_163.c62 mp_digit *u, z; in ec_GF2m_163_mod()
134 mp_digit *u, *v; in ec_GF2m_163_sqr()
184 mp_digit a2 = 0, a1 = 0, a0, b2 = 0, b1 = 0, b0; in ec_GF2m_163_mul()
187 mp_digit a5 = 0, a4 = 0, a3 = 0, b5 = 0, b4 = 0, b3 = 0; in ec_GF2m_163_mul()
188 mp_digit rm[6]; in ec_GF2m_163_mul()
H A Dec2_193.c62 mp_digit *u, z; in ec_GF2m_193_mod()
142 mp_digit *u, *v; in ec_GF2m_193_sqr()
193 mp_digit a3 = 0, a2 = 0, a1 = 0, a0, b3 = 0, b2 = 0, b1 = 0, b0; in ec_GF2m_193_mul()
196 mp_digit a6 = 0, a5 = 0, a4 = 0, b6 = 0, b5 = 0, b4 = 0; in ec_GF2m_193_mul()
197 mp_digit rm[8]; in ec_GF2m_193_mul()
H A Dec2_233.c62 mp_digit *u, z; in ec_GF2m_233_mod()
158 mp_digit *u, *v; in ec_GF2m_233_sqr()
211 mp_digit a3 = 0, a2 = 0, a1 = 0, a0, b3 = 0, b2 = 0, b1 = 0, b0; in ec_GF2m_233_mul()
214 mp_digit a7 = 0, a6 = 0, a5 = 0, a4 = 0, b7 = 0, b6 = 0, b5 = 0, b4 = in ec_GF2m_233_mul()
216 mp_digit rm[8]; in ec_GF2m_233_mul()
H A Decl-priv.h62 (((curve_size_in_bits)+(sizeof(mp_digit)*8-1))/(sizeof(mp_digit)*8))
63 #define ECL_BITS (sizeof(mp_digit)*8)
64 #define ECL_MAX_FIELD_SIZE_DIGITS (80/sizeof(mp_digit))
93 { mp_digit tmp,sum; \
101 { mp_digit tmp; \
H A Decp_384.c67 mp_digit s[10][12]; in ec_GFp_nistp384_mod()
75 mp_digit s[10][6]; in ec_GFp_nistp384_mod()
H A Decp_521.c68 mp_digit s1[ECP521_DIGITS] = { 0 }; in ec_GFp_nistp521_mod()
H A Dec2_mont.c199 mp_digit top_bit, mask; in ec_GF2m_pt_mul_mont()