summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2021-09-09 11:51:28 +0200
committerjonsykkel <jonrevold@gmail.com>2021-09-09 11:51:28 +0200
commit86e6290a60e37f16ebbf5d0840e6e2059b4898a2 (patch)
treecc301035d4c50071555ac8f7e3fe3d98319de027
parent6e5d88cb8bdc85183c206a8c128b4a5c8577904c (diff)
downloadokeffa-86e6290a60e37f16ebbf5d0840e6e2059b4898a2.tar.gz
mul optimiz
-rw-r--r--src/fz_mul.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/fz_mul.c b/src/fz_mul.c
index deaa645..9d8b824 100644
--- a/src/fz_mul.c
+++ b/src/fz_mul.c
@@ -16,11 +16,12 @@ 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);
fz_copy(b,ys,len);
- for(size_t x = 0;x < bitness;x++){
+ for(size_t x = 0;x < bitness-1;x++){
fz_add_gated(xy,xs,xy,len2,fz_odd(ys));
fz_shl(xs,xs,len2,1);
fz_shr(ys,ys,len,1);
}
+ fz_add_gated(xy,xs,xy,len2,fz_odd(ys));
fz_copy(xy, o_lo,len);
fz_copy(xy+len,o_hi,len);
}