Enum winter_verifier::HashFunction
source · [−]#[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_192
BLAKE3 hash function with 192 bit output.
When this function is used in the STARK protocol, proof security cannot exceed 96 bits.
Blake3_256
BLAKE3 hash function with 256 bit output.
When this function is used in the STARK protocol, proof security cannot exceed 128 bits.
Sha3_256
SHA3 hash function with 256 bit output.
When this function is used in the STARK protocol, proof security cannot exceed 128 bits.
Implementations
sourceimpl HashFunction
impl HashFunction
sourcepub fn collision_resistance(&self) -> u32
pub fn collision_resistance(&self) -> u32
Returns collision resistance of this hash function in bits.
Trait Implementations
sourceimpl Clone for HashFunction
impl Clone for HashFunction
sourcefn clone(&self) -> HashFunction
fn clone(&self) -> HashFunction
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for HashFunction
impl Debug for HashFunction
sourceimpl Deserializable for HashFunction
impl Deserializable for HashFunction
sourcefn read_from<R>(source: &mut R) -> Result<HashFunction, DeserializationError> where
R: ByteReader,
fn read_from<R>(source: &mut R) -> Result<HashFunction, DeserializationError> where
R: ByteReader,
Reads a hash function enum from the specified source.
sourcefn 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
sourceimpl PartialEq<HashFunction> for HashFunction
impl PartialEq<HashFunction> for HashFunction
sourceimpl Serializable for HashFunction
impl Serializable for HashFunction
sourcefn write_into<W>(&self, target: &mut W) where
W: ByteWriter,
fn write_into<W>(&self, target: &mut W) where
W: ByteWriter,
Serializes self and writes the resulting bytes into the target.
sourcefn write_batch_into<W>(source: &[Self], target: &mut W) where
W: ByteWriter,
fn write_batch_into<W>(source: &[Self], target: &mut W) where
W: ByteWriter,
Serializes all elements of the source and writes these bytes into the target. Read more
sourcefn get_size_hint(&self) -> usize
fn get_size_hint(&self) -> usize
Returns an estimate of how many bytes are needed to represent self. Read more
impl Copy for HashFunction
impl Eq for HashFunction
impl StructuralEq for HashFunction
impl StructuralPartialEq for HashFunction
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more