package sign
import "golang.org/x/crypto/nacl/sign"
Package sign signs small messages using public-key cryptography.
This package is interoperable with libsodium, as well as TweetNaCl.
The sign package is essentially a wrapper for the Ed25519 signature algorithm (implemented by crypto/ed25519). It is frozen and is not accepting new features.
Index ¶
- Constants
- func GenerateKey(rand io.Reader) (publicKey *[32]byte, privateKey *[64]byte, err error)
- func Open(out, signedMessage []byte, publicKey *[32]byte) ([]byte, bool)
- func Sign(out, message []byte, privateKey *[64]byte) []byte
Constants ¶
const Overhead = 64
Overhead is the number of bytes of overhead when signing a message.
Functions ¶
func GenerateKey ¶
GenerateKey generates a new public/private key pair suitable for use with Sign and Open.
func Open ¶
Open verifies a signed message produced by Sign and appends the message to out, which must not overlap the signed message. The output will be Overhead bytes smaller than the signed message.
func Sign ¶
Sign appends a signed copy of message to out, which will be Overhead bytes longer than the original and must not overlap it.
Source Files ¶
sign.go
- Version
- v0.44.0
- Published
- Nov 11, 2025
- Platform
- linux/amd64
- Imports
- 3 packages
- Last checked
- 5 hours ago –
Tools for package owners.