ed25519

package
v0.0.0-...-72bc2f9 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PublicKeySize is the size, in bytes, of public keys as used in this package.
	PublicKeySize = ed25519.PublicKeySize
	// PrivateKeySize is the size, in bytes, of private keys as used in this package.
	PrivateKeySize = ed25519.PrivateKeySize
	// SignatureSize is the size, in bytes, of signatures generated and verified by this package.
	SignatureSize = ed25519.SignatureSize
	// SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032.
	SeedSize = ed25519.SeedSize
)

Variables

This section is empty.

Functions

This section is empty.

Types

type PrivateKey

type PrivateKey struct {
	Key ed25519.PrivateKey
}

PrivateKey based on the secp256k1 curve

func DeriveHardenedKey

func DeriveHardenedKey(parent crypto.PrivateKey, chaincode []byte) (*PrivateKey, error)

func GenerateKey

func GenerateKey(rand io.Reader) (*PrivateKey, error)

func PrivateKeyFromBytes

func PrivateKeyFromBytes(privKey []byte) (*PrivateKey, error)

PrivateKeyFromBytes get a private key from seed []byte

func (PrivateKey) Bytes

func (pk PrivateKey) Bytes() []byte

Bytes returns the byte representation of the private key

func (PrivateKey) PublicKey

func (pk PrivateKey) PublicKey() crypto.PublicKey

PublicKey return the public key that is derived from the private key

func (PrivateKey) Sign

func (pk PrivateKey) Sign(message []byte) (signature []byte, err error)

Sign signs the message with the private key and returns the signature.

type PublicKey

type PublicKey struct {
	Key ed25519.PublicKey
}

PublicKey based on the ed25519 curve

func PublicKeyFromBytes

func PublicKeyFromBytes(keyBytes []byte) (*PublicKey, error)

PublicKeyFromBytes create a public key from []byte

func (PublicKey) Bytes

func (pk PublicKey) Bytes() []byte

Bytes returns the byte representation of the public key

func (PublicKey) Verify

func (pk PublicKey) Verify(message, sig []byte) bool

Verify verifies whether sig is a valid signature of message.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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