pbc

package
v0.0.0-...-34685ae Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2017 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const CurveFp254BNb = bls.CurveFp254BNb

CurveFp254BNb -- 254 bit curve

View Source
const CurveFp382_1 = bls.CurveFp382_1

CurveFp382_1 -- 382 bit curve 1

View Source
const CurveFp382_2 = bls.CurveFp382_2

CurveFp382_2 -- 382 bit curve 2

View Source
const Fp254_G1_Base_Seed = "Fp254_G1_Base_Seed"
View Source
const Fp254_G1_Base_Str = "" /* 131-byte string literal not displayed */
View Source
const Fp254_G2_Base_Seed = "Fp254_G2_Base_Seed"
View Source
const Fp254_G2_Base_Str = "" /* 260-byte string literal not displayed */
View Source
const Fp382_1_G1_Base_Seed = "Fp382_1_G1_Base_Seed"
View Source
const Fp382_1_G1_Base_Str = "" /* 195-byte string literal not displayed */
View Source
const Fp382_1_G2_Base_Seed = "Fp382_1_G2_Base_Seed"
View Source
const Fp382_1_G2_Base_Str = "" /* 391-byte string literal not displayed */
View Source
const Fp382_2_G1_Base_Seed = "Fp382_2_G1_Base_Seed"
View Source
const Fp382_2_G1_Base_Str = "" /* 194-byte string literal not displayed */
View Source
const Fp382_2_G2_Base_Seed = "Fp382_2_G2_Base_Seed"
View Source
const Fp382_2_G2_Base_Str = "" /* 388-byte string literal not displayed */

Variables

View Source
var ErrVarTime = errors.New("no constant time implementation available")

Functions

func NewScalar

func NewScalar() kyber.Scalar

NewScalar returns a non initialized kyber.Scalar implementation to use with PBC groups.

func PointMarshalTo

func PointMarshalTo(p kyber.Point, w io.Writer) (int, error)

PointMarshalTo provides a generic implementation of Point.EncodeTo based on Point.Encode.

func PointUnmarshalFrom

func PointUnmarshalFrom(p kyber.Point, r io.Reader) (int, error)

PointUnmarshalFrom provides a generic implementation of Point.DecodeFrom, based on Point.Decode, or Point.Pick if r is a Cipher or cipher.Stream. The returned byte-count is valid only when decoding from a normal Reader, not when picking from a pseudorandom source.

func ScalarMarshalTo

func ScalarMarshalTo(s kyber.Scalar, w io.Writer) (int, error)

ScalarMarshalTo provides a generic implementation of Scalar.EncodeTo based on Scalar.Encode.

func ScalarUnmarshalFrom

func ScalarUnmarshalFrom(s kyber.Scalar, r io.Reader) (int, error)

ScalarUnmarshalFrom provides a generic implementation of Scalar.DecodeFrom, based on Scalar.Decode, or Scalar.Pick if r is a Cipher or cipher.Stream. The returned byte-count is valid only when decoding from a normal Reader, not when picking from a pseudorandom source.

Types

type Pairing

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

A Pairing object represents a pairing-based cryptography environment, consisting of two source groups G1 and G2 and a target group GT. All of these groups support the standard Group API operations. In addition, the GT group supports the new Pairing operation, via the PointGT extension to the Point interface. The input groups G1 and G2 may be identical or different, as indicated by the Symmetric() method.

func NewPairing

func NewPairing(curve int) *Pairing

NewPairing returns a new initialized curve. XXX It is currently UNDEFINED to declare multiple pairing since the C lib uses a global variable underneath.

func NewPairingFp254BNb

func NewPairingFp254BNb() *Pairing

func NewPairingFp382_1

func NewPairingFp382_1() *Pairing

func NewPairingFp382_2

func NewPairingFp382_2() *Pairing

func (*Pairing) Cipher

func (p *Pairing) Cipher(key []byte, options ...interface{}) kyber.Cipher

func (*Pairing) G1

func (p *Pairing) G1() kyber.Group

func (*Pairing) G2

func (p *Pairing) G2() kyber.Group

func (*Pairing) GT

func (p *Pairing) GT() PairingGroup

func (*Pairing) Hash

func (p *Pairing) Hash() hash.Hash

type PairingGroup

type PairingGroup interface {
	kyber.Group // Standard Group operations

	PointGT() PointGT // Create new pairing-capable Point
}

Group interface extension to create pairing-capable points.

type PairingSuite

type PairingSuite interface {
	G1() kyber.Group
	G2() kyber.Group
	GT() PairingGroup
	kyber.HashFactory
	kyber.CipherFactory
}

PairingSuite represents the basic functionalities needed to use pairing based cryptography.

type PointGT

type PointGT interface {
	kyber.Point // Standard Point operations

	// Compute the pairing of two points p1 and p2,
	// which must be in the associated groups G1 and G2 respectively.
	Pairing(p1, p2 kyber.Point) kyber.Point
}

Point interface extension for a point in a pairing target group (GT), which supports the Pairing operation.

Jump to

Keyboard shortcuts

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