Skip to content

Commit

Permalink
chore: rename r1cs_shape_and_key to r1cs_shape_and_ck
Browse files Browse the repository at this point in the history
  • Loading branch information
huitseeker committed May 2, 2024
1 parent 3a0527e commit a4ead79
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/bellpepper/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ mod tests {
// First create the shape
let mut cs: ShapeCS<E> = ShapeCS::new();
synthesize_alloc_bit(&mut cs);
let (shape, ck) = cs.r1cs_shape_and_key(&*default_ck_hint());
let (shape, ck) = cs.r1cs_shape_and_ck(&*default_ck_hint());

// Now get the assignment
let mut cs = SatisfyingAssignment::<E>::new();
Expand Down
2 changes: 1 addition & 1 deletion src/bellpepper/r1cs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ pub trait NovaShape<E: Engine> {
/// Return an appropriate `R1CSShape` and `CommitmentKey` structs.
/// A `CommitmentKeyHint` should be provided to help guide the construction of the `CommitmentKey`.
/// This parameter is documented in `r1cs::R1CS::commitment_key`.
fn r1cs_shape_and_key(&self, ck_hint: &CommitmentKeyHint<E>) -> (R1CSShape<E>, CommitmentKey<E>) {
fn r1cs_shape_and_ck(&self, ck_hint: &CommitmentKeyHint<E>) -> (R1CSShape<E>, CommitmentKey<E>) {
let S = self.r1cs_shape();
let ck = commitment_key(&S, ck_hint);

Expand Down
4 changes: 2 additions & 2 deletions src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ mod tests {
NovaAugmentedCircuit::new(primary_params, None, &tc1, ro_consts1.clone());
let mut cs: TestShapeCS<E1> = TestShapeCS::new();
let _ = circuit1.synthesize(&mut cs);
let (shape1, ck1) = cs.r1cs_shape_and_key(&*default_ck_hint());
let (shape1, ck1) = cs.r1cs_shape_and_ck(&*default_ck_hint());
assert_eq!(cs.num_constraints(), num_constraints_primary);

let tc2 = TrivialCircuit::default();
Expand All @@ -405,7 +405,7 @@ mod tests {
NovaAugmentedCircuit::new(secondary_params, None, &tc2, ro_consts2.clone());
let mut cs: TestShapeCS<E2> = TestShapeCS::new();
let _ = circuit2.synthesize(&mut cs);
let (shape2, ck2) = cs.r1cs_shape_and_key(&*default_ck_hint());
let (shape2, ck2) = cs.r1cs_shape_and_ck(&*default_ck_hint());
assert_eq!(cs.num_constraints(), num_constraints_secondary);

// Execute the base case for the primary
Expand Down
6 changes: 3 additions & 3 deletions src/gadgets/ecc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ mod tests {
let mut cs: TestShapeCS<E2> = TestShapeCS::new();
let _ = synthesize_smul::<E1, _>(cs.namespace(|| "synthesize"));
println!("Number of constraints: {}", cs.num_constraints());
let (shape, ck) = cs.r1cs_shape_and_key(&*default_ck_hint());
let (shape, ck) = cs.r1cs_shape_and_ck(&*default_ck_hint());

// Then the satisfying assignment
let mut cs = SatisfyingAssignment::<E2>::new();
Expand Down Expand Up @@ -1089,7 +1089,7 @@ mod tests {
let mut cs: TestShapeCS<E2> = TestShapeCS::new();
let _ = synthesize_add_equal::<E1, _>(cs.namespace(|| "synthesize add equal"));
println!("Number of constraints: {}", cs.num_constraints());
let (shape, ck) = cs.r1cs_shape_and_key(&*default_ck_hint());
let (shape, ck) = cs.r1cs_shape_and_ck(&*default_ck_hint());

// Then the satisfying assignment
let mut cs = SatisfyingAssignment::<E2>::new();
Expand Down Expand Up @@ -1149,7 +1149,7 @@ mod tests {
let mut cs: TestShapeCS<E2> = TestShapeCS::new();
let _ = synthesize_add_negation::<E1, _>(cs.namespace(|| "synthesize add equal"));
println!("Number of constraints: {}", cs.num_constraints());
let (shape, ck) = cs.r1cs_shape_and_key(&*default_ck_hint());
let (shape, ck) = cs.r1cs_shape_and_ck(&*default_ck_hint());

// Then the satisfying assignment
let mut cs = SatisfyingAssignment::<E2>::new();
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ where
);
let mut cs: ShapeCS<E1> = ShapeCS::new();
let _ = circuit_primary.synthesize(&mut cs);
let (r1cs_shape_primary, ck_primary) = cs.r1cs_shape_and_key(ck_hint1);
let (r1cs_shape_primary, ck_primary) = cs.r1cs_shape_and_ck(ck_hint1);

// Initialize ck for the secondary
let circuit_secondary: NovaAugmentedCircuit<'_, E1, C2> = NovaAugmentedCircuit::new(
Expand All @@ -179,7 +179,7 @@ where
);
let mut cs: ShapeCS<E2> = ShapeCS::new();
let _ = circuit_secondary.synthesize(&mut cs);
let (r1cs_shape_secondary, ck_secondary) = cs.r1cs_shape_and_key(ck_hint2);
let (r1cs_shape_secondary, ck_secondary) = cs.r1cs_shape_and_ck(ck_hint2);

if r1cs_shape_primary.num_io != 2 || r1cs_shape_secondary.num_io != 2 {
return Err(NovaError::InvalidStepCircuitIO);
Expand Down
2 changes: 1 addition & 1 deletion src/nifs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ mod tests {
// First create the shape
let mut cs: TestShapeCS<E> = TestShapeCS::new();
let _ = synthesize_tiny_r1cs_bellpepper(&mut cs, None);
let (shape, ck) = cs.r1cs_shape_and_key(&*default_ck_hint());
let (shape, ck) = cs.r1cs_shape_and_ck(&*default_ck_hint());
let ro_consts =
<<E as Engine>::RO as ROTrait<<E as Engine>::Base, <E as Engine>::Scalar>>::Constants::default();

Expand Down
2 changes: 1 addition & 1 deletion src/spartan/direct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ impl<E: Engine, S: RelaxedR1CSSNARKTrait<E>, C: StepCircuit<E::Scalar>> DirectSN
let mut cs: ShapeCS<E> = ShapeCS::new();
let _ = circuit.synthesize(&mut cs);

let (shape, ck) = cs.r1cs_shape_and_key(&*S::ck_floor());
let (shape, ck) = cs.r1cs_shape_and_ck(&*S::ck_floor());

let (pk, vk) = S::setup(&ck, &shape)?;

Expand Down

0 comments on commit a4ead79

Please sign in to comment.