MPCL

Package ed25519

Package ed25519 implements the Ed25519 signature algorithm.

Constants

const PrivateKeySize = 64

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

const PublicKeySize = 32

PublicKeySize is the size, in bytes, of public keys as used in this package.

const SeedSize = 32

SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032.

const SignatureSize = 64

SignatureSize is the size, in bytes, of signatures generated and verified by this package.

Variables

This section is empty.

Functions

func NewKeyFromSeed
func NewKeyFromSeed(seed [SeedSize]byte) (PublicKey, PrivateKey)

NewKeyFromSeed calculates a private key and a public key from a seed. RFC 8032's private keys correspond to seeds in this package.

func Sign
func Sign(privateKey PrivateKey, message []byte) []byte

Sign signs the message with privateKey and returns the signature.

Types

type PrivateKey [64]byte

PrivateKey defines the Ed25519 private key.

   XXX type PrivateKey [PrivateKeySize]byte
type PublicKey [32]byte

PublicKey defines the Ed25519 public key.

   XXX type PublicKey [PublicKeySize]byte