altbn128

package
v1.1.1-rc Latest Latest
Warning

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

Go to latest
Published: May 1, 2020 License: MIT Imports: 5 Imported by: 3 modules, 5 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecompressToG1

func DecompressToG1(m []byte) (*bn256.G1, error)

DecompressToG1 decompresses byte slice into G1 point by extracting Y parity bit from the first byte, extracting X value and calculating original Y value based on the extracted Y parity. The parity bit is encoded in the top byte as 0x01 (even) or 0x00 (odd).

func DecompressToG2

func DecompressToG2(m []byte) (*bn256.G2, error)

DecompressToG2 decompresses byte slice into G2 point by extracting Y parity bit from the first byte, extracting X value and calculating original Y value based on the extracted Y parity. The parity bit is encoded in the top byte as 0x01 (even) or 0x00 (odd).

func G1FromInts

func G1FromInts(x *big.Int, y *big.Int) (*bn256.G1, error)

G1FromInts returns G1 point based on the provided x and y.

func G1HashToPoint

func G1HashToPoint(m []byte) *bn256.G1

G1HashToPoint hashes the provided byte slice, maps it into a G1 and returns it as a G1 point.

func G2FromInts

func G2FromInts(x *gfP2, y *gfP2) (*bn256.G2, error)

G2FromInts returns G2 point based on the provided x and y in Fp^2.

Types

type G1Point

type G1Point struct {
	*bn256.G1
}

func (G1Point) Compress

func (g G1Point) Compress() []byte

Compress compresses point by using X value and the parity bit of Y encoded into the first byte.

type G2Point

type G2Point struct {
	*bn256.G2
}

func (G2Point) Compress

func (g G2Point) Compress() []byte

Compress compresses point by using X value and the parity bit of Y encoded into the first byte.

Jump to

Keyboard shortcuts

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