halo2_base::poseidon

Trait PoseidonInstructions

Source
pub trait PoseidonInstructions<F: ScalarField> {
    // Required methods
    fn hash_var_len_bytes<const MAX_LEN: usize>(
        &self,
        ctx: &mut Context<F>,
        inputs: &VarLenBytes<F, MAX_LEN>,
    ) -> AssignedValue<F>
       where F: BigPrimeField;
    fn hash_var_len_bytes_vec(
        &self,
        ctx: &mut Context<F>,
        inputs: &VarLenBytesVec<F>,
    ) -> AssignedValue<F>
       where F: BigPrimeField;
    fn hash_fix_len_bytes<const MAX_LEN: usize>(
        &self,
        ctx: &mut Context<F>,
        inputs: &FixLenBytes<F, MAX_LEN>,
    ) -> AssignedValue<F>
       where F: BigPrimeField;
}
Expand description

Trait for Poseidon instructions

Required Methods§

Source

fn hash_var_len_bytes<const MAX_LEN: usize>( &self, ctx: &mut Context<F>, inputs: &VarLenBytes<F, MAX_LEN>, ) -> AssignedValue<F>
where F: BigPrimeField,

Return hash of a VarLenBytes

Source

fn hash_var_len_bytes_vec( &self, ctx: &mut Context<F>, inputs: &VarLenBytesVec<F>, ) -> AssignedValue<F>
where F: BigPrimeField,

Return hash of a VarLenBytesVec

Source

fn hash_fix_len_bytes<const MAX_LEN: usize>( &self, ctx: &mut Context<F>, inputs: &FixLenBytes<F, MAX_LEN>, ) -> AssignedValue<F>
where F: BigPrimeField,

Return hash of a FixLenBytes

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§

Source§

impl<'a, F: ScalarField, const T: usize, const RATE: usize> PoseidonInstructions<F> for PoseidonChip<'a, F, T, RATE>