bls

package module
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2020 License: Apache-2.0 Imports: 17 Imported by: 1

README

CircleCI

This is a fork implementing a kyber/dedis wrapper for this library (among other things)

High speed bls12-381 implementation in go.

Pairing Instance

A Group instance or a pairing engine instance is not suitable for concurrent processing since an instance has its own preallocated memory for temporary variables. A new instance must be created for each thread.

Base Field

x86 optimized base field is generated with kilic/fp and for native go is generated with goff. Generated codes are slightly edited in both for further requirements.

Scalar Field

Standart big.Int module is currently used for scalar field implementation. x86 optimized faster field implementation is planned to be added.

Serialization

Point serialization is in line with zkcrypto library.

Mapping to G1 and G2 Point

Simplified SWU method and try and increment method are available for both G1 and G2.

Benchmarks

test results badge

on 3.1 GHz i5

BenchmarkPairing  1034837 ns/op

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Domain = []byte("BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_NUL_")

Domain comes from the ciphersuite used by the RFC of this name compatible with the paired library > v18

View Source
var G1One = g1One
View Source
var G2One = g2One

Functions

func NewBLS12381Suite

func NewBLS12381Suite() pairing.Suite

func NewGroupG1

func NewGroupG1() kyber.Group

func NewGroupG2

func NewGroupG2() kyber.Group

func NewGroupGT

func NewGroupGT() kyber.Group

func NewKyberScalar

func NewKyberScalar() kyber.Scalar

Types

type E added in v0.2.0

type E = fe12

E is type for target group element

type Engine added in v0.2.0

type Engine struct {
	G1 *G1
	G2 *G2
	// contains filtered or unexported fields
}

Engine is BLS12-381 elliptic curve pairing engine

func NewEngine added in v0.2.0

func NewEngine() *Engine

NewEngine creates new pairing engine insteace.

func (*Engine) AddPair added in v0.2.0

func (e *Engine) AddPair(g1 *PointG1, g2 *PointG2) *Engine

AddPair adds a g1, g2 point pair to pairing engine

func (*Engine) AddPairInv added in v0.2.0

func (e *Engine) AddPairInv(g1 *PointG1, g2 *PointG2) *Engine

AddPairInv adds a G1, G2 point pair to pairing engine. G1 point is negated.

func (*Engine) Check added in v0.2.0

func (e *Engine) Check() bool

Check computes pairing and checks if result is equal to one

func (*Engine) GT added in v0.2.0

func (e *Engine) GT() *GT

GT returns target group instance.

func (*Engine) Reset added in v0.2.0

func (e *Engine) Reset() *Engine

Reset deletes added pairs.

func (*Engine) Result added in v0.2.0

func (e *Engine) Result() *E

Result computes pairing and returns target group element as result.

type G1

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

G1 is struct for G1 group.

func NewG1

func NewG1() *G1

NewG1 constructs a new G1 instance.

func (*G1) Add

func (g *G1) Add(r, p1, p2 *PointG1) *PointG1

Add adds two G1 points p1, p2 and assigns the result to point at first argument.

func (*G1) Affine

func (g *G1) Affine(p *PointG1) *PointG1

Add adds two G1 points p1, p2 and assigns the result to point at first argument.

func (*G1) ClearCofactor added in v0.2.0

func (g *G1) ClearCofactor(p *PointG1)

ClearCofactor maps given a G1 point to correct subgroup

func (*G1) Copy

func (g *G1) Copy(dst *PointG1, src *PointG1) *PointG1

Copy copies source point to destination point.

func (*G1) Double

func (g *G1) Double(r, p *PointG1) *PointG1

Double doubles a G1 point p and assigns the result to the point at first argument.

func (*G1) EncodeToPoint added in v0.3.0

func (g *G1) EncodeToPoint(msg, domain []byte) (*PointG1, error)

EncodeToCurve given a message and domain seperator tag returns the hash result which is a valid curve point. Implementation follows BLS12381G1_XMD:SHA-256_SSWU_NU_ suite at https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06

func (*G1) Equal

func (g *G1) Equal(p1, p2 *PointG1) bool

Equal checks if given two G1 point is equal in their affine form.

func (*G1) FromBytes added in v0.2.0

func (g *G1) FromBytes(in []byte) (*PointG1, error)

