Trait winter_crypto::ElementHasher [−][src]
pub trait ElementHasher: Hasher {
type BaseField: StarkField;
fn hash_elements<E>(elements: &[E]) -> Self::Digest
where
E: FieldElement<BaseField = Self::BaseField>;
}
Expand description
Defines a cryptographic hash function for hashing field elements.
This trait defines a hash procedure for a sequence of field elements. The elements can be either in the base field specified for this hasher, or in an extension of the base field.
Associated Types
type BaseField: StarkField
type BaseField: StarkField
Specifies a base field for elements which can be hashed with this hasher.
Required methods
fn hash_elements<E>(elements: &[E]) -> Self::Digest where
E: FieldElement<BaseField = Self::BaseField>,
fn hash_elements<E>(elements: &[E]) -> Self::Digest where
E: FieldElement<BaseField = Self::BaseField>,
Returns a hash of the provided field elements.
For malleable field elements, the elements are normalized first, and the hash is computed from internal representations of the normalized elements.