[−][src]Struct storage_proofs::piece_inclusion_proof::PieceInclusionProof
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]
piece_spec: PieceSpec,
tree: &MerkleTree<H::Domain, H::Function>
) -> Result<PieceInclusionProof<H>>
pub fn verify(
&self,
root: &H::Domain,
comm_p: &H::Domain,
piece_leaves: usize,
sector_leaves: usize
) -> bool
[src]
&self,
root: &H::Domain,
comm_p: &H::Domain,
piece_leaves: usize,
sector_leaves: usize
) -> bool
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]
root: &[u8],
proofs: &[PieceInclusionProof<H>],
comm_ps: &[Fr32Ary],
piece_sizes: &[usize],
sector_size: usize
) -> Result<bool>
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]
fn from(proof: PieceInclusionProof<H>) -> Self
[src]
impl<H: Clone + Hasher> Clone for PieceInclusionProof<H> where
H::Domain: Clone,
[src]
H::Domain: Clone,
fn clone(&self) -> PieceInclusionProof<H>
[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]
H::Domain: Debug,
impl<'_, H: Hasher> TryFrom<&'_ [u8]> for PieceInclusionProof<H>
[src]
Auto Trait Implementations
impl<H> Send for PieceInclusionProof<H> where
<H as Hasher>::Domain: Send,
<H as Hasher>::Domain: Send,
impl<H> Unpin for PieceInclusionProof<H> where
<H as Hasher>::Domain: Unpin,
<H as Hasher>::Domain: Unpin,
impl<H> Sync for PieceInclusionProof<H> where
<H as Hasher>::Domain: Sync,
<H as Hasher>::Domain: Sync,
impl<H> UnwindSafe for PieceInclusionProof<H> where
<H as Hasher>::Domain: UnwindSafe,
<H as Hasher>::Domain: UnwindSafe,
impl<H> RefUnwindSafe for PieceInclusionProof<H> where
<H as Hasher>::Domain: RefUnwindSafe,
<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]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> SendSyncUnwindSafe for T where
T: Send + Sync + UnwindSafe + ?Sized,
[src]
T: Send + Sync + UnwindSafe + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,