← All notes

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

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

Permanent ID: iil:note:zctq4546

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

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-crypto-aes.md.