pub trait SequentialCommit {
type Commitment: From<Word>;
// Required method
fn to_elements(&self) -> Vec<Felt>;
// Provided method
fn to_commitment(&self) -> Self::Commitment { ... }
}Expand description
Defines how to compute a commitment to an object represented as a sequence of field elements.
Required Associated Types§
Sourcetype Commitment: From<Word>
type Commitment: From<Word>
A type of the commitment which must be derivable from Word.
Required Methods§
Sourcefn to_elements(&self) -> Vec<Felt>
fn to_elements(&self) -> Vec<Felt>
Returns a representation of the object as a sequence of fields elements.
Provided Methods§
Sourcefn to_commitment(&self) -> Self::Commitment
fn to_commitment(&self) -> Self::Commitment
Computes the commitment to the object.
The default implementation of this function uses RPO256 hash function to hash the sequence of elements returned from Self::to_elements().