Lines Matching defs:meth
58 GFMethod *meth = NULL;
61 meth = GFMethod_consGFp(irr);
62 if (meth == NULL)
76 meth->field_mul = &ec_GFp_mul_mont;
77 meth->field_sqr = &ec_GFp_sqr_mont;
78 meth->field_div = &ec_GFp_div_mont;
79 meth->field_enc = &ec_GFp_enc_mont;
80 meth->field_dec = &ec_GFp_dec_mont;
81 meth->extra1 = mmm;
82 meth->extra2 = NULL;
83 meth->extra_free = &ec_GFp_extra_free_mont;
85 mmm->N = meth->irr;
86 i = mpl_significant_bits(&meth->irr);
89 mmm->n0prime = 0 - s_mp_invmod_radix(MP_DIGIT(&meth->irr, 0));
93 GFMethod_free(meth);
96 return meth;
104 const GFMethod *meth)
113 MP_CHECKOK(s_mp_redc(r, (mp_mont_modulus *) meth->extra1));
122 (a, b, &s, (mp_mont_modulus *) meth->extra1));
126 return s_mp_mul_mont(a, b, r, (mp_mont_modulus *) meth->extra1);
135 ec_GFp_sqr_mont(const mp_int *a, mp_int *r, const GFMethod *meth)
137 return ec_GFp_mul_mont(a, a, r, meth);
143 const GFMethod *meth)
151 MP_CHECKOK(ec_GFp_div(a, b, r, meth));
152 MP_CHECKOK(ec_GFp_enc_mont(r, r, meth));
154 MP_CHECKOK(ec_GFp_enc_mont(r, r, meth));
163 ec_GFp_enc_mont(const mp_int *a, mp_int *r, const GFMethod *meth)
168 mmm = (mp_mont_modulus *) meth->extra1;
177 ec_GFp_dec_mont(const mp_int *a, mp_int *r, const GFMethod *meth)
184 MP_CHECKOK(s_mp_redc(r, (mp_mont_modulus *) meth->extra1));
192 ec_GFp_extra_free_mont(GFMethod *meth)
194 if (meth->extra1 != NULL) {
196 kmem_free(meth->extra1, sizeof(mp_mont_modulus));
198 free(meth->extra1);
200 meth->extra1 = NULL;