Skip to content

Commit

Permalink
read_vk does not need to receive the compiled circuit as input
Browse files Browse the repository at this point in the history
  • Loading branch information
iquerejeta committed Oct 21, 2024
1 parent 9f0cbf5 commit 06f929a
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions halo2_proofs/src/plonk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,18 @@ use std::io;
pub fn vk_read<C: SerdeCurveAffine, R: io::Read, ConcreteCircuit: Circuit<C::Scalar>>(
reader: &mut R,
format: SerdeFormat,
k: u32,
circuit: &ConcreteCircuit,
compress_selectors: bool,
#[cfg(feature = "circuit-params")]
params: ConcreteCircuit::Params,
) -> io::Result<VerifyingKey<C>>
where
C::Scalar: SerdePrimeField + FromUniformBytes<64>,
{
let (_, _, cs) = compile_circuit(k, circuit, compress_selectors)
.map_err(|e| io::Error::new(io::ErrorKind::Other, e.to_string()))?;
let mut cs = ConstraintSystem::default();
#[cfg(feature = "circuit-params")]
ConcreteCircuit::configure_with_params(&mut cs, params);
#[cfg(not(feature = "circuit-params"))]
ConcreteCircuit::configure(&mut cs);

let cs_mid: ConstraintSystemMid<_> = cs.into();
VerifyingKey::read(reader, format, cs_mid.into())
}
Expand Down

0 comments on commit 06f929a

Please sign in to comment.