operations

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FileExists

func FileExists(path string) (bool, error)

func NewConstraintSystem

func NewConstraintSystem(circuit frontend.Circuit) (constraint.ConstraintSystem, error)

func OpenFileOnCreaterOverwrite

func OpenFileOnCreaterOverwrite(file string) (*os.File, error)

func PlonkVerify

func PlonkVerify(vk native_plonk.VerifyingKey, proof native_plonk.Proof, wit witness.Witness, isFront bool) error

func Power2Index

func Power2Index(n uint64) int

func ReadCcs

func ReadCcs(fn string) (constraint.ConstraintSystem, error)

func ReadCcsAndVk added in v0.1.4

func ReadCcsAndVk(ccsFile, vkFile string) (constraint.ConstraintSystem, plonk.VerifyingKey, error)

func ReadPk

func ReadPk(fn string) (plonk.ProvingKey, error)

func ReadProof

func ReadProof(fn string) (plonk.Proof, error)

func ReadSrs

func ReadSrs(size int, srsDir string) (*kzg.SRS, *kzg.SRS, error)

func ReadVk

func ReadVk(fn string) (plonk.VerifyingKey, error)

func ReadWitness

func ReadWitness(fn string) (witness.Witness, error)

func SaveProofAndWitnessInSol added in v0.1.3

func SaveProofAndWitnessInSol(proof *Proof, proofSolFile, witnessSolFile string) error

func WriteCcs

func WriteCcs(ccs constraint.ConstraintSystem, fn string) error

func WritePk

func WritePk(pk plonk.ProvingKey, fn string) error

func WriteProof

func WriteProof(proof plonk.Proof, fn string) error

func WriteProofInSolidity added in v0.1.1

func WriteProofInSolidity(proof plonk.Proof, fn string) error

func WriteVk

func WriteVk(vk plonk.VerifyingKey, fn string) error

func WriteVkInSolidity added in v0.1.3

func WriteVkInSolidity(vk plonk.VerifyingKey, fn string) error

func WriteWitness

func WriteWitness(wit witness.Witness, fn string) error

func WriteWitnessInJson added in v0.1.1

func WriteWitnessInJson(wit witness.Witness, fn string) error

Types

type CircuitFile added in v0.1.2

type CircuitFile struct {
	Ccs   constraint.ConstraintSystem
	Vkeys []plonk.VerifyingKey
}

type CircuitOperations

type CircuitOperations struct {
	ProvingKey    native_plonk.ProvingKey
	VerifyingKey  native_plonk.VerifyingKey
	Ccs           constraint.ConstraintSystem
	Config        *Config
	ComponentName string
	Logger        *zerolog.Logger
}

func (*CircuitOperations) ConstraintSystem

func (c *CircuitOperations) ConstraintSystem() (constraint.ConstraintSystem, error)

func (*CircuitOperations) GetVerifyingKey

func (c *CircuitOperations) GetVerifyingKey() (native_plonk.VerifyingKey, error)

func (*CircuitOperations) LoadCcsPkVk

func (c *CircuitOperations) LoadCcsPkVk() error

func (*CircuitOperations) ProveWithAssignment

func (c *CircuitOperations) ProveWithAssignment(assignment frontend.Circuit, isFront bool) (*Proof, error)

func (*CircuitOperations) SaveCcsPkVk

func (c *CircuitOperations) SaveCcsPkVk(ccsFile, pkFile, vkFile string) error

func (*CircuitOperations) SaveProofAndWitness

func (c *CircuitOperations) SaveProofAndWitness(proof *Proof, proofFile, witnessFile string) error

func (*CircuitOperations) UnsafeFingerPrint

func (c *CircuitOperations) UnsafeFingerPrint() ([]byte, error)

func (*CircuitOperations) Verify

type Config

type Config struct {
	CircuitDir string
	SrsDir     string
	DataDir    string

	CcsFile string
	PkFile  string
	VkFile  string
}

type Proof

type Proof struct {
	Proof   plonk.Proof
	Witness witness.Witness
}

func ReadProofAndWitness added in v0.1.3

func ReadProofAndWitness(proofFile, pubWitnessFile string) (*Proof, error)

Jump to

Keyboard shortcuts

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