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

Make the commitments generic over the hash function and remove deprecated hashing traits #129

Merged
merged 8 commits into from
Sep 9, 2021

Conversation

elichai
Copy link
Contributor

@elichai elichai commented Aug 8, 2021

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:

  • merkle trees (we use a library that only supports Sha3, should probably just implement this ourselves).
  • Creating a second generator point (doesn't make sense to make this generic somehow)

@survived survived force-pushed the try-and-increment branch 3 times, most recently from 11c8420 to d973d16 Compare August 26, 2021 13:08
Base automatically changed from try-and-increment to master August 27, 2021 15:36
@elichai elichai marked this pull request as ready for review August 31, 2021 15:00
@@ -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");
Copy link
Contributor

@survived survived Sep 1, 2021

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.

Copy link
Contributor Author

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

@survived survived merged commit 1569c91 into master Sep 9, 2021
@elichai elichai deleted the refactor-hashing branch September 9, 2021 08:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants