Fix return from parallel versions of Keccak_Hash() function.

This commit is contained in:
Moinak Ghosh 2013-01-28 00:51:47 +05:30
parent 468044d816
commit a03e3ba41b

View file

@ -55,8 +55,7 @@ Keccak256_par(uchar_t *cksum_buf, uchar_t *buf, uint64_t bytes)
* If not then just do a simple serial hashing. * If not then just do a simple serial hashing.
*/ */
if (bytes / 2 <= KECCAK_BLOCK_SIZE * 2) { if (bytes / 2 <= KECCAK_BLOCK_SIZE * 2) {
Keccak_Hash(256, buf, bytes * 8, cksum_buf); return (Keccak_Hash(256, buf, bytes * 8, cksum_buf));
return;
} }
pos[0] = buf; pos[0] = buf;
len[0] = bytes/2; len[0] = bytes/2;
@ -93,8 +92,7 @@ Keccak512_par(uchar_t *cksum_buf, uchar_t *buf, uint64_t bytes)
* If not then just do a simple serial hashing. * If not then just do a simple serial hashing.
*/ */
if (bytes / 2 <= KECCAK_BLOCK_SIZE * 2) { if (bytes / 2 <= KECCAK_BLOCK_SIZE * 2) {
Keccak_Hash(512, buf, bytes * 8, cksum_buf); return (Keccak_Hash(512, buf, bytes * 8, cksum_buf));
return;
} }
pos[0] = buf; pos[0] = buf;
len[0] = bytes/2; len[0] = bytes/2;