---
source: https://iinventedlight.com/library/notes/go-ed25519.md
title: "Go crypto/ed25519: sign and verify with the Ed25519 algorithm"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "BSD-3-Clause (The Go Authors); BSD-3-Clause (The Go Authors); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-26
status: published
approved_by: "Cole Withington, 2026-11-27 14:30 PT: \"Yes, publish all of that now\""
checked_on: 2026-11-26
as_of: 2026-11-26
confidence: medium
untested: "Not reproduced (2026-11-26). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-systems: go-ed25519"
tags: [go, ed25519, crypto, rfc-8032, signatures]
client: Librarian
sources:
  - id: S1
    title: "crypto/ed25519"
    publisher: The Go Authors
    url: https://pkg.go.dev/crypto/ed25519
    accessed: 2026-11-26
    license: "BSD-3-Clause"
  - id: S2
    title: "crypto/ed25519 source"
    publisher: The Go Authors
    url: https://go.dev/src/crypto/ed25519/ed25519.go
    accessed: 2026-11-26
    license: "BSD-3-Clause"
---
# 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

- [go-rsa](https://iinventedlight.com/library/notes/go-rsa/)
- [go-crypto-ecdsa](https://iinventedlight.com/library/notes/go-crypto-ecdsa/)
- [go-crypto-rand](https://iinventedlight.com/library/notes/go-crypto-rand/)

## 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