FromBytes constructs a new point given uncompressed byte input. FromBytes does not take zcash flags into account. Byte input expected to be larger than 96 bytes. First 96 bytes should be concatenation of x and y values. Point (0, 0) is considered as infinity.

func (*G1) FromCompressed

func (g *G1) FromCompressed(compressed []byte) (*PointG1, error)

FromCompressed expects byte slice larger than 96 bytes and given bytes returns a new point in G1. Serialization rules are in line with zcash library. See below for details. https://github.com/zcash/librustzcash/blob/master/pairing/src/bls12_381/README.md#serialization https://docs.rs/bls12_381/0.1.1/bls12_381/notes/serialization/index.html

func (*G1) FromUncompressed

func (g *G1) FromUncompressed(uncompressed []byte) (*PointG1, error)

FromUncompressed expects byte slice larger than 96 bytes and given bytes returns a new point in G1. Serialization rules are in line with zcash library. See below for details. https://github.com/zcash/librustzcash/blob/master/pairing/src/bls12_381/README.md#serialization https://docs.rs/bls12_381/0.1.1/bls12_381/notes/serialization/index.html

func (*G1) HashToCurve added in v0.3.0

func (g *G1) HashToCurve(msg, domain []byte) (*PointG1, error)

HashToCurve given a message and domain seperator tag returns the hash result which is a valid curve point. Implementation follows BLS12381G1_XMD:SHA-256_SSWU_RO_ suite at https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06

func (*G1) InCorrectSubgroup added in v0.2.0

func (g *G1) InCorrectSubgroup(p *PointG1) bool

InCorrectSubgroup checks whether given point is in correct subgroup.

func (*G1) IsAffine

func (g *G1) IsAffine(p *PointG1) bool

IsAffine checks a G1 point whether it is in affine form.

func (*G1) IsOnCurve

func (g *G1) IsOnCurve(p *PointG1) bool

IsOnCurve checks a G1 point is on curve.

func (*G1) IsZero

func (g *G1) IsZero(p *PointG1) bool

IsZero returns true if given point is equal to zero.

func (*G1) MapToCurve added in v0.3.0

func (g *G1) MapToCurve(in []byte) (*PointG1, error)

MapToCurve given a byte slice returns a valid G1 point. This mapping function implements the Simplified Shallue-van de Woestijne-Ulas method. https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06 Input byte slice should be a valid field element, otherwise an error is returned.

func (*G1) MulByCofactor

func (g *G1) MulByCofactor(c, p *PointG1)

func (*G1) MulScalar

func (g *G1) MulScalar(c, p *PointG1, e *big.Int) *PointG1

MulScalar multiplies a point by given scalar value in big.Int and assigns the result to point at first argument.

func (*G1) MultiExp added in v0.2.0

func (g *G1) MultiExp(r *PointG1, points []*PointG1, powers []*big.Int) (*PointG1, error)

MultiExp calculates multi exponentiation. Given pairs of G1 point and scalar values (P_0, e_0), (P_1, e_1), ... (P_n, e_n) calculates r = e_0 * P_0 + e_1 * P_1 + ... + e_n * P_n Length of points and scalars are expected to be equal, otherwise an error is returned. Result is assigned to point at first argument.

func (*G1) Neg

func (g *G1) Neg(r, p *PointG1) *PointG1

Neg negates a G1 point p and assigns the result to the point at first argument.

func (*G1) New added in v0.2.0

func (g *G1) New() *PointG1

New creates a new G1 Point which is equal to zero in other words point at infinity.

func (*G1) One

func (g *G1) One() *PointG1

One returns a new G1 Point which is equal to generator point.

func (*G1) Q added in v0.2.0

func (g *G1) Q() *big.Int

Q returns group order in big.Int.

func (*G1) Sub

func (g *G1) Sub(c, a, b *PointG1) *PointG1

Sub subtracts two G1 points p1, p2 and assigns the result to point at first argument.

func (*G1) ToBytes added in v0.2.0

func (g *G1) ToBytes(p *PointG1) []byte

ToBytes serializes a point into bytes in uncompressed form. ToBytes does not take zcash flags into account. ToBytes returns (0, 0) if point is infinity.

func (*G1) ToCompressed

func (g *G1) ToCompressed(p *PointG1) []byte

ToCompressed given a G1 point returns bytes in compressed form of the point. Serialization rules are in line with zcash library. See below for details. https://github.com/zcash/librustzcash/blob/master/pairing/src/bls12_381/README.md#serialization https://docs.rs/bls12_381/0.1.1/bls12_381/notes/serialization/index.html

