gnark

package
v0.0.0-...-0190ce5 Latest Latest
Warning

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

Go to latest
Published: May 31, 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 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"`
	OriginLen frontend.Variable   `gnark:",public"` // This is encoded as a single ASCII character per byte
	Origin    [256]uints.U8       `gnark:",public"` // The max capacity is 256 bytes (arbitrarily)
	CallerLen frontend.Variable   `gnark:",public"` // The 'len' arguments are necessary to parse the witness
	Caller    [256]uints.U8       `gnark:",public"`
	BlockTime frontend.Variable   `gnark:",public"`
	BlockNb   frontend.Variable   `gnark:",public"`
	TxHash    [64]uints.U8        `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