ed25519

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PublicKeySize is the size, in bytes, of public keys as used in this package.
	PublicKeySize = 32

	// PrivateKeySize is the size, in bytes, of private keys as used in this package.
	PrivateKeySize = 64

	// SeedSize is the size, in bytes, of private key seeds.
	SeedSize = 32
)

Variables

This section is empty.

Functions

func NewKeyIterator

func NewKeyIterator(rand io.Reader) (*keyIterator, error)

NewKeyIterator creates and initializes a new Ed25519 key iterator. The iterator is NOT thread safe; you must create a separate iterator for each worker instead of sharing a single instance.

Types

type KeyPair

type KeyPair struct {
	// PublicKey is the public key of the Ed25519 key pair.
	PublicKey PublicKey

	// PrivateKey is the private key of the Ed25519 key pair.
	PrivateKey PrivateKey
}

KeyPair is a type with both Ed25519 keys.

func GenerateKey

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

func (*KeyPair) Validate

func (kp *KeyPair) Validate() error

Validate performs sanity checks to ensure that the public and private keys match.

type PrivateKey

type PrivateKey []byte

PrivateKey is the type of Ed25519 private keys.

type PublicKey

type PublicKey []byte

PublicKey is the type of Ed25519 public keys.

Jump to

Keyboard shortcuts

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