zklib

package module
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BASE_RAW_TX_SIZE = 191

Functions

This section is empty.

Types

type BaseProof

type BaseProof struct {
	CurveId    ecc.ID
	InnerField *big.Int
	OuterField *big.Int

	Ccs          *constraint.ConstraintSystem
	VerifyingKey *native_groth16.VerifyingKey
	ProvingKey   *native_groth16.ProvingKey
	// contains filtered or unexported fields
}

func BootBaseProof added in v0.1.4

func BootBaseProof(baseTxSize int) (*BaseProof, error)

func NewBaseProof

func NewBaseProof(baseTxSize int) (*BaseProof, error)

func (*BaseProof) ComputeProof

func (po *BaseProof) ComputeProof(fullWitness witness.Witness) (
	native_groth16.Proof,
	error,
)

func (*BaseProof) CreateBaseCaseWitness

func (po *BaseProof) CreateBaseCaseWitness(
	rawTxBytes []byte,
	currTxId [32]byte,
) (witness.Witness, error)

FIXME: This is duplicated from groth16/common.go

func (*BaseProof) CreateLightWitness added in v0.1.4

func (po *BaseProof) CreateLightWitness(genesisTxId []byte) (*witness.Witness, error)

func (*BaseProof) ReadKeys

func (po *BaseProof) ReadKeys() error

func (*BaseProof) VerifyProof

func (po *BaseProof) VerifyProof(witness *witness.Witness, proof *native_groth16.Proof) bool

func (*BaseProof) WriteKeys

func (po *BaseProof) WriteKeys() error

generate innerVK, innerPK, compiled circuit and save to disk

type NormalProof

type NormalProof struct {
	CurveId    ecc.ID
	InnerField *big.Int
	OuterField *big.Int

	Ccs *constraint.ConstraintSystem

	VerifyingKey *native_groth16.VerifyingKey
	ProvingKey   *native_groth16.ProvingKey

	BaseProofObj *BaseProof
	// contains filtered or unexported fields
}

func NewNormalProof

func NewNormalProof(prefixSize int, postfixSize int, baseProof *BaseProof) (*NormalProof, error)

func (*NormalProof) ComputeProof added in v0.1.4

func (po *NormalProof) ComputeProof(fullWitness witness.Witness) (native_groth16.Proof, error)

func (*NormalProof) CreateFullWitness added in v0.1.4

func (po *NormalProof) CreateFullWitness(
	prevPublicWitness witness.Witness,
	prevProof native_groth16.Proof,
	prevVk native_groth16.VerifyingKey,
	prefixBytes []byte, prevTxnIdBytes []byte, postFixBytes []byte, spendingTxId []byte) (*witness.Witness, error)

func (*NormalProof) CreateLightWitness added in v0.1.4

func (po *NormalProof) CreateLightWitness(txId []byte) (*witness.Witness, error)

func (*NormalProof) ReadKeys

func (po *NormalProof) ReadKeys() error

func (*NormalProof) SetupKeys

func (po *NormalProof) SetupKeys() error

func (*NormalProof) VerifyProof added in v0.1.4

func (po *NormalProof) VerifyProof(witness *witness.Witness, proof *native_groth16.Proof) bool

func (*NormalProof) WriteKeys

func (po *NormalProof) WriteKeys() error

type ProofSystem added in v0.1.4

type ProofSystem struct {
	InnerField *big.Int
	OuterField *big.Int
	// contains filtered or unexported fields
}

func NewProofSystem added in v0.1.4

func NewProofSystem(normalPrefixSize int, normalPostfixSize int) (*ProofSystem, error)

func (*ProofSystem) CreateBaseCaseProof added in v0.1.4

func (ps *ProofSystem) CreateBaseCaseProof(pInfo txivc.BaseProofInfo) (string, error)

func (*ProofSystem) VerifyBaseProof added in v0.1.4

func (ps *ProofSystem) VerifyBaseProof(txId string, jsonProof string) bool

Directories

Path Synopsis
twostack

Jump to

Keyboard shortcuts

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