Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Bls12_381.Poseidon128
SourceImplementation of an instantiation of Poseidon 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:
These parameters have been generated using security_parameters.ml from Mec.
The linear layer constants and the round keys can be generated using generate_ark.ml and generate_mds.sage from Mec. The constants must be loaded at the top level using Poseidon128.constants_init
.
The current implementation only provides the functions to run a permutation. The user is responsible to build a hash function on top of it.
Context of the permutation
constants_init ark mds
initializes the constants for Poseidon.
Warnings:
init
, apply_permutation
and get
init a b c
returns a new context with an initialised state with the value [a, b, c]
.
apply_permutation ctxt
applies a permutation on the state. The context is modified.