crypto

package
v0.0.0-...-5d85a61 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2023 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressPubkey

func CompressPubkey(pubkey *ecdsa.PublicKey) []byte

func CreateAddress

func CreateAddress(b common.Address, nonce uint64) common.Address

func CreateAddress2

func CreateAddress2(b common.Address, salt [32]byte, inithash []byte) common.Address

func DecompressPubkey

func DecompressPubkey(pubkey []byte) (*ecdsa.PublicKey, error)

func Ecrecover

func Ecrecover(hash, sig []byte) ([]byte, error)

func FromECDSA

func FromECDSA(priv *ecdsa.PrivateKey) []byte

func FromECDSAPub

func FromECDSAPub(pub *ecdsa.PublicKey) []byte

func GenerateKey

func GenerateKey() (*ecdsa.PrivateKey, error)

func Hash160

func Hash160(buf []byte) []byte

func HexToECDSA

func HexToECDSA(hexkey string) (*ecdsa.PrivateKey, error)

func Keccak256

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

func Keccak256Hash

func Keccak256Hash(data ...[]byte) (h common.Hash)

func Keccak512

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

func LoadECDSA

func LoadECDSA(file string) (*ecdsa.PrivateKey, error)

func NewLigoPubkeyAddr

func NewLigoPubkeyAddr(pubkey []byte) string

func NewLigoScriptAddr

func NewLigoScriptAddr(script []byte) string

func PubkeyToAddress

func PubkeyToAddress(p ecdsa.PublicKey) common.Address

func S256

func S256() elliptic.Curve

func SaveECDSA

func SaveECDSA(file string, key *ecdsa.PrivateKey) error

func SigToPub

func SigToPub(hash, sig []byte) (*ecdsa.PublicKey, error)

func Sign

func Sign(hash []byte, prv *ecdsa.PrivateKey) (sig []byte, err error)

func ToECDSA

func ToECDSA(d []byte) (*ecdsa.PrivateKey, error)

func ToECDSAPub

func ToECDSAPub(pub []byte) *ecdsa.PublicKey

func ToECDSAUnsafe

func ToECDSAUnsafe(d []byte) *ecdsa.PrivateKey

func UnmarshalPubkey

func UnmarshalPubkey(pub []byte) (*ecdsa.PublicKey, error)

func ValidateLigoAddr

func ValidateLigoAddr(input string) bool

func ValidateSignatureValues

func ValidateSignatureValues(v byte, r, s *big.Int, homestead bool) bool

func VerifySignature

func VerifySignature(pubkey, hash, signature []byte) bool

Types

This section is empty.

Directories

Path Synopsis
Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xb.
Package blake2b implements the BLAKE2b hash algorithm defined by RFC 7693 and the extendable output function (XOF) BLAKE2Xb.
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
Package bn256 implements the Optimal Ate pairing over a 256-bit Barreto-Naehrig curve.
cloudflare
Package bn256 implements a particular bilinear group at the 128-bit security level.
Package bn256 implements a particular bilinear group at the 128-bit security level.
google
Package bn256 implements a particular bilinear group.
Package bn256 implements a particular bilinear group.
Package secp256k1 wraps the bitcoin secp256k1 C library.
Package secp256k1 wraps the bitcoin secp256k1 C library.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.
Package sha3 implements the SHA-3 fixed-output-length hash functions and the SHAKE variable-output-length hash functions defined by FIPS-202.

Jump to

Keyboard shortcuts

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