Namespace: go.std.crypto.ed25519
v1.0Contents
Summary
Provides a low-level interface to the crypto/ed25519 package.
Package ed25519 implements the Ed25519 signature algorithm. See
https://ed25519.cr.yp.to/.
These functions are also compatible with the “Ed25519” function defined in
RFC 8032. However, unlike RFC 8032's formulation, this package's private key
representation includes a public key suffix to make multiple signing
operations with the same key more efficient. This package refers to the RFC
8032 private key as the “seed”.
Index
- *PrivateKey
- *PublicKey
- GenerateKey
- NewKeyFromSeed
- PrivateKey
- PrivateKeySize
- PublicKey
- PublicKeySize
- SeedSize
- Sign
- SignatureSize
- Verify
- arrayOfPrivateKey
- arrayOfPublicKey
Legend
-
Constant
Variable
Function
Macro
Special form
Type
GoVar
Receiver/Method
Constants
Constants are variables with :const true in their metadata. Joker currently does not recognize them as special; as such, it allows redefining them or their values.-
PrivateKeySize
Int v1.0PrivateKeySize is the size, in bytes, of private keys as used in this package.
-
PublicKeySize
Int v1.0PublicKeySize is the size, in bytes, of public keys as used in this package.
-
SeedSize
Int v1.0SeedSize is the size, in bytes, of private key seeds. These are the private key representations used by RFC 8032.
-
SignatureSize
Int v1.0SignatureSize is the size, in bytes, of signatures generated and verified by this package.
Variables
-
(None.)
Functions, Macros, and Special Forms
-
GenerateKey
Function v1.0(GenerateKey rand)
GenerateKey generates a public/private key pair using entropy from rand.
If rand is nil, crypto/rand.Reader will be used.
Go input arguments: (rand io.Reader)
Go returns: (PublicKey, PrivateKey, error)
Joker input arguments: [^go.std.io/Reader rand]
Joker returns: [^PublicKey, ^PrivateKey, ^Error] -
NewKeyFromSeed
Function v1.0(NewKeyFromSeed seed)
NewKeyFromSeed calculates a private key from a seed. It will panic if
len(seed) is not SeedSize. This function is provided for interoperability
with RFC 8032. RFC 8032's private keys correspond to seeds in this
package.
Go input arguments: (seed []byte)
Go returns: PrivateKey
Joker input arguments: [^arrayOfByte seed]
Joker returns: ^PrivateKey -
Sign
Function v1.0(Sign privateKey message)
Sign signs the message with privateKey and returns a signature. It will
panic if len(privateKey) is not PrivateKeySize.
Go input arguments: (privateKey PrivateKey, message []byte)
Go returns: []byte
Joker input arguments: [^PrivateKey privateKey, ^arrayOfByte message]
Joker returns: ^arrayOfByte -
Verify
Function v1.0(Verify publicKey message sig)
Verify reports whether sig is a valid signature of message by publicKey. It
will panic if len(publicKey) is not PublicKeySize.
Go input arguments: (publicKey PublicKey, message []byte, sig []byte)
Go returns: bool
Joker input arguments: [^PublicKey publicKey, ^arrayOfByte message, ^arrayOfByte sig]
Joker returns: ^Boolean
Types
-
*PrivateKey
Concrete Type v1.0PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer.
-
*PublicKey
Concrete Type v1.0PublicKey is the type of Ed25519 public keys.
-
PrivateKey
Concrete Type v1.0PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer.
-
Equal
Receiver for PrivateKey v1.0([x])
Equal reports whether priv and x have the same value.
-
Public
Receiver for PrivateKey v1.0([])
Public returns the PublicKey corresponding to priv.
-
Seed
Receiver for PrivateKey v1.0([])
Seed returns the private key seed corresponding to priv. It is provided for
interoperability with RFC 8032. RFC 8032's private keys correspond to seeds
in this package.
-
Sign
Receiver for PrivateKey v1.0([rand message opts])
Sign signs the given message with priv.
Ed25519 performs two passes over messages to be signed and therefore cannot
handle pre-hashed messages. Thus opts.HashFunc() must return zero to
indicate the message hasn't been hashed. This can be achieved by passing
crypto.Hash(0) as the value for opts.
-
PublicKey
Concrete Type v1.0PublicKey is the type of Ed25519 public keys.
-
Equal
Receiver for PublicKey v1.0([x])
Equal reports whether pub and x have the same value.
-
arrayOfPrivateKey
Concrete Type v1.0PrivateKey is the type of Ed25519 private keys. It implements crypto.Signer.
-
arrayOfPublicKey
Concrete Type v1.0PublicKey is the type of Ed25519 public keys.