NXP Reader Library  v17.1.0.2535

Internal Functions of the Symmetric Cryptography component. More...

Collaboration diagram for Internals:

Functions

phStatus_t phCryptoSym_Sw_EncryptBlock (phCryptoSym_Sw_DataParams_t *pDataParams, uint8_t PH_CRYTOSYM_SW_FAST_RAM *pBlock)
 Generic interface function for encryption of a single AES/DES data block. More...
 
phStatus_t phCryptoSym_Sw_DecryptBlock (phCryptoSym_Sw_DataParams_t *pDataParams, uint8_t PH_CRYTOSYM_SW_FAST_RAM *pBlock)
 Generic interface function for decryption of a single AES/DES data block. More...
 
void phCryptoSym_Sw_CMAC_LeftShift (const uint8_t *pInBuffer, uint8_t bInputLen, uint8_t *pOutBuffer)
 Implements the left shift according to CMAC standard. More...
 
phStatus_t phCryptoSym_Sw_CMAC_GenerateK1K2 (phCryptoSym_Sw_DataParams_t *pDataParams, uint8_t *pSubKey1, uint8_t *pSubKey2)
 Implements sub key generation according to CMAC standard. More...
 
phStatus_t phCryptoSym_Sw_Diversify_CMAC (phCryptoSym_Sw_DataParams_t *pDataParams, const uint8_t *pData, uint16_t wDataLength, uint8_t *pMac, uint8_t *pMacLength)
 Calculate CMAC for Key diversification. More...
 

Detailed Description

Internal Functions of the Symmetric Cryptography component.

Function Documentation

◆ phCryptoSym_Sw_EncryptBlock()

phStatus_t phCryptoSym_Sw_EncryptBlock ( phCryptoSym_Sw_DataParams_t pDataParams,
uint8_t PH_CRYTOSYM_SW_FAST_RAM pBlock 
)

Generic interface function for encryption of a single AES/DES data block.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERUnknown key type currently loaded.
Parameters
[in]pDataParams[In] Pointer to this layers parameter structure.
[in,out]pBlock[InOut] IO buffer for the data block to perform the encryption on.

◆ phCryptoSym_Sw_DecryptBlock()

phStatus_t phCryptoSym_Sw_DecryptBlock ( phCryptoSym_Sw_DataParams_t pDataParams,
uint8_t PH_CRYTOSYM_SW_FAST_RAM pBlock 
)

Generic interface function for decryption of a single AES/DES data block.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERUnknown key type currently loaded.
Parameters
[in]pDataParams[In] Pointer to this layers parameter structure.
[in,out]pBlock[InOut] IO buffer for the data block to perform the decryption on.

◆ phCryptoSym_Sw_CMAC_LeftShift()

void phCryptoSym_Sw_CMAC_LeftShift ( const uint8_t pInBuffer,
uint8_t  bInputLen,
uint8_t pOutBuffer 
)

Implements the left shift according to CMAC standard.

Parameters
[in]pInBuffer[In] Array containing the input buffer to be shifted.
[in]bInputLen[In] Length of the input buffer.
[out]pOutBuffer[Out] Array containing the output buffer where the shifted value is stored.

◆ phCryptoSym_Sw_CMAC_GenerateK1K2()

phStatus_t phCryptoSym_Sw_CMAC_GenerateK1K2 ( phCryptoSym_Sw_DataParams_t pDataParams,
uint8_t pSubKey1,
uint8_t pSubKey2 
)

Implements sub key generation according to CMAC standard.

Implementation according to SUBK(K) section 6 of NIST SP_800-38B

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INTERNAL_ERRORUnsupported block length.
Parameters
[in]pDataParams[In] Pointer to this layers parameter structure.
[out]pSubKey1[Out] Destination pointer for CMAC subkey 1
[out]pSubKey2[Out] Destination pointer for CMAC subkey 2

◆ phCryptoSym_Sw_Diversify_CMAC()

phStatus_t phCryptoSym_Sw_Diversify_CMAC ( phCryptoSym_Sw_DataParams_t pDataParams,
const uint8_t pData,
uint16_t  wDataLength,
uint8_t pMac,
uint8_t pMacLength 
)

Calculate CMAC for Key diversification.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_PARAMETERAn unsupported key is loaded (or no key is loaded). or wDataLength is larger than double the current block size.
Parameters
[in]pDataParams[In] Pointer to this layers parameter structure.
[in]pData[In] Input data; uint8_t[wDataLength].
[in]wDataLength[In] Number of input data bytes.
[out]pMac[Out] Output MAC block; uint8_t[16].
[out]pMacLength[Out] Length of MAC.