Kinetis SDK v.1.3 API Reference Manual
Rev. 0
Freescale Semiconductor, Inc.
|
This section describes the programming interface of the LTC HAL driver.
Data Structures | |
struct | ltc_hal_pkha_mode_params_t |
LTC PKHA parameters. More... | |
Typedefs | |
typedef uint32_t | ltc_hal_mode_t |
Full word representing the actual bit values for the LTC mode register. More... | |
Functions | |
static uint32_t | LTC_HAL_GetWordFromUnaligned (const uint8_t *src) |
Reads an unaligned word. More... | |
static void | LTC_HAL_SetUnalignedFromWord (uint32_t srcWord, uint8_t *dst) |
Converts a 32-bit word into a byte array. More... | |
void | LTC_HAL_Init (LTC_Type *base) |
Initializes the LTC HAL. More... | |
static void | LTC_HAL_ModeSetAlgorithm (ltc_hal_mode_t *outMode, ltc_hal_algorithm_t alg) |
Sets the LTC operating algorithm. More... | |
static void | LTC_HAL_ModeSetEncrypt (ltc_hal_mode_t *outMode, ltc_hal_mode_encrypt_t encrypt) |
Sets the encrypt/decrypt mode. More... | |
static ltc_hal_mode_encrypt_t | LTC_HAL_ModeGetEncrypt (ltc_hal_mode_t *outMode) |
Gets the encrypt/decrypt mode. More... | |
static void | LTC_HAL_ModeSetICVTest (ltc_hal_mode_t *outMode, ltc_hal_mode_icv_check_t check) |
Sets the ICV test selection. More... | |
static void | LTC_HAL_ModeSetAlgorithmState (ltc_hal_mode_t *outMode, ltc_hal_mode_algorithm_state_t as) |
Sets the algorithm state. More... | |
static ltc_hal_mode_algorithm_state_t | LTC_HAL_ModeGetAlgorithmState (ltc_hal_mode_t *outMode) |
Gets the algorithm state. More... | |
static void | LTC_HAL_ModeSetSymmetricAlg (ltc_hal_mode_t *outMode, ltc_hal_mode_symmetric_alg_t alg) |
Sets the symmetric algorithm. More... | |
static void | LTC_HAL_ModeSetDecryptKey (LTC_Type *base) |
Sets the mode DK bit. More... | |
static void | LTC_HAL_PKHA_ModeSetFunc (ltc_hal_mode_t *outMode, ltc_hal_pkha_func_t func) |
Sets the PKHA function. More... | |
static void | LTC_HAL_PKHA_ModeSetMontgomeryInput (ltc_hal_mode_t *outMode, ltc_hal_pkha_montgomery_form_t form) |
Sets PKHA montgomery inputs. More... | |
static void | LTC_HAL_PKHA_ModeSetMontgomeryOutput (ltc_hal_mode_t *outMode, ltc_hal_pkha_montgomery_form_t form) |
Sets PKHA montgomery outputs. More... | |
static void | LTC_HAL_PKHA_ModeSetF2M (ltc_hal_mode_t *outMode, ltc_hal_pkha_f2m_t form) |
Sets the PKHA arithmetic type (f2m or integer). More... | |
static void | LTC_HAL_PKHA_ModeSetR2 (ltc_hal_mode_t *outMode, ltc_hal_pkha_r2_t form) |
Sets the PKHA use of R2 mod N. More... | |
static void | LTC_HAL_PKHA_ModeSetTimingEqual (ltc_hal_mode_t *outMode, ltc_hal_pkha_timing_t form) |
Sets the PKHA timing equalization. More... | |
static void | LTC_HAL_PKHA_ModeSetOutput (ltc_hal_mode_t *outMode, ltc_hal_pkha_output_reg_t form) |
Sets the PKHA output selection. More... | |
static void | LTC_HAL_PKHA_ModeSetRamArea (ltc_hal_mode_t *outMode, ltc_hal_pkha_reg_area_t area) |
Sets the PKHA RAM area selection. More... | |
static void | LTC_HAL_PKHA_ModeSetQuadArea (ltc_hal_mode_t *outMode, ltc_hal_pkha_clr_quad_area_t quad) |
Sets the PKHA Quad area selection. More... | |
static void | LTC_HAL_WriteMode (LTC_Type *base, ltc_hal_mode_t mode) |
LTC write mode register. More... | |
static ltc_hal_mode_t | LTC_HAL_ReadMode (LTC_Type *base) |
LTC read mode register. More... | |
static uint8_t | LTC_HAL_GetKeySize (LTC_Type *base) |
Gets the LTC key size. More... | |
ltc_status_t | LTC_HAL_SetKeySize (LTC_Type *base, uint8_t keySize) |
Sets the LTC key size. More... | |
static uint16_t | LTC_HAL_GetDataSize (LTC_Type *base) |
Gets the LTC data size. More... | |
ltc_status_t | LTC_HAL_SetDataSize (LTC_Type *base, uint16_t dataSize) |
Sets the LTC data size. More... | |
static uint8_t | LTC_HAL_GetICVSize (LTC_Type *base) |
Gets the LTC ICV size. More... | |
ltc_status_t | LTC_HAL_SetICVSize (LTC_Type *base, uint8_t dataSize) |
Sets the LTC ICV size. More... | |
static void | LTC_HAL_Command (LTC_Type *base, ltc_hal_cmd_t cmd) |
Issues LTC commands. More... | |
static void | LTC_HAL_SetInterruptMask (LTC_Type *base, ltc_hal_isr_mask_t mask) |
Sets LTC Interrupt Masked. More... | |
static void | LTC_HAL_SetPKHAEnableDMA (LTC_Type *base, ltc_hal_dma_enable_t enable) |
Sets LTC DMA enable for PKHA. More... | |
static void | LTC_HAL_SetInputFIFOEnableDMA (LTC_Type *base, ltc_hal_dma_enable_t enable) |
Sets LTC DMA enable for input FIFO. More... | |
static void | LTC_HAL_SetInputFIFORequestSizeDMA (LTC_Type *base, ltc_hal_fifo_dma_size_t size) |
Sets the LTC DMA input FIFO request size. More... | |
static void | LTC_HAL_SetOutputFIFOEnableDMA (LTC_Type *base, ltc_hal_dma_enable_t enable) |
Sets the LTC DMA enable for output FIFO. More... | |
static void | LTC_HAL_SetOutputFIFORequestSizeDMA (LTC_Type *base, ltc_hal_fifo_dma_size_t size) |
Sets the LTC DMA output FIFO request size. More... | |
static void | LTC_HAL_SetInputFIFOByteSwap (LTC_Type *base, ltc_hal_byte_swap_t swap) |
Sets the LTC input FIFO byte swap. More... | |
static void | LTC_HAL_SetOutputFIFOByteSwap (LTC_Type *base, ltc_hal_byte_swap_t swap) |
Sets the LTC output FIFO byte swap. More... | |
static void | LTC_HAL_SetKeyRegInputByteSwap (LTC_Type *base, ltc_hal_byte_swap_t swap) |
Sets the LTC input key register byte swap. More... | |
static void | LTC_HAL_SetKeyRegOutputByteSwap (LTC_Type *base, ltc_hal_byte_swap_t swap) |
Sets the LTC output key register byte swap. More... | |
static void | LTC_HAL_SetCtxRegInputByteSwap (LTC_Type *base, ltc_hal_byte_swap_t swap) |
Sets the LTC input context register byte swap. More... | |
static void | LTC_HAL_SetCtxRegOutputByteSwap (LTC_Type *base, ltc_hal_byte_swap_t swap) |
Sets the LTC output context register byte swap. More... | |
static void | LTC_HAL_SetKeyRegAccessLock (LTC_Type *base, ltc_hal_key_lock_t lock) |
Sets the LTC key register access lock. More... | |
static void | LTC_HAL_ClearWritten (LTC_Type *base, ltc_hal_clear_written_t clear) |
Clears LTC internal registers. More... | |
static bool | LTC_HAL_GetStatusFlag (LTC_Type *base, ltc_hal_status_flag_t flag) |
Gets LTC status flags. More... | |
static void | LTC_HAL_ClearDoneInterruptStatus (LTC_Type *base) |
Clears the status done interrupt. More... | |
void | LTC_HAL_GetStatusFlagMasked (LTC_Type *base, ltc_hal_status_flag_t in, ltc_hal_status_flag_t *out) |
Gets LTC masked status flags. More... | |
static bool | LTC_HAL_GetErrorStatusFlag (LTC_Type *base, ltc_hal_error_status_flag_t flag) |
Gets LTC error status flags. More... | |
void | LTC_HAL_GetErrorStatusFlagMasked (LTC_Type *base, ltc_hal_error_status_flag_t in, ltc_hal_error_status_flag_t *out) |
Gets LTC masked error status flags. More... | |
uint8_t | LTC_HAL_GetAADSize (LTC_Type *base, bool *authOnly) |
Gets the LTC AAD size. More... | |
void | LTC_HAL_SetAADSize (LTC_Type *base, uint16_t size, bool authOnly) |
Sets the LTC AAD size. More... | |
uint8_t | LTC_HAL_GetIVSize (LTC_Type *base, bool *onlyIV) |
Gets the LTC IV size. More... | |
void | LTC_HAL_SetIVSize (LTC_Type *base, uint16_t size, bool onlyIV) |
Sets the LTC IV size. More... | |
static void | LTC_HAL_SetDPAMaskSeed (LTC_Type *base, uint32_t mask) |
Sets the DPA mask seed value. More... | |
ltc_status_t | LTC_HAL_PKHA_SetASize (LTC_Type *base, uint16_t size) |
Sets the PKHA A size. More... | |
static uint16_t | LTC_HAL_PKHA_GetASize (LTC_Type *base) |
Gets the PKHA A size. More... | |
ltc_status_t | LTC_HAL_PKHA_SetBSize (LTC_Type *base, uint16_t size) |
Sets the PKHA B size. More... | |
static uint16_t | LTC_HAL_PKHA_GetBSize (LTC_Type *base) |
Gets the PKHA B size. More... | |
ltc_status_t | LTC_HAL_PKHA_SetNSize (LTC_Type *base, uint16_t size) |
Sets the PKHA N size. More... | |
static uint16_t | LTC_HAL_PKHA_GetNSize (LTC_Type *base) |
Gets the PKHA N size. More... | |
ltc_status_t | LTC_HAL_PKHA_SetESize (LTC_Type *base, uint16_t size) |
Sets the PKHA E size. More... | |
static uint16_t | LTC_HAL_PKHA_GetESize (LTC_Type *base) |
Gets the PKHA E size. More... | |
ltc_status_t | LTC_HAL_SetContext (LTC_Type *base, const uint8_t *data, uint8_t dataSize, uint8_t startIndex) |
Writes the LTC context register;. More... | |
ltc_status_t | LTC_HAL_GetContext (LTC_Type *base, uint8_t *dest, uint8_t dataSize, uint8_t startIndex) |
Reads the LTC context register. More... | |
ltc_status_t | LTC_HAL_SetKey (LTC_Type *base, const uint8_t *key, uint8_t keySize) |
Sets the LTC keys. More... | |
ltc_status_t | LTC_HAL_GetKey (LTC_Type *base, uint8_t *key, uint8_t keySize) |
Gets the LTC keys. More... | |
static uint8_t | LTC_HAL_InputFIFOGetLevel (LTC_Type *base) |
Gets the input FIFO level. More... | |
static bool | LTC_HAL_InputFIFOFull (LTC_Type *base) |
Gets the input FIFO level. More... | |
static uint8_t | LTC_HAL_OutputFIFOGetLevel (LTC_Type *base) |
Gets the output FIFO level. More... | |
static bool | LTC_HAL_OutputFIFOFull (LTC_Type *base) |
Gets the output FIFO level. More... | |
static void | LTC_HAL_WriteInputFIFO (LTC_Type *base, uint32_t data) |
Writes data to input FIFO. More... | |
static uint32_t | LTC_HAL_ReadOutputFIFO (LTC_Type *base) |
Reads data from the output FIFO. More... | |
static uint32_t | LTC_HAL_GetStatusFIFO (LTC_Type *base) |
Reads data from the LTC FIFO Status register. More... | |
ltc_status_t | LTC_HAL_WritePKA (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize) |
Writes data to the PKHA A register. More... | |
ltc_status_t | LTC_HAL_WriteSizedPKA (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize) |
Writes data and its size to the PKHA A register. More... | |
void | LTC_HAL_ReadPKA (LTC_Type *base, uint8_t quad, uint8_t *data, uint16_t dataSize) |
Reads data from the PKHA A register. More... | |
ltc_status_t | LTC_HAL_WritePKB (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize) |
Writes data to the PKHA B register. More... | |
ltc_status_t | LTC_HAL_WriteSizedPKB (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize) |
Writes data and its size to the PKHA B register. More... | |
void | LTC_HAL_ReadPKB (LTC_Type *base, uint8_t quad, uint8_t *data, uint16_t dataSize) |
Reads data from the PKHA B register. More... | |
ltc_status_t | LTC_HAL_WritePKN (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize) |
Writes data to the PKHA N register. More... | |
ltc_status_t | LTC_HAL_WriteSizedPKN (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize) |
Writes data and its size to the PKHA N register. More... | |
void | LTC_HAL_ReadPKN (LTC_Type *base, uint8_t quad, uint8_t *data, uint16_t dataSize) |
Reads data from the PKHA N register. More... | |
ltc_status_t | LTC_HAL_WritePKE (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize) |
Writes data to the PKHA E register. More... | |
ltc_status_t | LTC_HAL_WriteSizedPKE (LTC_Type *base, uint8_t quad, const uint8_t *data, uint16_t dataSize) |
Writes data and its size to the PKHA E register. More... | |
void | LTC_HAL_ReadPKE (LTC_Type *base, uint8_t quad, uint8_t *data, uint16_t dataSize) |
Reads data from the PKHA E register. More... | |
void | LTC_HAL_PKHA_ModeSetSrcRegCopy (ltc_hal_mode_t *outMode, ltc_hal_pkha_reg_area_t reg) |
Sets the PKHA copy source register. More... | |
void | LTC_HAL_PKHA_ModeSetDstRegCopy (ltc_hal_mode_t *outMode, ltc_hal_pkha_reg_area_t reg) |
Sets the PKHA copy destination register. More... | |
void | LTC_HAL_PKHA_ModeSetSrcSegCopy (ltc_hal_mode_t *outMode, ltc_hal_pkha_quad_area_t quad) |
Sets the PKHA copy source segment. More... | |
void | LTC_HAL_PKHA_ModeSetDstSegCopy (ltc_hal_mode_t *outMode, ltc_hal_pkha_quad_area_t quad) |
Sets the PKHA copy destination segment. More... | |
struct ltc_hal_pkha_mode_params_t |
typedef uint32_t ltc_hal_mode_t |
enum ltc_status_t |
enum ltc_hal_algorithm_t |
enum ltc_hal_pkha_f2m_t |
enum ltc_hal_pkha_r2_t |
enum ltc_hal_pkha_func_t |
enum ltc_hal_cmd_t |
enum ltc_hal_key_lock_t |
enum ltc_hal_byte_swap_t |
enum ltc_hal_dma_enable_t |
enum ltc_hal_isr_mask_t |
|
inlinestatic |
This function creates a 32-bit word from an input array of four bytes.
src | Input array of four bytes. The array can start at any address in memory. |
|
inlinestatic |
This function creates an output array of four bytes from an input 32-bit word.
srcWord | Input 32-bit unsigned integer. |
dst | Output array of four bytes. The array can start at any address in memory. |
void LTC_HAL_Init | ( | LTC_Type * | base | ) |
Initializes the LTC module to a known working state.
base | LTC module base pointer. |
|
inlinestatic |
This function sets the mode algorithm to use to switch between the major operating modes of PKHA, AES, DES, and 3DES. The value of this determines which way the mode register is interpreted, and should be set first before setting other mode settings.
outMode | Output mode word |
alg | Algorithm to select |
|
inlinestatic |
Sets the operating mode to encrypt or decrypt symmetric key algorithms.
outMode | Output mode word |
encrypt | Encrypt/decrypt mode selector |
|
inlinestatic |
Gets the operating mode to encrypt or decrypt the symmetric key algorithms.
outMode | Output mode word |
|
inlinestatic |
Sets the algorithm to perform or not perform ICV checking for all algorithms other than AES ECB.
outMode | Output mode word |
check | Compare / Don't compare selector |
|
inlinestatic |
Sets the state of the algorithm to be executed.
outMode | Output mode word |
as | Algorithm state to select |
|
inlinestatic |
Gets the state of the algorithm.
|
inlinestatic |
Sets the symmetric encryption/decryption operating mode.
outMode | Output mode word |
alg | Operation mode to use |
|
inlinestatic |
Sets the LTC AES Mode DK bit to mark the key as decrypt key.
|
inlinestatic |
Sets the mathematics or memory function for the PKHA mode operation.
outMode | Output mode word |
func | Function to use |
|
inlinestatic |
Sets the LTC PKHA mode to use regular or montgomery-form inputs.
outMode | Output mode word |
form | Form to use |
|
inlinestatic |
Sets the LTC PKHA mode to use regular or montgomery-form outputs.
outMode | Output mode word |
form | Form to use |
|
inlinestatic |
Sets the LTC PKHA mode to perform integer or f2m binary polynomial operations.
outMode | Output mode word |
form | Form to use |
|
inlinestatic |
Sets the LTC PKHA mode to calculate or use the supplied R2 mod N inputs.
outMode | Output mode word |
form | Form to use |
|
inlinestatic |
Sets the LTC PKHA mode to use timing equalized version of functions or not.
outMode | Output mode word |
form | Form to use |
|
inlinestatic |
Sets the LTC PKHA mode to output results in a particular destination register.
outMode | Output mode word |
form | Form to use |
|
inlinestatic |
Sets the LTC PKHA mode to clear a particular RAM area.
outMode | Output mode word |
area | Ram area to clear. |
|
inlinestatic |
Sets the LTC PKHA mode to clear a particular Quadrant area.
outMode | Output mode word |
quad | Quad area to clear. |
|
inlinestatic |
The mode register can only be written all at once. Use the other LTC_HAL_ModeSet* utility functions to construct the mode and then use this to write it to the hardware.
base | LTC module base pointer |
mode | Mode to set |
|
inlinestatic |
base | LTC module base pointer |
|
inlinestatic |
Returns the size in bytes of the key used for AES/DES operations.
base | LTC module base pointer |
ltc_status_t LTC_HAL_SetKeySize | ( | LTC_Type * | base, |
uint8_t | keySize | ||
) |
Sets the size in bytes of the key being used for AES/DES operations.
base | LTC module base pointer |
keySize | Size in bytes of the key to write |
|
inlinestatic |
Returns the size in bytes of the data being used for AES/DES operations.
base | LTC module base pointer |
ltc_status_t LTC_HAL_SetDataSize | ( | LTC_Type * | base, |
uint16_t | dataSize | ||
) |
Sets the size in bytes of the data being used for AES/DES operations.
base | LTC module base pointer |
dataSize | Size in bytes of the data that will be written to the input FIFO |
|
inlinestatic |
Returns the size in bytes of data in the last block of ICV (integrity check value) is valid when performing AES integrity checks.
base | LTC module base pointer |
ltc_status_t LTC_HAL_SetICVSize | ( | LTC_Type * | base, |
uint8_t | dataSize | ||
) |
Sets the size in bytes of data that is valid in the last block ICV (integrity check value).
base | LTC module base pointer |
dataSize | Size in bytes of the valid ICV data |
|
inlinestatic |
Issues LTC commands to reset the module or submodules.
base | LTC module base pointer |
cmd | Command to issue. |
|
inlinestatic |
base | LTC module base pointer |
mask | ISR mask/no mask setting |
|
inlinestatic |
Enables/disables DMA request and done signals for PKHA.
base | LTC module base pointer |
enable | Enable/disable DMA |
|
inlinestatic |
Enables/disables the DMA request and done signals for input FIFO.
base | LTC module base pointer |
enable | Enable/disable DMA |
|
inlinestatic |
Input FIFO only requests data if the input FIFO has enough space for the request size.
base | LTC module base pointer |
size | Input FIFO DMA request size of 1 or 4 bytes |
|
inlinestatic |
Enables/disables the DMA request and done signals for output FIFO.
base | LTC module base pointer |
enable | Enable/disable DMA |
|
inlinestatic |
Input FIFO only requests data if the output FIFO has enough space for the request size.
base | LTC module base pointer |
size | Output FIFO DMA request size of 1 or 4 bytes |
|
inlinestatic |
Sets whether the input FIFO should byte swap all data written to.
base | LTC module base pointer |
swap | Input FIFO byte swap value |
|
inlinestatic |
Sets whether the output FIFO should byte swap all data read from.
base | LTC module base pointer |
swap | Output FIFO byte swap value |
|
inlinestatic |
Sets whether the key register should byte swap all data written to. Data is byte-swapped only within a single word.
base | LTC module base pointer |
swap | Input key register byte swap value |
|
inlinestatic |
Sets whether the key register should byte swap all data read from. Data is byte-swapped only within a single word.
base | LTC module base pointer |
swap | Output key register byte swap value |
|
inlinestatic |
Sets whether the context register should byte swap all data written to. Data is byte-swapped only within a single word.
base | LTC module base pointer |
swap | Input context register byte swap value |
|
inlinestatic |
Sets whether the context register should byte swap all data read from. Data is byte-swapped only within a single word.
base | LTC module base pointer |
swap | Output context register byte swap value |
|
inlinestatic |
Sets read access to the LTC key register.
base | LTC module base pointer |
swap | lock Key register read access value |
|
inlinestatic |
This function clears various internal registers of the LTC to reset components to a known state.
base | LTC module base pointer |
clear | Submodule to be cleared |
|
inlinestatic |
Returns the status of a single or multiple status flags. The return value is only true if at least one of the selected flags are true.
base | LTC module base pointer |
flag | Status flag to check |
|
inlinestatic |
This function clears the interrupt flag that signals an operation has completed, so it can be reasserted on a subsequent operation.
base | LTC module base pointer |
void LTC_HAL_GetStatusFlagMasked | ( | LTC_Type * | base, |
ltc_hal_status_flag_t | in, | ||
ltc_hal_status_flag_t * | out | ||
) |
Returns the status of each individual flag requested.
base | LTC module base pointer |
in | Status flags to check |
out | Output status flags set |
|
inlinestatic |
Returns the status of a single or multiple error status flags. The return value is only true if all selected flags are true.
base | LTC module base pointer |
flag | Error status flag to check |
void LTC_HAL_GetErrorStatusFlagMasked | ( | LTC_Type * | base, |
ltc_hal_error_status_flag_t | in, | ||
ltc_hal_error_status_flag_t * | out | ||
) |
Returns the error status of each individual flag requested.
base | LTC module base pointer |
flag | Error status flag to check |
in | Error status flags to check |
out | Output error status flags set |
uint8_t LTC_HAL_GetAADSize | ( | LTC_Type * | base, |
bool * | authOnly | ||
) |
Returns the size in bytes (mod 16) of how much of the last block of AAD is valid.
base | LTC module base pointer |
authOnly | Output parameter to store whether or not only AAD data is to be written to the FIFO, meaning only authentication is being performed. |
void LTC_HAL_SetAADSize | ( | LTC_Type * | base, |
uint16_t | size, | ||
bool | authOnly | ||
) |
Sets the size of the AAD to be written. This data is added to the data size register, which is the AAD size rounded up to the next 16-byte boundary. If the 'authOnly' flag is set, it tells the engine that only authentication is performed which means only AAD data is written into the input FIFO.
base | LTC module base pointer |
Size | Size in bytes of the AAD data |
authOnly | Whether or not only AAD data is to be written to the FIFO, meaning only authentication is being performed. |
uint8_t LTC_HAL_GetIVSize | ( | LTC_Type * | base, |
bool * | onlyIV | ||
) |
Returns the size in bytes (mod 16) of how much of the last block of IV is valid.
base | LTC module base pointer |
onlyIV | Output parameter to store whether or not only IV data is to be written to the FIFO. |
void LTC_HAL_SetIVSize | ( | LTC_Type * | base, |
uint16_t | size, | ||
bool | onlyIV | ||
) |
Sets the size of the IV to be written. This data is added to the data size register, which is the IV size rounded up to the next 16-byte boundary.
base | LTC module base pointer |
Size | Size in bytes (mod 16) of the IV data |
onlyIV | Whether or not only IV data is to be written to the FIFO |
|
inlinestatic |
The differential power analysis (DPA) needs a seed mask to introduce noise into the power consumed by the AES module. This should be seeded at least at POR but preferably every 100 k AES blocks processed to provide DPA protection.
base | LTC module base pointer |
mask | Random DPA mask seed value |
ltc_status_t LTC_HAL_PKHA_SetASize | ( | LTC_Type * | base, |
uint16_t | size | ||
) |
Sets the size in bytes of data contained in the PKHA A register.
base | LTC module base pointer |
size | Size in bytes (maximum 256) |
|
inlinestatic |
Returns the size in bytes of data contained in the PKHA A register.
base | LTC module base pointer |
ltc_status_t LTC_HAL_PKHA_SetBSize | ( | LTC_Type * | base, |
uint16_t | size | ||
) |
Sets the size in bytes of data contained in the PKHA B register.
base | LTC module base pointer |
size | Size in bytes (maximum 256) |
|
inlinestatic |
Returns the size in bytes of data contained in the PKHA B register.
base | LTC module base pointer |
ltc_status_t LTC_HAL_PKHA_SetNSize | ( | LTC_Type * | base, |
uint16_t | size | ||
) |
Sets the size in bytes of data contained in the PKHA N register.
base | LTC module base pointer |
size | Size in bytes (maximum 256) |
|
inlinestatic |
Returns the size in bytes of data contained in the PKHA N register.
base | LTC module base pointer |
ltc_status_t LTC_HAL_PKHA_SetESize | ( | LTC_Type * | base, |
uint16_t | size | ||
) |
Sets the size in bytes of data contained in the PKHA E register.
base | LTC module base pointer |
size | Size in bytes (maximum 256) |
|
inlinestatic |
Returns the size in bytes of data contained in the PKHA E register.
base | LTC module base pointer |
ltc_status_t LTC_HAL_SetContext | ( | LTC_Type * | base, |
const uint8_t * | data, | ||
uint8_t | dataSize, | ||
uint8_t | startIndex | ||
) |
The LTC context register is a 512 bit (64 byte) register that holds internal context for the crypto engine. The meaning varies based on the algorithm and operating state being used. This register is written by the driver/application to load state such as IV, counter, and so on. Then, it is updated by the internal crypto engine as needed.
base | LTC module base pointer |
data | Data to write |
dataSize | Size of data to write in bytes |
startIndex | Starting word (4-byte) index into the 16-word register. |
ltc_status_t LTC_HAL_GetContext | ( | LTC_Type * | base, |
uint8_t * | dest, | ||
uint8_t | dataSize, | ||
uint8_t | startIndex | ||
) |
The LTC context register is a 512 bit (64 byte) register that holds internal context for the crypto engine. The meaning varies based on the algorithm and operating state being used. This register is written by the driver/application to load state such as IV, counter, and so on. Then, it is updated by the internal crypto engine as needed.
base | LTC module base pointer |
data | Destination of read data |
dataSize | Size of data to read in bytes |
startIndex | Starting word (4-byte) index into the 16-word register. |
ltc_status_t LTC_HAL_SetKey | ( | LTC_Type * | base, |
const uint8_t * | key, | ||
uint8_t | keySize | ||
) |
This function writes the LTC keys into the key register. The keys should be written before the key size.
base | LTC module base pointer |
key | Array of key words |
keySize | Number of bytes for all keys to be loaded (maximum 32, must be a multiple of 4). |
ltc_status_t LTC_HAL_GetKey | ( | LTC_Type * | base, |
uint8_t * | key, | ||
uint8_t | keySize | ||
) |
This function retrieves the LTC keys from the key register.
base | LTC module base pointer |
key | Array of data to store keys |
keySize | Number of bytes of keys to retrieve |
|
inlinestatic |
Returns the number of entries currently in the input FIFO.
base | LTC module base pointer |
|
inlinestatic |
Returns the number of entries currently in the input FIFO.
base | LTC module base pointer |
|
inlinestatic |
Returns the number of entries currently in the output FIFO.
base | LTC module base pointer |
|
inlinestatic |
Returns the number of entries currently in the output FIFO.
base | LTC module base pointer |
|
inlinestatic |
Writes a word of data to the input FIFO for algorithm processing.
base | LTC module base pointer |
data | Data to write |
|
inlinestatic |
Reads a word of data from the output FIFO after algorithm processing.
base | LTC module base pointer |
|
inlinestatic |
Reads LTC FIFO Status register actual value.
base | LTC module base pointer |
ltc_status_t LTC_HAL_WritePKA | ( | LTC_Type * | base, |
uint8_t | quad, | ||
const uint8_t * | data, | ||
uint16_t | dataSize | ||
) |
Writes data in byte-sized chunks to the PKHA A register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero.
base | LTC module base pointer |
quad | Quadrant in register (0 - 3) to refer to the sub-registers. |
data | Array of bytes to be written |
dataSize | Size of data to be written in bytes |
ltc_status_t LTC_HAL_WriteSizedPKA | ( | LTC_Type * | base, |
uint8_t | quad, | ||
const uint8_t * | data, | ||
uint16_t | dataSize | ||
) |
Writes data in byte-sized chunks to the PKHA A register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero. Also write data size to PKASZ register.
base | LTC module base pointer |
quad | Quadrant in register (0 - 3) to refer to the sub-registers. |
data | Array of bytes to be written |
dataSize | Size of data to be written in bytes and stored in PKASZ reg. |
void LTC_HAL_ReadPKA | ( | LTC_Type * | base, |
uint8_t | quad, | ||
uint8_t * | data, | ||
uint16_t | dataSize | ||
) |
Reads data in byte-sized chunks from PKHA A register, which is 2048 bits in size.
base | LTC module base pointer |
quad | Quadrant in register (0 - 3) to refer to the sub-registers. |
data | Array of bytes to be read into. This must be large enough to store 'dataSize' bytes. |
dataSize | Size of data to be read, in bytes |
ltc_status_t LTC_HAL_WritePKB | ( | LTC_Type * | base, |
uint8_t | quad, | ||
const uint8_t * | data, | ||
uint16_t | dataSize | ||
) |
Writes data in byte-sized chunks to PKHA B register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero.
base | LTC module base pointer |
quad | Quadrant in register (0 - 3) to refer to the sub-registers. |
data | Array of bytes to be written |
dataSize | Size of data to be written in bytes |
ltc_status_t LTC_HAL_WriteSizedPKB | ( | LTC_Type * | base, |
uint8_t | quad, | ||
const uint8_t * | data, | ||
uint16_t | dataSize | ||
) |
Writes data in byte-sized chunks to PKHA B register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero. Also write data size to PKBSZ register.
base | LTC module base pointer |
quad | Quadrant in register (0 - 3) to refer to the sub-registers. |
data | Array of bytes to be written |
dataSize | Size of data to be written in bytes and stored in PKBSZ reg. |
void LTC_HAL_ReadPKB | ( | LTC_Type * | base, |
uint8_t | quad, | ||
uint8_t * | data, | ||
uint16_t | dataSize | ||
) |
Reads data in byte-sized chunks from PKHA B register, which is 2048 bits in size.
base | LTC module base pointer |
quad | Quadrant in register (0 - 3) to refer to the sub-registers. |
data | Array of bytes to be read into. This must be large enough to store 'dataSize' bytes. |
dataSize | Size of data to be read, in bytes |
ltc_status_t LTC_HAL_WritePKN | ( | LTC_Type * | base, |
uint8_t | quad, | ||
const uint8_t * | data, | ||
uint16_t | dataSize | ||
) |
Writes data in byte-sized chunks to PKHA N register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero.
base | LTC module base pointer |
quad | Quadrant in register (0 - 3) to refer to the sub-registers. |
data | Array of bytes to be written |
dataSize | Size of data to be written in bytes |
ltc_status_t LTC_HAL_WriteSizedPKN | ( | LTC_Type * | base, |
uint8_t | quad, | ||
const uint8_t * | data, | ||
uint16_t | dataSize | ||
) |
Writes data in byte-sized chunks to the PKHA N register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero. Also write data size to PKNSZ register.
base | LTC module base pointer |
quad | Quadrant in register (0 - 3) to refer to the sub-registers. |
data | Array of bytes to be written |
dataSize | Size of data to be written in bytes and stored in PKNSZ reg. |
void LTC_HAL_ReadPKN | ( | LTC_Type * | base, |
uint8_t | quad, | ||
uint8_t * | data, | ||
uint16_t | dataSize | ||
) |
Reads data in byte-sized chunks from PKHA N register, which is 2048 bits in size.
base | LTC module base pointer |
quad | Quadrant in register (0 - 3) to refer to the sub-registers. |
data | Array of bytes to be read into. This must be large enough to store 'dataSize' bytes. |
dataSize | Size of data to be read, in bytes |
ltc_status_t LTC_HAL_WritePKE | ( | LTC_Type * | base, |
uint8_t | quad, | ||
const uint8_t * | data, | ||
uint16_t | dataSize | ||
) |
Writes data in byte-sized chunks to PKHA E register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero.
base | LTC module base pointer |
quad | Quadrant in register (0 - 3) to refer to the sub-registers. |
data | Array of bytes to be written |
dataSize | Size of data to be written in bytes |
ltc_status_t LTC_HAL_WriteSizedPKE | ( | LTC_Type * | base, |
uint8_t | quad, | ||
const uint8_t * | data, | ||
uint16_t | dataSize | ||
) |
Writes data in byte-sized chunks to PKHA E register, which is 2048 bits in size. This register can only be written when the mode register is not set for PKHA operation. Otherwise, reads and writes return zero. Also write data size to PKESZ register.
base | LTC module base pointer |
quad | Quadrant in register (0 - 3) to refer to the sub-registers. |
data | Array of bytes to be written |
dataSize | Size of data to be written in bytes and stored in PKESZ reg. |
void LTC_HAL_ReadPKE | ( | LTC_Type * | base, |
uint8_t | quad, | ||
uint8_t * | data, | ||
uint16_t | dataSize | ||
) |
Reads data in byte-sized chunks from PKHA E register, which is 2048 bits in size.
base | LTC module base pointer |
quad | Quadrant in register (0 - 3) to refer to the sub-registers. |
data | Array of bytes to be read into. This must be large enough to store 'dataSize' bytes. |
dataSize | Size of data to be read, in bytes |
void LTC_HAL_PKHA_ModeSetSrcRegCopy | ( | ltc_hal_mode_t * | outMode, |
ltc_hal_pkha_reg_area_t | reg | ||
) |
Sets the LTC PKHA source register to perform register copy.
outMode | Output mode word |
reg | Register to use |
void LTC_HAL_PKHA_ModeSetDstRegCopy | ( | ltc_hal_mode_t * | outMode, |
ltc_hal_pkha_reg_area_t | reg | ||
) |
Sets the LTC PKHA destination register to perform register copy.
outMode | Output mode word |
reg | Register to use |
void LTC_HAL_PKHA_ModeSetSrcSegCopy | ( | ltc_hal_mode_t * | outMode, |
ltc_hal_pkha_quad_area_t | quad | ||
) |
Sets the LTC PKHA source segment to perform register copy.
outMode | Output mode word |
reg | Register to use |
void LTC_HAL_PKHA_ModeSetDstSegCopy | ( | ltc_hal_mode_t * | outMode, |
ltc_hal_pkha_quad_area_t | quad | ||
) |
Sets the LTC PKHA destination segment to perform register copy.
outMode | Output mode word |
reg | Register to use |