Documentation
¶
Overview ¶
Package mimc implements the MiMC hash function as a gnark circuit
This is an internal package as the implementation is used for some internal components and proof recursion where importing the github.com/consensys/gnark/std/hash package would create an import cycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MiMC ¶
type MiMC struct {
// contains filtered or unexported fields
}
MiMC contains the params of the MiMC hash func and the curves on which it is implemented.
NB! See the package documentation for length extension attack consideration.
func NewMiMC ¶
NewMiMC returns a MiMC instance that can be used in a gnark circuit. The out-circuit counterpart of this function is provided in gnark-crypto.
NB! See the package documentation for length extension attack consideration.
func (*MiMC) SetState ¶
SetState manually sets the state of the hasher to the provided value. In the case of MiMC only a single frontend variable is expected to represent the state.
func (*MiMC) State ¶
State returns the inner-state of the hasher. In the context of MiMC only a single field element is returned.
func (*MiMC) Sum ¶
Sum hash using Miyaguchi–Preneel where the XOR operation is replaced by field addition.