Enum winter_verifier::HashFunction [−][src]
#[repr(u8)]
pub enum HashFunction {
Blake3_192,
Blake3_256,
Sha3_256,
}Expand description
Defines a set of available hash function for STARK protocol.
Choice of a hash function has a direct impact on proof generation time, proof size, and proof soundness. In general, sounds of the proof is bounded by the collision resistance of the hash function used by the protocol.
Variants
BLAKE3 hash function with 192 bit output.
When this function is used in the STARK protocol, proof security cannot exceed 96 bits.
BLAKE3 hash function with 256 bit output.
When this function is used in the STARK protocol, proof security cannot exceed 128 bits.
SHA3 hash function with 256 bit output.
When this function is used in the STARK protocol, proof security cannot exceed 128 bits.
Implementations
Returns collision resistance of this hash function in bits.
Trait Implementations
pub fn read_from<R>(
source: &mut R
) -> Result<HashFunction, DeserializationError> where
R: ByteReader,
pub fn read_from<R>(
source: &mut R
) -> Result<HashFunction, DeserializationError> where
R: ByteReader,
Reads a hash function enum from the specified source.
fn read_batch_from<R>(
source: &mut R,
num_elements: usize
) -> Result<Vec<Self, Global>, DeserializationError> where
R: ByteReader,
fn read_batch_from<R>(
source: &mut R,
num_elements: usize
) -> Result<Vec<Self, Global>, DeserializationError> where
R: ByteReader,
Reads a sequence of bytes from the provided source, attempts to deserialize these bytes
into a vector with the specified number of Self elements, and returns the result. Read more
Auto Trait Implementations
impl RefUnwindSafe for HashFunction
impl Send for HashFunction
impl Sync for HashFunction
impl Unpin for HashFunction
impl UnwindSafe for HashFunction
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self