mimc

package
v0.0.0-...-ae8e47d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 25, 2023 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package mimc provides a ZKP-circuit function to compute a MiMC hash.

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

func NewMiMC

func NewMiMC(api frontend.API) (MiMC, error)

NewMiMC returns a MiMC instance, than can be used in a gnark circuit

func (*MiMC) Reset

func (h *MiMC) Reset()

Reset resets the Hash to its initial state.

func (*MiMC) Sum

func (h *MiMC) Sum() frontend.Variable

Sum hash (in r1cs form) using Miyaguchi–Preneel: https://en.wikipedia.org/wiki/One-way_compression_function The XOR operation is replaced by field addition. See github.com/consensys/gnark-crypto for reference implementation.

func (*MiMC) Write

func (h *MiMC) Write(data ...frontend.Variable)

Write adds more data to the running hash.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL