Implementation of SAM commands used for MIFARE DESFire communication in X-Mode. More...

Modules | |
| Defines | |
| Definitions for SAM commands used for MIFARE DESFire communication in X-Mode. | |
Functions | |
| phStatus_t | phhalHw_Sam_Cmd_DESFire_AuthenticatePICC (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bOption, uint8_t bISOMode, uint8_t bDFKeyNo, uint8_t bKeyNo, uint8_t bKeyVer, uint8_t bPCDcap2InLen, uint8_t *pPCDcap2In, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pPDcap2, uint8_t *pPCDcap2, uint8_t *pPiccReturnCode) |
| Perform an authentication procedure between SAM AV3 and MIFARE DESFire. More... | |
| phStatus_t | phhalHw_Sam_Cmd_DESFire_ChangeKeyPICC (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bCryptoMethod, uint8_t bConfig, uint8_t bKeySetNo, uint8_t bDFKeyNo, uint8_t bCurrKeyNo, uint8_t bCurrKeyVer, uint8_t bNewKeyNo, uint8_t bNewKeyVer, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pPiccReturnCode) |
| The DESFire_ChangeKeyPICC command supports the procedure to change a key stored in the PICC in X-Mode. More... | |
| phStatus_t | phhalHw_Sam_Cmd_DESFire_WriteX (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t bCrypto, uint8_t *pData, uint8_t bDataLen, uint8_t *pPiccReturnCode, uint8_t *pErrLen) |
| The DESFire_WriteX command is used to apply the DESFire Secure Messaging in X-mode on PICC commands writing data to the DESFire PICC. More... | |
| phStatus_t | phhalHw_Sam_Cmd_DESFire_ReadX (phhalHw_Sam_DataParams_t *pDataParams, uint16_t wOption, uint8_t bCrypto, uint8_t *pAppData, uint8_t bAppDataLen, uint8_t **ppResponse, uint16_t *pRespLen, uint8_t *pPiccReturnCode, uint8_t *pErrLen) |
| The DESFire_ReadX command is used to remove the DESFire Secure Messaging in X-mode on PICC commands reading data from the DESFire PICC. More... | |
| phStatus_t | phhalHw_Sam_Cmd_DESFire_CreateTMFilePICC (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bOption, uint8_t bISOMode, uint8_t bKeyNo, uint8_t bKeyVer, uint8_t bFileNo, uint8_t bFileOption, uint8_t *pAccessRights, uint8_t *pTMIExclFileMap, uint8_t bTMKeyOptions, uint8_t bTSIGKeyNo, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pPiccReturnCode) |
| The DESFire_CreateTMFilePICC command supports the procedure to create a Transaction MAC File in the PICC in X-mode from a key stored in the SAM. More... | |
Implementation of SAM commands used for MIFARE DESFire communication in X-Mode.
| phStatus_t phhalHw_Sam_Cmd_DESFire_AuthenticatePICC | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t | bOption, | ||
| uint8_t | bISOMode, | ||
| uint8_t | bDFKeyNo, | ||
| uint8_t | bKeyNo, | ||
| uint8_t | bKeyVer, | ||
| uint8_t | bPCDcap2InLen, | ||
| uint8_t * | pPCDcap2In, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivInputLen, | ||
| uint8_t * | pPDcap2, | ||
| uint8_t * | pPCDcap2, | ||
| uint8_t * | pPiccReturnCode | ||
| ) |
Perform an authentication procedure between SAM AV3 and MIFARE DESFire.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pPCDcap2In, pDivInput, pPDcap2 pPCDcap2 and pPiccReturnCode are NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bOption | [In] Option to update the P1 information. The options can be combined by bitwise OR.
|
| [in] | bISOMode | [In] ISO mode to be used.
|
| [in] | bDFKeyNo | [In] DESFire Key Number to be used for authentication. |
| [in] | bKeyNo | [In] Key number to be used in SAM or DESFire Key number.
|
| [in] | bKeyVer | [In] Key version to be used in SAM. |
| [in] | bPCDcap2InLen | [In] Length of PCDcap2 field in bytes.
|
| [in] | pPCDcap2In | [In] Input PCD capabilities to be exchanged.
|
| [in] | pDivInput | [In] Diversification Input used to diversify the key.
|
| [in] | bDivInputLen | [In] Length of bytes available in pDivInput buffer. |
| [out] | pPDcap2 | [Out] Buffer containing the output PD capabilities. This will contain 6 bytes of PD information, if targeting EVx authentication type and first authentication. |
| [out] | pPCDcap2 | [Out] Buffer containing the output PCD capabilities. This will contain 6 bytes of PCD information, if targeting EVx authentication type and first authentication. |
| [out] | pPiccReturnCode | [Out] Error code returned by PICC. Will be
|
| phStatus_t phhalHw_Sam_Cmd_DESFire_ChangeKeyPICC | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t | bCryptoMethod, | ||
| uint8_t | bConfig, | ||
| uint8_t | bKeySetNo, | ||
| uint8_t | bDFKeyNo, | ||
| uint8_t | bCurrKeyNo, | ||
| uint8_t | bCurrKeyVer, | ||
| uint8_t | bNewKeyNo, | ||
| uint8_t | bNewKeyVer, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivInputLen, | ||
| uint8_t * | pPiccReturnCode | ||
| ) |
The DESFire_ChangeKeyPICC command supports the procedure to change a key stored in the PICC in X-Mode.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pDivInput and pPiccReturnCode are NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bCryptoMethod | [In] Key compilation method. Options for P1 information byte. The options can be combined by bitwise OR.
|
| [in] | bConfig | [In] Options for P2 information byte. The options can be combined by bitwise OR.
|
| [in] | bKeySetNo | [In] If bConfig = Cmd.ChangeKeyEV2, Key set number to which the key to be changed belongs to. |
| [in] | bDFKeyNo | [In] Number of DESFire PICC key to be changed. This should be present only if bConfig = Cmd.ChangeKeyEV2. |
| [in] | bCurrKeyNo | [In] Number of key entry holding the current key in SAM.
|
| [in] | bCurrKeyVer | [In] Key version of the current key in SAM. |
| [in] | bNewKeyNo | [In] Number of key entry holding the new key in SAM.
|
| [in] | bNewKeyVer | [In] Key version of new key in SAM. |
| [in] | pDivInput | [In] Diversification Input used to diversify the key.
|
| [in] | bDivInputLen | [In] Length of bytes available in pDivInput buffer. |
| [out] | pPiccReturnCode | [Out] Error code returned by PICC. Will be
|
| phStatus_t phhalHw_Sam_Cmd_DESFire_WriteX | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t | bCrypto, | ||
| uint8_t * | pData, | ||
| uint8_t | bDataLen, | ||
| uint8_t * | pPiccReturnCode, | ||
| uint8_t * | pErrLen | ||
| ) |
The DESFire_WriteX command is used to apply the DESFire Secure Messaging in X-mode on PICC commands writing data to the DESFire PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pData, pPiccReturnCode and pErrLen are NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Buffering options for exchanging information to SAM.
|
| [in] | bCrypto | [In] Option to set the P2 information byte. CAn be combined by using bitwise OR operator.
|
| [in] | pData | [In] The data to be written to the DESFire PICC.
|
| [in] | bDataLen | [In] Length of bytes available in pData buffer. |
| [out] | pPiccReturnCode | [Out] Error code returned by PICC. Will be
|
| [out] | pErrLen | [Out] Length of bytes available in pPiccReturnCode buffer. |
| phStatus_t phhalHw_Sam_Cmd_DESFire_ReadX | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint16_t | wOption, | ||
| uint8_t | bCrypto, | ||
| uint8_t * | pAppData, | ||
| uint8_t | bAppDataLen, | ||
| uint8_t ** | ppResponse, | ||
| uint16_t * | pRespLen, | ||
| uint8_t * | pPiccReturnCode, | ||
| uint8_t * | pErrLen | ||
| ) |
The DESFire_ReadX command is used to remove the DESFire Secure Messaging in X-mode on PICC commands reading data from the DESFire PICC.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pAppData, pRespLen, pPiccReturnCode and pErrLen are NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | wOption | [In] Buffering options.
|
| [in] | bCrypto | [In] Crypto configuration. Option to set the P2 information byte. |
| [in] | pAppData | [In] The following information should be passed.
|
| [in] | bAppDataLen | [In] Length of bytes available in pAppData buffer. |
| [out] | ppResponse | [Out] The data received from SAM. |
| [out] | pRespLen | [Out] Length of bytes available in ppResponse buffer. |
| [out] | pPiccReturnCode | [Out] Error code returned by PICC. Will be
|
| [out] | pErrLen | [Out] Length of bytes available in pPiccReturnCode buffer. |
| phStatus_t phhalHw_Sam_Cmd_DESFire_CreateTMFilePICC | ( | phhalHw_Sam_DataParams_t * | pDataParams, |
| uint8_t | bOption, | ||
| uint8_t | bISOMode, | ||
| uint8_t | bKeyNo, | ||
| uint8_t | bKeyVer, | ||
| uint8_t | bFileNo, | ||
| uint8_t | bFileOption, | ||
| uint8_t * | pAccessRights, | ||
| uint8_t * | pTMIExclFileMap, | ||
| uint8_t | bTMKeyOptions, | ||
| uint8_t | bTSIGKeyNo, | ||
| uint8_t * | pDivInput, | ||
| uint8_t | bDivInputLen, | ||
| uint8_t * | pPiccReturnCode | ||
| ) |
The DESFire_CreateTMFilePICC command supports the procedure to create a Transaction MAC File in the PICC in X-mode from a key stored in the SAM.
| PH_ERR_SUCCESS | Operation successful. |
| PH_ERR_INVALID_DATA_PARAMS | pDataParams is NULL. |
| PH_ERR_INVALID_PARAMETER | pAccessRights, pDivInput and pPiccReturnCode are NULL. |
| Other | Depending on implementation and underlaying component. |
| [in] | pDataParams | [In] Pointer to this layer's parameter structure. |
| [in] | bOption | [In] Key diversification selection. Options for P1 information byte. |
| [in] | bISOMode | [In] Options for P2 information byte. |
| [in] | bKeyNo | [In] Key number to be used in SAM. One of the following
|
| [in] | bKeyVer | [In] Key version to be used in SAM. |
| [in] | bFileNo | [In] File number of the file to be created. |
| [in] | bFileOption | [In] Options for the targeted file.
|
| [in] | pAccessRights | [In] Access conditions to be applied for the file. Refer respective product DataSheet for access rights information. This should be two bytes long. |
| [in] | pTMIExclFileMap | [In] TMI exclusion FileMap. Should be 4 byte. |
| [in] | bTMKeyOptions | [In] Option for the TransactionMAC Key. One of the following,
|
| [in] | bTSIGKeyNo | [In] Key Number pointing to AppTransactionSIGKey. |
| [in] | pDivInput | [In] Diversification Input used to diversify the key. |
| [in] | bDivInputLen | [In] Length of bytes available in pDivInput buffer. |
| [out] | pPiccReturnCode | [Out] Error code returned by PICC. Will be |