pub trait Commitment:
AddAssign
+ SubAssign
+ Sized
+ Default
+ Clone
+ Neg<Output = Self>
+ Eq
+ Sub<Output = Self>
+ Debug
+ Sync
+ Send {
type Scalar: Scalar + for<'a> Mul<&'a Self, Output = Self> + Mul<Self, Output = Self> + Serialize + for<'a> Deserialize<'a>;
type PublicSetup<'a>;
// Required method
fn compute_commitments(
committable_columns: &[CommittableColumn<'_>],
offset: usize,
setup: &Self::PublicSetup<'_>,
) -> Vec<Self>;
}
Expand description
A trait for using commitment schemes generically.
Required Associated Types§
sourcetype Scalar: Scalar + for<'a> Mul<&'a Self, Output = Self> + Mul<Self, Output = Self> + Serialize + for<'a> Deserialize<'a>
type Scalar: Scalar + for<'a> Mul<&'a Self, Output = Self> + Mul<Self, Output = Self> + Serialize + for<'a> Deserialize<'a>
The associated scalar that the commitment is for. There are multiple possible commitment schemes for a scalar, but only one scalar for any commitment.
sourcetype PublicSetup<'a>
type PublicSetup<'a>
The public setup for the commitment scheme.
Required Methods§
sourcefn compute_commitments(
committable_columns: &[CommittableColumn<'_>],
offset: usize,
setup: &Self::PublicSetup<'_>,
) -> Vec<Self>
fn compute_commitments( committable_columns: &[CommittableColumn<'_>], offset: usize, setup: &Self::PublicSetup<'_>, ) -> Vec<Self>
Compute the commitments for the given columns.
The resulting commitments are written to the slice in commitments
, which is a buffer.
commitments
is expected to have the same length as committable_columns
and the behavior is undefined if it does not.
The length of each CommittableColumn should be the same.
offset
is the amount that committable_columns
is “offset” by. Logically adding offset
many 0s to the beginning of each of the committable_columns
.
Object Safety§
This trait is not object safe.