Skip to content

Commit

Permalink
Fix typos
Browse files Browse the repository at this point in the history
Signed-off-by: lovesh <[email protected]>
  • Loading branch information
lovesh committed Feb 5, 2025
1 parent edd0768 commit 21df38c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions equality_across_groups/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
description = "Protocols for proving equality of committed values across groups"

[dependencies]
ark-serialize.workspace = true
Expand Down
7 changes: 5 additions & 2 deletions equality_across_groups/src/pok_ecdsa_pubkey.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,7 @@ mod tests {
let comm_key_tom = PedersenCommitmentKey::<Tom256Affine>::new::<Blake2b512>(b"test2");
let comm_key_bls = PedersenCommitmentKey::<BlsG1Affine>::new::<Blake2b512>(b"test3");

// Bulletproofs++ setup
let base = 2;
let mut bpp_setup_params = BppSetupParams::<Tom256Affine>::new_for_perfect_range_proof::<
Blake2b512,
Expand All @@ -311,14 +312,16 @@ mod tests {
bpp_setup_params.G = comm_key_tom.g;
bpp_setup_params.H_vec[0] = comm_key_tom.h;

// ECDSA public key setup
let sk = Fr::rand(&mut rng);
let pk = (SECP_GEN * sk).into_affine();

// Commit to ECDSA public key on Tom-256 curve
let comm_pk = PointCommitmentWithOpening::new(&mut rng, &pk, &comm_key_tom).unwrap();

// Commit to ECDSA public key on BLS12-381 curve
let pk_x = from_base_field_to_scalar_field::<Fq, BlsFr>(pk.x().unwrap());
let pk_y = from_base_field_to_scalar_field::<Fq, BlsFr>(pk.y().unwrap());

let bls_comm_pk_rx = BlsFr::rand(&mut rng);
let bls_comm_pk_ry = BlsFr::rand(&mut rng);
let bls_comm_pk_x = comm_key_bls.commit(&pk_x, &bls_comm_pk_rx);
Expand Down Expand Up @@ -375,7 +378,7 @@ mod tests {
)
.unwrap();

// Proof that x coordinate is same in both Tom-256 and BLS12-381 commitments
// Proof that y coordinate is same in both Tom-256 and BLS12-381 commitments
let proof_eq_pk_y = ProofLargeWitness::<
Tom256Affine,
BlsG1Affine,
Expand Down
3 changes: 2 additions & 1 deletion schnorr_pok/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Also implements the proof of **inequality of discrete log** when only one of the
the prover. i.e. given `y = g * x` and `z = h * k`, prover and verifier know `g`, `h`, `y` and `z` and
prover additionally knows `x` but not `k`.

Also implements the following sigma protocols:
Also implements the following sigma protocols in [`Product`]:
- Proving product relation among values committed in a Pedersen commitment
- Proving square relation among values committed in a Pedersen commitment
- Proving inverse relation among values committed in a Pedersen commitment
Expand Down Expand Up @@ -70,5 +70,6 @@ So even though the crate's name is `schnorr_pok`, it implements other protocols

[`Inequality`]: https://docs.rs/schnorr_pok/latest/schnorr_pok/inequality/
[`discrete_log_pairing`]: https://docs.rs/schnorr_pok/latest/schnorr_pok/discrete_log_pairing/
[`Product`]: https://docs.rs/schnorr_pok/latest/schnorr_pok/product_relations/

<!-- cargo-rdme end -->
3 changes: 2 additions & 1 deletion schnorr_pok/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
//! the prover. i.e. given `y = g * x` and `z = h * k`, prover and verifier know `g`, `h`, `y` and `z` and
//! prover additionally knows `x` but not `k`.
//!
//! Also implements the following sigma protocols:
//! Also implements the following sigma protocols in [`Product`]:
//! - Proving product relation among values committed in a Pedersen commitment
//! - Proving square relation among values committed in a Pedersen commitment
//! - Proving inverse relation among values committed in a Pedersen commitment
Expand Down Expand Up @@ -68,6 +68,7 @@
//!
//! [`Inequality`]: crate::inequality
//! [`discrete_log_pairing`]: crate::discrete_log_pairing
//! [`Product`]: crate::product_relations
use crate::error::SchnorrError;
use ark_ec::{AffineRepr, CurveGroup, VariableBaseMSM};
Expand Down
6 changes: 3 additions & 3 deletions schnorr_pok/src/product_relations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@
//! - `v_a, v_b, v_c, r_a, r_b, r_c`
//!
//! The prover proves knowledge of `v_a, v_b, v_c, r_a, r_b, r_c` using the usual sigma protocol (Schnorr) while
//! proving that `c = a * v_b + h * r` where `r = r_c - (r_a * r_b)`
//! proving that `c = a * v_b + h * r` where `r = r_c - (r_a * v_b)`
//!
//! For proving the inverse relation `v_a * v_a_inv = 1`, the above protocol can be used but a more efficient way is to prove
//! given commitments `a = g * v_a + h * r_a`, `a_inv = g * v_a_inv + h * r_a_inv` that `g = a * v_a_inv + h * r`. This saves
//! some commitments and responses.
//! given commitments `a = g * v_a + h * r_a`, `a_inv = g * v_a_inv + h * r_a_inv` that `g = a * v_a_inv + h * r` where
//! `r = -(r_a * v_a_inv)`. This saves some commitments and responses.
//!
//! Similarly, for proving the square relation `v_a * v_a = v_a_sqr`, the above product protocol can be used but that will
//! have duplicate commitments and responses for `v_a` so a dedicated protocol is used.
Expand Down

0 comments on commit 21df38c

Please sign in to comment.