func (*G1) ToUncompressed

func (g *G1) ToUncompressed(p *PointG1) []byte

ToUncompressed given a G1 point returns bytes in uncompressed (x, y) form of the point. Serialization rules are in line with zcash library. See below for details. https://github.com/zcash/librustzcash/blob/master/pairing/src/bls12_381/README.md#serialization https://docs.rs/bls12_381/0.1.1/bls12_381/notes/serialization/index.html

func (*G1) Zero

func (g *G1) Zero() *PointG1

Zero returns a new G1 Point which is equal to point at infinity.

type G2

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

G2 is struct for G2 group.

func NewG2

func NewG2(f *fp2) *G2

NewG2 constructs a new G2 instance.

func (*G2) Add

func (g *G2) Add(r, p1, p2 *PointG2) *PointG2

Add adds two G2 points p1, p2 and assigns the result to point at first argument.

func (*G2) Affine

func (g *G2) Affine(p *PointG2) *PointG2

Affine calculates affine form of given G2 point.

func (*G2) ClearCofactor added in v0.2.0

func (g *G2) ClearCofactor(p *PointG2)

ClearCofactor maps given a G2 point to correct subgroup

func (*G2) Copy

func (g *G2) Copy(dst *PointG2, src *PointG2) *PointG2

Copy copies source point to destination point.

func (*G2) Double

func (g *G2) Double(r, p *PointG2) *PointG2

Double doubles a G2 point p and assigns the result to the point at first argument.

func (*G2) EncodeToCurve added in v0.3.0

func (g *G2) EncodeToCurve(msg, domain []byte) (*PointG2, error)

EncodeToCurve given a message and domain seperator tag returns the hash result which is a valid curve point. Implementation follows BLS12381G1_XMD:SHA-256_SSWU_NU_ suite at https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06

func (*G2) Equal

func (g *G2) Equal(p1, p2 *PointG2) bool

Equal checks if given two G2 point is equal in their affine form.

func (*G2) FromBytes added in v0.2.0

func (g *G2) FromBytes(in []byte) (*PointG2, error)

FromBytes constructs a new point given uncompressed byte input. FromBytes does not take zcash flags into account. Byte input expected to be larger than 96 bytes. First 192 bytes should be concatenation of x and y values Point (0, 0) is considered as infinity.

func (*G2) FromCompressed

func (g *G2) FromCompressed(compressed []byte) (*PointG2, error)

FromCompressed expects byte slice larger than 96 bytes and given bytes returns a new point in G2. Serialization rules are in line with zcash library. See below for details. https://github.com/zcash/librustzcash/blob/master/pairing/src/bls12_381/README.md#serialization https://docs.rs/bls12_381/0.1.1/bls12_381/notes/serialization/index.html

func (*G2) FromUncompressed

func (g *G2) FromUncompressed(uncompressed []byte) (*PointG2, error)

FromUncompressed expects byte slice larger than 192 bytes and given bytes returns a new point in G2. Serialization rules are in line with zcash library. See below for details. https://github.com/zcash/librustzcash/blob/master/pairing/src/bls12_381/README.md#serialization https://docs.rs/bls12_381/0.1.1/bls12_381/notes/serialization/index.html

func (*G2) HashToCurve added in v0.3.0

func (g *G2) HashToCurve(msg, domain []byte) (*PointG2, error)

HashToCurve given a message and domain seperator tag returns the hash result which is a valid curve point. Implementation follows BLS12381G1_XMD:SHA-256_SSWU_RO_ suite at https://tools.ietf.org/html/draft-irtf-cfrg-hash-to-curve-06

func (*G2) InCorrectSubgroup added in v0.2.0

func (g *G2) InCorrectSubgroup(p *PointG2) bool

InCorrectSubgroup checks whether given point is in correct subgroup.

func (*G2) IsAffine

func (g *G2) IsAffine(p *PointG2) bool

IsAffine checks a G2 point whether it is in affine form.

func (*G2) IsOnCurve

func (g *G2) IsOnCurve(p *PointG2) bool

IsOnCurve checks a G2 point is on curve.

func (*G2) IsZero

func (g *G2) IsZero(p *PointG2) bool

IsZero returns true if given point is equal to zero.

func (*G2) MulScalar

