Posted 05 February 2016 - 01:34 AM
This is an implementation of the BLAKE-256 hashing algorithm in ComputerCraft, a SHA-3 finalist.
Following my ChaCha20 implementation, I'm also bringing a new hashing algorithm to CC.
It's core structure is somewhat similar to ChaCha20, which makes it very fast (in CC terms), up to 6x the speed of SHA-2 with small inputs.
It's usage is pretty simple, one function digest which takes two arguments, data and salt.
The "data" argument is your usual input, whether it's file contents, passwords, signatures, etc.
The "salt" argument is a built in salt mechanism, such as in password salting and cannot be more than 16 chars/bytes.
The output is a bytetable, which I defined here.
tl;dr, use :toHex() on the output to get the typical hexadecimal encoding.
Download:
pastebin get XRy3LMBG blake
Following my ChaCha20 implementation, I'm also bringing a new hashing algorithm to CC.
It's core structure is somewhat similar to ChaCha20, which makes it very fast (in CC terms), up to 6x the speed of SHA-2 with small inputs.
It's usage is pretty simple, one function digest which takes two arguments, data and salt.
The "data" argument is your usual input, whether it's file contents, passwords, signatures, etc.
The "salt" argument is a built in salt mechanism, such as in password salting and cannot be more than 16 chars/bytes.
The output is a bytetable, which I defined here.
tl;dr, use :toHex() on the output to get the typical hexadecimal encoding.
Download:
pastebin get XRy3LMBG blake
Edited on 30 April 2016 - 04:23 AM