package pairing

import "go.dedis.ch/kyber/v3/pairing"

Index

Types

type Suite

type Suite interface {
	G1() kyber.Group
	G2() kyber.Group
	GT() kyber.Group
	Pair(p1, p2 kyber.Point) kyber.Point
	kyber.Encoding
	kyber.HashFactory
	kyber.XOFFactory
	kyber.Random
}

Suite interface represents a triplet of elliptic curve groups (G₁, G₂ and GT) such that there exists a function e(g₁ˣ,g₂ʸ)=gTˣʸ (where gₓ is a generator of the respective group) which is called a pairing.

type SuiteBn256

type SuiteBn256 struct {
	Suite
	kyber.Group
}

SuiteBn256 is an adapter that implements the suites.Suite interface so that bn256 can be used as a common suite to generate key pairs for instance but still preserves the properties of the pairing (e.g. the Pair function).

It's important to note that the Point function will generate a point compatible with public keys only (group G2) where the signature must be used as a point from the group G1.

func NewSuiteBn256

func NewSuiteBn256() *SuiteBn256

NewSuiteBn256 makes a new BN256 suite

func (*SuiteBn256) Point

func (s *SuiteBn256) Point() kyber.Point

Point generates a point from the G2 group that can only be used for public keys

func (*SuiteBn256) PointLen

func (s *SuiteBn256) PointLen() int

PointLen returns the length of a G2 point

func (*SuiteBn256) Scalar

func (s *SuiteBn256) Scalar() kyber.Scalar

Scalar generates a scalar

func (*SuiteBn256) ScalarLen

func (s *SuiteBn256) ScalarLen() int

ScalarLen returns the lenght of a scalar

func (*SuiteBn256) String

func (s *SuiteBn256) String() string

String returns the name of the suite

Source Files

adapter.go pairing.go

Directories

PathSynopsis
pairing/bn256Package bn256 implements a particular bilinear group.
Version
v3.1.0 (latest)
Published
Nov 30, 2022
Platform
linux/amd64
Imports
2 packages
Last checked
1 month ago

Tools for package owners.