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
fn setup<R: Rng + CryptoRng>(
local_data_commitment: &Self::LocalDataCommitment,
program_verifying_key_crh: &Self::ProgramVerifyingKeyCRH,
rng: &mut R
) -> Result<Self, ProgramError>
fn setup<R: Rng + CryptoRng>(
local_data_commitment: &Self::LocalDataCommitment,
program_verifying_key_crh: &Self::ProgramVerifyingKeyCRH,
rng: &mut R
) -> Result<Self, ProgramError>
Initializes a new instance of a program.
fn load(
local_data_commitment: &Self::LocalDataCommitment,
program_verifying_key_crh: &Self::ProgramVerifyingKeyCRH
) -> Result<Self, ProgramError>
fn load(
local_data_commitment: &Self::LocalDataCommitment,
program_verifying_key_crh: &Self::ProgramVerifyingKeyCRH
) -> Result<Self, ProgramError>
Loads an instance of a program.
Returns the execution of the program.
fn execute_blank<R: Rng + CryptoRng>(
&self,
rng: &mut R
) -> Result<Self::Execution, ProgramError>
fn execute_blank<R: Rng + CryptoRng>(
&self,
rng: &mut R
) -> Result<Self::Execution, ProgramError>
Returns the blank execution of the program, typically used for a SNARK setup.
fn evaluate(
&self,
primary: &Self::PublicInput,
witness: &Self::Execution
) -> bool
fn evaluate(
&self,
primary: &Self::PublicInput,
witness: &Self::Execution
) -> bool
Returns the evaluation of the program on given input and witness.
Implementors
impl<C: Testnet1Components> ProgramScheme for snarkvm_dpc::testnet1::program::noop_program::NoopProgram<C>
impl<C: Testnet2Components> ProgramScheme for snarkvm_dpc::testnet2::program::noop_program::NoopProgram<C>