bls

package module
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: MIT Imports: 13 Imported by: 32

README

CircleCI

kyber-bls12381

Kyber wrapper around kilic/bls12381 library.

Note: GT does not fully support the kyber.Point interface yet.

Previous library

This repository is the successor of the previous library bls12381 which was a complete fork of the upstream library.

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

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 GroupChecker

type GroupChecker interface {
	kyber.Point
	IsInCorrectGroup() bool
}

GroupChecker allows to verify if a Point is in the correct group or not. For curves which don't have a prime order, we need to only consider the points lying in the subgroup of prime order. That check returns true if the point is correct or not.

type KyberG1

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

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

func NullKyberG1

func NullKyberG1() *KyberG1

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) IsInCorrectGroup

func (k *KyberG1) IsInCorrectGroup() bool

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 NullKyberG2

func NullKyberG2() *KyberG2

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) IsInCorrectGroup

func (k *KyberG2) IsInCorrectGroup() bool

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 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) ValidatePairing

func (s *Suite) ValidatePairing(p1, p2, p3, p4 kyber.Point) bool

ValidatePairing implements the `pairing.Suite` interface

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.

Directories

Path Synopsis
tests

Jump to

Keyboard shortcuts

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