NXP Reader Library  v17.1.0.2535

SAM commands used for cryptographic data processing. This includes encryption, decryption, MAC generation and MAC verification. More...

Collaboration diagram for Data Processing:

Macros

#define PHHAL_HW_SAMAV2_CMD_DECIPHERDATA_OPTION_WITHLENGTH   0x04
 Option mask for a decipher with given input length.
 

Functions

phStatus_t phhalHw_SamAV2_Cmd_SAM_VerifyMAC (phhalHw_SamAV2_DataParams_t *pDataParams, uint16_t wOption, uint8_t bNum, uint8_t *pTxBuffer, uint8_t bTxLength)
 Check the validity of the MAC over given data. More...
 
phStatus_t phhalHw_SamAV2_Cmd_SAM_GenerateMAC (phhalHw_SamAV2_DataParams_t *pDataParams, uint16_t wOption, uint8_t bNum, uint8_t *pTxBuffer, uint8_t bTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Generate a MAC over given data. More...
 
phStatus_t phhalHw_SamAV2_Cmd_SAM_DecipherData (phhalHw_SamAV2_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint8_t bTxLength, uint8_t *pLenEncInputData, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Decipher a data stream. More...
 
phStatus_t phhalHw_SamAV2_Cmd_SAM_EncipherData (phhalHw_SamAV2_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint8_t bTxLength, uint8_t bOffset, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Encipher a data stream. More...
 
phStatus_t phhalHw_SamAV2_Cmd_SAM_DecipherOfflineData (phhalHw_SamAV2_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint8_t bTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Decipher a data stream using an OfflineCrypto key. More...
 
phStatus_t phhalHw_SamAV2_Cmd_SAM_EncipherOfflineData (phhalHw_SamAV2_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pTxBuffer, uint8_t bTxLength, uint8_t **ppRxBuffer, uint16_t *pRxLength)
 Encipher a data stream using an OfflineCrypto key. More...
 

Sam AV2 command code for Sam Data Processing feature.

#define PHHAL_HW_SAMAV2_CMD_VERIFY_MAC_INS   0x5C
 CMD Byte for SAM_VerifyMac command.
 
#define PHHAL_HW_SAMAV2_CMD_GENERATE_MAC_INS   0x7C
 CMD Byte for SAM_GenerateMac command.
 
#define PHHAL_HW_SAMAV2_CMD_ENCIPHER_DATA_INS   0xED
 CMD Byte for SAM_EncipherData command.
 
#define PHHAL_HW_SAMAV2_CMD_DECIPHER_DATA_INS   0xDD
 CMD Byte for SAM_DecipherData command.
 
#define PHHAL_HW_SAMAV2_CMD_DECIPHER_OFFLINE_DATA_INS   0x0D
 CMD Byte for SAM_DecipherOfflineData command.
 
#define PHHAL_HW_SAMAV2_CMD_ENCIPHER_OFFLINE_DATA_INS   0x0E
 CMD Byte for SAM_EncipherOfflineData command.
 

Detailed Description

SAM commands used for cryptographic data processing. This includes encryption, decryption, MAC generation and MAC verification.

Function Documentation

◆ phhalHw_SamAV2_Cmd_SAM_VerifyMAC()

phStatus_t phhalHw_SamAV2_Cmd_SAM_VerifyMAC ( phhalHw_SamAV2_DataParams_t pDataParams,
uint16_t  wOption,
uint8_t  bNum,
uint8_t pTxBuffer,
uint8_t  bTxLength 
)

Check the validity of the MAC over given data.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Buffering options.
[in]bNum[In] Number of MAC bytes to check in the plain data buffer.
[in]pTxBuffer[In] Plain data including the MAC to be checked.
[in]bTxLength[In] Length of input data.

◆ phhalHw_SamAV2_Cmd_SAM_GenerateMAC()

phStatus_t phhalHw_SamAV2_Cmd_SAM_GenerateMAC ( phhalHw_SamAV2_DataParams_t pDataParams,
uint16_t  wOption,
uint8_t  bNum,
uint8_t pTxBuffer,
uint8_t  bTxLength,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Generate a MAC over given data.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter:
[in]bNum[In] Number of MAC bytes to generate.
[in]pTxBuffer[In] Plain data to be MACed.
[in]bTxLength[In] Length of input data.
[out]ppRxBuffer[Out] Pointer to plain MACed data.
[out]pRxLength[Out] Length of plain MACed data.

◆ phhalHw_SamAV2_Cmd_SAM_DecipherData()

phStatus_t phhalHw_SamAV2_Cmd_SAM_DecipherData ( phhalHw_SamAV2_DataParams_t pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint8_t  bTxLength,
uint8_t pLenEncInputData,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Decipher a data stream.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter:
[in]pTxBuffer[In] Data to be deciphered.
[in]bTxLength[In] Length of input data.
[in]pLenEncInputData[In] Overall length of encrypted input data. This 3 byte value is only used if indicated by wOption.
[out]ppRxBuffer[Out] Pointer to the deciphered data.
[out]pRxLength[Out] Length of deciphered data.

◆ phhalHw_SamAV2_Cmd_SAM_EncipherData()

phStatus_t phhalHw_SamAV2_Cmd_SAM_EncipherData ( phhalHw_SamAV2_DataParams_t pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint8_t  bTxLength,
uint8_t  bOffset,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Encipher a data stream.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter:
[in]pTxBuffer[In] Data to be enciphered.
[in]bTxLength[In] Length of input data.
[in]bOffset[In] Offset into the input data indicating the first data byte to be enciphered.
[out]ppRxBuffer[Out] Pointer to enciphered data.
[out]pRxLength[Out] Length of enciphered data.

◆ phhalHw_SamAV2_Cmd_SAM_DecipherOfflineData()

phStatus_t phhalHw_SamAV2_Cmd_SAM_DecipherOfflineData ( phhalHw_SamAV2_DataParams_t pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint8_t  bTxLength,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Decipher a data stream using an OfflineCrypto key.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter:
[in]pTxBuffer[In] Data to be deciphered.
[in]bTxLength[In] Length of input data.
[out]ppRxBuffer[Out] Pointer to deciphered data.
[out]pRxLength[Out] Length of deciphered data.

◆ phhalHw_SamAV2_Cmd_SAM_EncipherOfflineData()

phStatus_t phhalHw_SamAV2_Cmd_SAM_EncipherOfflineData ( phhalHw_SamAV2_DataParams_t pDataParams,
uint16_t  wOption,
uint8_t pTxBuffer,
uint8_t  bTxLength,
uint8_t **  ppRxBuffer,
uint16_t pRxLength 
)

Encipher a data stream using an OfflineCrypto key.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Option parameter:
[in]pTxBuffer[In] Data to be enciphered.
[in]bTxLength[In] Length of input data
[out]ppRxBuffer[Out] Pointer to enciphered data
[out]pRxLength[Out] Length of enciphered data.