crypto

package
v0.2.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	PubkeyLength    = blst.BLST_P2_COMPRESS_BYTES
	SignatureLength = blst.BLST_P1_COMPRESS_BYTES
)
View Source
const (
	Secp256k1SigLength = 64
)

Variables

View Source
var ErrorAggregation = errors.New("crypto: failed to aggregate bls signatures")

Functions

func AggregateSignatures

func AggregateSignatures(sigs [][]byte) ([]byte, error)

func AggregateVerify

func AggregateVerify(pks [][]byte, msg, sig []byte) bool

func CompressP256k1Pubkey

func CompressP256k1Pubkey(pubkey [64]byte) []byte

func DoubleSHA256Sum

func DoubleSHA256Sum(data []byte) []byte

func Hash160Sum

func Hash160Sum(data []byte) []byte

func SHA256Sum

func SHA256Sum(data ...[]byte) []byte

func Sign

func Sign(sk *PrivateKey, msg []byte) []byte

func Uint64LE

func Uint64LE(n ...uint64) []byte

func Verify

func Verify(pk, msg, sig []byte) bool

Types

type AggregatePublicKey

type AggregatePublicKey = blst.P2Aggregate

type AggregateSignature

type AggregateSignature = blst.P1Aggregate

type PrivateKey

type PrivateKey = blst.SecretKey

func GenPrivKey

func GenPrivKey() *PrivateKey

type PublicKey

type PublicKey = blst.P2Affine

type Signature

type Signature = blst.P1Affine

Jump to

Keyboard shortcuts

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