bls12381

package
v0.1.6-0...-5c25bcb Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

README

This is a minimalistic copy of High Speed BLS12-381 Implementation in Go. The original README can be found here. The original LICENSE is Apache License 2.0 and can be found here.

There are two reasons why we cannot use original BLS12-381 library kilic/bls12-381 directly as go module:

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SQRT_M_XI_CUBED = &fe{
	0x43b571cad3215f1f,
	0xccb460ef1c702dc2,
	0x742d884f4f97100b,
	0xdb2c3e3238a3382b,
	0xe40f3fa13fce8f88,
	0x73a2af9892a2ff,
}

Functions

func ClearCofactor

func ClearCofactor(p *PointG1)

ClearCofactor maps given a G1 point to correct subgroup

func HashToCurve

func HashToCurve(msg, domain []byte, hashFunc func() hash.Hash) ([]byte, error)

func IsAffine

func IsAffine(p *PointG1) bool

IsAffine checks a G1 point whether it is in affine form.

func IsZero

func IsZero(p *PointG1) bool

IsZero returns true if given point is equal to zero.

func ToBytes

func ToBytes(p *PointG1) []byte

ToBytes serializes a point into bytes in uncompressed form. ToBytes returns (0, 0) if point is infinity.

Types

type PointG1

type PointG1 [3]fe

PointG1 is type for point in G1 and used for both Affine and Jacobian point representation. A point is accounted as in affine form if z is equal to one.

func Add

func Add(r, p1, p2 *PointG1) *PointG1

Add adds two G1 points p1, p2 and assigns the result to point at first argument.

func Affine

func Affine(p *PointG1) *PointG1

Affine returns the affine representation of the given point

func Double

func Double(r, p *PointG1) *PointG1

Double doubles a G1 point p and assigns the result to the point at first argument.

func MulScalarBig

func MulScalarBig(c, p *PointG1, e *big.Int) *PointG1

MulScalar multiplies a point by given scalar value in big.Int and assigns the result to point at first argument.

func (*PointG1) Set

func (p *PointG1) Set(p2 *PointG1) *PointG1

func (*PointG1) Zero

func (p *PointG1) Zero() *PointG1

Jump to

Keyboard shortcuts

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