Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: [experiment] Tagged SHA256 hashes #42

wants to merge 2 commits into
base: master


None yet
1 participant
Copy link

commented May 2, 2019

Introducing a new SHA256t hash type that works as a tagged hash. The idea of tagged hashes is to prevent collisions between hashes meant for different purposes. This type allows tagging these hashes using Rust's type system so that they are semantically different from each other and can't be confused.

It also enables seamless efficient calculation of these hashes.

The Tag::engine() method should return a HashEngine that is prefilled with data. Of course, it is supposed to have this data statically initialized instead of calculated on call.


  • the serde macro complains but I don't fully understand why:
the type parameter `T` is not constrained by the impl trait, self type, or predicates
  • probably an example and of course tests

stevenroose added some commits May 2, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.