package bls12-381-hash

  1. Overview
  2. Docs

Module Bls12_381_hash.AnemoiSource

Implementation of AnemoiJive over the scalar field of BLS12-381.

Sourcetype ctxt

A context contains the state and the instance parameters

Sourceval allocate_ctxt : ?mds:Bls12_381.Fr.t array array -> ?constants:Bls12_381.Fr.t array -> int -> int -> ctxt

allocate_ctxt ?mds ?constants l nb_rounds. Allocate a context for a specific instance of Anemoi

Sourceval get_state : ctxt -> Bls12_381.Fr.t array

Return the current state of the context

Sourceval get_state_size : ctxt -> int

Return the state size of the context

Sourceval set_state : ctxt -> Bls12_381.Fr.t array -> unit

set_state ctxt state. Set the context state to the given value. The value state must be of the same size than the expecting state

Sourceval apply_permutation : ctxt -> unit

Apply a permutation on the current state of the context

Sourceval jive128_1_compress : Bls12_381.Fr.t -> Bls12_381.Fr.t -> Bls12_381.Fr.t

jive128_1_compress x y calls AnemoiJive for l = 1 on x and y to compute (u, v) and returns x + y + u + v

Sourcemodule Parameters : sig ... end

Set of parameters for BLS12-381, and parameters for specific instantiations given in the reference paper