Struct snarkvm_marlin::constraints::snark::MarlinSNARK
source · [−]pub struct MarlinSNARK<F: PrimeField, FSF: PrimeField, PC: PolynomialCommitment<F, FSF>, FS: FiatShamirRng<F, FSF>, MC: MarlinMode, V: ToConstraintField<F> + Clone> { /* private fields */ }
Expand description
The Marlin proof system.
Trait Implementations
sourceimpl<F: Clone + PrimeField, FSF: Clone + PrimeField, PC: Clone + PolynomialCommitment<F, FSF>, FS: Clone + FiatShamirRng<F, FSF>, MC: Clone + MarlinMode, V: Clone + ToConstraintField<F> + Clone> Clone for MarlinSNARK<F, FSF, PC, FS, MC, V>
impl<F: Clone + PrimeField, FSF: Clone + PrimeField, PC: Clone + PolynomialCommitment<F, FSF>, FS: Clone + FiatShamirRng<F, FSF>, MC: Clone + MarlinMode, V: Clone + ToConstraintField<F> + Clone> Clone for MarlinSNARK<F, FSF, PC, FS, MC, V>
sourcefn clone(&self) -> MarlinSNARK<F, FSF, PC, FS, MC, V>
fn clone(&self) -> MarlinSNARK<F, FSF, PC, FS, MC, V>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<F: Debug + PrimeField, FSF: Debug + PrimeField, PC: Debug + PolynomialCommitment<F, FSF>, FS: Debug + FiatShamirRng<F, FSF>, MC: Debug + MarlinMode, V: Debug + ToConstraintField<F> + Clone> Debug for MarlinSNARK<F, FSF, PC, FS, MC, V>
impl<F: Debug + PrimeField, FSF: Debug + PrimeField, PC: Debug + PolynomialCommitment<F, FSF>, FS: Debug + FiatShamirRng<F, FSF>, MC: Debug + MarlinMode, V: Debug + ToConstraintField<F> + Clone> Debug for MarlinSNARK<F, FSF, PC, FS, MC, V>
sourceimpl<TargetField, BaseField, PC, FS, MM, V> SNARK for MarlinSNARK<TargetField, BaseField, PC, FS, MM, V> where
TargetField: PrimeField,
BaseField: PrimeField + PoseidonDefaultParametersField,
PC: PolynomialCommitment<TargetField, BaseField>,
FS: FiatShamirRng<TargetField, BaseField>,
MM: MarlinMode,
V: ToConstraintField<TargetField> + Clone,
impl<TargetField, BaseField, PC, FS, MM, V> SNARK for MarlinSNARK<TargetField, BaseField, PC, FS, MM, V> where
TargetField: PrimeField,
BaseField: PrimeField + PoseidonDefaultParametersField,
PC: PolynomialCommitment<TargetField, BaseField>,
FS: FiatShamirRng<TargetField, BaseField>,
MM: MarlinMode,
V: ToConstraintField<TargetField> + Clone,
type BaseField = BaseField
type PreparedVerifyingKey = PreparedCircuitVerifyingKey<TargetField, BaseField, PC, MM>
type Proof = Proof<TargetField, BaseField, PC>
type ProvingKey = CircuitProvingKey<TargetField, BaseField, PC, MM>
type ScalarField = TargetField
type UniversalSetupConfig = usize
type UniversalSetupParameters = UniversalSRS<TargetField, BaseField, PC>
type VerifierInput = V
type VerifyingKey = CircuitVerifyingKey<TargetField, BaseField, PC, MM>
fn universal_setup<R: Rng + CryptoRng>(
max_degree: &Self::UniversalSetupConfig,
rng: &mut R
) -> Result<Self::UniversalSetupParameters, SNARKError>
fn setup<C: ConstraintSynthesizer<TargetField>, R: Rng + CryptoRng>(
circuit: &C,
srs: &mut SRS<'_, R, Self::UniversalSetupParameters>
) -> Result<(Self::ProvingKey, Self::VerifyingKey), SNARKError>
fn prove_with_terminator<C: ConstraintSynthesizer<TargetField>, R: Rng + CryptoRng>(
parameters: &Self::ProvingKey,
circuit: &C,
terminator: &AtomicBool,
rng: &mut R
) -> Result<Self::Proof, SNARKError>
fn verify_prepared(
prepared_verifying_key: &Self::PreparedVerifyingKey,
input: &Self::VerifierInput,
proof: &Self::Proof
) -> Result<bool, SNARKError>
fn prove<C, R>(
proving_key: &Self::ProvingKey,
input_and_witness: &C,
rng: &mut R
) -> Result<Self::Proof, SNARKError> where
C: ConstraintSynthesizer<Self::ScalarField>,
R: Rng + CryptoRng,
fn verify(
verifying_key: &Self::VerifyingKey,
input: &Self::VerifierInput,
proof: &Self::Proof
) -> Result<bool, SNARKError>
sourceimpl<TargetField, BaseField, PC, PCG, FS, MM, V> SNARKVerifierGadget<MarlinSNARK<TargetField, BaseField, PC, FS, MM, V>> for MarlinVerificationGadget<TargetField, BaseField, PC, PCG, MM> where
TargetField: PrimeField,
BaseField: PrimeField + PoseidonDefaultParametersField,
PC: PolynomialCommitment<TargetField, BaseField>,
PCG: PCCheckVar<TargetField, PC, BaseField>,
FS: FiatShamirRng<TargetField, BaseField>,
MM: MarlinMode,
V: ToConstraintField<TargetField> + Clone,
impl<TargetField, BaseField, PC, PCG, FS, MM, V> SNARKVerifierGadget<MarlinSNARK<TargetField, BaseField, PC, FS, MM, V>> for MarlinVerificationGadget<TargetField, BaseField, PC, PCG, MM> where
TargetField: PrimeField,
BaseField: PrimeField + PoseidonDefaultParametersField,
PC: PolynomialCommitment<TargetField, BaseField>,
PCG: PCCheckVar<TargetField, PC, BaseField>,
FS: FiatShamirRng<TargetField, BaseField>,
MM: MarlinMode,
V: ToConstraintField<TargetField> + Clone,
type InputGadget = NonNativeFieldInputVar<TargetField, BaseField>
type PreparedVerificationKeyGadget = PreparedCircuitVerifyingKeyVar<TargetField, BaseField, PC, PCG, FSA<TargetField, BaseField>, FSG<TargetField, BaseField>, MM>
type ProofGadget = ProofVar<TargetField, BaseField, PC, PCG>
type VerificationKeyGadget = CircuitVerifyingKeyVar<TargetField, BaseField, PC, PCG, MM>
fn input_gadget_from_bytes<CS: ConstraintSystem<BaseField>>(
cs: CS,
bytes: &[UInt8]
) -> Result<Self::InputGadget, SynthesisError>
fn check_verify<CS: ConstraintSystem<BaseField>>(
cs: CS,
verification_key: &Self::VerificationKeyGadget,
input: &Self::InputGadget,
proof: &Self::ProofGadget
) -> Result<(), SynthesisError>
fn prepared_check_verify<CS: ConstraintSystem<BaseField>>(
cs: CS,
prepared_verification_key: &Self::PreparedVerificationKeyGadget,
input: &Self::InputGadget,
proof: &Self::ProofGadget
) -> Result<(), SynthesisError>
Auto Trait Implementations
impl<F, FSF, PC, FS, MC, V> RefUnwindSafe for MarlinSNARK<F, FSF, PC, FS, MC, V> where
F: RefUnwindSafe,
FS: RefUnwindSafe,
FSF: RefUnwindSafe,
MC: RefUnwindSafe,
PC: RefUnwindSafe,
V: RefUnwindSafe,
impl<F, FSF, PC, FS, MC, V> Send for MarlinSNARK<F, FSF, PC, FS, MC, V> where
FS: Send,
PC: Send,
V: Send,
impl<F, FSF, PC, FS, MC, V> Sync for MarlinSNARK<F, FSF, PC, FS, MC, V> where
FS: Sync,
PC: Sync,
V: Sync,
impl<F, FSF, PC, FS, MC, V> Unpin for MarlinSNARK<F, FSF, PC, FS, MC, V> where
F: Unpin,
FS: Unpin,
FSF: Unpin,
MC: Unpin,
PC: Unpin,
V: Unpin,
impl<F, FSF, PC, FS, MC, V> UnwindSafe for MarlinSNARK<F, FSF, PC, FS, MC, V> where
F: UnwindSafe,
FS: UnwindSafe,
FSF: UnwindSafe,
MC: UnwindSafe,
PC: UnwindSafe,
V: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more