diff options
author | Mattias Andrée <maandree@operamail.com> | 2013-02-08 06:31:13 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2013-02-08 06:31:13 +0100 |
commit | 7ad82d0366a352055316c0e2de22dc9abdd292a4 (patch) | |
tree | 5c5b967487e8d9a157b5c29feee898cf302472ff /c/sha3.c | |
parent | m (diff) | |
download | sha3sum-7ad82d0366a352055316c0e2de22dc9abdd292a4.tar.gz sha3sum-7ad82d0366a352055316c0e2de22dc9abdd292a4.tar.bz2 sha3sum-7ad82d0366a352055316c0e2de22dc9abdd292a4.tar.xz |
corrected
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'c/sha3.c')
-rw-r--r-- | c/sha3.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -335,7 +335,7 @@ static byte* pad10star1(byte* msg, long len, long r, long* outlen) { byte* message; - long nrf = len >> 3; + long nrf = (len <<= 3) >> 3; long nbrf = len & 7; long ll = len % r; long i; @@ -382,7 +382,14 @@ extern void initialise(long bitrate, long capacity, long output) w = b / 25; l = lb(w); nr = 12 + (l << 1); - wmod = w == 64 ? -1LL ? (1LL << w) - 1LL; + if (w == 64) + wmod = -1; + else + { + wmod = 1; + wmod <<= w; + wmod--; + } S = (llong*)malloc(25 * sizeof(llong)); M = (byte*)malloc(mlen = (r * b) >> 2); mptr = 0; |