← All notes

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

Sources

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

Permanent ID: iil:note:mbfjb4p7

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.},
}

Markdown

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.

All artifact files (JSON index)

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.