Skip to content

Segmentation fault when computing 512bit SHA3 hash #18

wereHamster opened this Issue Jan 17, 2014 · 1 comment

2 participants


I have roughly the following code:

return $ BS8.unpack $ BS16.encode $ SHA3.hashlazy 512 contents

And it consistently throws a Segmentation fault exception. The stacktrace indicates that it happens in sha3_finalize:

Program received signal SIGSEGV, Segmentation fault.
0x00007ffff68e57cd in memset () from /usr/lib/
(gdb) bt
#0  0x00007ffff68e57cd in memset () from /usr/lib/
#1  0x0000000000866af9 in sha3_finalize ()
#2  0x000000000085fc36 in s6PC_info ()
#3  0x0000000000000000 in ?? ()

The content was 141679296 bytes long, which is divisible by 8.

@vincenthz vincenthz added a commit that closed this issue Jan 19, 2014
@vincenthz Fix segfault in SHA3 when having message sized aligned with the buffe…
…r size.

When the buffer is full, we need to process it before appending the padding.

fix #18
@vincenthz vincenthz closed this in a69b8c8 Jan 19, 2014

Thanks, it's now fixed in 0.11.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.