Generic AESCTRDRBG implementation based on the AESCTR driver.
This file should only be included in the board file to fill the AESCTR_config struct.
This implementation uses the AESCTR driver to generate the random bitstream required to mutate the internal AESCTRDRBG state and provide random output bits. The driver will construct a dynamic instance of the AESCTR driver. Mutual exclusion and hardware access are all handled by the AESCTR driver instance.
The driver implementation does not perform runtime checks for most input parameters. Only values that are likely to have a stochastic element to them are checked (such as whether a driver is already open). Higher input parameter validation coverage is achieved by turning on assertions when compiling the driver.
#include <stdint.h>
#include <stdbool.h>
#include <ti/drivers/AESCTRDRBG.h>
#include <ti/devices/DeviceFamily.h>
#include <DeviceFamily_constructPath(driverlib/aes.h)>
#include <ti/drivers/aesctr/AESCTRLPF3.h>
Go to the source code of this file.
Data Structures | |
struct | AESCTRDRBGXX_HWAttrs |
AESCTRDRBGXX Hardware Attributes. More... | |
struct | AESCTRDRBGXX_Object |
AESCTRDRBGXX Object. More... | |
Macros | |
#define | AESCTRDRBG_MAX_KEY_LENGTH AESCTRDRBG_AES_KEY_LENGTH_256 |
Define that specifies the maximum AES key length required. More... | |
#define | AESCTRDRBG_MAX_SEED_LENGTH (AESCTRDRBG_MAX_KEY_LENGTH + AESCTRDRBG_AES_BLOCK_SIZE_BYTES) |
Define that specifies the maximum seed length used by the driver. More... | |
#define AESCTRDRBG_MAX_KEY_LENGTH AESCTRDRBG_AES_KEY_LENGTH_256 |
Define that specifies the maximum AES key length required.
This define defines what the largest AES key length used in an application is. Since this implementation needs to support all AES key lengths by default, temporary buffers and the internal driver state are sized to accommodate AES-256. If only AES-128 is used in an application, the driver can be recompiled with a different AESCTRDRBG_MAX_KEY_LENGTH to save RAM in the AESCTRDRBGXX_Object and reducing stack size requirements.
#define AESCTRDRBG_MAX_SEED_LENGTH (AESCTRDRBG_MAX_KEY_LENGTH + AESCTRDRBG_AES_BLOCK_SIZE_BYTES) |
Define that specifies the maximum seed length used by the driver.