From 7bc82c8d8398430488342f89647dbe6c39d43e95 Mon Sep 17 00:00:00 2001 From: saitima Date: Thu, 3 Oct 2024 12:58:04 +0300 Subject: [PATCH] chore(fflonk): fflonk vk constructor --- crates/fflonk/src/verifier.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/crates/fflonk/src/verifier.rs b/crates/fflonk/src/verifier.rs index 2179152..e09284e 100644 --- a/crates/fflonk/src/verifier.rs +++ b/crates/fflonk/src/verifier.rs @@ -29,6 +29,20 @@ pub struct FflonkVerificationKey> { } impl> FflonkVerificationKey { + pub fn new(n: usize, c0: E::G1Affine, num_inputs: usize, num_state_polys: usize, num_witness_polys: usize, total_lookup_entries_length: usize, g2_elements: [E::G2Affine; 2]) -> Self { + let non_residues = make_non_residues(num_state_polys - 1); + FflonkVerificationKey { + n, + c0, + num_inputs, + num_state_polys, + num_witness_polys, + non_residues, + g2_elements, + total_lookup_entries_length, + _marker: std::marker::PhantomData, + } + } pub fn from_setup(setup: &FflonkSetup, crs: &Crs) -> Result { let FflonkSetup { original_setup, c0_commitment: c0 } = setup; Ok(Self {