Repository navigation
Conversation
PedersenCommitmentFactory::new previously rejected G == H and identity generators, but accepted G == -H (i.e. (G + H).is_identity()). In prime-order Ristretto255, H = -G is distinct from G and non-identity, yet carries the trivial discrete-log relation log_G(H) = -1, collapsing commitments k*G + v*(-G) = (k - v)*G so every commitment opens to any arbitrary value v' under blinding k' = k - v + v'. Reject G == -H with CommitmentError::InvalidGenerators alongside G == H and identity points, and cover additive-inverse generator pairs in tests.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
G == -HinPedersenCommitmentFactory::new(src/ristretto/pedersen/commitment_factory.rs):PedersenCommitmentFactory::new(G, H)to returnErr(CommitmentError::InvalidGenerators)whenG == Hor either point is the identity, preventing trivial discrete-log relations that break commitment binding.G == -H(i.e.(G + H).is_identity()) was still accepted: in prime-order Ristretto255,H = -Gis non-identity and distinct fromG, yet has the known discrete-log relationlog_G(H) = -1, collapsingk*G + v*(-G) = (k - v)*Gso any commitment(k, v)validly opens to every arbitrary valuev'under blindingk' = k - v + v'(andcommit(&v, &v)degenerates to the identity point for non-zerov).G == -HwithCommitmentError::InvalidGeneratorsalongsideG == Hand identity points.Verification
ristretto::pedersen::commitment_factory::test::degenerate_generators_are_rejected(failed before fix on(g, -g), passes for(g, -g),(-g, g),(h, -h),(-h, h))cargo test --locked --all-features&cargo test --locked --release --all-featurescargo clippy --locked --all-targets --all-features -- -D warningscargo +nightly fmt --all -- --check&./scripts/file_license_check.sh