batch

package
v0.0.0-...-79b6b6b Latest Latest
Warning

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

Go to latest
Published: Mar 2, 2022 License: Apache-2.0 Imports: 6 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssembleProverVerifier

func AssembleProverVerifier(m uint32,
	ck *cm.Ck, kzg1 *kzg.KZG1Settings, kzg2 *kzg.KZG2Settings,
	P []mcl.G1, Q []mcl.G2,
	A []mcl.G1, B []mcl.G2) (Prover, Verifier)

Run GenerateBatchInstance to get ck, A, and B. Using that create a prover and verifier.

func GenerateBatchInstance

func GenerateBatchInstance(m uint32, n uint32, alpha mcl.Fr, beta mcl.Fr, g mcl.G1, h mcl.G2) (*cm.Ck, *kzg.KZG1Settings, *kzg.KZG2Settings, []mcl.G1, []mcl.G2, []mcl.G1, []mcl.G2)

Given alpha, beta, G, H, this will return ck, A, and B.

func GipaBatchTestSetup

func GipaBatchTestSetup(m uint32, n uint32, alpha mcl.Fr, beta mcl.Fr, g mcl.G1, h mcl.G2) (Prover, Verifier)

Calls the above two functions at once for simple ease. Nothing fancy.

Types

type Proof

type Proof struct {
	T            mcl.GT
	GipaKzgProof gipakzg.Proof
}

type Prover

type Prover struct {
	Prover gipakzg.Prover
	N      uint32 // Product of two 32 bits will be at most 64 bits
	M      uint32 // Product of two 32 bits will be at most 64 bits
	MN     uint64 // In hyperproofs we may have to pad vector A and B. Thus self.N * self.M may not be equal to self.MN

}

func (*Prover) Clone

func (self *Prover) Clone(prover *Prover)

Use this only if you need to deepcopy

func (*Prover) FiatShamir

func (self *Prover) FiatShamir(Transcript []byte, T mcl.GT) mcl.Fr

func (*Prover) Init

func (self *Prover) Init(M uint32, N uint32, MN uint64, ck *cm.Ck, kzg1 *kzg.KZG1Settings, kzg2 *kzg.KZG2Settings, A []mcl.G1, B []mcl.G2)

func (*Prover) Prove

func (self *Prover) Prove() Proof

type Verifier

type Verifier struct {
	Verifier gipakzg.Verifier
	W        []mcl.G1
	N        uint32 // Be sure to do ceil when padding
	M        uint32
	MN       uint64 // In hyperproofs we may have to pad vector A and B. Thus self.N * self.M may not be equal to self.MN
	B        []mcl.G2
	P        []mcl.G1
	Q        []mcl.G2
}

func (*Verifier) Clone

func (self *Verifier) Clone(verifier *Verifier)

Use this only if you need to deepcopy

func (*Verifier) FiatShamir

func (self *Verifier) FiatShamir(Transcript []byte, T mcl.GT) mcl.Fr

func (*Verifier) Init

func (self *Verifier) Init(M uint32, N uint32, MN uint64,
	W []mcl.G1, kzg1 *kzg.KZG1Settings, kzg2 *kzg.KZG2Settings,
	P []mcl.G1, Q []mcl.G2, B []mcl.G2)

func (*Verifier) Verify

func (self *Verifier) Verify(proof Proof) bool

func (*Verifier) VerifyEdrax

func (self *Verifier) VerifyEdrax(proof Proof) bool

GIPA + Edrax. Check the overleaf BMMV19 notes.

Jump to

Keyboard shortcuts

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