rpbs

package
v0.0.0-...-7a2e46d Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FIELD_MODULUS = fp.Modulus()
	CURVE_ORDER   = fr.Modulus()
)

Functions

func BytesToPoint

func BytesToPoint(hash [32]byte) (*bn254.G1Affine, error)

func CurveRHS

func CurveRHS(x *fp.Element) *fp.Element

x^3 + 3

func DecodePointFromRPBSFormat

func DecodePointFromRPBSFormat(encodedPointInRPBSFormat string) (*bn254.G1Affine, error)

encoded point in RPBS format (that was formed by JS code) is represented as a hex string: len(hex(X)) + "04" + hex(X) + hex(Y)

func EncodePoint

func EncodePoint(point *bn254.G1Affine) []byte

we need encoding a point in this format for compatibility reasons since it is used in JS library elliptic.js '04' + hex(x) + hex(y)

func NegateBigInt

func NegateBigInt(input *big.Int) *big.Int

func Verify

func Verify(builderBid builderTypes.BuilderBlockBid) (bool, error)

func VerifySignature

func VerifySignature(y1 *bn254.G1Affine, info string, sig *Signature) bool

func VerifySignatureWithStringInput

func VerifySignatureWithStringInput(rpbsServicePublicKey string, info string, sig *rpbsTypes.EncodedRPBSSignature) (bool, error)

Types

type Complex

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

func ComplexCurveMul

func ComplexCurveMul(x *Complex, y *Complex, neg *fp.Element) *Complex

func ComplexExponent

func ComplexExponent(base *Complex, n *big.Int, neg *fp.Element) *Complex

type Signature

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

func DecodeRPBSSignature

func DecodeRPBSSignature(sig *rpbsTypes.EncodedRPBSSignature) (*Signature, error)

Jump to

Keyboard shortcuts

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