|
|
|
@ -106,7 +106,7 @@ struct Op { |
|
|
|
|
Unit rp; |
|
|
|
|
// z = montRed(xy)
|
|
|
|
|
void (*montRedPU)(Unit *z, const Unit *xy, const Unit *p, Unit rp); |
|
|
|
|
// z = mont(x, y) = montRed(fp_mulPre(x, y))
|
|
|
|
|
// z = mont(x, y) = montRed(fpDbl_mulPre(x, y))
|
|
|
|
|
void (*montPU)(Unit *z, const Unit *x, const Unit *y, const Unit *p, Unit rp); |
|
|
|
|
|
|
|
|
|
// require p
|
|
|
|
@ -114,7 +114,7 @@ struct Op { |
|
|
|
|
void2uOp fp_invOp; |
|
|
|
|
void4u fp_addP; |
|
|
|
|
void4u fp_subP; |
|
|
|
|
void3u fp_modP; |
|
|
|
|
void3u fpDbl_modP; |
|
|
|
|
FpGenerator *fg; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -130,9 +130,9 @@ struct Op { |
|
|
|
|
/*
|
|
|
|
|
FpDbl <=> Fp |
|
|
|
|
*/ |
|
|
|
|
void2u fp_sqrPre; |
|
|
|
|
void3u fp_mulPre; |
|
|
|
|
void2u fp_mod; |
|
|
|
|
void2u fpDbl_sqrPre; |
|
|
|
|
void3u fpDbl_mulPre; |
|
|
|
|
void2u fpDbl_mod; |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
for Fp2 = F[u] / (u^2 + 1) |
|
|
|
@ -154,12 +154,12 @@ struct Op { |
|
|
|
|
, isFullBit(true), fp_addNC(0), fp_subNC(0) |
|
|
|
|
, isMont(false), fp_preInv(0) |
|
|
|
|
, rp(0), montRedPU(0), montPU(0) |
|
|
|
|
, fp_negP(0), fp_invOp(0), fp_addP(0), fp_subP(0), fp_modP(0) |
|
|
|
|
, fp_negP(0), fp_invOp(0), fp_addP(0), fp_subP(0), fpDbl_modP(0) |
|
|
|
|
, fg(createFpGenerator()) |
|
|
|
|
, fpDbl_add(0), fpDbl_sub() |
|
|
|
|
, fpDbl_addP(0), fpDbl_subP() |
|
|
|
|
, fpDbl_addNC(0), fpDbl_subNC() |
|
|
|
|
, fp_sqrPre(0), fp_mulPre(0), fp_mod(0) |
|
|
|
|
, fpDbl_sqrPre(0), fpDbl_mulPre(0), fpDbl_mod(0) |
|
|
|
|
, xi_c(0) |
|
|
|
|
, fp2_add(0), fp2_sub(0), fp2_mul(0), fp2_neg(0) |
|
|
|
|
, fp2_sqr(0), fp2_mul_xi(0) |
|
|
|
|