[][src]Trait storage_proofs::layered_drgporep::Layers

pub trait Layers {
    type Hasher: Hasher;
    type Graph: Layerable<Self::Hasher> + ParameterSetMetadata + Sync + Send;
    fn transform(graph: &Self::Graph) -> Self::Graph;
fn invert_transform(graph: &Self::Graph) -> Self::Graph; fn prove_layers<'a>(
        graph: &Self::Graph,
        sloth_iter: usize,
        pub_inputs: &PublicInputs<<Self::Hasher as Hasher>::Domain>,
        tau: &[Tau<<Self::Hasher as Hasher>::Domain>],
        aux: &'a [MerkleTree<<Self::Hasher as Hasher>::Domain, <Self::Hasher as Hasher>::Function>],
        layer_challenges: &LayerChallenges,
        layers: usize,
        total_layers: usize,
        partition_count: usize
    ) -> Result<Vec<Vec<EncodingProof<Self::Hasher>>>> { ... }
fn extract_and_invert_transform_layers<'a>(
        graph: &Self::Graph,
        sloth_iter: usize,
        layer_challenges: &LayerChallenges,
        replica_id: &<Self::Hasher as Hasher>::Domain,
        data: &'a mut [u8]
    ) -> Result<()> { ... }
fn transform_and_replicate_layers(
        graph: &Self::Graph,
        sloth_iter: usize,
        layer_challenges: &LayerChallenges,
        replica_id: &<Self::Hasher as Hasher>::Domain,
        data: &mut [u8]
    ) -> Result<(Vec<Tau<<Self::Hasher as Hasher>::Domain>>, Vec<MerkleTree<<Self::Hasher as Hasher>::Domain, <Self::Hasher as Hasher>::Function>>)> { ... }
fn generate_data_tree(
        graph: &Self::Graph,
        data: &[u8],
        _layer: usize
    ) -> MerkleTree<<Self::Hasher as Hasher>::Domain, <Self::Hasher as Hasher>::Function> { ... } }

Layers provides default implementations of methods required to handle proof and verification of layered proofs of replication. Implementations must provide transform and invert_transform methods.

Associated Types

Loading content...

Required methods

fn transform(graph: &Self::Graph) -> Self::Graph

Transform a layer's public parameters, returning new public parameters corresponding to the next layer. Warning: This method will likely need to be extended for other implementations but because it is not clear what parameters they will need, only the ones needed for zizag are currently present (same applies to [invert_transform]).

fn invert_transform(graph: &Self::Graph) -> Self::Graph

Transform a layer's public parameters, returning new public parameters corresponding to the previous layer.

Loading content...

Provided methods

fn prove_layers<'a>(
    graph: &Self::Graph,
    sloth_iter: usize,
    pub_inputs: &PublicInputs<<Self::Hasher as Hasher>::Domain>,
    tau: &[Tau<<Self::Hasher as Hasher>::Domain>],
    aux: &'a [MerkleTree<<Self::Hasher as Hasher>::Domain, <Self::Hasher as Hasher>::Function>],
    layer_challenges: &LayerChallenges,
    layers: usize,
    total_layers: usize,
    partition_count: usize
) -> Result<Vec<Vec<EncodingProof<Self::Hasher>>>>

fn extract_and_invert_transform_layers<'a>(
    graph: &Self::Graph,
    sloth_iter: usize,
    layer_challenges: &LayerChallenges,
    replica_id: &<Self::Hasher as Hasher>::Domain,
    data: &'a mut [u8]
) -> Result<()>

fn transform_and_replicate_layers(
    graph: &Self::Graph,
    sloth_iter: usize,
    layer_challenges: &LayerChallenges,
    replica_id: &<Self::Hasher as Hasher>::Domain,
    data: &mut [u8]
) -> Result<(Vec<Tau<<Self::Hasher as Hasher>::Domain>>, Vec<MerkleTree<<Self::Hasher as Hasher>::Domain, <Self::Hasher as Hasher>::Function>>)>

fn generate_data_tree(
    graph: &Self::Graph,
    data: &[u8],
    _layer: usize
) -> MerkleTree<<Self::Hasher as Hasher>::Domain, <Self::Hasher as Hasher>::Function>

Loading content...

Implementors

impl<'a, H: 'static + Hasher> Layers for ZigZagDrgPoRep<'a, H>[src]

type Hasher = <ZigZagBucketGraph<H> as ZigZag>::BaseHasher

type Graph = ZigZagBucketGraph<Self::Hasher>

Loading content...