func (g *G2) MulScalar(c, p *PointG2, e *big.Int) *PointG2

MulScalar multiplies a point by given scalar value in big.Int and assigns the result to point at first argument.

func (*G2) MultiExp added in v0.2.0

func (g *G2) MultiExp(r *PointG2, points []*PointG2, powers []*big.Int) (*PointG2, error)

MultiExp calculates multi exponentiation. Given pairs of G2 point and scalar values (P_0, e_0), (P_1, e_1), ... (P_n, e_n) calculates r = e_0 * P_0 + e_1 * P_1 + ... + e_n * P_n Length of points and scalars are expected to be equal, otherwise an error is returned. Result is assigned to point at first argument.

func (*G2) Neg

func (g *G2) Neg(r, p *PointG2) *PointG2

Neg negates a G2 point p and assigns the result to the point at first argument.

func (*G2) New added in v0.2.0

func (g *G2) New() *PointG2

New creates a new G2 Point which is equal to zero in other words point at infinity.

func (*G2) One

func (g *G2) One() *PointG2

One returns a new G2 Point which is equal to generator point.

func (*G2) Q added in v0.2.0

func (g *G2) Q() *big.Int

Q returns group order in big.Int.

func (*G2) Sub

func (g *G2) Sub(c, a, b *PointG2) *PointG2

Sub subtracts two G2 points p1, p2 and assigns the result to point at first argument.

func (*G2) ToBytes added in v0.2.0

func (g *G2) ToBytes(p *PointG2) []byte

ToBytes serializes a point into bytes in uncompressed form, does not take zcash flags into account, returns (0, 0) if point is infinity.

func (*G2) ToCompressed

func (g *G2) ToCompressed(p *PointG2) []byte

ToCompressed given a G2 point returns bytes in compressed form of the point. Serialization rules are in line with zcash library. See below for details. https://github.com/zcash/librustzcash/blob/master/pairing/src/bls12_381/README.md#serialization https://docs.rs/bls12_381/0.1.1/bls12_381/notes/serialization/index.html

func (*G2) ToUncompressed

func (g *G2) ToUncompressed(p *PointG2) []byte

ToUncompressed given a G2 point returns bytes in uncompressed (x, y) form of the point. Serialization rules are in line with zcash library. See below for details. https://github.com/zcash/librustzcash/blob/master/pairing/src/bls12_381/README.md#serialization https://docs.rs/bls12_381/0.1.1/bls12_381/notes/serialization/index.html

func (*G2) Zero

func (g *G2) Zero() *PointG2

Zero returns a new G2 Point which is equal to point at infinity.

type GT added in v0.2.0

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

GT is type for target multiplicative group GT.

func NewGT added in v0.2.0

func NewGT() *GT

NewGT constructs new target group instance.

func (*GT) Add added in v0.2.0

func (g *GT) Add(c, a, b *E)

Add adds two field element `a` and `b` and assigns the result to the element in first argument.

func (*GT) Copy added in v0.2.0

func (g *GT) Copy(a, b *E)

Copy copies values of the second source element to first element

func (*GT) Equal added in v0.2.0

func (g *GT) Equal(a, b *E) bool

Equal returns true if given two element is equal, otherwise returns false

func (*GT) Exp added in v0.2.0

func (g *GT) Exp(c, a *E, s *big.Int)

Exp exponents an element `a` by a scalar `s` and assigns the result to the element in first argument.

func (*GT) FromBytes added in v0.2.0

func (g *GT) FromBytes(in []byte) (*E, error)

FromBytes expects 576 byte input and returns target group element FromBytes returns error if given element is not on correct subgroup.

func (*GT) Inverse added in v0.2.0

func (g *GT) Inverse(c, a *E)

Inverse inverses an element `a` and assigns the result to the element in first argument.

func (*GT) IsOne added in v0.2.0

func (g *GT) IsOne(e *E) bool

IsOne returns true if given element equals to one

func (*GT) IsValid added in v0.2.0

func (g *GT) IsValid(e *E) bool

IsValid checks whether given target group element is in correct subgroup.

func (*GT) Mul added in v0.2.0

func (g *GT) Mul(c, a, b *E)

Mul multiplies two field element `a` and `b` and assigns the result to the element in first argument.

func (*GT) New added in v0.2.0

func (g *GT) New() *E

New initializes a new target group element which is equal to one

func (*GT) One added in v0.2.0

func (g *GT) One() *E

One initializes a new target group element which is equal to one

func (*GT) Q added in v0.2.0

func (g *GT) Q() *big.Int

Q returns group order in big.Int.

func (*GT) Square added in v0.2.0

func (g *GT) Square(c, a *E)

Square squares an element `a` and assigns the result to the element in first argument.

func (*GT) Sub added in v0.2.0

func (g *GT) Sub(c, a, b *E)

Sub subtracts two field element `a` and `b`, and assigns the result to the element in first argument.

func (*GT) ToBytes added in v0.2.0

func (g *GT) ToBytes(e *E) []byte

ToBytes serializes target group element.

type KyberG1

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

KyberG1 is a kyber.Point holding a G1 point on BLS12-381 curve

func (*KyberG1) Add

func (k *KyberG1) Add(a, b kyber.Point) kyber.Point

func (*KyberG1) Base

func (k *KyberG1) Base() kyber.Point

func (*KyberG1) Clone

func (k *KyberG1) Clone() kyber.Point

func (*KyberG1) Data

func (k *KyberG1) Data() ([]byte, error)

func (*KyberG1) Embed

func (k *KyberG1) Embed(data []byte, rand cipher.Stream) kyber.Point

func (*KyberG1) EmbedLen

func (k *KyberG1) EmbedLen() int

func (*KyberG1) Equal

func (k *KyberG1) Equal(k2 kyber.Point) bool

func (*KyberG1) Hash

func (k *KyberG1) Hash(m []byte) kyber.Point

func (*KyberG1) MarshalBinary

func (k *KyberG1) MarshalBinary() ([]byte, error)

func (*KyberG1) MarshalSize

func (k *KyberG1) MarshalSize() int

func (*KyberG1) MarshalTo

func (k *KyberG1) MarshalTo(w io.Writer) (int, error)

func (*KyberG1) Mul

func (k *KyberG1) Mul(s kyber.Scalar, q kyber.Point) kyber.Point

func (*KyberG1) Neg

func (k *KyberG1) Neg(a kyber.Point) kyber.Point

func (*KyberG1) Null

func (k *KyberG1) Null() kyber.Point

func (*KyberG1) Pick

func (k *KyberG1) Pick(rand cipher.Stream) kyber.Point

func (*KyberG1) Set

func (k *KyberG1) Set(q kyber.Point) kyber.Point

func (*KyberG1) String

func (k *KyberG1) String() string

func (*KyberG1) Sub

func (k *KyberG1) Sub(a, b kyber.Point) kyber.Point

func (*KyberG1) UnmarshalBinary

func (k *KyberG1) UnmarshalBinary(buff []byte) error

func (*KyberG1) UnmarshalFrom

func (k *KyberG1) UnmarshalFrom(r io.Reader) (int, error)

type KyberG2

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

KyberG2 is a kyber.Point holding a G2 point on BLS12-381 curve

func (*KyberG2) Add

func (k *KyberG2) Add(a, b kyber.Point) kyber.Point

func (*KyberG2) Base

func (k *KyberG2) Base() kyber.Point

func (*KyberG2) Clone

func (k *KyberG2) Clone() kyber.Point

func (*KyberG2) Data

func (k *KyberG2) Data() ([]byte, error)

func (*KyberG2) Embed

func (k *KyberG2) Embed(data []byte, rand cipher.Stream) kyber.Point

func (*KyberG2) EmbedLen

func (k *KyberG2) EmbedLen() int

func (*KyberG2) Equal

func (k *KyberG2) Equal(k2 kyber.Point) bool

func (*KyberG2) Hash

func (k *KyberG2) Hash(m []byte) kyber.Point

func (*KyberG2) MarshalBinary

func (k *KyberG2) MarshalBinary() ([]byte, error)

func (*KyberG2) MarshalSize

func (k *KyberG2) MarshalSize() int

func (*KyberG2) MarshalTo

func (k *KyberG2) MarshalTo(w io.Writer) (int, error)

func (*KyberG2) Mul

func (k *KyberG2) Mul(s kyber.Scalar, q kyber.Point) kyber.Point

func (*KyberG2) Neg

func (k *KyberG2) Neg(a kyber.Point) kyber.Point

func (*KyberG2) Null

func (k *KyberG2) Null() kyber.Point

func (*KyberG2) Pick

func (k *KyberG2) Pick(rand cipher.Stream) kyber.Point

