summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2021-09-09 11:53:43 +0200
committerjonsykkel <jonrevold@gmail.com>2021-09-09 11:53:43 +0200
commit977e8c8bc60bcc90bb25f0b010adf3c25664f8fa (patch)
treeaa6cd04eefeea7ee1445fb226423f4f5c02a5ddc
parent91eaaeaaf9824c79a5dc3b823afcd152e48cd916 (diff)
downloadokeffa-977e8c8bc60bcc90bb25f0b010adf3c25664f8fa.tar.gz
a
-rw-r--r--src/fz_mul.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/fz_mul.c b/src/fz_mul.c
index 9d8b824..b9d6c09 100644
--- a/src/fz_mul.c
+++ b/src/fz_mul.c
@@ -6,8 +6,8 @@
#include <okeffa/w_op.h>
void fz_mul_egypt(word_t *a,word_t *b,word_t *o_lo,word_t *o_hi,size_t len){
- size_t len2 = len*2;
- size_t bitness = fz_bitness(len);
+ size_t len2 = len*2;
+ size_t bitness_m1 = fz_bitness(len)-1;
word_t xy[len2];
word_t xs[len2];
word_t ys[len];
@@ -16,7 +16,7 @@ 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-1;x++){
+ for(size_t x = 0;x < bitness_m1;x++){
fz_add_gated(xy,xs,xy,len2,fz_odd(ys));
fz_shl(xs,xs,len2,1);
fz_shr(ys,ys,len,1);