Skip to main content

HashToGroup

Trait HashToGroup 

Source
pub trait HashToGroup {
    type Input;
    type Output;

    // Required method
    fn hash_to_group(
        &self,
        input: &[Self::Input],
    ) -> Result<Self::Output, Error>;
}
Expand description

A trait for a hash function that projects the value to an affine group element.

Required Associated Types§

Required Methods§

Source

fn hash_to_group(&self, input: &[Self::Input]) -> Result<Self::Output, Error>

Returns the hash of the given input.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<E, const RATE: usize> HashToGroup for Poseidon<E, RATE>
where E: Environment,

Source§

fn hash_to_group( &self, input: &[<Poseidon<E, RATE> as HashToGroup>::Input], ) -> Result<<Poseidon<E, RATE> as HashToGroup>::Output, Error>

Returns a group element from hashing the input.

Source§

type Input = Field<E>

Source§

type Output = Group<E>

Implementors§