aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMITSUNARI Shigeo <herumi@nifty.com>2016-09-27 15:24:22 +0800
committerMITSUNARI Shigeo <herumi@nifty.com>2016-09-27 15:24:22 +0800
commit79e5899f2afdc33c32b2c012c09d088bac8de01e (patch)
tree6e81fdfb06756e5b8ac4970d87273346d7677f23 /include
parent930fab73fc7a235b4e6369b3bbb5e3a533595115 (diff)
downloadtangerine-mcl-79e5899f2afdc33c32b2c012c09d088bac8de01e.tar.gz
tangerine-mcl-79e5899f2afdc33c32b2c012c09d088bac8de01e.tar.zst
tangerine-mcl-79e5899f2afdc33c32b2c012c09d088bac8de01e.zip
same prototype of montRedPU and fpDbl_modP
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;