package bls12-381-hash

  1. Overview
  2. Docs

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

type ctxt

A context contains the state and the instance parameters

val 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

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

Return the current state of the context

val get_state_size : ctxt -> int

Return the state size of the context

val 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

val apply_permutation : ctxt -> unit

Apply a permutation on the current state of the context

val 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

module Parameters : sig ... end

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