-
Notifications
You must be signed in to change notification settings - Fork 8
Code review and minor corrections #52
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
Merged
Merged
Changes from 19 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
ffdc495
fix(prover): optimize prover_commit() by removing unnecessary cloning
nougzarm 1252d87
chore(docs): fix and clarify documentation in the traits module
nougzarm fdddbfb
Clippy fix
nougzarm ad9ee3f
chore(docs): improve Error module documentation
nougzarm f56d9bb
chore(docs): improve lib module documentation
nougzarm 4fcb881
Cargo fmt
nougzarm 45fe06e
chore(composition): improve code quality and readability
nougzarm 32e7bdd
Minor
nougzarm 2e1338b
Unnecessary code removed
nougzarm 4a1448b
Unnecessary code removed 2
nougzarm ce5747b
chore(docs): complete documentation for the duplex_sponge module
nougzarm cf4551c
Improved ByteSchnorrCodec's verifier_challenge function
nougzarm 9e1e903
fix(codec): revert verifier_challenge to previous version due to scal…
nougzarm 00d57a9
Updated morphism to linear map naming
nougzarm fc1e088
fix warnings
nougzarm 46253ce
Minor
nougzarm d2ac64a
Fix Doctest
nougzarm 833081c
Changed "linear map" to "relation" where needed
nougzarm 22d4b2f
Simplified the test_vectors module code:
nougzarm 12a40b6
Merge branch 'main' into minor-update
mmaker File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
| @@ -1,24 +1,31 @@ | ||
| //! # Error: Error Types for Zero-Knowledge Proofs. | ||
| //! | ||
| //! This module defines the [`Error`] enum, which encapsulates possible errors that may occur | ||
| //! during the execution of Sigma protocols or their non-interactive variants. | ||
| //! This module defines the [`Error`] enum, which enumerates the possible failure modes | ||
| //! encountered during the execution of interactive or non-interactive Sigma protocols. | ||
| //! | ||
| //! These errors include: | ||
| //! - Verification failures (e.g., when a proof does not verify correctly). | ||
| //! - Mismatched parameters during batch verification. | ||
| //! - Uninitialized group variables. | ||
| //! - Failed proof verification, | ||
| //! - Mismatched parameter lengths (e.g., during batch verification), | ||
| //! - Access to unassigned group variables in constraint systems. | ||
| /// An error during proving or verification, such as a verification failure. | ||
| /// Represents an error encountered during the execution of a Sigma protocol. | ||
| /// | ||
| /// This may occur during proof generation, response computation, or verification. | ||
| #[non_exhaustive] | ||
| #[derive(Debug, thiserror::Error)] | ||
| pub enum Error { | ||
| /// Something is wrong with the proof, causing a verification failure. | ||
| /// The proof is invalid: verification failed. | ||
| #[error("Verification failed.")] | ||
| VerificationFailure, | ||
| /// Indicates a mismatch in parameter sizes during batch verification. | ||
| #[error("Mismatched parameter sizes for batch verification.")] | ||
|
|
||
| /// The sizes of input parameters (e.g., witnesses, commitments) do not match expected values. | ||
|
||
| #[error("Mismatched parameter sizes in proof or batch verification.")] | ||
| ProofSizeMismatch, | ||
|
|
||
| /// Uninitialized group element variable. | ||
| #[error("Uninitialized group element variable: {var_debug}")] | ||
| UnassignedGroupVar { var_debug: String }, | ||
| UnassignedGroupVar { | ||
| /// Debug representation of the unassigned variable. | ||
| var_debug: String, | ||
| }, | ||
| } | ||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
The calculation is done in the same way in the cases And and Or