From e8c89d13b673da332e429e5208c6a61f4a212711 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Garillot?= Date: Sun, 10 Mar 2024 19:01:22 -0400 Subject: [PATCH] chore: rename r1cs_shape_and_key to r1cs_shape_and_ck --- src/bellpepper/mod.rs | 2 +- src/bellpepper/r1cs.rs | 2 +- src/circuit.rs | 4 ++-- src/gadgets/ecc.rs | 6 +++--- src/lib.rs | 4 ++-- src/nifs.rs | 2 +- src/spartan/direct.rs | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/bellpepper/mod.rs b/src/bellpepper/mod.rs index a8a657e0..2ffcb12b 100644 --- a/src/bellpepper/mod.rs +++ b/src/bellpepper/mod.rs @@ -45,7 +45,7 @@ mod tests { // First create the shape let mut cs: ShapeCS = 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::::new(); diff --git a/src/bellpepper/r1cs.rs b/src/bellpepper/r1cs.rs index 8d2401fe..ed8301b9 100644 --- a/src/bellpepper/r1cs.rs +++ b/src/bellpepper/r1cs.rs @@ -27,7 +27,7 @@ pub trait NovaShape { /// 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) -> (R1CSShape, CommitmentKey) { + fn r1cs_shape_and_ck(&self, ck_hint: &CommitmentKeyHint) -> (R1CSShape, CommitmentKey) { let S = self.r1cs_shape(); let ck = commitment_key(&S, ck_hint); diff --git a/src/circuit.rs b/src/circuit.rs index 129fed58..1b7c508b 100644 --- a/src/circuit.rs +++ b/src/circuit.rs @@ -396,7 +396,7 @@ mod tests { NovaAugmentedCircuit::new(primary_params, None, &tc1, ro_consts1.clone()); let mut cs: TestShapeCS = 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(); @@ -405,7 +405,7 @@ mod tests { NovaAugmentedCircuit::new(secondary_params, None, &tc2, ro_consts2.clone()); let mut cs: TestShapeCS = 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 diff --git a/src/gadgets/ecc.rs b/src/gadgets/ecc.rs index f9d8de16..25a1334b 100644 --- a/src/gadgets/ecc.rs +++ b/src/gadgets/ecc.rs @@ -1033,7 +1033,7 @@ mod tests { let mut cs: TestShapeCS = TestShapeCS::new(); let _ = synthesize_smul::(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::::new(); @@ -1089,7 +1089,7 @@ mod tests { let mut cs: TestShapeCS = TestShapeCS::new(); let _ = synthesize_add_equal::(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::::new(); @@ -1149,7 +1149,7 @@ mod tests { let mut cs: TestShapeCS = TestShapeCS::new(); let _ = synthesize_add_negation::(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::::new(); diff --git a/src/lib.rs b/src/lib.rs index 3e31479d..f838fa90 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -168,7 +168,7 @@ where ); let mut cs: ShapeCS = 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( @@ -179,7 +179,7 @@ where ); let mut cs: ShapeCS = 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); diff --git a/src/nifs.rs b/src/nifs.rs index 914f49cf..9e75d57f 100644 --- a/src/nifs.rs +++ b/src/nifs.rs @@ -168,7 +168,7 @@ mod tests { // First create the shape let mut cs: TestShapeCS = 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 = <::RO as ROTrait<::Base, ::Scalar>>::Constants::default(); diff --git a/src/spartan/direct.rs b/src/spartan/direct.rs index bee96b82..61935e19 100644 --- a/src/spartan/direct.rs +++ b/src/spartan/direct.rs @@ -109,7 +109,7 @@ impl, C: StepCircuit> DirectSN let mut cs: ShapeCS = 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)?;