ed25519
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package ed25519 implements the Ed25519 signature algorithm.
These functions are also compatible with the “Ed25519” function defined inRFC 8032. However, unlikeRFC 8032's formulation, this package's private keyrepresentation includes a public key suffix to make multiple signingoperations with the same key more efficient. This package refers to theRFC8032 private key as the “seed”.
The ed25519 package is a wrapper for the Ed25519 implementation in thecrypto/ed25519 package. It isfrozen and is not accepting new features.
Index¶
Constants¶
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// SignatureSize is the size, in bytes, of signatures generated and verified by this package.SignatureSize = 64// SeedSize is the size, in bytes, of private key seeds. These are the private key representations used byRFC 8032.SeedSize = 32)
Variables¶
This section is empty.
Functions¶
funcGenerateKey¶
func GenerateKey(randio.Reader) (PublicKey,PrivateKey,error)
GenerateKey generates a public/private key pair using entropy from rand.If rand is nil, crypto/rand.Reader will be used.
funcSign¶
func Sign(privateKeyPrivateKey, message []byte) []byte
Sign signs the message with privateKey and returns a signature. It willpanic if len(privateKey) is not PrivateKeySize.
Types¶
typePrivateKey¶
type PrivateKey =ed25519.PrivateKey
PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer.
This type is an alias for crypto/ed25519's PrivateKey type.See the crypto/ed25519 package for the methods on this type.
funcNewKeyFromSeed¶
func NewKeyFromSeed(seed []byte)PrivateKey
NewKeyFromSeed calculates a private key from a seed. It will panic iflen(seed) is not SeedSize. This function is provided for interoperabilitywithRFC 8032.RFC 8032's private keys correspond to seeds in thispackage.