gnark

package
v0.0.0-...-f0abe85 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ToArray256

func ToArray256(d []byte) [256]uints.U8

Utility for tests mostly

func ToArray32

func ToArray32(d []byte) [32]uints.U8

func ToArray64

func ToArray64(d []byte) [64]uints.U8

Types

type Groth16Proof

type Groth16Proof struct {
	Proof         []byte `json:"proof"`
	VerifyingKey  []byte `json:"verifying_key"`
	PublicWitness []byte `json:"public_witness"`
}

Struct type expected for the "proof" argument

func (*Groth16Proof) ExtractData

func (proof *Groth16Proof) ExtractData(witness witness.Witness) (*zktx.HyleOutput, error)

func (*Groth16Proof) ParseProof

type HyleCircuit

type HyleCircuit struct {
	Version     frontend.Variable   `gnark:",public"`
	InputLen    frontend.Variable   `gnark:",public"`
	Input       []frontend.Variable `gnark:",public"`
	OutputLen   frontend.Variable   `gnark:",public"`
	Output      []frontend.Variable `gnark:",public"`
	IdentityLen frontend.Variable   `gnark:",public"` // This is encoded as a single ASCII character per byte
	Identity    [256]uints.U8       `gnark:",public"` // The max capacity is 256 bytes (arbitrarily, but we need something static)
	TxHash      [64]uints.U8        `gnark:",public"`
	PayloadHash [32]uints.U8        `gnark:",public"`
	Success     frontend.Variable   `gnark:",public"`
}

This is the public interface that a verifiable circuit must implement

func (*HyleCircuit) Define

func (c *HyleCircuit) Define(api frontend.API) error

Jump to

Keyboard shortcuts

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