Go crypto/aes: AES block cipher as defined in FIPS 197
Answer: The aes package implements AES encryption, formerly Rijndael, as defined in US Federal Information Processing Standards Publication 197.
Algorithm and key sizes
The package implements AES encryption, formerly Rijndael, as defined in that publication.
The block size is 16 bytes.
NewCipher creates and returns a new cipher Block.
Give NewCipher a 16, 24, or 32 byte key, which selects AES 128, AES 192, or AES 256.
KeySizeError reports an invalid key size.
Constant-time behavior
AES operations here are not implemented with constant-time algorithms.
Hardware support can make the operations constant-time, including AES NI on amd64 and Message Security Assist on s390x.
On those systems, passing NewCipher's result into cipher NewGCM also keeps GCM GHASH constant-time.
See also
Claims
- id: C1 claim: The package implements AES as defined in FIPS 197. source: S1 evidence: "Package aes implements AES encryption (formerly Rijndael), as defined in"
- id: C2 claim: NewCipher accepts a 16-, 24-, or 32-byte key for AES-128, AES-192, or AES-256. source: S1 evidence: "either 16, 24, or 32 bytes to select"
- id: C3 claim: NewCipher accepts a 16-, 24-, or 32-byte key for AES 128, AES 192, or AES 256. source: S2 evidence: "either 16, 24, or 32 bytes to select"
Sources
- [S1] aes package - crypto/aes. The Go Authors. https://pkg.go.dev/crypto/aes . License: BSD-3-Clause. Accessed 2026-11-26.
- [S2] aes.go (source). The Go Authors. https://go.dev/src/crypto/aes/aes.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, aes package - crypto/aes; The Go Authors, aes.go (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, aes package - crypto/aes; The Go Authors, aes.go (source). BSD-3-Clause (https://go.dev/LICENSE). Copyright The Go Authors.
Cite this
iinventedlight. 2026. "Go crypto/aes: AES block cipher as defined in FIPS 197." iinventedlight Library, iil:note:zctq4546, version of 2026-11-26. https://iinventedlight.com/library/notes/go-crypto-aes/. License: CC-BY-4.0.
@misc{iil_note_zctq4546,
author = {{iinventedlight}},
title = {{Go crypto/aes: AES block cipher as defined in FIPS 197}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-26},
url = {https://iinventedlight.com/library/notes/go-crypto-aes/},
note = {Permanent ID iil:note:zctq4546. 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-crypto-aes.schema.json (schema; CC-BY-4.0)
- go-crypto-aes.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-crypto-aes.md.