Trait ark_snark::UniversalSetupSNARK
source · pub trait UniversalSetupSNARK<F: PrimeField>: SNARK<F> {
type ComputationBound: Clone + Default + Debug;
type PublicParameters: Clone + Debug;
fn universal_setup<R: RngCore + CryptoRng>(
compute_bound: &Self::ComputationBound,
rng: &mut R
) -> Result<Self::PublicParameters, Self::Error>;
fn index<C: ConstraintSynthesizer<F>, R: RngCore + CryptoRng>(
pp: &Self::PublicParameters,
circuit: C,
rng: &mut R
) -> Result<(Self::ProvingKey, Self::VerifyingKey), UniversalSetupIndexError<Self::ComputationBound, Self::Error>>;
}
Expand description
A SNARK with universal setup. That is, a SNARK where the trusted setup is circuit-independent.
Required Associated Types§
sourcetype ComputationBound: Clone + Default + Debug
type ComputationBound: Clone + Default + Debug
Specifies how to bound the size of public parameters required to generate the index proving and verification keys for a given circuit.
sourcetype PublicParameters: Clone + Debug
type PublicParameters: Clone + Debug
Specifies the type of universal public parameters.
Required Methods§
sourcefn universal_setup<R: RngCore + CryptoRng>(
compute_bound: &Self::ComputationBound,
rng: &mut R
) -> Result<Self::PublicParameters, Self::Error>
fn universal_setup<R: RngCore + CryptoRng>(
compute_bound: &Self::ComputationBound,
rng: &mut R
) -> Result<Self::PublicParameters, Self::Error>
Specifies how to bound the size of public parameters required to generate the index proving and verification keys for a given circuit.
sourcefn index<C: ConstraintSynthesizer<F>, R: RngCore + CryptoRng>(
pp: &Self::PublicParameters,
circuit: C,
rng: &mut R
) -> Result<(Self::ProvingKey, Self::VerifyingKey), UniversalSetupIndexError<Self::ComputationBound, Self::Error>>
fn index<C: ConstraintSynthesizer<F>, R: RngCore + CryptoRng>(
pp: &Self::PublicParameters,
circuit: C,
rng: &mut R
) -> Result<(Self::ProvingKey, Self::VerifyingKey), UniversalSetupIndexError<Self::ComputationBound, Self::Error>>
Indexes the public parameters according to the circuit circuit
, and
outputs circuit-specific proving and verification keys.