batchplain

package
v0.0.0-...-63bedb4 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssembleProverVerifier

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

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

func GenerateBatchPlainInstance

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

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

func GipaBatchPlainTestSetup

func GipaBatchPlainTestSetup(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
	GipaProof gipa.Proof
}

type Prover

type Prover struct {
	Prover gipa.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, A []mcl.G1, B []mcl.G2)

func (*Prover) Prove

func (self *Prover) Prove() Proof

type Verifier

type Verifier struct {
	Verifier gipa.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, ck *cm.Ck, 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