RustCrypto / hashes

Collection of cryptographic hash functions written in pure Rust
1.81k stars 245 forks source link

Add TurboSHAKE #458

Closed aewag closed 1 year ago

aewag commented 1 year ago

This adds TurboSHAKE128 and TurboSHAKE256 to the sha3 crate. It is based on the specification document and the IETF draft.

I changed the Sha3State to be based by default on a KeccakF1600 permutation. But the round_count can be overwritten using new() to base the Sha3State on KeccakP1600. To reflect this change, I renamed the function apply_f to permute.

tarcieri commented 1 year ago

@aewag nice! Do you plan to use this in the k12 PR?

aewag commented 1 year ago

@aewag nice! Do you plan to use this in the k12 PR?

Yes, that's planned, and I hope I'll find the time to finish the k12PR soon.

aewag commented 1 year ago

@tarcieri I added the test vectors as .bbl files and updated the tests. With this the PR is ready for review. :)