Trait ark_crypto_primitives::SNARK [−][src]
The basic functionality for a SNARK.
Associated Types
type ProvingKey: Clone
[src]
The information required by the prover to produce a proof for a specific circuit C.
type VerifyingKey: Clone + ToBytes
[src]
The information required by the verifier to check a proof for a specific circuit C.
type Proof: Clone
[src]
The proof output by the prover.
type ProcessedVerifyingKey: Clone
[src]
This contains the verification key, but preprocessed to enable faster verification.
type Error: 'static + Error
[src]
Errors encountered during setup, proving, or verification.
Required methods
pub fn circuit_specific_setup<C, R>(
circuit: C,
rng: &mut R
) -> Result<(Self::ProvingKey, Self::VerifyingKey), Self::Error> where
C: ConstraintSynthesizer<F>,
R: RngCore + CryptoRng,
[src]
circuit: C,
rng: &mut R
) -> Result<(Self::ProvingKey, Self::VerifyingKey), Self::Error> where
C: ConstraintSynthesizer<F>,
R: RngCore + CryptoRng,
Takes in a description of a computation (specified in R1CS constraints), and samples proving and verification keys for that circuit.
pub fn prove<C, R>(
circuit_pk: &Self::ProvingKey,
circuit: C,
rng: &mut R
) -> Result<Self::Proof, Self::Error> where
C: ConstraintSynthesizer<F>,
R: RngCore + CryptoRng,
[src]
circuit_pk: &Self::ProvingKey,
circuit: C,
rng: &mut R
) -> Result<Self::Proof, Self::Error> where
C: ConstraintSynthesizer<F>,
R: RngCore + CryptoRng,
Generates a proof of satisfaction of the arithmetic circuit C (specified as R1CS constraints).
pub fn process_vk(
circuit_vk: &Self::VerifyingKey
) -> Result<Self::ProcessedVerifyingKey, Self::Error>
[src]
circuit_vk: &Self::VerifyingKey
) -> Result<Self::ProcessedVerifyingKey, Self::Error>
Preprocesses circuit_vk
to enable faster verification.
pub fn verify_with_processed_vk(
circuit_pvk: &Self::ProcessedVerifyingKey,
public_input: &[F],
proof: &Self::Proof
) -> Result<bool, Self::Error>
[src]
circuit_pvk: &Self::ProcessedVerifyingKey,
public_input: &[F],
proof: &Self::Proof
) -> Result<bool, Self::Error>
Checks that proof
is a valid proof of the satisfaction of circuit
encoded in circuit_pvk
, with respect to the public input public_input
,
specified as R1CS constraints.
Provided methods
pub fn verify(
circuit_vk: &Self::VerifyingKey,
public_input: &[F],
proof: &Self::Proof
) -> Result<bool, Self::Error>
[src]
circuit_vk: &Self::VerifyingKey,
public_input: &[F],
proof: &Self::Proof
) -> Result<bool, Self::Error>
Checks that proof
is a valid proof of the satisfaction of circuit
encoded in circuit_vk
, with respect to the public input public_input
,
specified as R1CS constraints.