~mdw
/
catacomb
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
progs/..., symm/...: Fix 32-bit right-shift idiom.
[catacomb]
/
symm
/
sha3.c
diff --git
a/symm/sha3.c
b/symm/sha3.c
index
97a3f7a
..
1696762
100644
(file)
--- a/
symm/sha3.c
+++ b/
symm/sha3.c
@@
-231,7
+231,7
@@
static void leftenc_sz(shake_ctx *ctx, size_t n)
octet b[9];
unsigned i;
octet b[9];
unsigned i;
- SET64(t, ((n&~MASK32) >> 16) >> 16, n&MASK32);
+ SET64(t, ((n&~
(size_t)
MASK32) >> 16) >> 16, n&MASK32);
STORE64_B_(b + 1, t);
for (i = 1; i < 8 && !b[i]; i++);
i--; b[i] = 8 - i;
STORE64_B_(b + 1, t);
for (i = 1; i < 8 && !b[i]; i++);
i--; b[i] = 8 - i;
@@
-244,7
+244,7
@@
static void rightenc_sz(shake_ctx *ctx, size_t n)
octet b[9];
unsigned i;
octet b[9];
unsigned i;
- SET64(t, ((n&~MASK32) >> 16) >> 16, n&MASK32);
+ SET64(t, ((n&~
(size_t)
MASK32) >> 16) >> 16, n&MASK32);
STORE64_B_(b, t);
for (i = 0; i < 7 && !b[i]; i++);
b[8] = 8 - i;
STORE64_B_(b, t);
for (i = 0; i < 7 && !b[i]; i++);
b[8] = 8 - i;