package bls12-381-hash

  1. Overview
  2. Docs

Griffin over the scalar field of BLS12-381 for a security of 128 bits and with the permutation x^5.

module Parameters : sig ... end
type ctxt

Context of the instance. It contains the states and the parameters such as the state size, the constants and the alpha/beta's

val allocate_ctxt : Parameters.t -> ctxt

allocate_ctxt parameters allocates a new context for an instance of Griffin with the parameters parameters.

val apply_permutation : ctxt -> unit

apply_permutation ctxt applies a permutation on the state. The context is modified

val apply_one_round : ctxt -> int -> unit

apply_one_round ctxt i_round_key applies only one round of the permutation on the state. i_round_key is the index of the first round constant to use for the round. The context is modified

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 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

OCaml

Innovation. Community. Security.