The AES functions.
The AES cipher allows 128-bit, 192-bit and 256-bit keys.
The AES functions are defined in huaes.h. An AES parameters object,
key object and operating context are required to perform the AES algorithm.
An RNG context is required if key generation will be performed.
The various modes of operation are indicated by:
-
SB_AES_ECB
-
SB_AES_CBC
-
SB_AES_CFB8
-
SB_AES_CFB128
-
SB_AES_OFB128
-
SB_AES_KEYWRAP
-
SB_AES_CTR8
-
SB_AES_CTR16
-
SB_AES_CTR32
-
SB_AES_CTR64
-
SB_AES_CTR128
-
SB_AES_XTS(unitBytes)
For AES Counter (CTR) mode, you may use the macro
SB_AES_CTR(ctrBits)
to define the mode of operation, where
ctrBits is the size (in bits)
of the counter, and
ctrBits is a multiple of 8 and is no greater than
128. The
SB_AES_CTR modes above are provided for convenience for using
counter mode with a counter size of 8, 16, 32, 64 or 128.
For AES XTS mode, you may use the macro
SB_AES_XTS(unitBytes) to
define the mode of operation, where
unitBytes is the number of bytes
in a data unit. The number of bytes in a data unit must be a multiple of 16,
with a maximum of 2
24 ( = 0x1000000 ).
The increment function implemented for the CTR mode is "Standard Incrementing
Function" described in Appendix B.1 of NIST SP 800-38A 2001
(
http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf).
The block size constants are:
-
SB_AES_128_BLOCK_BITS
-
SB_AES_128_BLOCK_BYTES
-
SB_AES_KEYWRAP_BLOCK_BITS
-
SB_AES_KEYWRAP_BLOCK_BYTES
The supported key size constants are:
-
SB_AES_128_KEY_BITS
-
SB_AES_128_KEY_BYTES
-
SB_AES_192_KEY_BITS
-
SB_AES_192_KEY_BYTES
-
SB_AES_256_KEY_BITS
-
SB_AES_256_KEY_BYTES
-
SB_AES_128_XTS_KEY_BITS
-
SB_AES_128_XTS_KEY_BYTES
-
SB_AES_256_XTS_KEY_BITS
-
SB_AES_256_XTS_KEY_BYTES