diff --git a/plonky2/src/plonk/circuit_builder.rs b/plonky2/src/plonk/circuit_builder.rs index ca68af9c..e4e3e997 100644 --- a/plonky2/src/plonk/circuit_builder.rs +++ b/plonky2/src/plonk/circuit_builder.rs @@ -836,15 +836,8 @@ impl, const D: usize> CircuitBuilder { [(); C::Hasher::HASH_SIZE]:, { // TODO: Can skip parts of this. - let CircuitData { - prover_only, - common, - .. - } = self.build(); - ProverCircuitData { - prover_only, - common, - } + let circuit_data = self.build(); + circuit_data.prover_data() } /// Builds a "verifier circuit", with data needed to verify proofs but not generate them. @@ -853,14 +846,7 @@ impl, const D: usize> CircuitBuilder { [(); C::Hasher::HASH_SIZE]:, { // TODO: Can skip parts of this. - let CircuitData { - verifier_only, - common, - .. - } = self.build(); - VerifierCircuitData { - verifier_only, - common, - } + let circuit_data = self.build(); + circuit_data.verifier_data() } } diff --git a/plonky2/src/plonk/circuit_data.rs b/plonky2/src/plonk/circuit_data.rs index 8e8c13f7..16c899de 100644 --- a/plonky2/src/plonk/circuit_data.rs +++ b/plonky2/src/plonk/circuit_data.rs @@ -151,6 +151,18 @@ impl, C: GenericConfig, const D: usize> common, } } + + pub fn prover_data(self) -> ProverCircuitData { + let CircuitData { + prover_only, + common, + .. + } = self; + ProverCircuitData { + prover_only, + common, + } + } } /// Circuit data required by the prover. This may be thought of as a proving key, although it