#[repr(C)]pub struct MerkleVerifyCols<T> {Show 16 fields
pub proof_idx: T,
pub is_valid: T,
pub is_last_merkle: T,
pub is_combining_leaves: T,
pub is_last_leaf: T,
pub leaf_sub_idx: T,
pub merkle_idx_bit_src: T,
pub current_idx_bit_src: T,
pub total_depth: T,
pub height: T,
pub left: [T; 8],
pub right: [T; 8],
pub recv_flag: T,
pub commit_major: T,
pub commit_minor: T,
pub compression_output: [T; 8],
}Expand description
There are two parts in the merkle proof: hashing leaves and the (standard) merkle proof.
Example: (k = 2), going from left to right
leaf0
leaf1 -> a
leaf2 \
leaf3 -> b -> c \ will start hashing with merkle proof siblings
merkle_sibing -> …
(First part) Hashing leaves: there are 2^k leaves, each is [T; DIGEST_SIZE]. Each row in
MerkleVerify AIR represents a Poseidon2 compression (of two leaves, or two intermediate values).
So there are 2^k - 1 rows for this part. At height 0, the leaves are at the bottom (leaf0 ~
leaf3) in the diagram above. At height 1 are the intermediate hashes (a, b) in the diagram
above. The first row in the AIR will be Poseidon2 compression of leaf0 and leaf1, and the second
row will be Poseidon2 compression of leaf2 and leaf3. And the third row will be Poseidon2
compression of a and b.
(Second part) Standard merkle proof, the next row will be Poseidon2 compression of c and the
sibling of c.
Fields§
§proof_idx: TIndex of the proof this row is for
is_valid: TIndicator: whether this row is valid
is_last_merkle: TIndicator: whether this is the last row of a merkle proof
is_combining_leaves: TIndicator: whether this row hashes two leaves or is part of the Merkle path proof
is_last_leaf: TIndicator: whether this row is the root of the hashed leaves
leaf_sub_idx: TRow node index of this node in the leaf hash tree, 0 if is_combining_leaves is false
merkle_idx_bit_src: TThe merkle idx of the leaf hash root
current_idx_bit_src: TMerkle idx suffix after shifting right max(0, height - k) bits
total_depth: TTotal depth of the merkle proof including the leaves part = merkle_proof.len() + 1 + k
height: T0 -> total_depth - 1, where leaves are at height 0, combined leaf hash is at height k
left: [T; 8]§right: [T; 8]§recv_flag: TFlag that indicates what to receive; 0 for left, 1 for right, 2 for both
commit_major: T§commit_minor: T§compression_output: [T; 8]Implementations§
Trait Implementations§
Source§impl<T> Borrow<MerkleVerifyCols<T>> for [T]
impl<T> Borrow<MerkleVerifyCols<T>> for [T]
Source§fn borrow(&self) -> &MerkleVerifyCols<T>
fn borrow(&self) -> &MerkleVerifyCols<T>
Source§impl<T> BorrowMut<MerkleVerifyCols<T>> for [T]
impl<T> BorrowMut<MerkleVerifyCols<T>> for [T]
Source§fn borrow_mut(&mut self) -> &mut MerkleVerifyCols<T>
fn borrow_mut(&mut self) -> &mut MerkleVerifyCols<T>
Source§impl<T> StructReflectionHelper for MerkleVerifyCols<T>
impl<T> StructReflectionHelper for MerkleVerifyCols<T>
Auto Trait Implementations§
impl<T> Freeze for MerkleVerifyCols<T>where
T: Freeze,
impl<T> RefUnwindSafe for MerkleVerifyCols<T>where
T: RefUnwindSafe,
impl<T> Send for MerkleVerifyCols<T>where
T: Send,
impl<T> Sync for MerkleVerifyCols<T>where
T: Sync,
impl<T> Unpin for MerkleVerifyCols<T>where
T: Unpin,
impl<T> UnwindSafe for MerkleVerifyCols<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.