aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/mcl/fp.hpp5
-rw-r--r--include/mcl/op.hpp11
2 files changed, 6 insertions, 10 deletions
diff --git a/include/mcl/fp.hpp b/include/mcl/fp.hpp
index ec2652b..fc1389e 100644
--- a/include/mcl/fp.hpp
+++ b/include/mcl/fp.hpp
@@ -468,9 +468,6 @@ public:
static inline IoMode getIoMode() { return ioMode_; }
static inline const char* getIoSeparator() { return fp::getIoSeparator(ioMode_); }
private:
- /*
- wrapper function for generic p
- */
// y[N] <- x[N * 2] % p[N]
static inline void fpDbl_modW(Unit *y, const Unit *x)
{
@@ -479,7 +476,7 @@ private:
// z[N] <- montRed(xy[N * 2])
static inline void fp_montRedW(Unit *z, const Unit *xy)
{
- op_.montRedPU(z, xy, op_.p, op_.rp);
+ op_.montRedPU(z, xy, op_.p);
}
static inline void fp_mul_UnitW(Unit *z, const Unit *x, Unit y)
{
diff --git a/include/mcl/op.hpp b/include/mcl/op.hpp
index fde9a82..0d8d521 100644
--- a/include/mcl/op.hpp
+++ b/include/mcl/op.hpp
@@ -63,7 +63,7 @@ enum PrimeMode {
struct Op {
/*
don't change the layout of rp and p
- asm code assumes &rp == &op and p == (Unit*)&op + 1
+ asm code assumes &rp + 1 == p
*/
Unit rp;
Unit p[maxOpUnitSize];
@@ -110,15 +110,14 @@ struct Op {
void3u fp_subNC; // assume x > y
// for Montgomery
int2u fp_preInv;
- // these two members are for mcl_fp_mont
+
+ void3u fpDbl_modP;
// z = montRed(xy)
- void (*montRedPU)(Unit *z, const Unit *xy, const Unit *p, Unit rp);
+ void3u montRedPU;
// 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
void2uOp fp_invOp;
- void3u fpDbl_modP;
/*
for FpDbl
@@ -184,10 +183,10 @@ struct Op {
fp_addNC = 0;
fp_subNC = 0;
fp_preInv = 0;
+ fpDbl_modP = 0;
montRedPU = 0;
montPU = 0;
fp_invOp = 0;
- fpDbl_modP = 0;
fpDbl_add = 0;
fpDbl_sub = 0;
fpDbl_addNC = 0;