ed25519

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2020 License: Apache-2.0, Apache-2.0, BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Overview

Package ed25519 implements the Ed25519 signature algorithm. See http://ed25519.cr.yp.to/.

Index

Constants

View Source
const (
	PublicKeySize  = 32
	PrivateKeySize = 64
	SignatureSize  = 64
)

Variables

This section is empty.

Functions

func GenerateKey

func GenerateKey(rand io.Reader) (publicKey *[PublicKeySize]byte, privateKey *[PrivateKeySize]byte, err error)

GenerateKey generates a public/private key pair using randomness from rand.

func MakePublicKey

func MakePublicKey(privateKey *[PrivateKeySize]byte) (publicKey *[PublicKeySize]byte)

MakePublicKey makes a publicKey from the first half of privateKey.

func Sign

func Sign(privateKey *[PrivateKeySize]byte, message []byte) *[SignatureSize]byte

Sign signs the message with privateKey and returns a signature.

func Verify

func Verify(publicKey *[PublicKeySize]byte, message []byte, sig *[SignatureSize]byte) bool

Verify returns true iff sig is a valid signature of message by publicKey.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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