Skip to content

Commit bf51975

Browse files
committed
Update docs
Signed-off-by: lovesh <lovesh.bond@gmail.com>
1 parent 4e8ed69 commit bf51975

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

equality_across_groups/src/ec/sw_scalar_mult.rs

+2
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ impl<P: AffineRepr, C: AffineRepr, const NUM_REPS: usize>
228228
let bit_idx = i % 8;
229229
let c = (challenge[byte_idx] >> bit_idx) & 1;
230230
// If c = 0, send opening of point alpha * base else send opening of (alpha-omega) * base
231+
// If c = 0, the point addition protocol gets a challenge value of "-1" else it gets the value "1"
231232
if c == 0 {
232233
ScalarMultiplicationProofSingleRep {
233234
comm_alpha: p.comm_alpha.comm,
@@ -300,6 +301,7 @@ impl<P: AffineRepr, C: AffineRepr, const NUM_REPS: usize>
300301
comm_key_2,
301302
)?;
302303
// If c = 0, expect opening of point alpha * base else expect opening of (alpha-omega) * base
304+
// If c = 0, the point addition protocol gets a challenge value of "-1" else it gets the value "1"
303305
if c == 0 {
304306
if self.0[i].comm_alpha
305307
!= CommitmentWithOpening::new_given_randomness(

equality_across_groups/src/pok_ecdsa_pubkey.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,11 @@
1515
//!
1616
//! Thus using the protocols for scalar multiplication and point addition, the prover proves:
1717
//! - Given commitments to `z` and `-z*R`, the scalar multiplication of `z` and `-R` is indeed `-z*R`
18-
//! - Given commitments to `q` and `-z*R`, the sum of `q` and `-z*R` is indeed `-g*t*r^-1`
18+
//! - Given commitments to `q` and `-z*R`, the sum of `q` and `-z*R` is indeed `-g*t*r^-1`. Note that the `-g*t*r^-1` is public but
19+
//! the point addition protocol expects all 3 points to be committed so the prover commits to `-g*t*r^-1` and the proof
20+
//! contains the randomness used in its commitment. The verifier can itself compute `-g*t*r^-1` so using the randomness in the proof,
21+
//! it computes the same commitment to `-g*t*r^-1` as the prover's. So I could use a point addition protocol where the resulting point
22+
//! isn't committed but that protocol isn't going to be any better than the currently implemented one.
1923
//!
2024
2125
#![allow(non_snake_case)]
@@ -58,7 +62,8 @@ pub struct PoKEcdsaSigCommittedPublicKeyProtocol<const NUM_REPS_SCALAR_MULT: usi
5862
pub comm_z: Affine,
5963
/// Commitment to coordinates of `-z*R`
6064
pub comm_minus_zR: PointCommitment<crate::tom256::Affine>,
61-
/// Randomness in the commitment to coordinates of `-g*t*r^-1`
65+
/// Randomness in the commitment to coordinates of `-g*t*r^-1` so verifier can create the same commitment
66+
/// to `-g*t*r^-1` as the prover.
6267
pub comm_minus_g_t_r_inv_rand: (
6368
<crate::tom256::Affine as AffineRepr>::ScalarField,
6469
<crate::tom256::Affine as AffineRepr>::ScalarField,
@@ -78,7 +83,8 @@ pub struct PoKEcdsaSigCommittedPublicKey<const NUM_REPS_SCALAR_MULT: usize = 128
7883
pub comm_z: Affine,
7984
/// Commitment to coordinates of `-z*R`
8085
pub comm_minus_zR: PointCommitment<crate::tom256::Affine>,
81-
/// Randomness in the commitment to coordinates of `-g*t*r^-1`
86+
/// Randomness in the commitment to coordinates of `-g*t*r^-1` so verifier can create the same commitment
87+
/// to `-g*t*r^-1` as the prover.
8288
pub comm_minus_g_t_r_inv_rand: (
8389
<crate::tom256::Affine as AffineRepr>::ScalarField,
8490
<crate::tom256::Affine as AffineRepr>::ScalarField,

0 commit comments

Comments
 (0)