Last active
April 24, 2018 12:36
-
-
Save KamilLelonek/374f6adf05db3a6b16d695214ea1f963 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
defp iterate(_mnemonic, round_number, _previous_block, result) | |
when round_number > @rounds_count, | |
do: result | |
defp iterate(mnemonic, round_number, previous_block, result) do | |
with next_block = :crypto.hmac(:sha512, mnemonic, previous_block), | |
do: iterate(mnemonic, round_number + 1, next_block, :crypto.exor(next_block, result)) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment