util

package
v0.1.0-testnet Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2022 License: MPL-2.0 Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidECCPubKeyFormat = errors.New("ECC pubkey format could not be detected")

Functions

func BytesToFloat32

func BytesToFloat32(b []byte) (float32, error)

func CardIDFromPubKey

func CardIDFromPubKey(pubKey *ecdsa.PublicKey) string

func ECCPrivKeyToHex

func ECCPrivKeyToHex(privKey *ecdsa.PrivateKey) string

func ECCPubKeyToHexString

func ECCPubKeyToHexString(pubKey *ecdsa.PublicKey) string

func Float32ToBytes

func Float32ToBytes(f float32) ([]byte, error)

func ParseECCPrivKey

func ParseECCPrivKey(privKey []byte) (*ecdsa.PrivateKey, error)

func ParseECCPubKey

func ParseECCPubKey(rawPubKey []byte) (pubKey *ecdsa.PublicKey, err error)

func PinPrompt

func PinPrompt() (string, error)

Create an interactive prompt for user's pin

func RandomKey

func RandomKey(length int) []byte

func Uint16ToBytes

func Uint16ToBytes(i uint16) []byte

Types

type ECDSASignature

type ECDSASignature struct {
	R, S *big.Int
}

func ParseECDSASignature

func ParseECDSASignature(rawSig []byte) (*ECDSASignature, error)

Jump to

Keyboard shortcuts

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