sha256

package
v0.0.0-...-b124b1e Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SHA256

type SHA256 struct {
	// contains filtered or unexported fields
}

SHA256 contains the params of the SHA256 hash func and the curves on which it is implemented

func NewSHA256

func NewSHA256(seed string, id ecc.ID, api frontend.API) (SHA256, error)

NewSHA256 returns a SHA256 instance, than can be used in a gnark circuit

func (*SHA256) Reset

func (h *SHA256) Reset()

Reset resets the Hash to its initial state.

func (*SHA256) Sum

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

Hash 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 (*SHA256) Write

func (h *SHA256) 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