package bls12-381-hash

  1. Overview
  2. Docs

Implementation of an instantiation of Rescue over the scalar field of BLS12-381 for a security of 128 bits and with the permutation x^5. The parameters of the instantiation are:

  • state size = 3
  • number of rounds = 14

These parameters have been generated using this script.

type ctxt

Context of the permutation

val constants_init : Bls12_381.Fr.t array -> Bls12_381.Fr.t array array -> unit

constants_init ark mds initializes the constants for Poseidon.

Warnings:

  • The function does not verify the parameters are secured
  • This function must be called before calling init, apply_permutation and get

init a b c returns a new context with an initialised state with the value [a, b, c].

val apply_permutation : ctxt -> unit

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

get ctxt returns the state of the permutation

OCaml

Innovation. Community. Security.