[][src]Struct storage_proofs::piece_inclusion_proof::PieceInclusionProof

pub struct PieceInclusionProof<H: Hasher> { /* fields omitted */ }

Based on the alignment information (and sector size, provided during verification), the algorithm deterministically consumes the elements.

Methods

impl<H: Hasher> PieceInclusionProof<H>[src]

pub fn new(
    piece_spec: PieceSpec,
    tree: &MerkleTree<H::Domain, H::Function>
) -> Result<PieceInclusionProof<H>>
[src]

pub fn verify(
    &self,
    root: &H::Domain,
    comm_p: &H::Domain,
    piece_leaves: usize,
    sector_leaves: usize
) -> bool
[src]

verify takes a merkle root and (pre-processed) piece data. Iff it returns true, then PieceInclusionProof indeed proves that piece's bytes were included in the merkle tree corresponding to root -- and at the position encoded in the proof. piece_leaves and sector_leaves are in units of Domain (i.e. NODE_SIZE = 32 bytes).

pub fn verify_all(
    root: &[u8],
    proofs: &[PieceInclusionProof<H>],
    comm_ps: &[Fr32Ary],
    piece_sizes: &[usize],
    sector_size: usize
) -> Result<bool>
[src]

verify_piece_inclusion_proofs returns true iff each provided piece is proved with respect to root by the corresponding (by index) proof.

Trait Implementations

impl<H: Hasher> From<PieceInclusionProof<H>> for Vec<u8>[src]

impl<H: Clone + Hasher> Clone for PieceInclusionProof<H> where
    H::Domain: Clone
[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<H: Debug + Hasher> Debug for PieceInclusionProof<H> where
    H::Domain: Debug
[src]

impl<'_, H: Hasher> TryFrom<&'_ [u8]> for PieceInclusionProof<H>[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<H> Send for PieceInclusionProof<H> where
    <H as Hasher>::Domain: Send

impl<H> Unpin for PieceInclusionProof<H> where
    <H as Hasher>::Domain: Unpin

impl<H> Sync for PieceInclusionProof<H> where
    <H as Hasher>::Domain: Sync

impl<H> UnwindSafe for PieceInclusionProof<H> where
    <H as Hasher>::Domain: UnwindSafe

impl<H> RefUnwindSafe for PieceInclusionProof<H> where
    <H as Hasher>::Domain: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,