prover

package
v0.0.1-beta Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2023 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Ark

func Ark(api frontend.API, in []frontend.Variable, c []*big.Int, r int) []frontend.Variable

func ComputeCCS

func ComputeCCS() constraint.ConstraintSystem

func CreateVkPk

func CreateVkPk()

func GenerateProof

func GenerateProof(inputData types.BatchStruct, batchNum int) (any, string, []byte, error)

GenerateProof generates a proof for the given input data and returns the proof and the error batchDbCount is the number of batches in the database and it will be passed as batchNum here

func GenerateVerificationKey

func GenerateVerificationKey() (groth16.ProvingKey, groth16.VerifyingKey, error)

func GetMerkleRoot

func GetMerkleRoot(api frontend.API, leaves [common.BatchSize]frontend.Variable) frontend.Variable

func GetMerkleRootCheck

func GetMerkleRootCheck(transactions []types.GetTransactionStruct) string

func MiMC7

func MiMC7(api frontend.API, nRounds int, xIn, k frontend.Variable) frontend.Variable

func Mix

func Mix(api frontend.API, in []frontend.Variable, m [][]*big.Int) []frontend.Variable

func MixLast

func MixLast(api frontend.API, in []frontend.Variable, m [][]*big.Int, s int) frontend.Variable

func MixS

func MixS(api frontend.API, in []frontend.Variable, s []*big.Int, r int) []frontend.Variable

func MultiMiMC7

func MultiMiMC7(api frontend.API, nRounds int, in []frontend.Variable, k frontend.Variable) frontend.Variable

func POSEIDON_C

func POSEIDON_C(t int) []*big.Int

func POSEIDON_M

func POSEIDON_M(t int) [][]*big.Int

func POSEIDON_P

func POSEIDON_P(t int) [][]*big.Int

func POSEIDON_S

func POSEIDON_S(t int) []*big.Int

func Poseidon

func Poseidon(api frontend.API, inputs []frontend.Variable) frontend.Variable

func PoseidonEx

func PoseidonEx(api frontend.API, inputs []frontend.Variable, initialState frontend.Variable, nOuts int) []frontend.Variable

func ReadProvingKeyFromFile

func ReadProvingKeyFromFile(filename string) (groth16.ProvingKey, error)

func Sigma

Types

type MyCircuit

type MyCircuit struct {
	To              [common.BatchSize]frontend.Variable `gnark:",public"`
	From            [common.BatchSize]frontend.Variable `gnark:",public"`
	Amount          [common.BatchSize]frontend.Variable `gnark:",public"`
	TransactionHash [common.BatchSize]frontend.Variable `gnark:",public"`
	FromBalances    [common.BatchSize]frontend.Variable `gnark:",public"`
	ToBalances      [common.BatchSize]frontend.Variable `gnark:",public"`
	Messages        [common.BatchSize]frontend.Variable `gnark:",public"`
	PublicKeys      [common.BatchSize]eddsa.PublicKey   `gnark:",public"`
	Signatures      [common.BatchSize]eddsa.Signature   `gnark:",public"`
}

func (*MyCircuit) Define

func (circuit *MyCircuit) Define(api frontend.API) error

Jump to

Keyboard shortcuts

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