dummy

package
v0.0.0-...-b1352b5 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeCS

func MakeCS(circID circuits.MockCircuitID, scalarField *big.Int) (constraint.ConstraintSystem, error)

Compiles the circuit for a given circuit ID

func MakeProof

func MakeProof(setup *circuits.Setup, x any, circID circuits.MockCircuitID) string

Generates a dummy proof for circuit ID with public input X.

func MakeUnsafeSetup

func MakeUnsafeSetup(srsProvider circuits.SRSProvider, circID circuits.MockCircuitID, scalarField *big.Int) (circuits.Setup, error)

Generates a deterministic (and unsafe) setup. Take the circuit ID as an input to "specialize" the circuit. The circID parameter is only meaningful to generate test samples for the smart-contract.

func NewBuilder

func NewBuilder(circID circuits.MockCircuitID, scalarField *big.Int) *builder

Types

type CircuitDummy

type CircuitDummy struct {
	X frontend.Variable `gnark:",public"`

	// This relies on the fact that x^5 is a permutation in Fr of the bn254
	// curve.
	X5 frontend.Variable `gnark:",secret"`

	// Optional field, changes the circuit so that X5 = X^5 + ID. This
	// functionality allows generated different incompatible versions of the
	// dummy circuit.
	ID int `gnark:"-"`
}

CircuitDummy, that is verified by only one public input. dummy.CircuitDummy can also be optionally given an ID (0 by default) so that a proof for circuit of ID x will be rejected by the verifier for the circuit of ID y.

func Assign

func Assign(id circuits.MockCircuitID, x_ any) *CircuitDummy

Generates an assignment for the circuit.

func (*CircuitDummy) Define

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

Jump to

Keyboard shortcuts

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