Skip to content

Conversation

@nougzarm
Copy link
Collaborator

@nougzarm nougzarm commented Jul 1, 2025

No description provided.

nougzarm added 17 commits July 1, 2025 08:46
…ar decoding failure

Reverted the `verifier_challenge` method to its previous implementation because the optimized version
failed to produce a valid scalar in some edge cases. The issue arose when attempting to convert
a reduced BigUint to a field scalar via its byte representation (`from_repr`), which panicked
when the representation was out of bounds or invalid for the underlying field.

This ensures compatibility and correctness when deriving challenges from squeezed bytes.
.collect();
let prover_state = (nonces.clone(), witness.clone());
let commitment = self.0.linear_map.evaluate(&nonces)?;
let prover_state = (nonces, witness.clone());
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Computing commitment before prover state saves cloning of the nonces vector

Ok(ProtocolCommitment::And(commitments))
}
Protocol::Or(ps) => {
Protocol::And(ps) | Protocol::Or(ps) => {
Copy link
Collaborator Author

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

src/errors.rs Outdated
/// 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.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error can occur in different contexts (always being due to a size problem)

pub struct LinearMap<G: Group> {
/// The set of linear combination constraints (equations).
pub constraints: Vec<LinearCombination<G>>,
// TODO: Update the usage of the word "morphism"
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The name "morphism" has been changed to "linear map"

/// - `simulate_transcript`
#[allow(clippy::type_complexity)]
pub trait SigmaProtocolSimulator: SigmaProtocol {
/// Simulates a protocol transcript given a challenge.
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This function does not take challenge as an argument

pedersen_commitment_dleq,
};

type Codec = ByteSchnorrCodec<G, KeccakDuplexSponge>;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Such an alias is already defined in the codec module

@mmaker mmaker merged commit dca59dd into sigma-rs:main Jul 4, 2025
5 of 6 checks passed
Chausseaumoine pushed a commit to Chausseaumoine/sigma-rs that referenced this pull request Jul 7, 2025
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