Trait snarkvm_wasm::traits::algorithms::snark::SNARKGadget [−][src]
pub trait SNARKGadget<F, CF, S> where
S: SNARK,
F: PrimeField,
CF: PrimeField, { type PreparedVerifyingKeyVar: AllocGadget<<S as SNARK>::PreparedVerificationParameters, CF> + Clone; type VerifyingKeyVar: AllocGadget<<S as SNARK>::VerificationParameters, CF> + ToBytesGadget<CF> + Clone; type InputVar: AllocGadget<Vec<F, Global>, CF> + Clone; type ProofVar: AllocGadget<<S as SNARK>::Proof, CF> + Clone; type VerifierSize: PartialOrd<Self::VerifierSize> + Clone + Debug; fn verifier_size(
circuit_vk: &<S as SNARK>::VerificationParameters
) -> Self::VerifierSize; fn verify_with_processed_vk<CS>(
cs: CS,
circuit_pvk: &Self::PreparedVerifyingKeyVar,
x: &Self::InputVar,
proof: &Self::ProofVar
) -> Result<Boolean, SynthesisError>
where
CS: ConstraintSystem<CF>; fn verify<CS>(
cs: CS,
circuit_vk: &Self::VerifyingKeyVar,
x: &Self::InputVar,
proof: &Self::ProofVar
) -> Result<Boolean, SynthesisError>
where
CS: ConstraintSystem<CF>; }
Expand description
This implements constraints for SNARK verifiers.
Associated Types
type PreparedVerifyingKeyVar: AllocGadget<<S as SNARK>::PreparedVerificationParameters, CF> + Clone[src]
type PreparedVerifyingKeyVar: AllocGadget<<S as SNARK>::PreparedVerificationParameters, CF> + Clone[src]type VerifyingKeyVar: AllocGadget<<S as SNARK>::VerificationParameters, CF> + ToBytesGadget<CF> + Clone[src]
type VerifyingKeyVar: AllocGadget<<S as SNARK>::VerificationParameters, CF> + ToBytesGadget<CF> + Clone[src]type InputVar: AllocGadget<Vec<F, Global>, CF> + Clone[src]
type InputVar: AllocGadget<Vec<F, Global>, CF> + Clone[src]type ProofVar: AllocGadget<<S as SNARK>::Proof, CF> + Clone[src]
type ProofVar: AllocGadget<<S as SNARK>::Proof, CF> + Clone[src]type VerifierSize: PartialOrd<Self::VerifierSize> + Clone + Debug[src]
type VerifierSize: PartialOrd<Self::VerifierSize> + Clone + Debug[src]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 as SNARK>::VerificationParameters
) -> Self::VerifierSize[src]
fn verifier_size(
circuit_vk: &<S as SNARK>::VerificationParameters
) -> Self::VerifierSize[src]Returns information about the R1CS constraints required to check proofs relative
to the verification key circuit_vk.
fn verify_with_processed_vk<CS>(
cs: CS,
circuit_pvk: &Self::PreparedVerifyingKeyVar,
x: &Self::InputVar,
proof: &Self::ProofVar
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<CF>, [src]
fn verify_with_processed_vk<CS>(
cs: CS,
circuit_pvk: &Self::PreparedVerifyingKeyVar,
x: &Self::InputVar,
proof: &Self::ProofVar
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<CF>, [src]fn verify<CS>(
cs: CS,
circuit_vk: &Self::VerifyingKeyVar,
x: &Self::InputVar,
proof: &Self::ProofVar
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<CF>, [src]
fn verify<CS>(
cs: CS,
circuit_vk: &Self::VerifyingKeyVar,
x: &Self::InputVar,
proof: &Self::ProofVar
) -> Result<Boolean, SynthesisError> where
CS: ConstraintSystem<CF>, [src]