bn256

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2021 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotUint256 = errors.New("big.Ints are not at most 256-bit unsigned integers")

ErrNotUint256 occurs when we work with a uint with more than 256 bits

Functions

func BigIntArraySliceToG1

func BigIntArraySliceToG1(g1BigIntArray [][2]*big.Int) ([]*cloudflare.G1, error)

BigIntArraySliceToG1 converts Ethereum big.Int G1 array slice into cloudflare.G1 slice for computing purposes.

func BigIntArrayToG1

func BigIntArrayToG1(g1BigInt [2]*big.Int) (*cloudflare.G1, error)

BigIntArrayToG1 converts Ethereum big.Int G1 arrays into cloudflare.G1 elements for computing purposes.

func BigIntArrayToG2

func BigIntArrayToG2(g2BigInt [4]*big.Int) (*cloudflare.G2, error)

BigIntArrayToG2 converts Ethereum big.Int G2 arrays into cloudflare.G2 elements for computing purposes.

func G1ToBigIntArray

func G1ToBigIntArray(g1 *cloudflare.G1) [2]*big.Int

G1ToBigIntArray converts cloudflare.G2 into big.Int array for testing purposes.

func G2ToBigIntArray

func G2ToBigIntArray(g2 *cloudflare.G2) [4]*big.Int

G2ToBigIntArray converts cloudflare.G2 into big.Int array for testing purposes.

func MarshalBigInt

func MarshalBigInt(x *big.Int) ([]byte, error)

MarshalBigInt converts a 256-bit uint into a byte slice.

func MarshalBigIntSlice

func MarshalBigIntSlice(bigSlice []*big.Int) ([]byte, error)

MarshalBigIntSlice returns a byte slice for encoding that we will use to check that we hash to the correct value. All of these values are assumed to be uint256.

func MarshalG1Big

func MarshalG1Big(hashPoint [2]*big.Int) ([]byte, error)

MarshalG1Big is used to compare the result from Go code generated by Solidity with the original Go code in cloudflare directory.

func MarshalG1BigSlice

func MarshalG1BigSlice(g1BigSlice [][2]*big.Int) ([]byte, error)

MarshalG1BigSlice creates a byte slice from G1Big slice. This is used in testing purposes.

func MarshalG2Big

func MarshalG2Big(hashPoint [4]*big.Int) ([]byte, error)

MarshalG2Big is used to compare the result from Go code generated by Solidity with the original Go code in cloudflare directory.

Types

This section is empty.

Directories

Path Synopsis
Package cloudflare implements a particular bilinear group at the 128-bit security level.
Package cloudflare implements a particular bilinear group at the 128-bit security level.

Jump to

Keyboard shortcuts

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