prv

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: Unlicense Imports: 3 Imported by: 0

Documentation

Overview

Package prv is a wrapper around secp256k1 library from the Decred project to handle, generate and serialise secp256k1 private keys.

Index

Constants

View Source
const (
	KeyLen = secp256k1.PrivKeyBytesLen
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Bytes

type Bytes [KeyLen]byte

func (Bytes) Zero

func (pb Bytes) Zero()

Zero zeroes out a private key in serial form.

type Key

type Key secp256k1.PrivateKey

Key is a private key.

func GenerateKey

func GenerateKey() (prv *Key, e error)

GenerateKey a private key.

func PrivkeyFromBytes

func PrivkeyFromBytes(b []byte) *Key

PrivkeyFromBytes converts a byte slice into a private key.

func (*Key) ToBytes

func (prv *Key) ToBytes() (b Bytes)

ToBytes returns the Bytes serialized form. It zeroes the original bytes.

func (*Key) Zero

func (prv *Key) Zero()

Zero out a private key to prevent key scraping from memory.

Jump to

Keyboard shortcuts

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