Struct HierarchicalCommitment

Source
pub struct HierarchicalCommitment<const M: usize, const N: usize, const D: usize> { /* private fields */ }
Expand description

Two-layer commitment structure with inner and outer commitments

  • M: Size of commitment output
  • N: Size of witness vector
  • D: Degree of the polynomials

Implementations§

Source§

impl<const M: usize, const N: usize, const D: usize> HierarchicalCommitment<M, N, D>

Source

pub fn new( params: AjtaiParameters, inner_matrix: RqMatrix<M, N, D>, outer_matrix: RqMatrix<M, N, D>, decomp_params: DecompositionParameters, ) -> Result<Self, HierarchicalError>

Creates a new hierarchical commitment scheme with separate matrices for inner and outer commitments Both schemes use the same AjtaiParameters for consistent security

Source

pub fn commit_batch( &self, witnesses: &[RqVector<N, D>], ) -> Result<HierarchicalProof<M, N, D>, HierarchicalError>

Commits to a batch of witnesses using the hierarchical structure This creates both inner commitments for each witness and an outer commitment that summarizes them all, providing a more compact representation

Source

pub fn verify( &self, proof: &HierarchicalProof<M, N, D>, ) -> Result<(), HierarchicalError>

Verifies a hierarchical proof This ensures:

  1. All inner commitments match their openings
  2. The decomposed parts match what’s stored in the proof
  3. The outer commitment correctly summarizes the inner commitments
  4. The outer commitment matches its opening
Source

pub fn inner_scheme(&self) -> &AjtaiCommitment<M, N, D>

Returns a reference to the inner commitment scheme

Source

pub fn outer_scheme(&self) -> &AjtaiCommitment<M, N, D>

Returns a reference to the outer commitment scheme

Source

pub fn decomp_params(&self) -> &DecompositionParameters

Returns a reference to the decomposition parameters

Trait Implementations§

Source§

impl<const M: usize, const N: usize, const D: usize> Debug for HierarchicalCommitment<M, N, D>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<const M: usize, const N: usize, const D: usize> Freeze for HierarchicalCommitment<M, N, D>

§

impl<const M: usize, const N: usize, const D: usize> RefUnwindSafe for HierarchicalCommitment<M, N, D>

§

impl<const M: usize, const N: usize, const D: usize> Send for HierarchicalCommitment<M, N, D>

§

impl<const M: usize, const N: usize, const D: usize> Sync for HierarchicalCommitment<M, N, D>

§

impl<const M: usize, const N: usize, const D: usize> Unpin for HierarchicalCommitment<M, N, D>

§

impl<const M: usize, const N: usize, const D: usize> UnwindSafe for HierarchicalCommitment<M, N, D>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

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

§

fn vzip(self) -> V