Skip to content

Commit

Permalink
Deterministic pedersen secret generation
Browse files Browse the repository at this point in the history
  • Loading branch information
davxy committed Jul 9, 2024
1 parent d466265 commit 737ca2c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/pedersen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,13 @@ impl<S: PedersenSuite> Prover<S> for Secret<S> {
output: Output<S>,
ad: impl AsRef<[u8]>,
) -> (Proof<S>, ScalarField<S>) {
// TODO: Build as rand if not test-vectors feature? Or is this enough
let cb = S::challenge(&[&input.0, &output.0], ad.as_ref());
let b = self.scalar * cb;

// Construct the nonces
let k = S::nonce(&self.scalar, input);
let kb = S::nonce(&k, input);
let b = S::nonce(&kb, input);
let kb = S::nonce(&b, input);

// Yb = x*G + b*B
let pk_blind = (S::Affine::generator() * self.scalar + S::BLINDING_BASE * b).into_affine();
Expand Down

0 comments on commit 737ca2c

Please sign in to comment.