Documentation ¶
Index ¶
- func AssembleProverVerifier(m uint64, ck *cm.Ck, A []mcl.G1, B []mcl.G2) (Prover, Verifier)
- func GenerateGipaInstance(m uint64, alpha mcl.Fr, beta mcl.Fr, g mcl.G1, h mcl.G2) (*cm.Ck, []mcl.G1, []mcl.G2)
- func GipaTestSetup(m uint64, alpha mcl.Fr, beta mcl.Fr, g mcl.G1, h mcl.G2) (Prover, Verifier)
- type Proof
- type Prover
- type Verifier
- func (self *Verifier) Challenge() mcl.Fr
- func (self *Verifier) Check(A []mcl.G1, B []mcl.G2) bool
- func (self *Verifier) Clone(verifier *Verifier)
- func (self *Verifier) FiatShamir() mcl.Fr
- func (self *Verifier) Fold(x mcl.Fr)
- func (self *Verifier) Init(M uint64, ck *cm.Ck, com cm.Com)
- func (self *Verifier) Print()
- func (self *Verifier) Transform()
- func (self *Verifier) Update(ComL cm.Com, ComR cm.Com)
- func (self *Verifier) Verify(proof Proof) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AssembleProverVerifier ¶
Run GenerateGipaInstance to get ck, A, and B. Using that create a prover and verifier.
func GenerateGipaInstance ¶
func GenerateGipaInstance(m uint64, alpha mcl.Fr, beta mcl.Fr, g mcl.G1, h mcl.G2) (*cm.Ck, []mcl.G1, []mcl.G2)
Given alpha, beta, G, H, this will return ck, A, and B.
func GipaTestSetup ¶
Calls the above two functions at once for simple ease. Nothing fancy.
Types ¶
type Prover ¶
type Prover struct { M uint64 A []mcl.G1 B []mcl.G2 Ck cm.Ck MPrime uint64 A_L []mcl.G1 A_R []mcl.G1 B_L []mcl.G2 B_R []mcl.G2 Z_L mcl.GT Z_R mcl.GT Ck1 cm.Ck Ck2 cm.Ck ComL cm.Com ComR cm.Com X []mcl.Fr Transcript [32]byte RandomChallenges []mcl.Fr }
Prover is a struct to manage the prover state.
func (*Prover) FiatShamir ¶
func (self *Prover) FiatShamir() mcl.Fr
func (*Prover) Fold ¶
func (self *Prover) Fold(x mcl.Fr)
Fold is a member function of Prover It computes: - A', B' - ck' Parameters ---------- x, Fr the random challenge posed by the verifier
Returns ------- None Updates the data members A, B, and ck.
func (*Prover) Transform ¶
Transform is a member function of Prover It performs the following operations: - Breaks the vector A into two equal parts (A_L, A_R) - Breaks the vector B into two equal parts (B_L, B_R) - Computes z_L, z_R - Breaks the commitment key into half - Computes the left and right commitment Parameters ---------- None
Returns ------- Updates the data members ComL and ComR. Returns ComL, ComR so that verifier can pose the challenge
type Verifier ¶
type Verifier struct { M uint64 Ck cm.Ck Com cm.Com MPrime uint64 ComL cm.Com ComR cm.Com X []mcl.Fr Transcript [32]byte }
Verifier is a struct to manage the prover state.
func (*Verifier) Challenge ¶
func (self *Verifier) Challenge() mcl.Fr
Challenge is a member function of Verifier. Will be defunct after adding Fiat-Shamir It poses a random challenge to the prover based on ComL and ComR Parameters ---------- ComL, type Com ComR, type Com
Returns ------- x, Fr a random challenge Updates the data members, ComR and ComL
func (*Verifier) Check ¶
Check is a member function of Verifier It performs the final pairing and commitment check. Parameters ---------- A, slice mcl.G1 should be of size 1 B, slice mcl.G2 should be of size 1
Returns ------- bool, true if the verification is successful.
func (*Verifier) FiatShamir ¶
func (self *Verifier) FiatShamir() mcl.Fr
func (*Verifier) Fold ¶
func (self *Verifier) Fold(x mcl.Fr)
Fold is a member function of Verifier Verifier computes the ck' and com' Inner product of A', B' (prover state) should be equal to com' Parameters ---------- x, Fr challenge posed to the prover
Returns ------- None Updates the data members, com and ck