potatosalad / erlang-libdecaf

ed448goldilocks (libdecaf) NIF with timeslice reductions for Erlang and Elixir.
MIT License
29 stars 16 forks source link

Add legacy Keccak support (#12) #15

Closed ukazap closed 2 years ago

ukazap commented 2 years ago

Resolves #12.

This commit adds the following legacy Keccak (pre-standardization) algorithms to libdecaf_sha3:hash/2:

by changing the pad from 0x06 to 0x01.

The added algorithms are verified against their corresponding test vectors from https://keccak.team/obsolete/KeccakKAT-3.zip.

potatosalad commented 2 years ago

@ukazap Thanks! This looks awesome!

potatosalad commented 2 years ago

@ukazap Oh, I made a slight modification to your changes: I moved all of the legacy KECCAK-related functions to the libdecaf_keccak_sha3 module so there's less confusion over which algorithms are officially supported by NIST's SHA-3 versus legacy variations.

ukazap commented 2 years ago

@potatosalad Looks good. Thanks!