-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: put
merlin
behind feature (#180)
# Rationale for this change See #161 for rationale. # What changes are included in this PR? NOTE: the individual commits may be good to review individually * `DoryMessages` accepts `impl Transcript` instead of `merlin::Transcript`. This is a breaking change, making the proofs non-backward compatible. The API deos not change. * Changed `CommitmentEvaluationProof` to accept `impl Transcript` rather than `merlin::Transcript`. * Replaced `merlin::Transcript` with `Keccak256Transcript` within `QueryProof`. Although the proof could be made generic, there is no real use-case for `merlin`. In the future, we can easily support other transcripts, but I think it is best to keep it concrete for now. * Dropped dead code and renamed the old `merlin` module. * Put `merlin` behind the `blitzar` feature flag since it is still required for the `blitzar::InnerProductProof`. * The tests are _NOT_ refactored to remove `merlin`. This can be done in a separate PR. # Are these changes tested? Yes. Existing tests cover the changes.
- Loading branch information
Showing
19 changed files
with
145 additions
and
435 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
crates/proof-of-sql/src/base/proof/merlin_transcript_core.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
impl super::transcript_core::TranscriptCore for merlin::Transcript { | ||
fn new() -> Self { | ||
merlin::Transcript::new(b"TranscriptCore::new") | ||
} | ||
fn raw_append(&mut self, message: &[u8]) { | ||
self.append_message(b"TranscriptCore::raw_append", message) | ||
} | ||
fn raw_challenge(&mut self) -> [u8; 32] { | ||
let mut result = [0u8; 32]; | ||
self.challenge_bytes(b"TranscriptCore::raw_challenge", &mut result); | ||
result | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
mod tests { | ||
use super::super::transcript_core::test_util::*; | ||
#[test] | ||
fn we_get_equivalent_challenges_with_equivalent_merlin_transcripts() { | ||
we_get_equivalent_challenges_with_equivalent_transcripts::<merlin::Transcript>() | ||
} | ||
#[test] | ||
fn we_get_different_challenges_with_different_keccak256_transcripts() { | ||
we_get_different_challenges_with_different_transcripts::<merlin::Transcript>() | ||
} | ||
#[test] | ||
fn we_get_different_nontrivial_consecutive_challenges_from_keccak256_transcript() { | ||
we_get_different_nontrivial_consecutive_challenges_from_transcript::<merlin::Transcript>() | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
215 changes: 0 additions & 215 deletions
215
crates/proof-of-sql/src/base/proof/transcript_protocol.rs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.