debris / tiny-keccak

An implementation of Keccak derived functions specified in FIPS-202, SP800-185 and KangarooTwelve
Creative Commons Zero v1.0 Universal
194 stars 50 forks source link

towards support for `digest::Digest` #51

Closed ryankurte closed 1 year ago

ryankurte commented 2 years ago

hey there, thanks for making a neat crate! i'm attempting to use this with some cryptographic crates that require hashers implement the digest::Digest trait.

this PR refactors the Sha3 and Keccak types to use generics and adds digest::FixedOutput, digest::Reset and Default implementations for compatibility with the digest::Digest trait, if that's something you would be interested in?

this is a breaking change as objects are now typed based on their output width.

note that this targets digest@0.9.0 as the wider ecosystem has not yet updated to 0.10.0