Struct filecoin_hashers::blake2s::Blake2sDomain[][src]

pub struct Blake2sDomain(pub [u8; 32]);

Implementations

impl Blake2sDomain[src]

pub fn trim_to_fr32(&mut self)[src]

Trait Implementations

impl Algorithm<Blake2sDomain> for Blake2sFunction[src]

fn hash(&mut self) -> Blake2sDomain[src]

Returns the hash value for the data stream written so far.

fn reset(&mut self)[src]

Reset Hasher state.

fn leaf(&mut self, leaf: Blake2sDomain) -> Blake2sDomain[src]

Returns hash value for MT leaf (prefix 0x00).

fn node(
    &mut self,
    left: Blake2sDomain,
    right: Blake2sDomain,
    _height: usize
) -> Blake2sDomain
[src]

Returns hash value for MT interior node (prefix 0x01).

fn multi_node(
    &mut self,
    parts: &[Blake2sDomain],
    _height: usize
) -> Blake2sDomain
[src]

Returns hash value for MT interior node (prefix 0x01).

impl AsRef<[u8]> for Blake2sDomain[src]

fn as_ref(&self) -> &[u8][src]

Performs the conversion.

impl AsRef<Blake2sDomain> for Blake2sDomain[src]

fn as_ref(&self) -> &Self[src]

Performs the conversion.

impl Clone for Blake2sDomain[src]

fn clone(&self) -> Blake2sDomain[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Blake2sDomain[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Default for Blake2sDomain[src]

fn default() -> Blake2sDomain[src]

Returns the “default value” for a type. Read more

impl<'de> Deserialize<'de> for Blake2sDomain[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl Domain for Blake2sDomain[src]

fn into_bytes(&self) -> Vec<u8>[src]

fn try_from_bytes(raw: &[u8]) -> Result<Self>[src]

fn write_bytes(&self, dest: &mut [u8]) -> Result<()>[src]

Write itself into the given slice, LittleEndian bytes.

fn random<R: RngCore>(rng: &mut R) -> Self[src]

impl Element for Blake2sDomain[src]

fn byte_len() -> usize[src]

Returns the length of an element when serialized as a byte slice.

fn from_slice(bytes: &[u8]) -> Self[src]

Creates the element from its byte form. Panics if the slice is not appropriately sized.

fn copy_to_slice(&self, bytes: &mut [u8])[src]

impl From<[u8; 32]> for Blake2sDomain[src]

fn from(val: [u8; 32]) -> Self[src]

Performs the conversion.

impl From<Fr> for Blake2sDomain[src]

fn from(val: Fr) -> Self[src]

Performs the conversion.

impl From<FrRepr> for Blake2sDomain[src]

fn from(val: FrRepr) -> Self[src]

Performs the conversion.

impl Hash for Blake2sDomain[src]

fn hash<__H: Hasher>(&self, state: &mut __H)[src]

Feeds this value into the given Hasher. Read more

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0[src]

Feeds a slice of this type into the given Hasher. Read more

impl HashFunction<Blake2sDomain> for Blake2sFunction[src]

fn hash(data: &[u8]) -> Blake2sDomain[src]

fn hash2(a: &Blake2sDomain, b: &Blake2sDomain) -> Blake2sDomain[src]

fn hash_multi_leaf_circuit<Arity, CS: ConstraintSystem<Bls12>>(
    cs: CS,
    leaves: &[AllocatedNum<Bls12>],
    _height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]

fn hash_leaf_bits_circuit<CS: ConstraintSystem<Bls12>>(
    cs: CS,
    left: &[Boolean],
    right: &[Boolean],
    _height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]

fn hash_circuit<CS: ConstraintSystem<Bls12>>(
    cs: CS,
    bits: &[Boolean]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]

fn hash2_circuit<CS>(
    cs: CS,
    a_num: &AllocatedNum<Bls12>,
    b_num: &AllocatedNum<Bls12>
) -> Result<AllocatedNum<Bls12>, SynthesisError> where
    CS: ConstraintSystem<Bls12>, 
[src]

fn hash_md(input: &[T]) -> T[src]

fn hash_leaf(data: &dyn LightHashable<Self>) -> T[src]

fn hash_single_node(data: &dyn LightHashable<Self>) -> T[src]

fn hash_leaf_circuit<CS: ConstraintSystem<Bls12>>(
    cs: CS,
    left: &AllocatedNum<Bls12>,
    right: &AllocatedNum<Bls12>,
    height: usize
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]

fn hash_md_circuit<CS: ConstraintSystem<Bls12>>(
    _cs: &mut CS,
    _elements: &[AllocatedNum<Bls12>]
) -> Result<AllocatedNum<Bls12>, SynthesisError>
[src]

impl Hashable<Blake2sFunction> for Blake2sDomain[src]

fn hash(&self, state: &mut Blake2sFunction)[src]

Feeds this value into the given Hasher. Read more

fn hash_slice(data: &[Self], state: &mut H)[src]

Feeds a slice of this type into the given Hasher. Read more

impl Ord for Blake2sDomain[src]

fn cmp(&self, other: &Blake2sDomain) -> Ordering[src]

This method returns an Ordering between self and other. Read more

#[must_use]
fn max(self, other: Self) -> Self
1.21.0[src]

Compares and returns the maximum of two values. Read more

#[must_use]
fn min(self, other: Self) -> Self
1.21.0[src]

Compares and returns the minimum of two values. Read more

#[must_use]
fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]

Restrict a value to a certain interval. Read more

impl PartialEq<Blake2sDomain> for Blake2sDomain[src]

fn eq(&self, other: &Blake2sDomain) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &Blake2sDomain) -> bool[src]

This method tests for !=.

impl PartialOrd<Blake2sDomain> for Blake2sDomain[src]

fn partial_cmp(&self, other: &Blake2sDomain) -> Option<Ordering>[src]

This method returns an ordering between self and other values if one exists. Read more

#[must_use]
fn lt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than (for self and other) and is used by the < operator. Read more

#[must_use]
fn le(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

#[must_use]
fn gt(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

#[must_use]
fn ge(&self, other: &Rhs) -> bool
1.0.0[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

impl Serialize for Blake2sDomain[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl Copy for Blake2sDomain[src]

impl Eq for Blake2sDomain[src]

impl StructuralEq for Blake2sDomain[src]

impl StructuralPartialEq for Blake2sDomain[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToHex for T where
    T: AsRef<[u8]>, 
[src]

pub fn encode_hex<U>(&self) -> U where
    U: FromIterator<char>, 
[src]

Encode the hex strict representing self into the result. Lower case letters are used (e.g. f9b4ca) Read more

pub fn encode_hex_upper<U>(&self) -> U where
    U: FromIterator<char>, 
[src]

Encode the hex strict representing self into the result. Upper case letters are used (e.g. F9B4CA) Read more

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

pub fn vzip(self) -> V

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]