![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
Modules | |
Ltc_driver_aes_with_dpa | |
Ltc_driver_cmac_with_dpa | |
Ltc_driver_des_with_dpa | |
Data Structures | |
struct | ltc_dpa_handle_t |
Handle for LTC DPA APIs. More... | |
Macros | |
#define | LTC_DPA_AES_BLOCK_SIZE 16 |
AES block size in bytes. | |
#define | LTC_DPA_AES_IV_SIZE 16 |
AES Input Vector size in bytes. | |
#define | LTC_DPA_DES_BLOCK_SIZE 8 |
LTC DES block size in bytes. | |
#define | LTC_DPA_DES_KEY_SIZE 8 |
LTC DES key size - 64 bits. More... | |
#define | LTC_DPA_DES_IV_SIZE 8 |
LTC DES IV size - 8 bytes. | |
#define | LTC_DPA_AES_BLOCK_SIZE 16 |
AES block size in bytes. | |
#define | LTC_DPA_AES_IV_SIZE 16 |
AES Input Vector size in bytes. | |
#define | LTC_DPA_DES_BLOCK_SIZE 8 |
LTC DES block size in bytes. | |
#define | LTC_DPA_DES_KEY_SIZE 8 |
LTC DES key size - 64 bits. More... | |
#define | LTC_DPA_DES_IV_SIZE 8 |
LTC DES IV size - 8 bytes. | |
Typedefs | |
typedef uint32_t | ltc_dpa_request_t [250] |
User request details, also updated during processing. | |
typedef uint32_t | ltc_dpa_request_t [250] |
User request details, also updated during processing. | |
Enumerations | |
enum | ltc_dpa_hash_algo_t |
Algorithm supported by LTC_CMAC_DPA APIs. | |
enum | ltc_dpa_hash_algo_t |
Algorithm supported by LTC_CMAC_DPA APIs. | |
Functions | |
void | LTC_InitDPA (LTC_Type *base) |
Enable clock to LTC module. More... | |
void | LTC_SetDpaMaskSeedDPA (LTC_Type *base, uint32_t mask) |
Sets the DPA Mask Seed register. More... | |
status_t | LTC_CreateHandleDPA (LTC_Type *base, ltc_dpa_handle_t *handle, uint8_t seed[16]) |
Init the LTC DPA handle which is used in transcational functions. More... | |
status_t | LTC_AES_SetKeyDPA (LTC_Type *base, ltc_dpa_handle_t *handle, const uint8_t *key, size_t keySize) |
Set key for LTC DPA AES encryption. More... | |
void | LTC_SetDummyNumberDPA (ltc_dpa_handle_t *handle, uint32_t num) |
Set number of dummy operations added per one real operation. More... | |
void | LTC_SetDummyProbabilityDPA (ltc_dpa_handle_t *handle, uint32_t probability) |
Set probability a dummy operation runs to completion. More... | |
status_t | LTC_IdleTimePrngBufferEnableDPA (ltc_dpa_handle_t *handle, uint32_t *prngBuffer, size_t prngBufferArraySize) |
Enables the Idle time PRNG buffer. More... | |
status_t | LTC_IdleTimePrngBufferPutNextDPA (ltc_dpa_handle_t *handle) |
Runs PRNG algorithm and puts the 32-bit random word to associated memory buffer. More... | |
struct ltc_dpa_handle_t |
Data Fields | |
ltc_dpa_request_t | req |
Driver internals derived from user request and updated during request processing. | |
#define LTC_DPA_DES_KEY_SIZE 8 |
#define LTC_DPA_DES_KEY_SIZE 8 |
void LTC_InitDPA | ( | LTC_Type * | base | ) |
This function enables clock to the LTC module.
base | LTC peripheral base address |
void LTC_SetDpaMaskSeedDPA | ( | LTC_Type * | base, |
uint32_t | mask | ||
) |
The DPA Mask Seed register reseeds the mask that provides resistance against DPA (differential power analysis) attacks on AES or DES keys.
Differential Power Analysis Mask (DPA) resistance uses a randomly changing mask that introduces "noise" into the power consumed by the AES or DES. This reduces the signal-to-noise ratio that differential power analysis attacks use to "guess" bits of the key. This randomly changing mask should be seeded at POR, and continues to provide DPA resistance from that point on. However, to provide even more DPA protection it is recommended that the DPA mask be reseeded after every 50,000 blocks have been processed. At that time, software can opt to write a new seed (preferably obtained from an RNG) into the DPA Mask Seed register (DPAMS), or software can opt to provide the new seed earlier or later, or not at all. DPA resistance continues even if the DPA mask is never reseeded.
base | LTC peripheral base address |
mask | The DPA mask seed. |
status_t LTC_CreateHandleDPA | ( | LTC_Type * | base, |
ltc_dpa_handle_t * | handle, | ||
uint8_t | seed[16] | ||
) |
This function creates internal context for the LTC DPA functions. This function also initializes LTC DPA Mask Seed DPAMS register with a 32-bit word, where the word is derived from the seed[].
base | LTC module base address | |
[in,out] | handle | Pointer to ltc_dpa_handle_t structure |
seed | Pointer to 128-bit entropy input. |
status_t LTC_AES_SetKeyDPA | ( | LTC_Type * | base, |
ltc_dpa_handle_t * | handle, | ||
const uint8_t * | key, | ||
size_t | keySize | ||
) |
This function sets key for usage with LTC DPA AES functions.
base | LTC module base address | |
[in,out] | handle | Pointer to ltc_dpa_handle_t structure |
probability | Probability that a dummy operation runs to completion. |
void LTC_SetDummyNumberDPA | ( | ltc_dpa_handle_t * | handle, |
uint32_t | num | ||
) |
LTC_CreateHandleDPA() uses this function to configure default Nd = 15.
This function sets runtime parameter of number of dummy operation added per one real operation. Possible values have an upper limit FSL_LTC_DPA_MAX_ND. The parameter is stored in the handle and read by the driver from the handle when it executes encryption or decryption. This function can be called any time.
[in,out] | handle | Pointer to ltc_dpa_handle_t structure |
probability | Probability that a dummy operation runs to completion. |
void LTC_SetDummyProbabilityDPA | ( | ltc_dpa_handle_t * | handle, |
uint32_t | probability | ||
) |
LTC_CreateHandleDPA() uses this function to configure default probability = 100%, means in default setting all dummy operations run to completion.
This function sets runtime parameter of probability a dummy operation runs to completion. The parameter is stored in the handle and read by the driver from the handle when it executes encryption or decryption. This function can be called any time.
[in,out] | handle | Pointer to ltc_dpa_handle_t structure |
probability | Probability that a dummy operation runs to completion. Possible values are integer values 0 to 100. |
status_t LTC_IdleTimePrngBufferEnableDPA | ( | ltc_dpa_handle_t * | handle, |
uint32_t * | prngBuffer, | ||
size_t | prngBufferArraySize | ||
) |
This feature is intended to enable pseudo-random numbers generation during system idle time. These idle time pre-generated numbers are simply consumed by LTC_DPA encrypt/decrypt functions.
[in,out] | handle | Pointer to ltc_dpa_handle_t structure |
prngBuffer | Memory buffer to be used as storage for random 32-bit words. | |
prngBufferArraySize | Number of items (array size) in the prngBuffer[] array. |
status_t LTC_IdleTimePrngBufferPutNextDPA | ( | ltc_dpa_handle_t * | handle | ) |
This function is intended and designed to be used during system idle time to generate random numbers, to be consumed by LTC_DPA encrypt/decrypt APIs.
Example usage FreeRTOS Idle Time Hook:
Example usage in Super Loop (bare metal):
[in,out] | handle | Pointer to ltc_dpa_handle_t structure |