-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add a Hash interface #98
Comments
Notes on the type constraint idea:
|
In a recent take we have the following in a parameter block:
This is workable, but I'd love to see an improvement. In the back of my head I've always thought it would be nice if Cryptol could accept type constraints at the parameter level, along with the current values and types (natural numbers). |
- Removes all the hardcoded SHA-256 components (including a hardcoded maximum message width) in ECDSA - Replaces with the `HashInterface` - Updates the instantiations to use SHA-256
Renaming now that we could implement ECDSA with other hash functions -- the instantiation name needs to specify which hash is being used!
Adds a `fin` constraint to the interface to support truly arbitrary message lengths in SHA3.
Re: the last task. I decided not to search for other use cases at this point. If they arise in our upcoming work we can use the existing hash interface or modify it as necessary. |
Many algorithms, like ECDSA, are generic over the hash function they use as long as it satisfies certain properties (e.g. appropriate-length hash output). However, right now there is no unifying interface for hash functions. We should write an interface so that other algorithms can be written generically.
Some useful things we'll want in it, from implementing ECDSA:
hashlen
(the length of the output)Hash
function itselfThere may be other useful things to put in the interface, too.
The text was updated successfully, but these errors were encountered: