Trait proof_of_sql::base::commitment::Commitment
source · pub trait Commitment: AddAssign + SubAssign + Sized + Default + Copy + 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;
// Required methods
fn compute_commitments(
commitments: &mut [Self],
committable_columns: &[CommittableColumn<'_>],
offset: usize,
setup: &Self::PublicSetup,
);
fn fold_commitments(
commitments: &[Self],
multipliers: &[Self::Scalar],
) -> 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
type PublicSetup
The public setup for the commitment scheme.
Required Methods§
sourcefn compute_commitments(
commitments: &mut [Self],
committable_columns: &[CommittableColumn<'_>],
offset: usize,
setup: &Self::PublicSetup,
)
fn compute_commitments( commitments: &mut [Self], committable_columns: &[CommittableColumn<'_>], offset: usize, setup: &Self::PublicSetup, )
Compute the commitments for the given columns.
sourcefn fold_commitments(commitments: &[Self], multipliers: &[Self::Scalar]) -> Self
fn fold_commitments(commitments: &[Self], multipliers: &[Self::Scalar]) -> Self
Compute a linear combination of the given commitments: sum commitment[i] * multiplier[i]
.
Object Safety§
This trait is not object safe.