pub trait FieldHash {
type HashRepr: AsRef<[u8]>;
// Required method
fn to_hash_repr(&self) -> Self::HashRepr;
// Provided methods
fn digest_update<D: Digest>(&self, d: &mut D) { ... }
fn transcript_update(&self, t: &mut Transcript, l: &'static [u8]) { ... }
}
Expand description
Trait for a field element that can be hashed via digest::Digest
Required Associated Types§
Required Methods§
Sourcefn to_hash_repr(&self) -> Self::HashRepr
fn to_hash_repr(&self) -> Self::HashRepr
Convert Self
into a HashRepr
for hashing
Provided Methods§
Sourcefn digest_update<D: Digest>(&self, d: &mut D)
fn digest_update<D: Digest>(&self, d: &mut D)
Update the digest d
with the HashRepr
of Self
Sourcefn transcript_update(&self, t: &mut Transcript, l: &'static [u8])
fn transcript_update(&self, t: &mut Transcript, l: &'static [u8])
Update the merlin::Transcript t
with the HashRepr
of Self
with label l
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.