Trait snarkvm_gadgets::traits::algorithms::snark::SNARKGadget [−][src]
pub trait SNARKGadget<F: PrimeField, CF: PrimeField, S: SNARK> { type PreparedVerifyingKeyVar: AllocGadget<S::PreparedVerifyingKey, CF> + Clone; type VerifyingKeyVar: AllocGadget<S::VerifyingKey, CF> + ToBytesGadget<CF> + Clone; type InputVar: AllocGadget<Vec<F>, CF> + Clone + FromFieldElementsGadget<F, CF>; type ProofVar: AllocGadget<S::Proof, CF> + Clone; type VerifierSize: PartialOrd + Clone + Debug; fn verifier_size(circuit_vk: &S::VerifyingKey) -> Self::VerifierSize; fn verify_with_processed_vk<CS: ConstraintSystem<CF>>(
cs: CS,
circuit_pvk: &Self::PreparedVerifyingKeyVar,
x: &Self::InputVar,
proof: &Self::ProofVar
) -> Result<Boolean, SynthesisError>; fn verify<CS: ConstraintSystem<CF>>(
cs: CS,
circuit_vk: &Self::VerifyingKeyVar,
x: &Self::InputVar,
proof: &Self::ProofVar
) -> Result<Boolean, SynthesisError>; }
Expand description
This implements constraints for SNARK verifiers.
Associated Types
type PreparedVerifyingKeyVar: AllocGadget<S::PreparedVerifyingKey, CF> + Clone
type VerifyingKeyVar: AllocGadget<S::VerifyingKey, CF> + ToBytesGadget<CF> + Clone
type InputVar: AllocGadget<Vec<F>, CF> + Clone + FromFieldElementsGadget<F, CF>
type ProofVar: AllocGadget<S::Proof, CF> + Clone
type VerifierSize: PartialOrd + Clone + Debug
type VerifierSize: PartialOrd + Clone + Debug
Information about the R1CS constraints required to check proofs relative a given verification key. In the context of a LPCP-based pairing-based SNARK like that of [Groth16], this is independent of the R1CS matrices, whereas for more “complex” SNARKs like [Marlin], this can encode information about the highest degree of polynomials required to verify proofs.
Required methods
fn verifier_size(circuit_vk: &S::VerifyingKey) -> Self::VerifierSize
fn verifier_size(circuit_vk: &S::VerifyingKey) -> Self::VerifierSize
Returns information about the R1CS constraints required to check proofs relative
to the verification key circuit_vk
.