[−][src]Trait storage_proofs::proof::ProofScheme
The ProofScheme trait provides the methods that any proof scheme needs to implement.
Associated Types
type PublicParams: Clone
type SetupParams
type PublicInputs: Clone
type PrivateInputs
type Proof: Clone + Serialize + DeserializeOwned
type Requirements: Default
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>
_: &'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.
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>>
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>
_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>
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
pub_in: Self::PublicInputs,
_k: Option<usize>
) -> Self::PublicInputs
fn satisfies_requirements(
_pub_params: &Self::PublicParams,
_requirements: &Self::Requirements,
_partitions: usize
) -> bool
_pub_params: &Self::PublicParams,
_requirements: &Self::Requirements,
_partitions: usize
) -> bool
Implementors
impl<'a, H, G> ProofScheme<'a> for DrgPoRep<'a, H, G> where
H: 'a + Hasher,
G: 'a + Graph<H> + ParameterSetMetadata,
[src]
H: 'a + Hasher,
G: 'a + Graph<H> + ParameterSetMetadata,
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
fn setup(sp: &Self::SetupParams) -> Result<Self::PublicParams>
[src]
fn prove<'b>(
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs
) -> Result<Self::Proof>
[src]
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs
) -> Result<Self::Proof>
fn verify(
pub_params: &Self::PublicParams,
pub_inputs: &Self::PublicInputs,
proof: &Self::Proof
) -> Result<bool>
[src]
pub_params: &Self::PublicParams,
pub_inputs: &Self::PublicInputs,
proof: &Self::Proof
) -> Result<bool>
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
fn setup(_sp: &Self::SetupParams) -> Result<Self::PublicParams>
[src]
fn prove<'b>(
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs
) -> Result<Self::Proof>
[src]
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs
) -> Result<Self::Proof>
fn verify(
pub_params: &Self::PublicParams,
pub_inputs: &Self::PublicInputs,
proof: &Self::Proof
) -> Result<bool>
[src]
pub_params: &Self::PublicParams,
pub_inputs: &Self::PublicInputs,
proof: &Self::Proof
) -> Result<bool>
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
fn setup(sp: &SetupParams) -> Result<PublicParams>
[src]
fn prove<'b>(
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs
) -> Result<Self::Proof>
[src]
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs
) -> Result<Self::Proof>
fn verify(
pub_params: &Self::PublicParams,
pub_inputs: &Self::PublicInputs,
proof: &Self::Proof
) -> Result<bool>
[src]
pub_params: &Self::PublicParams,
pub_inputs: &Self::PublicInputs,
proof: &Self::Proof
) -> Result<bool>
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
fn setup(sp: &Self::SetupParams) -> Result<Self::PublicParams>
[src]
fn prove<'b>(
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs
) -> Result<Self::Proof>
[src]
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs
) -> Result<Self::Proof>
fn verify(
pub_params: &Self::PublicParams,
pub_inputs: &Self::PublicInputs,
proof: &Self::Proof
) -> Result<bool>
[src]
pub_params: &Self::PublicParams,
pub_inputs: &Self::PublicInputs,
proof: &Self::Proof
) -> Result<bool>
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
fn setup(sp: &Self::SetupParams) -> Result<Self::PublicParams>
[src]
fn prove<'b>(
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs
) -> Result<Self::Proof>
[src]
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs
) -> Result<Self::Proof>
fn verify(
pub_params: &Self::PublicParams,
pub_inputs: &Self::PublicInputs,
proof: &Self::Proof
) -> Result<bool>
[src]
pub_params: &Self::PublicParams,
pub_inputs: &Self::PublicInputs,
proof: &Self::Proof
) -> Result<bool>
impl<'a, H: Hasher, V: Vdf<H::Domain>> ProofScheme<'a> for BeaconPoSt<H, V> where
H: 'a,
[src]
H: 'a,
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
fn setup(sp: &SetupParams<H::Domain, V>) -> Result<PublicParams<H::Domain, V>>
[src]
fn prove<'b>(
pub_params: &'b PublicParams<H::Domain, V>,
pub_inputs: &'b PublicInputs<H::Domain>,
priv_inputs: &'b PrivateInputs<'a, H>
) -> Result<Proof<'a, H, V>>
[src]
pub_params: &'b PublicParams<H::Domain, V>,
pub_inputs: &'b PublicInputs<H::Domain>,
priv_inputs: &'b PrivateInputs<'a, H>
) -> Result<Proof<'a, H, V>>
fn verify(
pub_params: &PublicParams<H::Domain, V>,
pub_inputs: &PublicInputs<H::Domain>,
proof: &Proof<H, V>
) -> Result<bool>
[src]
pub_params: &PublicParams<H::Domain, V>,
pub_inputs: &PublicInputs<H::Domain>,
proof: &Proof<H, V>
) -> Result<bool>
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
fn setup(sp: &Self::SetupParams) -> Result<Self::PublicParams>
[src]
fn prove<'b>(
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs
) -> Result<Self::Proof>
[src]
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs
) -> Result<Self::Proof>
fn prove_all_partitions<'b>(
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs,
partition_count: usize
) -> Result<Vec<Self::Proof>>
[src]
pub_params: &'b Self::PublicParams,
pub_inputs: &'b Self::PublicInputs,
priv_inputs: &'b Self::PrivateInputs,
partition_count: usize
) -> Result<Vec<Self::Proof>>
fn verify_all_partitions(
pub_params: &Self::PublicParams,
pub_inputs: &Self::PublicInputs,
partition_proofs: &[Self::Proof]
) -> Result<bool>
[src]
pub_params: &Self::PublicParams,
pub_inputs: &Self::PublicInputs,
partition_proofs: &[Self::Proof]
) -> Result<bool>
fn with_partition(
pub_in: Self::PublicInputs,
k: Option<usize>
) -> Self::PublicInputs
[src]
pub_in: Self::PublicInputs,
k: Option<usize>
) -> Self::PublicInputs
fn satisfies_requirements(
public_params: &PublicParams<L::Hasher, L::Graph>,
requirements: &ChallengeRequirements,
partitions: usize
) -> bool
[src]
public_params: &PublicParams<L::Hasher, L::Graph>,
requirements: &ChallengeRequirements,
partitions: usize
) -> bool