Versions in this module Expand all Collapse all v0 v0.1.5 Aug 30, 2021 Changes in this version + const BlockSize + var G1Comparer = gocmp.Comparer(EqualG1) + var G2Comparer = gocmp.Comparer(EqualG2) + var GTComparer = gocmp.Comparer(EqualGT) + func DegreeFromThreshold(threshold uint64) uint64 + func EqualG1(p1, p2 *bn256.G1) bool + func EqualG2(p1, p2 *bn256.G2) bool + func EqualGT(p1, p2 *bn256.GT) bool + func HashBlockToInt(d Block) *big.Int + func KeyperX(keyperIndex int) *big.Int + func Shuffle(txs [][]byte, key *EpochSecretKey) [][]byte + func UnpadMessage(blocks []Block) ([]byte, error) + func ValidEval(v *big.Int) bool + func VerifyEpochSecretKeyShare(epochSecretKeyShare *EpochSecretKeyShare, eonPublicKeyShare *EonPublicKeyShare, ...) bool + func VerifyPolyEval(keyperIndex int, polyEval *big.Int, gammas *Gammas, threshold uint64) bool + type Block [BlockSize]byte + func HashBytesToBlock(d ...[]byte) Block + func HashGTToBlock(gt *bn256.GT) Block + func PadMessage(m []byte) []Block + func RandomSigma(r io.Reader) (Block, error) + func XORBlocks(b1 Block, b2 Block) Block + type EncryptedMessage struct + C1 *bn256.G2 + C2 Block + C3 []Block + func Encrypt(message []byte, eonPublicKey *EonPublicKey, epochID *EpochID, sigma Block) *EncryptedMessage + func (m *EncryptedMessage) Decrypt(epochSecretKey *EpochSecretKey) ([]byte, error) + func (m *EncryptedMessage) Marshal() []byte + func (m *EncryptedMessage) Sigma(epochSecretKey *EpochSecretKey) Block + func (m *EncryptedMessage) Unmarshal(d []byte) error + type EonPublicKey bn256.G2 + func ComputeEonPublicKey(gammas []*Gammas) *EonPublicKey + func (eonpubkey *EonPublicKey) Equal(pk2 *EonPublicKey) bool + func (eonpubkey *EonPublicKey) GobDecode(data []byte) error + func (eonpubkey *EonPublicKey) GobEncode() ([]byte, error) + func (eonpubkey *EonPublicKey) Marshal() []byte + func (eonpubkey *EonPublicKey) Unmarshal(m []byte) error + type EonPublicKeyShare bn256.G2 + func ComputeEonPublicKeyShare(keyperIndex int, gammas []*Gammas) *EonPublicKeyShare + func (g2 *EonPublicKeyShare) Equal(pk2 *EonPublicKeyShare) bool + func (g2 *EonPublicKeyShare) GobDecode(data []byte) error + func (g2 *EonPublicKeyShare) GobEncode() ([]byte, error) + type EonSecretKeyShare big.Int + func ComputeEonSecretKeyShare(polyEvals []*big.Int) *EonSecretKeyShare + func (esks *EonSecretKeyShare) Equal(e2 *EonSecretKeyShare) bool + func (esks *EonSecretKeyShare) GobDecode(data []byte) error + func (esks *EonSecretKeyShare) GobEncode() ([]byte, error) + type EpochID bn256.G1 + func ComputeEpochID(epochIndex uint64) *EpochID + func (g *EpochID) Equal(g2 *EpochID) bool + func (g *EpochID) GobDecode(data []byte) error + func (g *EpochID) GobEncode() ([]byte, error) + type EpochSecretKey bn256.G1 + func ComputeEpochSecretKey(keyperIndices []int, epochSecretKeyShares []*EpochSecretKeyShare, ...) (*EpochSecretKey, error) + func (g *EpochSecretKey) Equal(g2 *EpochSecretKey) bool + func (g *EpochSecretKey) GobDecode(data []byte) error + func (g *EpochSecretKey) GobEncode() ([]byte, error) + type EpochSecretKeyShare bn256.G1 + func ComputeEpochSecretKeyShare(eonSecretKeyShare *EonSecretKeyShare, epochID *EpochID) *EpochSecretKeyShare + func (g *EpochSecretKeyShare) Equal(g2 *EpochSecretKeyShare) bool + func (g *EpochSecretKeyShare) GobDecode(data []byte) error + func (g *EpochSecretKeyShare) GobEncode() ([]byte, error) + type Gammas []*bn256.G2 + func ZeroGammas(degree uint64) *Gammas + func (g *Gammas) Degree() uint64 + func (g *Gammas) GobDecode(data []byte) error + func (g *Gammas) GobEncode() ([]byte, error) + func (g *Gammas) Pi(xi *big.Int) *bn256.G2 + func (g Gammas) Equal(g2 Gammas) bool + type Polynomial []*big.Int + func NewPolynomial(coefficients []*big.Int) (*Polynomial, error) + func RandomPolynomial(r io.Reader, degree uint64) (*Polynomial, error) + func (p *Polynomial) Degree() uint64 + func (p *Polynomial) Eval(x *big.Int) *big.Int + func (p *Polynomial) EvalForKeyper(keyperIndex int) *big.Int + func (p *Polynomial) Gammas() *Gammas