aes

package standard library
go1.26.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 10, 2026 License: BSD-3-Clause Imports: 4 Imported by: 43,798

Documentation ΒΆ

Overview ΒΆ

Package aes implements AES encryption (formerly Rijndael), as defined in U.S. Federal Information Processing Standards Publication 197.

The AES operations in this package are not implemented using constant-time algorithms. An exception is when running on systems with enabled hardware support for AES that makes these operations constant-time. Examples include amd64 systems using AES-NI extensions and s390x systems using Message-Security-Assist extensions. On such systems, when the result of NewCipher is passed to cipher.NewGCM, the GHASH operation used by GCM is also constant-time.

Index ΒΆ

Constants ΒΆ

View Source
const BlockSize = 16

The AES block size in bytes.

Variables ΒΆ

This section is empty.

Functions ΒΆ

func NewCipher ΒΆ

func NewCipher(key []byte) (cipher.Block, error)

NewCipher creates and returns a new cipher.Block. The key argument must be the AES key, either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256.

Types ΒΆ

type KeySizeError ΒΆ

type KeySizeError int

func (KeySizeError) Error ΒΆ

func (k KeySizeError) Error() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL