Package aes

Package aes implements the Advanced Encryption Standard (AES) block cipher operations.

Constants

const BlockSize = 16

BlockSize defines the AES cipher block size in bytes.

Variables

This section is empty.

Functions

func Block128
func Block128(key [16]byte, data [16]byte) [16]byte

Block128 encrypts one data block with 128 bit key.

func Block192
func Block192(key [24]byte, data [16]byte) [16]byte

Block192 encrypts one data block with 192 bit key.

func Block256
func Block256(key [32]byte, data [16]byte) [16]byte

Block256 encrypts one data block with 256 bit key.

func DecryptBlock
func DecryptBlock(key []byte, data [BlockSize]byte) [BlockSize]byte

DecryptBlock decrypts one data block with the key. The key must be 16, 24, or 32 bytes long.

func DecryptBlockExpanded
func DecryptBlockExpanded(xk []uint32, dst, src []byte) []byte

DecryptBlockExpanded decrypts one block from src into dst, using the expanded key xk.

func DeriveDecryptionKey
func DeriveDecryptionKey(enc []uint32) []uint32

DeriveDecryptionKey derives the decryption key from the encryption key enc.

func EncryptBlock
func EncryptBlock(key []byte, data [BlockSize]byte) [BlockSize]byte

EncryptBlock encrypts one data block with the key. The key must be 16, 24, or 32 bytes long.

func EncryptBlockExpanded
func EncryptBlockExpanded(xk []uint32, dst, src []byte) []byte

EncryptBlockExpanded encrypts one block from src into dst, using the expanded key xk.

func ExpandEncryptionKey
func ExpandEncryptionKey(key []byte) []uint32

ExpandEncryptionKey expands the key and returns the expanded encryption key. See FIPS-197, Figure 11. Their rcon[i] is our powx[i-1] << 24.

func ExpandKey
func ExpandKey(key []byte) ([]uint32, []uint32)

ExpandKey expands the key and returns the expanded encryption and decryption keys.

Types

This section is empty.