-
Notifications
You must be signed in to change notification settings - Fork 111
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
Make the commitments generic over the hash function and remove deprecated hashing traits #129
Conversation
src/cryptographic_primitives/proofs/sigma_correct_homomorphic_elgamal_enc.rs
Outdated
Show resolved
Hide resolved
src/cryptographic_primitives/proofs/sigma_correct_homomorphic_elgamal_enc.rs
Outdated
Show resolved
Hide resolved
11c8420
to
d973d16
Compare
faeb7da
to
3289218
Compare
3289218
to
22507ef
Compare
@@ -209,9 +207,9 @@ mod tests { | |||
|
|||
let statement = LdeiStatement::new(&witness, alpha, g, d).unwrap(); | |||
|
|||
let proof = LdeiProof::prove::<Sha256>(&witness, &statement).expect("failed to prove"); | |||
let proof = LdeiProof::prove::<H>(&witness, &statement).expect("failed to prove"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we make LdeiProof generic over choice of hash, instead of making its functions generic over H
? Ie. I'm suggesting to replace LdeiProof::prove::<H>(..)
with LdeiProof::<H>::prove(..)
. Just to match syntax that all other proofs have.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm yeah, I guess it also makes sense because the proof is correct only over a specific hash function
As was specified in: #128 (comment)
This will allow the user to choose their own hash function when using our hash and related commitments,
it also removes deprecated hashing traits that are no longer in use.
I added a macro to run all the related tests over multiple hash functions (right now: sha256, sha512, sha3_256, sha3_512, blake2b, blake2s)
This is based on #128 so for now I made try-and-increment the base branch but will change that if and when #128 will get merged.
Things that still use explicit hash funciton: