versaHash

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2025 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Curve is a KoblitzCurve which implements secp256k1.
	Curve = btcec.S256()
	// One holds a big integer of 1
	One = new(big.Int).SetInt64(1)
	// Two holds a big integer of 2
	Two = new(big.Int).SetInt64(2)
	// Three holds a big integer of 3
	Three = new(big.Int).SetInt64(3)
	// Four holds a big integer of 4
	Four = new(big.Int).SetInt64(4)
	// Seven holds a big integer of 7
	Seven = new(big.Int).SetInt64(7)
	// N2 holds a big integer of N-2
	N2 = new(big.Int).Sub(Curve.N, Two)
)

Functions

func AggregateSignatures

func AggregateSignatures(privateKeys []*big.Int, message [32]byte) ([64]byte, error)

AggregateSignatures aggregates multiple signatures of different private keys over the same message into a single 64 byte signature.

func BatchVerify

func BatchVerify(publicKeys [][33]byte, messages [][32]byte, signatures [][64]byte) (bool, error)

BatchVerify verifies a list of 64 byte signatures of 32 byte messages against the public keys. Returns an error if verification fails. https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr.mediawiki#batch-verification

func GenerateRFC6979Nonce

func GenerateRFC6979Nonce(private []byte, msg []byte) *big.Int

func Marshal

func Marshal(curve elliptic.Curve, x, y *big.Int) []byte

Marshal converts a point into the form specified in section 2.3.3 of the SEC 1 standard.

func Sign

func Sign(privateKey *big.Int, message [32]byte) ([64]byte, error)

Sign a 32 byte message with the private key, returning a 64 byte signature. https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr.mediawiki#signing

func Unmarshal

func Unmarshal(curve elliptic.Curve, data []byte) (x, y *big.Int)

Unmarshal converts a point, serialised by Marshal, into an x, y pair. On error, x = nil.

func Verify

func Verify(publicKey [33]byte, message [32]byte, signature [64]byte) (bool, error)

Verify a 64 byte signature of a 32 byte message against the public key. Returns an error if verification fails. https://github.com/sipa/bips/blob/bip-schnorr/bip-schnorr.mediawiki#verification

func VersaHash

func VersaHash(data []byte, nonce []byte, extraNonce []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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