Trait FieldHash

Source
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§

Source

type HashRepr: AsRef<[u8]>

A representation of Self that can be converted to a slice of u8.

Required Methods§

Source

fn to_hash_repr(&self) -> Self::HashRepr

Convert Self into a HashRepr for hashing

Provided Methods§

Source

fn digest_update<D: Digest>(&self, d: &mut D)

Update the digest d with the HashRepr of Self

Source

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.

Implementors§