Go crypto/ed25519: sign and verify with the Ed25519 algorithm
Answer: The crypto/ed25519 package implements the Ed25519 signature algorithm in a form compatible with RFC 8032, with a private key layout that makes repeat signing cheaper.
Keys and sizes
The package implements the Ed25519 signature algorithm and is also compatible with the Ed25519 function defined in RFC 8032.
Unlike that RFC formulation, this package's private key representation includes a public key suffix so multiple signing operations with the same key are more efficient.
Public keys and seeds are 32 bytes, while private keys and signatures are 64 bytes.
A PrivateKey can sign messages.
Generate, sign, and verify
GenerateKey creates a public and private key pair using entropy from a random source.
GenerateKey uses a secure random source when random is nil.
If set by the application, a custom crypto/rand.Reader was used before Go 1.26. GODEBUG=cryptocustomrand=1 can restore that behavior. A future Go release will remove this setting.
Verify reports whether a signature is valid for a message and public key, and it panics if the public key length is not PublicKeySize.
See also
Claims
- id: C1 claim: GenerateKey generates a public/private key pair using entropy from random. source: S1 evidence: "GenerateKey generates a public/private key pair using entropy from random"
- id: C2 claim: The private key includes a public key suffix to make repeat signing more efficient. source: S2 evidence: "includes a public key suffix to make multiple signing"
- id: C3 claim: Public keys are 32 bytes and private keys are 64 bytes. source: S2 evidence: "PublicKeySize = 32"
Sources
- [S1] crypto/ed25519. The Go Authors. https://pkg.go.dev/crypto/ed25519 . License: BSD-3-Clause. Accessed 2026-11-26.
- [S2] crypto/ed25519 source. The Go Authors. https://go.dev/src/crypto/ed25519/ed25519.go . License: BSD-3-Clause. Accessed 2026-11-26.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: The Go Authors, crypto/ed25519; The Go Authors, crypto/ed25519 source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: The Go Authors, crypto/ed25519; The Go Authors, crypto/ed25519 source. BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.
Cite this
iinventedlight. 2026. "Go crypto/ed25519: sign and verify with the Ed25519 algorithm." iinventedlight Library, iil:note:mbfjb4p7, version of 2026-11-26. https://iinventedlight.com/library/notes/go-ed25519/. License: CC-BY-4.0.
@misc{iil_note_mbfjb4p7,
author = {{iinventedlight}},
title = {{Go crypto/ed25519: sign and verify with the Ed25519 algorithm}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-26},
url = {https://iinventedlight.com/library/notes/go-ed25519/},
note = {Permanent ID iil:note:mbfjb4p7. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
Extra files beside this note
These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.
- go-ed25519.schema.json (schema; CC-BY-4.0)
- go-ed25519.table.json (table; CC-BY-4.0)
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/go-ed25519.md.