Lines Matching defs:meth
67 GFMethod *meth = NULL;
70 meth = GFMethod_consGFp(irr);
71 if (meth == NULL)
85 meth->field_mul = &ec_GFp_mul_mont;
86 meth->field_sqr = &ec_GFp_sqr_mont;
87 meth->field_div = &ec_GFp_div_mont;
88 meth->field_enc = &ec_GFp_enc_mont;
89 meth->field_dec = &ec_GFp_dec_mont;
90 meth->extra1 = mmm;
91 meth->extra2 = NULL;
92 meth->extra_free = &ec_GFp_extra_free_mont;
94 mmm->N = meth->irr;
95 i = mpl_significant_bits(&meth->irr);
98 mmm->n0prime = 0 - s_mp_invmod_radix(MP_DIGIT(&meth->irr, 0));
102 GFMethod_free(meth);
105 return meth;
113 const GFMethod *meth)
122 MP_CHECKOK(s_mp_redc(r, (mp_mont_modulus *) meth->extra1));
131 (a, b, &s, (mp_mont_modulus *) meth->extra1));
135 return s_mp_mul_mont(a, b, r, (mp_mont_modulus *) meth->extra1);
144 ec_GFp_sqr_mont(const mp_int *a, mp_int *r, const GFMethod *meth)
146 return ec_GFp_mul_mont(a, a, r, meth);
152 const GFMethod *meth)
160 MP_CHECKOK(ec_GFp_div(a, b, r, meth));
161 MP_CHECKOK(ec_GFp_enc_mont(r, r, meth));
163 MP_CHECKOK(ec_GFp_enc_mont(r, r, meth));
172 ec_GFp_enc_mont(const mp_int *a, mp_int *r, const GFMethod *meth)
177 mmm = (mp_mont_modulus *) meth->extra1;
186 ec_GFp_dec_mont(const mp_int *a, mp_int *r, const GFMethod *meth)
193 MP_CHECKOK(s_mp_redc(r, (mp_mont_modulus *) meth->extra1));
201 ec_GFp_extra_free_mont(GFMethod *meth)
203 if (meth->extra1 != NULL) {
205 kmem_free(meth->extra1, sizeof(mp_mont_modulus));
207 free(meth->extra1);
209 meth->extra1 = NULL;