Make a SHAKE256 hash

Looks like the SHAKE256 hashing algorithm is built into OTP.

I’ve tried to use it in elixir… but this command fails, along with any variant I have tried…

:crypto.hash(:shake256, '')
** (ErlangError) Erlang error: {:badarg, {'hash.c', 108}, 'Bad digest type'}:

  * 1st argument: Bad digest type

    (crypto 5.1.2) crypto.erl:2181: :crypto.hash(:shake256, "")
    iex:9: (file)

Any help would be appreciated so I can implement bip85 into bitcoinlib.

that’s in the main branch, which may not be released yet. (and OTP 25.3 doesn’t have it). looks like OTP-26 release candidates might have it?

2 Likes