[][src]Trait storage_proofs::example_helper::Example

pub trait Example<'a, C: Circuit<Bls12>>: Default {
    fn name() -> String;
fn generate_groth_params<R: Rng>(
        &mut self,
        _: &mut R,
        _: &'a <Bls12 as JubjubEngine>::Params,
        _: usize,
        _: usize,
        _: usize,
        _: usize
    ) -> Parameters<Bls12>;
fn samples() -> usize;
fn create_circuit<R: Rng>(
        &mut self,
        _: &mut R,
        _: &'a <Bls12 as JubjubEngine>::Params,
        _: usize,
        _: usize,
        _: usize,
        _: usize,
        _: usize
    ) -> C;
fn verify_proof(
        &mut self,
        _: &Proof<Bls12>,
        _: &PreparedVerifyingKey<Bls12>
    ) -> Option<bool>; fn work_groth(
        &mut self,
        typ: CSType,
        data_size: usize,
        challenge_count: usize,
        m: usize,
        sloth_iter: usize
    ) { ... }
fn work_bench(
        &mut self,
        typ: CSType,
        data_size: usize,
        challenge_count: usize,
        m: usize,
        sloth_iter: usize
    ) { ... }
fn work_circuit(
        &mut self,
        typ: CSType,
        data_size: usize,
        challenge_count: usize,
        m: usize,
        sloth_iter: usize
    ) { ... }
fn clap(&self) -> ArgMatches { ... }
fn main() { ... }
fn create_proof<R: Rng>(
        &mut self,
        rng: &mut R,
        engine_params: &'a <Bls12 as JubjubEngine>::Params,
        groth_params: &Parameters<Bls12>,
        tree_depth: usize,
        challenge_count: usize,
        leaves: usize,
        m: usize,
        sloth_iter: usize
    ) -> Proof<Bls12> { ... }
fn get_num_constraints<R: Rng>(
        &mut self,
        rng: &mut R,
        engine_params: &'a JubjubBls12,
        tree_depth: usize,
        challenge_count: usize,
        leaves: usize,
        m: usize,
        sloth_iter: usize
    ) -> usize { ... } }

A trait that makes it easy to implement "Examples". These are really tunable benchmarking CLI tools.

Required methods

fn name() -> String

The name of the application. Used for identifying caches.

fn generate_groth_params<R: Rng>(
    &mut self,
    _: &mut R,
    _: &'a <Bls12 as JubjubEngine>::Params,
    _: usize,
    _: usize,
    _: usize,
    _: usize
) -> Parameters<Bls12>

Generate groth parameters

fn samples() -> usize

How many samples should be taken when proofing and verifying

fn create_circuit<R: Rng>(
    &mut self,
    _: &mut R,
    _: &'a <Bls12 as JubjubEngine>::Params,
    _: usize,
    _: usize,
    _: usize,
    _: usize,
    _: usize
) -> C

Create a new random proof

fn verify_proof(
    &mut self,
    _: &Proof<Bls12>,
    _: &PreparedVerifyingKey<Bls12>
) -> Option<bool>

Verify the given proof, return None if not implemented.

Loading content...

Provided methods

fn work_groth(
    &mut self,
    typ: CSType,
    data_size: usize,
    challenge_count: usize,
    m: usize,
    sloth_iter: usize
)

The actual work.

fn work_bench(
    &mut self,
    typ: CSType,
    data_size: usize,
    challenge_count: usize,
    m: usize,
    sloth_iter: usize
)

fn work_circuit(
    &mut self,
    typ: CSType,
    data_size: usize,
    challenge_count: usize,
    m: usize,
    sloth_iter: usize
)

fn clap(&self) -> ArgMatches

fn main()

fn create_proof<R: Rng>(
    &mut self,
    rng: &mut R,
    engine_params: &'a <Bls12 as JubjubEngine>::Params,
    groth_params: &Parameters<Bls12>,
    tree_depth: usize,
    challenge_count: usize,
    leaves: usize,
    m: usize,
    sloth_iter: usize
) -> Proof<Bls12>

fn get_num_constraints<R: Rng>(
    &mut self,
    rng: &mut R,
    engine_params: &'a JubjubBls12,
    tree_depth: usize,
    challenge_count: usize,
    leaves: usize,
    m: usize,
    sloth_iter: usize
) -> usize

Get the number of constraints of the circuit

Loading content...

Implementors

Loading content...