Skip to content

Commit

Permalink
refactor: Update AllocatedPoint type specifications in circuits and g…
Browse files Browse the repository at this point in the history
…adgets (lurk-lang#299)

- Change the parameter of `AllocatedPoint` from an `Engine` to the more minimal setup of a `Group`
- Ensure no changes are made to the operating logic of the code, only type specification has been updated.

Downstream changes:
- Modify data type of `W` and `E` fields in structures `AllocatedR1CSInstance` and `AllocatedRelaxedR1CSInstance` to `AllocatedPoint<E::GE>` along with the type of `T` parameter in `fold_with_r1cs`.
- Update `conditionally_select_point` function in `gadgets/r1cs.rs` to use a generic parameter `G` that inherits from `Group` instead of `E` from `Engine`.
- Update method signatures in `NovaAugmentedCircuit` and `SuperNovaAugmentedCircuit` to accommodate changes in the underlying type of `AllocatedPoint` from `E` to `E::GE`.
  • Loading branch information
huitseeker authored Feb 7, 2024
1 parent 788e878 commit 7a5d7bf
Show file tree
Hide file tree
Showing 4 changed files with 140 additions and 145 deletions.
4 changes: 2 additions & 2 deletions src/circuit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ impl<'a, E: Engine, SC: StepCircuit<E::Base>> NovaAugmentedCircuit<'a, E, SC> {
Vec<AllocatedNum<E::Base>>,
AllocatedRelaxedR1CSInstance<E>,
AllocatedR1CSInstance<E>,
AllocatedPoint<E>,
AllocatedPoint<E::GE>,
),
SynthesisError,
> {
Expand Down Expand Up @@ -214,7 +214,7 @@ impl<'a, E: Engine, SC: StepCircuit<E::Base>> NovaAugmentedCircuit<'a, E, SC> {
z_i: &[AllocatedNum<E::Base>],
U: &AllocatedRelaxedR1CSInstance<E>,
u: &AllocatedR1CSInstance<E>,
T: &AllocatedPoint<E>,
T: &AllocatedPoint<E::GE>,
arity: usize,
) -> Result<(AllocatedRelaxedR1CSInstance<E>, AllocatedBit), SynthesisError> {
// Check that u.x[0] = Hash(params, U, i, z0, zi)
Expand Down
Loading

0 comments on commit 7a5d7bf

Please sign in to comment.