aes

aes

https://pkg.go.dev/crypto/aes@go1.20.1

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.

常量

View Source

1
const BlockSize = 16

The AES block size in bytes.

变量

This section is empty.

函数

func NewCipher

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

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

类型

type KeySizeError

1
type KeySizeError int

(KeySizeError) Error

1
func (k KeySizeError) Error() string
最后修改 June 5, 2023: 更新标准库 (33f199b)