summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2021-09-21 20:12:09 +0200
committerjonsykkel <jonrevold@gmail.com>2021-09-21 20:12:09 +0200
commit723cc7ee5e17729c056cf97d5014685527e44db1 (patch)
tree5ab2dcdf0a5e691f48342fbf4e982ff33eba2353
parentcf7b73415d1e65c918def52f02a1dd7d3f75fccc (diff)
downloadokeffa-723cc7ee5e17729c056cf97d5014685527e44db1.tar.gz
apeloye
-rw-r--r--src/fz_mul.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/fz_mul.c b/src/fz_mul.c
index 74d6906..9c53308 100644
--- a/src/fz_mul.c
+++ b/src/fz_mul.c
@@ -14,12 +14,14 @@ void fz_mul_egypt(word_t *a,word_t *b,word_t *o_lo,word_t *o_hi,size_t len){
fz_copy(a,xs,len);
fz_clear(xs+len,len);
for(size_t y = 0;y < len;y++){
- word_t w = b[y];
- size_t cut = len+y+1;
+ word_t w = b[y];
+ size_t cut = len+1;
+ word_t *xyc = xy+y;
+ word_t *xsc = xs+y;
for(size_t x = 0;x < WORD_BITNESS;x++){
- fz_add_gated(xy,xs,xy,cut,w_odd(w));
+ fz_add_gated(xyc,xsc,xyc,cut,w_odd(w));
w >>= 1;
- fz_shl(xs,xs,cut,1);
+ fz_shl(xsc,xsc,cut,1);
}
}
fz_copy(xy, o_lo,len);