summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2021-09-09 08:50:03 +0200
committerjonsykkel <jonrevold@gmail.com>2021-09-09 08:55:57 +0200
commitf4c8a4073495fe27473ab13fab1aa0a63773806e (patch)
treed4db8ef19940651c71eba91c5ce34f9f93198bad
parent9d906e1b2a94a32709283c1d5039a54d55ea37b2 (diff)
downloadokeffa-f4c8a4073495fe27473ab13fab1aa0a63773806e.tar.gz
bla
-rw-r--r--src/fz_mul.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/fz_mul.c b/src/fz_mul.c
index d0d6434..70d4c9c 100644
--- a/src/fz_mul.c
+++ b/src/fz_mul.c
@@ -11,9 +11,13 @@ void fz_mul_egypt(word_t *a,word_t *b,word_t *o_lo,word_t *o_hi,size_t len){
word_t xy[FZ_MAXLEN*2];
word_t xs[FZ_MAXLEN*2];
word_t ys[FZ_MAXLEN];
- size_t len2 = len*2;
+ size_t len2 = len*2;
size_t bitness = fz_bitness(len);
+ fz_clear(xy,len2);
+ fz_copy(a,xs,len);
+ fz_clear(xs+len,len);
+ fz_copy(b,ys,len);
for(size_t x = 0;x < bitness;x++){
fz_add_gated(xy,xs,xy,len2,fz_odd(ys));
fz_shl(xs,xs,len2,1);