cryptoff

package
v0.0.0-...-c755132 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2019 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Curve = elliptic.P256()

Functions

func CreateAddress

func CreateAddress() (*ecdsa.PrivateKey, *ecdsa.PublicKey, string)

createAddress creates a new private and public key, and encodes the public key as string together these form an address for the coin

func CreateSignature

func CreateSignature(msg []byte, priv *ecdsa.PrivateKey) ecdsaSignature

createSignature hashes the given bytes and signs the resulting hash with the given private key to produce signature

func DecodePrivateKey

func DecodePrivateKey(str string) *ecdsa.PrivateKey

decodePrivateKey decodes the private key from given base58 encoded string

func DecodePublicKey

func DecodePublicKey(b58 string) *ecdsa.PublicKey

decodePublicKey takes as parameter a base58 encoded public key string, decodes it into golang structure

func EncodePrivateKey

func EncodePrivateKey(privKey *ecdsa.PrivateKey) string

encodePrivateKey base58 encodes the private key for storage/presentation

func EncodePublicKey

func EncodePublicKey(pubKey *ecdsa.PublicKey) string

encodePublicKey takes the ecdsa public key, encodes its two big integer parts, and merges them to a single base58 encoded string

func HexToPrivateKey

func HexToPrivateKey(hexStr string) *ecdsa.PrivateKey

hexToPrivateKey converts a hex-encoded string into a golang private key structure

func HexToPublicKey

func HexToPublicKey(xHex string, yHex string) *ecdsa.PublicKey

HexToPublicKey converts a hex-encoded string into a golang public key structure

func MergeTwoByteSlices

func MergeTwoByteSlices(slice1 []byte, slice2 []byte) []byte

mergeTwoByteSlices merges two byte slices into a single slice. the new slice will start with single byte for the length of first slice in new slice. this is followed by the first slice, which is followed by second slice so newslice = [slice1length][slice1][slice2]

Types

This section is empty.

Jump to

Keyboard shortcuts

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