[][src]Trait storage_proofs::proof::ProofScheme

pub trait ProofScheme<'a> {
    type PublicParams: Clone;
    type SetupParams;
    type PublicInputs: Clone;
    type PrivateInputs;
    type Proof: Clone + Serialize + DeserializeOwned;
    type Requirements: Default;
    fn setup(_: &Self::SetupParams) -> Result<Self::PublicParams>;
fn prove<'b>(
        _: &'b Self::PublicParams,
        _: &'b Self::PublicInputs,
        _: &'b Self::PrivateInputs
    ) -> Result<Self::Proof>; fn prove_all_partitions<'b>(
        pub_params: &'b Self::PublicParams,
        pub_in: &'b Self::PublicInputs,
        priv_in: &'b Self::PrivateInputs,
        partition_count: usize
    ) -> Result<Vec<Self::Proof>> { ... }
fn verify(
        _pub_params: &Self::PublicParams,
        _pub_inputs: &Self::PublicInputs,
        _proof: &Self::Proof
    ) -> Result<bool> { ... }
fn verify_all_partitions(
        pub_params: &Self::PublicParams,
        pub_in: &Self::PublicInputs,
        proofs: &[Self::Proof]
    ) -> Result<bool> { ... }
fn with_partition(
        pub_in: Self::PublicInputs,
        _k: Option<usize>
    ) -> Self::PublicInputs { ... }
fn satisfies_requirements(
        _pub_params: &Self::PublicParams,
        _requirements: &Self::Requirements,
        _partitions: usize
    ) -> bool { ... } }

The ProofScheme trait provides the methods that any proof scheme needs to implement.

Associated Types

Loading content...

Required methods

fn setup(_: &Self::SetupParams) -> Result<Self::PublicParams>

setup is used to generate public parameters from setup parameters in order to specialize a ProofScheme to the specific parameters required by a consumer.

fn prove<'b>(
    _: &'b Self::PublicParams,
    _: &'b Self::PublicInputs,
    _: &'b Self::PrivateInputs
) -> Result<Self::Proof>

prove generates and returns a proof from public parameters, public inputs, and private inputs.

Loading content...

Provided methods

fn prove_all_partitions<'b>(
    pub_params: &'b Self::PublicParams,
    pub_in: &'b Self::PublicInputs,
    priv_in: &'b Self::PrivateInputs,
    partition_count: usize
) -> Result<Vec<Self::Proof>>

fn verify(
    _pub_params: &Self::PublicParams,
    _pub_inputs: &Self::PublicInputs,
    _proof: &Self::Proof
) -> Result<bool>

verify returns true if the supplied proof is valid for the given public parameter and public inputs. Note that verify does not have access to private inputs. Remember that proof is untrusted, and any data it provides MUST be validated as corresponding to the supplied public parameters and inputs.

fn verify_all_partitions(
    pub_params: &Self::PublicParams,
    pub_in: &Self::PublicInputs,
    proofs: &[Self::Proof]
) -> Result<bool>

fn with_partition(
    pub_in: Self::PublicInputs,
    _k: Option<usize>
) -> Self::PublicInputs

fn satisfies_requirements(
    _pub_params: &Self::PublicParams,
    _requirements: &Self::Requirements,
    _partitions: usize
) -> bool

Loading content...

Implementors

impl<'a, H, G> ProofScheme<'a> for DrgPoRep<'a, H, G> where
    H: 'a + Hasher,
    G: 'a + Graph<H> + ParameterSetMetadata
[src]

type PublicParams = PublicParams<H, G>

type SetupParams = SetupParams

type PublicInputs = PublicInputs<H::Domain>

type PrivateInputs = PrivateInputs<'a, H>

type Proof = Proof<H>

type Requirements = NoRequirements

impl<'a, H: 'a + Hasher> ProofScheme<'a> for BatchPoST<H>[src]

type PublicParams = PublicParams

type SetupParams = SetupParams

type PublicInputs = PublicInputs<'a, H::Domain>

type PrivateInputs = PrivateInputs<'a, H>

type Proof = Proof<H>

type Requirements = NoRequirements

impl<'a, H: 'a + Hasher> ProofScheme<'a> for MerklePoR<H>[src]

type PublicParams = PublicParams

type SetupParams = SetupParams

type PublicInputs = PublicInputs<H::Domain>

type PrivateInputs = PrivateInputs<'a, H>

type Proof = Proof<H>

type Requirements = NoRequirements

impl<'a, H: 'a + Hasher> ProofScheme<'a> for PoRC<'a, H>[src]

type PublicParams = PublicParams

type SetupParams = SetupParams

type PublicInputs = PublicInputs<'a, H::Domain>

type PrivateInputs = PrivateInputs<'a, H>

type Proof = Proof<H>

type Requirements = NoRequirements

impl<'a, H: Hasher + 'a, V: Vdf<H::Domain>> ProofScheme<'a> for VDFPoSt<H, V>[src]

type PublicParams = PublicParams<H::Domain, V>

type SetupParams = SetupParams<H::Domain, V>

type PublicInputs = PublicInputs<H::Domain>

type PrivateInputs = PrivateInputs<'a, H>

type Proof = Proof<'a, H, V>

type Requirements = NoRequirements

impl<'a, H: Hasher, V: Vdf<H::Domain>> ProofScheme<'a> for BeaconPoSt<H, V> where
    H: 'a, 
[src]

type PublicParams = PublicParams<H::Domain, V>

type SetupParams = SetupParams<H::Domain, V>

type PublicInputs = PublicInputs<H::Domain>

type PrivateInputs = PrivateInputs<'a, H>

type Proof = Proof<'a, H, V>

type Requirements = NoRequirements

impl<'a, L: Layers> ProofScheme<'a> for L[src]

type PublicParams = PublicParams<L::Hasher, L::Graph>

type SetupParams = SetupParams

type PublicInputs = PublicInputs<<L::Hasher as Hasher>::Domain>

type PrivateInputs = PrivateInputs<L::Hasher>

type Proof = Proof<L::Hasher>

type Requirements = ChallengeRequirements

Loading content...