func (*KyberG2) Set

func (k *KyberG2) Set(q kyber.Point) kyber.Point

func (*KyberG2) String

func (k *KyberG2) String() string

func (*KyberG2) Sub

func (k *KyberG2) Sub(a, b kyber.Point) kyber.Point

func (*KyberG2) UnmarshalBinary

func (k *KyberG2) UnmarshalBinary(buff []byte) error

func (*KyberG2) UnmarshalFrom

func (k *KyberG2) UnmarshalFrom(r io.Reader) (int, error)

type KyberGT

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

func (*KyberGT) Add

func (k *KyberGT) Add(a, b kyber.Point) kyber.Point

func (*KyberGT) Base

func (k *KyberGT) Base() kyber.Point

func (*KyberGT) Clone

func (k *KyberGT) Clone() kyber.Point

func (*KyberGT) Data

func (k *KyberGT) Data() ([]byte, error)

func (*KyberGT) Embed

func (k *KyberGT) Embed(data []byte, rand cipher.Stream) kyber.Point

func (*KyberGT) EmbedLen

func (k *KyberGT) EmbedLen() int

func (*KyberGT) Equal

func (k *KyberGT) Equal(kk kyber.Point) bool

func (*KyberGT) MarshalBinary

func (k *KyberGT) MarshalBinary() ([]byte, error)

func (*KyberGT) MarshalSize

func (k *KyberGT) MarshalSize() int

func (*KyberGT) MarshalTo

func (k *KyberGT) MarshalTo(w io.Writer) (int, error)

func (*KyberGT) Mul

func (k *KyberGT) Mul(s kyber.Scalar, q kyber.Point) kyber.Point

func (*KyberGT) Neg

func (k *KyberGT) Neg(q kyber.Point) kyber.Point

func (*KyberGT) Null

func (k *KyberGT) Null() kyber.Point

func (*KyberGT) Pick

func (k *KyberGT) Pick(rand cipher.Stream) kyber.Point

func (*KyberGT) Set

func (k *KyberGT) Set(q kyber.Point) kyber.Point

func (*KyberGT) String

func (k *KyberGT) String() string

func (*KyberGT) Sub

func (k *KyberGT) Sub(a, b kyber.Point) kyber.Point

func (*KyberGT) UnmarshalBinary

func (k *KyberGT) UnmarshalBinary(buf []byte) error

func (*KyberGT) UnmarshalFrom

func (k *KyberGT) UnmarshalFrom(r io.Reader) (int, error)

type PointG1

type PointG1 [3]fe

PointG1 is type for point in G1. PointG1 is both used for Affine and Jacobian point representation. If z is equal to one the point is accounted as in affine form.

func (*PointG1) Set

func (p *PointG1) Set(p2 *PointG1) *PointG1

type PointG2

type PointG2 [3]fe2

PointG2 is type for point in G2. PointG2 is both used for Affine and Jacobian point representation. If z is equal to one the point is accounted as in affine form.

func (*PointG2) Set

func (p *PointG2) Set(p2 *PointG2) *PointG2

Set copies valeus of one point to another.

type Suite

type Suite struct {
}

func (*Suite) G1

func (s *Suite) G1() kyber.Group

func (*Suite) G2

func (s *Suite) G2() kyber.Group

func (*Suite) GT

func (s *Suite) GT() kyber.Group

func (*Suite) Hash

func (s *Suite) Hash() hash.Hash

Hash returns a newly instantiated sha256 hash function.

func (*Suite) New

func (s *Suite) New(t reflect.Type) interface{}

New implements the kyber.Encoding interface.

func (*Suite) Pair

func (s *Suite) Pair(p1, p2 kyber.Point) kyber.Point

func (*Suite) RandomStream

func (s *Suite) RandomStream() cipher.Stream

RandomStream returns a cipher.Stream which corresponds to a key stream from crypto/rand.

func (*Suite) Read

func (s *Suite) Read(r io.Reader, objs ...interface{}) error

Read is the default implementation of kyber.Encoding interface Read.

func (*Suite) Write

func (s *Suite) Write(w io.Writer, objs ...interface{}) error

Write is the default implementation of kyber.Encoding interface Write.

func (*Suite) XOF

func (s *Suite) XOF(seed []byte) kyber.XOF

XOF returns a newlly instantiated blake2xb XOF function.

Jump to

Keyboard shortcuts

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