bn256cgo

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2015 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Overview

Package bn256cgo is a drop in replacement for the bn256 package from go.crypto.

It should be about 10x faster than the pure-Go version when run on an amd64 based system. It wraps a patched version of http://cryptojedi.org/crypto/#dclxvi.

See the original package for documentation.

[1] http://cryptojedi.org/papers/dclxvi-20100714.pdf

Index

Constants

This section is empty.

Variables

View Source
var Order = bigFromBase10("65000549695646603732796438742359905742570406053903786389881062969044166799969")

Order is the number of elements in both G₁ and G₂: 36u⁴+36u³+18u³+6u+1.

Functions

This section is empty.

Types

type G1

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

func RandomG1

func RandomG1(r io.Reader) (*big.Int, *G1, error)

RandomG1 returns x and g₁ˣ where x is a random, non-zero number read from r.

func (*G1) Add

func (e *G1) Add(a, b *G1) *G1

func (*G1) Marshal

func (e *G1) Marshal() []byte

func (*G1) Neg

func (e *G1) Neg(a *G1)

func (*G1) ScalarBaseMult

func (e *G1) ScalarBaseMult(k *big.Int) *G1

func (*G1) ScalarMult

func (e *G1) ScalarMult(base *G1, k *big.Int) *G1

func (*G1) String

func (e *G1) String() string

func (*G1) Unmarshal

func (e *G1) Unmarshal(m []byte) (*G1, bool)

type G2

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

func RandomG2

func RandomG2(r io.Reader) (*big.Int, *G2, error)

RandomG2 returns x and g₂ˣ where x is a random, non-zero number read from r.

func (*G2) Add

func (e *G2) Add(a, b *G2) *G2

func (*G2) Marshal

func (e *G2) Marshal() []byte

func (*G2) Neg

func (e *G2) Neg(a *G2)

func (*G2) ScalarBaseMult

func (e *G2) ScalarBaseMult(k *big.Int) *G2

func (*G2) ScalarMult

func (e *G2) ScalarMult(base *G2, k *big.Int) *G2

func (*G2) String

func (e *G2) String() string

func (*G2) Unmarshal

func (e *G2) Unmarshal(m []byte) (*G2, bool)

type GT

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

func Pair

func Pair(g1 *G1, g2 *G2) *GT

func (*GT) Add

func (e *GT) Add(a, b *GT) *GT

func (*GT) Marshal

func (e *GT) Marshal() []byte

func (*GT) Neg

func (e *GT) Neg(a *GT) *GT

func (*GT) ScalarMult

func (e *GT) ScalarMult(base *GT, k *big.Int) *GT

func (*GT) String

func (e *GT) String() string

func (*GT) Unmarshal

func (e *GT) Unmarshal(m []byte) (*GT, bool)

Jump to

Keyboard shortcuts

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