Skip to content

fix(pedersen): reject additive-inverse generators in commitment factory - #269

Open
cyzcz wants to merge 1 commit into
tari-project:mainfrom
cyzcz:fix/pedersen-reject-inverse-generators
Open

cyzcz wants to merge 1 commit into
tari-project:mainfrom
cyzcz:fix/pedersen-reject-inverse-generators

Conversation

@cyzcz

@cyzcz cyzcz commented Dec 4, 2026

Copy link
Copy Markdown

Summary

  • Reject G == -H in PedersenCommitmentFactory::new (src/ristretto/pedersen/commitment_factory.rs):
    • PR fix!: security audit remediation (M1, M2, L1-L15) #263 (security audit remediation L14) updated PedersenCommitmentFactory::new(G, H) to return Err(CommitmentError::InvalidGenerators) when G == H or either point is the identity, preventing trivial discrete-log relations that break commitment binding.
    • However, G == -H (i.e. (G + H).is_identity()) was still accepted: in prime-order Ristretto255, H = -G is non-identity and distinct from G, yet has the known discrete-log relation log_G(H) = -1, collapsing k*G + v*(-G) = (k - v)*G so any commitment (k, v) validly opens to every arbitrary value v' under blinding k' = k - v + v' (and commit(&v, &v) degenerates to the identity point for non-zero v).
    • Rejects G == -H with CommitmentError::InvalidGenerators alongside G == H and identity points.

Verification

  • Regression unit test 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-features
  • cargo clippy --locked --all-targets --all-features -- -D warnings
  • cargo +nightly fmt --all -- --check & ./scripts/file_license_check.sh

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.
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.

1 participant