rbselection

package
v2.1.10-beta.1+incompa... Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2021 License: GPL-3.0 Imports: 10 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BigOne = bigOne
View Source
var BigZero = bigZero
View Source
var Gbase = gbase
View Source
var Hbase = hbase

Functions

func CompareG1

func CompareG1(a bn256.G1, b bn256.G1) bool

The comparison function of G1

func CompareG2

func CompareG2(a bn256.G2, b bn256.G2) bool

The comparison function of G2

func EvaluatePoly

func EvaluatePoly(f Polynomial, x *big.Int, degree int) (big.Int, error)

Calculate polynomial's evaluation at some point

func Lagrange

func Lagrange(f []big.Int, x []big.Int, degree int) big.Int

Lagrange's polynomial interpolation algorithm

func LagrangePub

func LagrangePub(cmt []bn256.G2, x []big.Int, degree int) bn256.G2

Lagrange's polynomial interpolation algorithm: group public key share --> group public key

func LagrangeSig

func LagrangeSig(sig []bn256.G1, x []big.Int, degree int) bn256.G1

Lagrange's polynomial interpolation algorithm: group signature share --> group signature

func RScodeVerify

func RScodeVerify(P []bn256.G2, x []big.Int, deg int) bool

RScode Verification function

func VerifyDLEQ

func VerifyDLEQ(proof DLEQproof, gbase bn256.G1, hbase bn256.G2, x bn256.G1, y bn256.G2) bool

to verify DLEQ proof

Types

type DLEQproof

type DLEQproof struct {
	// contains filtered or unexported fields
}

Structure defination for DLEQ proof: a zero knowledge proof for index

func DLEQ

func DLEQ(gbase bn256.G1, hbase bn256.G2, sk *big.Int) (DLEQproof, error)

Generate a DLEQ proof, i.e. exit sk, s.t x = sk*G1 and y = sk*G2

func (*DLEQproof) DecodeRLP

func (proof *DLEQproof) DecodeRLP(s *rlp.Stream) error

DecodeRLP implements rlp.Decoder

func (*DLEQproof) EncodeRLP

func (proof *DLEQproof) EncodeRLP(w io.Writer) error

DecodeRLP implements rlp.Encoder

func (*DLEQproof) ProofFlatToProof

func (p1 *DLEQproof) ProofFlatToProof(d *DLEQproofFlat)

type DLEQproofFlat

type DLEQproofFlat struct {
	A1 []byte
	A2 []byte
	Z  *big.Int
}

func ProofToProofFlat

func ProofToProofFlat(d *DLEQproof) DLEQproofFlat

type Polynomial

type Polynomial []big.Int

Structure defination for polynomial

func RandPoly

func RandPoly(degree int, constant big.Int) (Polynomial, error)

Generate a random polynomial, its constant item is nominated

Jump to

Keyboard shortcuts

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