Home
last modified time | relevance | path

Searched refs:mp_int (Results 1 – 25 of 35) sorted by relevance

12

/illumos-gate/usr/src/common/crypto/ecc/
H A Decp.h51 mp_err ec_GFp_pt_is_inf_aff(const mp_int *px, const mp_int *py);
54 mp_err ec_GFp_pt_set_inf_aff(mp_int *px, mp_int *py);
58 mp_err ec_GFp_pt_add_aff(const mp_int *px, const mp_int *py,
59 const mp_int *qx, const mp_int *qy, mp_int *rx,
60 mp_int *ry, const ECGroup *group);
63 mp_err ec_GFp_pt_sub_aff(const mp_int *px, const mp_int *py,
64 const mp_int *qx, const mp_int *qy, mp_int *rx,
65 mp_int *ry, const ECGroup *group);
68 mp_err ec_GFp_pt_dbl_aff(const mp_int *px, const mp_int *py, mp_int *rx,
69 mp_int *ry, const ECGroup *group);
[all …]
H A Decl-priv.h119 mp_int irr;
130 mp_err (*field_add) (const mp_int *a, const mp_int *b, mp_int *r,
132 mp_err (*field_neg) (const mp_int *a, mp_int *r, const GFMethod *meth);
133 mp_err (*field_sub) (const mp_int *a, const mp_int *b, mp_int *r,
135 mp_err (*field_mod) (const mp_int *a, mp_int *r, const GFMethod *meth);
136 mp_err (*field_mul) (const mp_int *a, const mp_int *b, mp_int *r,
138 mp_err (*field_sqr) (const mp_int *a, mp_int *r, const GFMethod *meth);
139 mp_err (*field_div) (const mp_int *a, const mp_int *b, mp_int *r,
141 mp_err (*field_enc) (const mp_int *a, mp_int *r, const GFMethod *meth);
142 mp_err (*field_dec) (const mp_int *a, mp_int *r, const GFMethod *meth);
[all …]
H A Dec2.h51 mp_err ec_GF2m_pt_is_inf_aff(const mp_int *px, const mp_int *py);
54 mp_err ec_GF2m_pt_set_inf_aff(mp_int *px, mp_int *py);
58 mp_err ec_GF2m_pt_add_aff(const mp_int *px, const mp_int *py,
59 const mp_int *qx, const mp_int *qy, mp_int *rx,
60 mp_int *ry, const ECGroup *group);
63 mp_err ec_GF2m_pt_sub_aff(const mp_int *px, const mp_int *py,
64 const mp_int *qx, const mp_int *qy, mp_int *rx,
65 mp_int *ry, const ECGroup *group);
68 mp_err ec_GF2m_pt_dbl_aff(const mp_int *px, const mp_int *py, mp_int *rx,
69 mp_int *ry, const ECGroup *group);
[all …]
H A Decl.h79 mp_err ECPoint_mul(const ECGroup *group, const mp_int *k, const mp_int *px,
80 const mp_int *py, mp_int *qx, mp_int *qy);
86 mp_err ECPoints_mul(const ECGroup *group, const mp_int *k1,
87 const mp_int *k2, const mp_int *px, const mp_int *py,
88 mp_int *qx, mp_int *qy);
94 mp_err ECPoint_validate(const ECGroup *group, const mp_int *px, const
95 mp_int *py);
H A Decp_aff.c58 ec_GFp_pt_is_inf_aff(const mp_int *px, const mp_int *py) in ec_GFp_pt_is_inf_aff()
71 ec_GFp_pt_set_inf_aff(mp_int *px, mp_int *py) in ec_GFp_pt_set_inf_aff()
83 ec_GFp_pt_add_aff(const mp_int *px, const mp_int *py, const mp_int *qx, in ec_GFp_pt_add_aff()
84 const mp_int *qy, mp_int *rx, mp_int *ry, in ec_GFp_pt_add_aff()
88 mp_int lambda, temp, tempx, tempy; in ec_GFp_pt_add_aff()
169 ec_GFp_pt_sub_aff(const mp_int *px, const mp_int *py, const mp_int *qx, in ec_GFp_pt_sub_aff()
170 const mp_int *qy, mp_int *rx, mp_int *ry, in ec_GFp_pt_sub_aff()
174 mp_int nqy; in ec_GFp_pt_sub_aff()
190 ec_GFp_pt_dbl_aff(const mp_int *px, const mp_int *py, mp_int *rx, in ec_GFp_pt_dbl_aff()
191 mp_int *ry, const ECGroup *group) in ec_GFp_pt_dbl_aff()
[all …]
H A Dec2_aff.c54 ec_GF2m_pt_is_inf_aff(const mp_int *px, const mp_int *py) in ec_GF2m_pt_is_inf_aff()
67 ec_GF2m_pt_set_inf_aff(mp_int *px, mp_int *py) in ec_GF2m_pt_set_inf_aff()
77 ec_GF2m_pt_add_aff(const mp_int *px, const mp_int *py, const mp_int *qx, in ec_GF2m_pt_add_aff()
78 const mp_int *qy, mp_int *rx, mp_int *ry, in ec_GF2m_pt_add_aff()
82 mp_int lambda, tempx, tempy; in ec_GF2m_pt_add_aff()
159 ec_GF2m_pt_sub_aff(const mp_int *px, const mp_int *py, const mp_int *qx, in ec_GF2m_pt_sub_aff()
160 const mp_int *qy, mp_int *rx, mp_int *ry, in ec_GF2m_pt_sub_aff()
164 mp_int nqy; in ec_GF2m_pt_sub_aff()
179 ec_GF2m_pt_dbl_aff(const mp_int *px, const mp_int *py, mp_int *rx, in ec_GF2m_pt_dbl_aff()
180 mp_int *ry, const ECGroup *group) in ec_GF2m_pt_dbl_aff()
[all …]
H A Decp_jac.c64 ec_GFp_pt_aff2jac(const mp_int *px, const mp_int *py, mp_int *rx, in ec_GFp_pt_aff2jac()
65 mp_int *ry, mp_int *rz, const ECGroup *group) in ec_GFp_pt_aff2jac()
88 ec_GFp_pt_jac2aff(const mp_int *px, const mp_int *py, const mp_int *pz, in ec_GFp_pt_jac2aff()
89 mp_int *rx, mp_int *ry, const ECGroup *group) in ec_GFp_pt_jac2aff()
92 mp_int z1, z2, z3; in ec_GFp_pt_jac2aff()
129 ec_GFp_pt_is_inf_jac(const mp_int *px, const mp_int *py, const mp_int *pz) in ec_GFp_pt_is_inf_jac()
137 ec_GFp_pt_set_inf_jac(mp_int *px, mp_int *py, mp_int *pz) in ec_GFp_pt_set_inf_jac()
151 ec_GFp_pt_add_jac_aff(const mp_int *px, const mp_int *py, const mp_int *pz, in ec_GFp_pt_add_jac_aff()
152 const mp_int *qx, const mp_int *qy, mp_int *rx, in ec_GFp_pt_add_jac_aff()
153 mp_int *ry, mp_int *rz, const ECGroup *group) in ec_GFp_pt_add_jac_aff()
[all …]
H A Decl_mult.c58 ECPoint_mul(const ECGroup *group, const mp_int *k, const mp_int *px, in ECPoint_mul()
59 const mp_int *py, mp_int *rx, mp_int *ry) in ECPoint_mul()
62 mp_int kt; in ECPoint_mul()
112 ec_pts_mul_basic(const mp_int *k1, const mp_int *k2, const mp_int *px, in ec_pts_mul_basic()
113 const mp_int *py, mp_int *rx, mp_int *ry, in ec_pts_mul_basic()
117 mp_int sx, sy; in ec_pts_mul_basic()
167 ec_pts_mul_simul_w2(const mp_int *k1, const mp_int *k2, const mp_int *px, in ec_pts_mul_simul_w2()
168 const mp_int *py, mp_int *rx, mp_int *ry, in ec_pts_mul_simul_w2()
172 mp_int precomp[4][4][2]; in ec_pts_mul_simul_w2()
173 const mp_int *a, *b; in ec_pts_mul_simul_w2()
[all …]
H A Decp_jm.c62 ec_GFp_pt_dbl_jm(const mp_int *px, const mp_int *py, const mp_int *pz, in ec_GFp_pt_dbl_jm()
63 const mp_int *paz4, mp_int *rx, mp_int *ry, mp_int *rz, in ec_GFp_pt_dbl_jm()
64 mp_int *raz4, mp_int scratch[], const ECGroup *group) in ec_GFp_pt_dbl_jm()
67 mp_int *t0, *t1, *M, *S; in ec_GFp_pt_dbl_jm()
132 ec_GFp_pt_add_jm_aff(const mp_int *px, const mp_int *py, const mp_int *pz, in ec_GFp_pt_add_jm_aff()
133 const mp_int *paz4, const mp_int *qx, in ec_GFp_pt_add_jm_aff()
134 const mp_int *qy, mp_int *rx, mp_int *ry, mp_int *rz, in ec_GFp_pt_add_jm_aff()
135 mp_int *raz4, mp_int scratch[], const ECGroup *group) in ec_GFp_pt_add_jm_aff()
138 mp_int *A, *B, *C, *D, *C2, *C3; in ec_GFp_pt_add_jm_aff()
233 ec_GFp_pt_mul_jm_wNAF(const mp_int *n, const mp_int *px, const mp_int *py, in ec_GFp_pt_mul_jm_wNAF()
[all …]
H A Decl_gf.c83 GFMethod_consGFp(const mp_int *irr) in GFMethod_consGFp()
142 GFMethod_consGF2m(const mp_int *irr, const unsigned int irr_arr[5]) in GFMethod_consGF2m()
215 ec_GFp_add(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_add()
232 ec_GFp_neg(const mp_int *a, mp_int *r, const GFMethod *meth) in ec_GFp_neg()
245 ec_GFp_sub(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_sub()
270 ec_GFp_add_3(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_add_3()
357 ec_GFp_add_4(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_add_4()
457 ec_GFp_add_5(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_add_5()
542 ec_GFp_add_6(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_add_6()
643 ec_GFp_sub_3(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_sub_3()
[all …]
H A Decp_mont.c61 GFMethod_consGFp_mont(const mp_int *irr) in GFMethod_consGFp_mont()
110 ec_GFp_mul_mont(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_mul_mont()
122 mp_int s; in ec_GFp_mul_mont()
142 ec_GFp_sqr_mont(const mp_int *a, mp_int *r, const GFMethod *meth) in ec_GFp_sqr_mont()
149 ec_GFp_div_mont(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_div_mont()
170 ec_GFp_enc_mont(const mp_int *a, mp_int *r, const GFMethod *meth) in ec_GFp_enc_mont()
184 ec_GFp_dec_mont(const mp_int *a, mp_int *r, const GFMethod *meth) in ec_GFp_dec_mont()
H A Dec2_mont.c60 gf2m_Mdouble(mp_int *x, mp_int *z, const ECGroup *group, int kmflag) in gf2m_Mdouble()
63 mp_int t1; in gf2m_Mdouble()
87 gf2m_Madd(const mp_int *x, mp_int *x1, mp_int *z1, mp_int *x2, mp_int *z2, in gf2m_Madd()
91 mp_int t1, t2; in gf2m_Madd()
119 gf2m_Mxy(const mp_int *x, const mp_int *y, mp_int *x1, mp_int *z1, in gf2m_Mxy()
120 mp_int *x2, mp_int *z2, const ECGroup *group) in gf2m_Mxy()
124 mp_int t3, t4, t5; in gf2m_Mxy()
193 ec_GF2m_pt_mul_mont(const mp_int *n, const mp_int *px, const mp_int *py, in ec_GF2m_pt_mul_mont()
194 mp_int *rx, mp_int *ry, const ECGroup *group) in ec_GF2m_pt_mul_mont()
197 mp_int x1, x2, z1, z2; in ec_GF2m_pt_mul_mont()
H A Decp_521.c59 ec_GFp_nistp521_mod(const mp_int *a, mp_int *r, const GFMethod *meth) in ec_GFp_nistp521_mod()
66 mp_int m1; in ec_GFp_nistp521_mod()
116 ec_GFp_nistp521_sqr(const mp_int *a, mp_int *r, const GFMethod *meth) in ec_GFp_nistp521_sqr()
130 ec_GFp_nistp521_mul(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_nistp521_mul()
144 ec_GFp_nistp521_div(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_nistp521_div()
148 mp_int t; in ec_GFp_nistp521_div()
H A Decl.c99 ECGroup_consGFp(const mp_int *irr, const mp_int *curvea, in ECGroup_consGFp()
100 const mp_int *curveb, const mp_int *genx, in ECGroup_consGFp()
101 const mp_int *geny, const mp_int *order, int cofactor) in ECGroup_consGFp()
140 ECGroup_consGFp_mont(const mp_int *irr, const mp_int *curvea, in ECGroup_consGFp_mont()
141 const mp_int *curveb, const mp_int *genx, in ECGroup_consGFp_mont()
142 const mp_int *geny, const mp_int *order, int cofactor) in ECGroup_consGFp_mont()
184 ECGroup_consGF2m(const mp_int *irr, const unsigned int irr_arr[5], in ECGroup_consGF2m()
185 const mp_int *curvea, const mp_int *curveb, in ECGroup_consGF2m()
186 const mp_int *genx, const mp_int *geny, in ECGroup_consGF2m()
187 const mp_int *order, int cofactor) in ECGroup_consGF2m()
[all …]
H A Decp_192.c59 ec_GFp_nistp192_mod(const mp_int *a, mp_int *r, const GFMethod *meth) in ec_GFp_nistp192_mod()
305 ec_GFp_nistp192_add(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_nistp192_add()
390 ec_GFp_nistp192_sub(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_nistp192_sub()
473 ec_GFp_nistp192_sqr(const mp_int *a, mp_int *r, const GFMethod *meth) in ec_GFp_nistp192_sqr()
487 ec_GFp_nistp192_mul(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_nistp192_mul()
501 ec_GFp_nistp192_div(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_nistp192_div()
505 mp_int t; in ec_GFp_nistp192_div()
H A Decp_224.c59 ec_GFp_nistp224_mod(const mp_int *a, mp_int *r, const GFMethod *meth) in ec_GFp_nistp224_mod()
327 ec_GFp_nistp224_sqr(const mp_int *a, mp_int *r, const GFMethod *meth) in ec_GFp_nistp224_sqr()
341 ec_GFp_nistp224_mul(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_nistp224_mul()
355 ec_GFp_nistp224_div(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_nistp224_div()
359 mp_int t; in ec_GFp_nistp224_div()
H A Decp_384.c57 ec_GFp_nistp384_mod(const mp_int *a, mp_int *r, const GFMethod *meth) in ec_GFp_nistp384_mod()
64 mp_int m[10]; in ec_GFp_nistp384_mod()
265 ec_GFp_nistp384_sqr(const mp_int *a, mp_int *r, const GFMethod *meth) in ec_GFp_nistp384_sqr()
279 ec_GFp_nistp384_mul(const mp_int *a, const mp_int *b, mp_int *r, in ec_GFp_nistp384_mul()
/illumos-gate/usr/src/common/mpi/
H A Dmpi.h245 } mp_int; typedef
252 mp_err mp_init(mp_int *mp, int kmflag);
253 mp_err mp_init_size(mp_int *mp, mp_size prec, int kmflag);
254 mp_err mp_init_copy(mp_int *mp, const mp_int *from);
255 mp_err mp_copy(const mp_int *from, mp_int *to);
256 void mp_exch(mp_int *mp1, mp_int *mp2);
257 void mp_clear(mp_int *mp);
258 void mp_zero(mp_int *mp);
259 void mp_set(mp_int *mp, mp_digit d);
260 mp_err mp_set_int(mp_int *mp, long z);
[all …]
H A Dmpi-priv.h187 mp_err s_mp_grow(mp_int *mp, mp_size min); /* increase allocated size */
188 mp_err s_mp_pad(mp_int *mp, mp_size min); /* left pad with zeroes */
191 void s_mp_clamp(mp_int *mp); /* clip leading zeroes */
200 void s_mp_exch(mp_int *a, mp_int *b); /* swap a and b in place */
202 mp_err s_mp_lshd(mp_int *mp, mp_size p); /* left-shift by p digits */
203 void s_mp_rshd(mp_int *mp, mp_size p); /* right-shift by p digits */
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 */
207 void s_mp_div_2(mp_int *mp); /* divide by 2 in place */
[all …]
H A Dmplogic.h69 mp_err mpl_not(mp_int *a, mp_int *b); /* one's complement */
70 mp_err mpl_and(mp_int *a, mp_int *b, mp_int *c); /* bitwise AND */
71 mp_err mpl_or(mp_int *a, mp_int *b, mp_int *c); /* bitwise OR */
72 mp_err mpl_xor(mp_int *a, mp_int *b, mp_int *c); /* bitwise XOR */
76 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 */
81 mp_err mpl_num_set(mp_int *a, int *num); /* count set bits */
82 mp_err mpl_num_clear(mp_int *a, int *num); /* count clear bits */
83 mp_err mpl_parity(mp_int *a); /* determine parity */
87 mp_err mpl_set_bit(mp_int *a, mp_size bitNum, mp_size value);
[all …]
H A Dmp_gf2m.h51 mp_err mp_badd(const mp_int *a, const mp_int *b, mp_int *c);
52 mp_err mp_bmul(const mp_int *a, const mp_int *b, mp_int *c);
59 mp_err mp_bmod(const mp_int *a, const unsigned int p[], mp_int *r);
60 mp_err mp_bmulmod(const mp_int *a, const mp_int *b, const unsigned int p[],
61 mp_int *r);
62 mp_err mp_bsqrmod(const mp_int *a, const unsigned int p[], mp_int *r);
63 mp_err mp_bdivmod(const mp_int *y, const mp_int *x, const mp_int *pp,
64 const unsigned int p[], mp_int *r);
66 int mp_bpoly2arr(const mp_int *a, unsigned int p[], int max);
67 mp_err mp_barr2poly(const unsigned int p[], mp_int *a);
H A Dmpprime.h58 mp_err mpp_divis(mp_int *a, mp_int *b);
59 mp_err mpp_divis_d(mp_int *a, mp_digit d);
62 mp_err mpp_random(mp_int *a);
63 mp_err mpp_random_size(mp_int *a, mp_size prec);
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);
70 mp_err mpp_pprime(mp_int *a, int nt);
71 mp_err mpp_sieve(mp_int *trial, const mp_digit *primes, mp_size nPrimes,
[all …]
H A Dmpi.c132 mp_err mp_init(mp_int *mp, int kmflag) in mp_init()
150 mp_err mp_init_size(mp_int *mp, mp_size prec, int kmflag) in mp_init_size()
179 mp_err mp_init_copy(mp_int *mp, const mp_int *from) in mp_init_copy()
211 mp_err mp_copy(const mp_int *from, mp_int *to) in mp_copy()
272 void mp_exch(mp_int *mp1, mp_int *mp2) in mp_exch()
297 void mp_clear(mp_int *mp) in mp_clear()
325 void mp_zero(mp_int *mp) in mp_zero()
340 void mp_set(mp_int *mp, mp_digit d) in mp_set()
354 mp_err mp_set_int(mp_int *mp, long z) in mp_set_int()
389 mp_err mp_set_ulong(mp_int *mp, unsigned long z) in mp_set_ulong()
[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()
124 mp_err mpl_set_bit(mp_int *a, mp_size bitNum, mp_size value) in mpl_set_bit()
154 mp_err mpl_get_bit(const mp_int *a, mp_size bitNum) in mpl_get_bit()
179 mp_err mpl_get_bits(const mp_int *a, mp_size lsbNum, mp_size numBits) in mpl_get_bits()
203 mp_err mpl_significant_bits(const mp_int *a) in mpl_significant_bits()
H A Dmp_gf2m.c208 mp_badd(const mp_int *a, const mp_int *b, mp_int *c) in mp_badd()
286 mp_bmul(const mp_int *a, const mp_int *b, mp_int *c) in mp_bmul()
289 mp_int tmp; in mp_bmul()
308 const mp_int *xch = b; /* switch a and b if b longer */ in mp_bmul()
351 mp_bmod(const mp_int *a, const unsigned int p[], mp_int *r) in mp_bmod()
433 mp_bmulmod(const mp_int *a, const mp_int *b, const unsigned int p[], mp_int *r) in mp_bmulmod()
448 mp_bsqrmod(const mp_int *a, const unsigned int p[], mp_int *r) in mp_bsqrmod()
451 mp_int tmp; in mp_bsqrmod()
493 mp_bdivmod(const mp_int *y, const mp_int *x, const mp_int *pp, in mp_bdivmod()
494 const unsigned int p[], mp_int *r) in mp_bdivmod()
[all …]

12