bls12

package
v0.0.0-...-e2af113 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2018 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

View Source
const (
	FqElementSize      = 48
	G1CompressedSize   = FqElementSize
	G1UncompressedSize = 2 * FqElementSize
)
View Source
const (
	Fq2ElementSize     = 96
	G2CompressedSize   = Fq2ElementSize
	G2UncompressedSize = 2 * Fq2ElementSize
)

Variables

This section is empty.

Functions

func FqMontgomeryReduce

func FqMontgomeryReduce(b []byte)

func IsScalar

func IsScalar(s []byte) bool

func ScalarOrder

func ScalarOrder() []byte

Types

type EP

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

EP is a point in G1 backed by a relic ep_st.

func (*EP) Add

func (ep *EP) Add(a *EP) *EP

func (*EP) Copy

func (ep *EP) Copy() *EP

func (*EP) DecodeCompressed

func (ep *EP) DecodeCompressed(in []byte) (*EP, error)

DecodeCompressed decodes a point according to ebfull/pairing bls12_381 serialization from a byte slice of length G1CompressedSize.

func (*EP) DecodeUncompressed

func (ep *EP) DecodeUncompressed(in []byte) (*EP, error)

DecodeUncompressed decodes a point according to ebfull/pairing bls12_381 serialization from a byte slice of length G1UncompressedSize.

func (*EP) EncodeCompressed

func (ep *EP) EncodeCompressed() []byte

EncodeCompressed encodes a point according to ebfull/pairing bls12_381 serialization into a byte slice of length G1CompressedSize.

func (*EP) EncodeUncompressed

func (ep *EP) EncodeUncompressed() []byte

EncodeUncompressed encodes a point according to ebfull/pairing bls12_381 serialization into a byte slice of length G1UncompressedSize.

func (*EP) Equal

func (ep *EP) Equal(a *EP) bool

func (*EP) ScalarBaseMult

func (ep *EP) ScalarBaseMult(s []byte) *EP

func (*EP) ScalarMult

func (ep *EP) ScalarMult(s []byte) *EP

func (*EP) SetOne

func (ep *EP) SetOne() *EP

func (*EP) SetZero

func (ep *EP) SetZero() *EP

type EP2

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

EP2 is a point in G2 backed by a relic ep2_t.

EP2 requires manual memory management.

func NewEP2

func NewEP2() *EP2

func (*EP2) Add

func (ep2 *EP2) Add(a *EP2) *EP2

func (*EP2) Close

func (ep2 *EP2) Close()

func (*EP2) DecodeCompressed

func (ep2 *EP2) DecodeCompressed(in []byte) (*EP2, error)

DecodeCompressed decodes a point according to ebfull/pairing bls12_381 serialization from a byte slice of length G2CompressedSize.

func (*EP2) DecodeUncompressed

func (ep2 *EP2) DecodeUncompressed(in []byte) (*EP2, error)

DecodeUncompressed decodes a point according to ebfull/pairing bls12_381 serialization from a byte slice of length G2UncompressedSize.

func (*EP2) EncodeCompressed

func (ep2 *EP2) EncodeCompressed() []byte

EncodeCompressed encodes a point according to ebfull/pairing bls12_381 serialization into a byte slice of length G2CompressedSize.

func (*EP2) EncodeUncompressed

func (ep2 *EP2) EncodeUncompressed() []byte

EncodeUncompressed encodes a point according to ebfull/pairing bls12_381 serialization into a byte slice of length G2UncompressedSize.

func (*EP2) Equal

func (ep2 *EP2) Equal(a *EP2) bool

func (*EP2) IsZero

func (ep2 *EP2) IsZero() bool

func (*EP2) ScalarMult

func (ep2 *EP2) ScalarMult(s []byte) *EP2

func (*EP2) ScaleByCofactor

func (ep2 *EP2) ScaleByCofactor() *EP2

func (*EP2) SetOne

func (ep2 *EP2) SetOne() *EP2

func (*EP2) SetZero

func (ep2 *EP2) SetZero() *EP2

Jump to

Keyboard shortcuts

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