summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjonsykkel <jonrevold@gmail.com>2021-09-08 07:38:01 +0200
committerjonsykkel <jonrevold@gmail.com>2021-09-08 07:39:15 +0200
commit61d9e9ad4a4e80d2a43592b492e64f3b0562bb21 (patch)
treef42d58910cf0c7b27bf62abbcd1ad7374fb3c7db
parent1ab57126228e5985b0ac05efa93d5c086b517b4e (diff)
downloadokeffa-61d9e9ad4a4e80d2a43592b492e64f3b0562bb21.tar.gz
renam
-rw-r--r--src/fz_arith.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/fz_arith.c b/src/fz_arith.c
index 5666941..8863ee2 100644
--- a/src/fz_arith.c
+++ b/src/fz_arith.c
@@ -4,11 +4,11 @@
wbool_t fz_add(word_t *a,word_t *b,word_t *o,size_t len){
wbool_t c = 0;
for(size_t x = 0;x < len;x++){
- word_t wa = a[x];
- word_t wb = b[x];
- word_t ws = wa+wb+c;
- o[x] = ws;
- c = w_carry(wa,wb,ws);
+ word_t ax = a[x];
+ word_t bx = b[x];
+ word_t ox = ax+bx+c;
+ o[x] = ox;
+ c = w_carry(ax,bx,ox);
}
return c;
}
@@ -16,11 +16,11 @@ wbool_t fz_add(word_t *a,word_t *b,word_t *o,size_t len){
wbool_t fz_sub(word_t *a,word_t *b,word_t *o,size_t len){
wbool_t c = 0;
for(size_t x = 0;x < len;x++){
- word_t wa = a[x];
- word_t wb = b[x];
- word_t wd = wa-wb-c;
- o[x] = wd;
- c = w_borrow(wa,wb,wd);
+ word_t ax = a[x];
+ word_t bx = b[x];
+ word_t ox = ax-bx-c;
+ o[x] = ox;
+ c = w_borrow(ax,bx,ox);
}
return c;
}
@@ -29,11 +29,11 @@ wbool_t fz_add_gated(word_t *a,word_t *b,word_t *o,size_t len,wbool_t gate){
wbool_t c = 0;
word_t mask = 0-(word_t)gate;
for(size_t x = 0;x < len;x++){
- word_t wa = a[x];
- word_t wb = b[x] & mask;
- word_t ws = wa+wb+c;
- o[x] = ws;
- c = w_carry(wa,wb,ws);
+ word_t ax = a[x];
+ word_t bx = b[x] & mask;
+ word_t ox = ax+bx+c;
+ o[x] = ox;
+ c = w_carry(ax,bx,ox);
}
return c;
}