bn254

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckG1AndG2DiscreteLogEquality

func CheckG1AndG2DiscreteLogEquality(pointG1 *bn254.G1Affine, pointG2 *bn254.G2Affine) (bool, error)

func DeserializeG1

func DeserializeG1(b []byte) *bn254.G1Affine

func DeserializeG2

func DeserializeG2(b []byte) *bn254.G2Affine

func GetG1Generator

func GetG1Generator() *bn254.G1Affine

func GetG2Generator

func GetG2Generator() *bn254.G2Affine

func MapToCurve

func MapToCurve(digest [32]byte) *bn254.G1Affine

MapToCurve implements the simple hash-and-check (also sometimes try-and-increment) algorithm see https://hackmd.io/@benjaminion/bls12-381#Hash-and-check Note that this function needs to be the same as the one used in the contract: we don't use the newer constant time hash-to-curve algorithms as they are gas-expensive to compute onchain

func MulByGeneratorG1

func MulByGeneratorG1(a *fr.Element) *bn254.G1Affine

func MulByGeneratorG2

func MulByGeneratorG2(a *fr.Element) *bn254.G2Affine

func SerializeG1

func SerializeG1(p *bn254.G1Affine) []byte

func SerializeG2

func SerializeG2(p *bn254.G2Affine) []byte

func VerifySig

func VerifySig(sig *bn254.G1Affine, pubkey *bn254.G2Affine, msgBytes [32]byte) (bool, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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