crypto

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2024 License: ISC Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompressPubkey

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

CompressPubkey encodes a public key to the 33-byte compressed format.

func DecompressPubkey

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

DecompressPubkey parses a public key in the 33-byte compressed format.

func Ecrecover

func Ecrecover(digestHash, sig []byte) (ecc.PublicKey, error)

Ecrecover returns the uncompressed public key that created the given signature.

func FromECDSAPub

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

func HexToECDSA

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

HexToECDSA parses a secp256k1 private key.

func Keccak256

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

Keccak256 calculates and returns the Keccak256 hash of the input data.

func Keccak256Hash

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

Keccak256Hash calculates and returns the Keccak256 hash of the input data, converting it to an internal Hash data structure.

func ParseSignature

func ParseSignature(signature []byte) (*secp256k1.Signature, error)

<R><S>

func Sign

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

<head><R><S>

func ToECDSA

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

ToECDSA creates a private key with the given D value.

func UnmarshalPubkey

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

UnmarshalPubkey converts bytes to a secp256k1 public key.

func VerifySignature

func VerifySignature(pubkey *ecdsa.PublicKey, digestHash, signature []byte) bool

VerifySignature checks that the given public key created signature over digest.

Types

This section is empty.

Directories

Path Synopsis
Package bip39 is the official Golang implementation of the BIP39 spec.
Package bip39 is the official Golang implementation of the BIP39 spec.
ecc
ed25519/internal
Package ed25519 implements the Ed25519 signature algorithm.
Package ed25519 implements the Ed25519 signature algorithm.
secp256k1
Package secp256k1 implements support for the elliptic curves needed for qitmeer.
Package secp256k1 implements support for the elliptic curves needed for qitmeer.
aes
bmw
jh
whirlpool
Package whirlpool implements the ISO/IEC 10118-3:2004 whirlpool cryptographic hash.
Package whirlpool implements the ISO/IEC 10118-3:2004 whirlpool cryptographic hash.

Jump to

Keyboard shortcuts

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