Implementation of SAM Data Processing commands. More...

Modules | |
| Defines | |
| Definitions for SAM Data Processing commands. | |
Functions | |
| phStatus_t | phhalHw_Sam_Cmd_SAM_ApplySM (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t bCommMode, uint8_t bOffset, uint8_t bCmdCtrIncr, uint8_t *pData, uint8_t bDataLen, uint8_t **ppResponse, uint16_t *pRespLen) |
| Apply the DESFire EVx (EV2 or higher) Secure Messaging in S-mode on the provided DESFire EVx (EV2 or higher) command according to the required mode and the currently activated session keys. More... | |
| phStatus_t | phhalHw_Sam_Cmd_SAM_RemoveSM (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t bCommMode, uint8_t *pData, uint8_t bDataLen, uint8_t **ppResponse, uint16_t *pRespLen) |
| Removes the DESFire EVx (EV2 or higher) Secure Messaging in S-mode from the provided PICC response payload according to the required mode and the currently activated session keys. More... | |
| phStatus_t | phhalHw_Sam_Cmd_SAM_VerifyMAC (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t bNum, uint8_t *pData, uint8_t bDataLen) |
| Verifies the MAC which was sent by the PICC or any other system based on the given MACed plain text data and the currently valid cryptographic key. More... | |
| phStatus_t | phhalHw_Sam_Cmd_SAM_GenerateMAC (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t bNum, uint8_t *pData, uint8_t bDataLen, uint8_t **ppResponse, uint16_t *pRespLen) |
| Generates a MAC which is meant to be sent to the PICC or any other system based on the given plain text data and the currently valid cryptographic key. More... | |
| phStatus_t | phhalHw_Sam_Cmd_SAM_DecipherData (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pEncData, uint8_t bEncDataLen, uint8_t *pLength, uint8_t **ppPlainData, uint16_t *pPlainDataLen) |
| Deciphers data packages sent by a PICC, any other system or a MIFARE card based on the currently valid cryptographic key and returns plain data to the host. More... | |
| phStatus_t | phhalHw_Sam_Cmd_SAM_EncipherData (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pPlainData, uint8_t bPlainDataLen, uint8_t bOffset, uint8_t **ppEncData, uint16_t *pEncDataLen) |
| Enciphers data packages which are meant to be sent to a PICC or any other system based on the given plain text data and the currently valid cryptographic key. More... | |
| phStatus_t | phhalHw_Sam_Cmd_SAM_DecipherOfflineData (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pEncData, uint8_t bEncDataLen, uint8_t **ppPlainData, uint16_t *pPlainDataLen) |
| Decrypts data received from any other system based on the given cipher text data and the currently valid cryptographic OfflineCrypto Key. More... | |
| phStatus_t | phhalHw_Sam_Cmd_SAM_EncipherOfflineData (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t *pPlainData, uint8_t bPlainDataLen, uint8_t **ppEncData, uint16_t *pEncDataLen) |
| Encrypts data received from any other system based on the given cipher text data and the currently valid cryptographic OfflineCrypto Key. More... | |
Implementation of SAM Data Processing commands.
| phStatus_t phhalHw_Sam_Cmd_SAM_ApplySM | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t | bCommMode, | ||
| uint8_t | bOffset, | ||
| uint8_t | bCmdCtrIncr, | ||
| uint8_t * | pData, | ||
| uint8_t | bDataLen, | ||
| uint8_t ** | ppResponse, | ||
| uint16_t * | pRespLen | ||
| ) |
Apply the DESFire EVx (EV2 or higher) Secure Messaging in S-mode on the provided DESFire EVx (EV2 or higher) command according to the required mode and the currently activated session keys.
The required protection mode is selected via the command parameter bCommMode.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful, chaining ongoing. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pData and pRespLen is NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Refer below for Option to be used.
|
| [in] | bCommMode | [In] Communication mode to be used. |
| [in] | bOffset | [In] Command offset. Index of the first byte in data field of the PICC command data. |
| [in] | bCmdCtrIncr | [In] Command counter increment value. Value by which to increase the CmdCtr. |
| [in] | pData | [In] Plain data to be protected according to the communication mode specified. |
| [in] | bDataLen | [In] Length of bytes available in pData buffer. |
| [out] | ppResponse | [Out] The protected data returned by Sam according to communication mode specified. |
| [out] | pRespLen | [Out] Length of bytes available in ppResponse buffer. |
| phStatus_t phhalHw_Sam_Cmd_SAM_RemoveSM | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t | bCommMode, | ||
| uint8_t * | pData, | ||
| uint8_t | bDataLen, | ||
| uint8_t ** | ppResponse, | ||
| uint16_t * | pRespLen | ||
| ) |
Removes the DESFire EVx (EV2 or higher) Secure Messaging in S-mode from the provided PICC response payload according to the required mode and the currently activated session keys.
The required protection mode is selected via the command parameter bCommMode.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful, chaining ongoing. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pData and pRespLen is NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Buffering options to exchange data to SAM and receive data from SAM.
|
| [in] | bCommMode | [In] Communication mode to be used. |
| [in] | pData | [In] The complete data received form the PICC including the status code. |
| [in] | bDataLen | [In] Length of bytes available in pData buffer. |
| [out] | ppResponse | [Out] The plain data returned by Sam according to communication mode specified. |
| [out] | pRespLen | [Out] Length of bytes available in ppResponse buffer. |
| phStatus_t phhalHw_Sam_Cmd_SAM_VerifyMAC | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t | bNum, | ||
| uint8_t * | pData, | ||
| uint8_t | bDataLen | ||
| ) |
Verifies the MAC which was sent by the PICC or any other system based on the given MACed plain text data and the currently valid cryptographic key.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful, chaining ongoing. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pData is NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Buffering options to exchange data to SAM and receive data from SAM.
|
| [in] | bNum | [In] Type of truncation mode to be applied if AES key type is used.
|
| [in] | pData | [In] Plain data including the MAC to be checked. |
| [in] | bDataLen | [In] Length of bytes available in pData buffer. |
| phStatus_t phhalHw_Sam_Cmd_SAM_GenerateMAC | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t | bNum, | ||
| uint8_t * | pData, | ||
| uint8_t | bDataLen, | ||
| uint8_t ** | ppResponse, | ||
| uint16_t * | pRespLen | ||
| ) |
Generates a MAC which is meant to be sent to the PICC or any other system based on the given plain text data and the currently valid cryptographic key.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful, chaining ongoing. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pData and pRespLen is NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Buffering options.
|
| [in] | bNum | [In] Type of truncation mode to be applied if AES key type is used. used.
|
| [in] | pData | [In] Plain data to be maced. Can be null if there is no data. |
| [in] | bDataLen | [In] Length of bytes available in pData buffer. |
| [out] | ppResponse | [Out] The generated MAC returned by SAM. |
| [out] | pRespLen | [Out] Length of bytes available in ppResponse buffer. |
| phStatus_t phhalHw_Sam_Cmd_SAM_DecipherData | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t * | pEncData, | ||
| uint8_t | bEncDataLen, | ||
| uint8_t * | pLength, | ||
| uint8_t ** | ppPlainData, | ||
| uint16_t * | pPlainDataLen | ||
| ) |
Deciphers data packages sent by a PICC, any other system or a MIFARE card based on the currently valid cryptographic key and returns plain data to the host.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful, chaining ongoing. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pEncData and pPlainDataLen is NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Option for including the length information in command frame.
|
| [in] | pEncData | [In] Encrypted data to be deciphered. |
| [in] | bEncDataLen | [In] Length of bytes available in pEncData buffer. |
| [in] | pLength | [In] Overall length of encrypted input data. This 3 byte value is only used if wOption has Length information (pLength) will be exchanged. |
| [out] | ppPlainData | [Out] Deciphered data returned by SAM. |
| [out] | pPlainDataLen | [Out] Length of bytes available in ppResponse buffer. |
| phStatus_t phhalHw_Sam_Cmd_SAM_EncipherData | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t * | pPlainData, | ||
| uint8_t | bPlainDataLen, | ||
| uint8_t | bOffset, | ||
| uint8_t ** | ppEncData, | ||
| uint16_t * | pEncDataLen | ||
| ) |
Enciphers data packages which are meant to be sent to a PICC or any other system based on the given plain text data and the currently valid cryptographic key.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful, chaining ongoing. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | bPlainDataLen and pEncDataLen is NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Buffering options.
|
| [in] | pPlainData | [In] Plain Data to be enciphered. |
| [in] | bPlainDataLen | [In] Length of bytes available in pPlainData buffer. |
| [in] | bOffset | [In] Offset into the input data indicating the first data byte to be enciphered. |
| [out] | ppEncData | [Out] Enciphered data returned by SAM. |
| [out] | pEncDataLen | [Out] Length of bytes available in ppEncData buffer. |
| phStatus_t phhalHw_Sam_Cmd_SAM_DecipherOfflineData | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t * | pEncData, | ||
| uint8_t | bEncDataLen, | ||
| uint8_t ** | ppPlainData, | ||
| uint16_t * | pPlainDataLen | ||
| ) |
Decrypts data received from any other system based on the given cipher text data and the currently valid cryptographic OfflineCrypto Key.
The valid key has been activated using a valid key activation (SAM_ActivateOfflineKey).
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful, chaining ongoing. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pEncData and pPlainDataLen is NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Buffering options.
|
| [in] | pEncData | [In] Encrypted data to be deciphered. |
| [in] | bEncDataLen | [In] Length of bytes available in pEncData buffer. |
| ppPlainData | [Out Deciphered data returned by SAM. | |
| [out] | pPlainDataLen | [Out] Length of bytes available in ppPlainData buffer. |
| phStatus_t phhalHw_Sam_Cmd_SAM_EncipherOfflineData | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t * | pPlainData, | ||
| uint8_t | bPlainDataLen, | ||
| uint8_t ** | ppEncData, | ||
| uint16_t * | pEncDataLen | ||
| ) |
Encrypts data received from any other system based on the given cipher text data and the currently valid cryptographic OfflineCrypto Key.
The valid key has been activated using a valid key activation (SAM_ActivateOfflineKey).
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_SUCCESS_CHAINING | Operation successful, chaining ongoing. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pEncData and pPlainDataLen is NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Buffering options.
|
| [in] | pPlainData | [In] Plain data to be enciphered. |
| [in] | bPlainDataLen | [In] Length of bytes available in pPlainData buffer. |
| [out] | ppEncData | [Out] Enciphered data returned by SAM. |
| [out] | pEncDataLen | [Out] Length of bytes available in ppEncData buffer. |