Skip to content

Commit

Permalink
Apply @davxy suggestions from code review
Browse files Browse the repository at this point in the history
naming convention and clean up.

Co-authored-by: Davide Galassi <[email protected]>
  • Loading branch information
drskalman and davxy authored Oct 23, 2024
1 parent c565032 commit 5192cdd
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
4 changes: 1 addition & 3 deletions common/src/test_helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ pub fn random_vec<X: UniformRand, R: Rng>(n: usize, rng: &mut R) -> Vec<X> {
(0..n).map(|_| X::rand(rng)).collect()
}

pub fn cond_sum<P>(bitmask: &[bool], points: &[P]) -> P
where
P: AffineRepr,
pub fn cond_sum<P: AffineRepr>(bitmask: &[bool], points: &[P]) -> P
{
assert_eq!(bitmask.len(), points.len());
bitmask
Expand Down
1 change: 0 additions & 1 deletion ring/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ pub(crate) fn hash_to_curve<F: PrimeField, P: AffineRepr<BaseField = F>>(message
let hash: [u8; 64] = blake2::Blake2b::digest(&seed[..]).into();
if let Some(point) = P::from_random_bytes(&hash) {
let point = point.clear_cofactor();
//assert!(point.is_in_correct_subgroup_assuming_on_curve());
return point;
}
seed[cnt_offset] += 1;
Expand Down
4 changes: 2 additions & 2 deletions ring/src/ring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const IDLE_ROWS: usize = ZK_ROWS + 1;
pub struct Ring<
F: PrimeField,
KzgCurve: Pairing<ScalarField = F>,
VrfAffineT: AffineRepr<BaseField = F>,
P: AffineRepr<BaseField = F>,
> {
// KZG commitments to the coordinates of the vector described above
pub cx: KzgCurve::G1Affine,
Expand All @@ -51,7 +51,7 @@ pub struct Ring<
// the number of keys "stored" in this commitment
pub curr_keys: usize,
// a parameter
pub padding_point: VrfAffineT,
pub padding_point: P,
}

impl<F: PrimeField, KzgCurve: Pairing<ScalarField = F>, VrfAffineT: AffineRepr<BaseField = F>>
Expand Down
2 changes: 1 addition & 1 deletion ring/src/ring_verifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ impl<F: PrimeField, CS: PCS<F>, P: AffineRepr<BaseField = F>, T: PlonkTranscript
}
}

pub fn verify_ring_proof<CondAddValuesT: CondAddValues<F> + VerifierGadget<F>>(
pub fn verify<CondAddValuesT: CondAddValues<F> + VerifierGadget<F>>(
&self,
proof: RingProof<F, CS>,
result: P,
Expand Down

0 comments on commit 5192cdd

Please sign in to comment.