Trait snarkvm_dpc::traits::program::ProgramScheme[][src]

pub trait ProgramScheme: Clone {
    type ID: Debug;
    type LocalData;
    type LocalDataCommitment;
    type PublicInput;
    type Execution;
    type ProgramVerifyingKeyCRH;
    type ProofSystem: SNARK;
    type ProvingKey;
    type VerifyingKey;
    fn setup<R: Rng + CryptoRng>(
        local_data_commitment: &Self::LocalDataCommitment,
        program_verifying_key_crh: &Self::ProgramVerifyingKeyCRH,
        rng: &mut R
    ) -> Result<Self, ProgramError>;
fn load(
        local_data_commitment: &Self::LocalDataCommitment,
        program_verifying_key_crh: &Self::ProgramVerifyingKeyCRH
    ) -> Result<Self, ProgramError>;
fn execute<R: Rng + CryptoRng>(
        &self,
        local_data: &Self::LocalData,
        position: u8,
        rng: &mut R
    ) -> Result<Self::Execution, ProgramError>;
fn execute_blank<R: Rng + CryptoRng>(
        &self,
        rng: &mut R
    ) -> Result<Self::Execution, ProgramError>;
fn evaluate(
        &self,
        primary: &Self::PublicInput,
        witness: &Self::Execution
    ) -> bool;
fn id(&self) -> Self::ID; }

Associated Types

Required methods

Initializes a new instance of a program.

Loads an instance of a program.

Returns the execution of the program.

Returns the blank execution of the program, typically used for a SNARK setup.

Returns the evaluation of the program on given input and witness.

Returns the program ID.

Implementors