NXP Reader Library  v17.1.0.2535

These Components implement the utility interfaces required for MIFARE Plus EVx application layer. These are not commands. More...

Collaboration diagram for Utilities:

Functions

phStatus_t phalMfpEVx_ResetSecMsgState (void *pDataParams)
 Reset the libraries internal secure messaging state. More...
 
phStatus_t phalMfpEVx_SetConfig (void *pDataParams, uint16_t wOption, uint16_t wValue)
 Perform a SetConfig command. More...
 
phStatus_t phalMfpEVx_GetConfig (void *pDataParams, uint16_t wOption, uint16_t *pValue)
 Perform a GetConfig command. More...
 
phStatus_t phalMfpEVx_SetVCAParams (void *pDataParams, void *pAlVCADataParams)
 This is a utility API which sets the VCA structure in MFP Ev1 structure params. More...
 
phStatus_t phalMfpEVx_CalculateTMV (void *pDataParams, uint16_t wOption, uint16_t wKeyNoTMACKey, uint16_t wKeyVerTMACKey, uint16_t wRamKeyNo, uint16_t wRamKeyVer, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pTMC, uint8_t *pUid, uint8_t bUidLen, uint8_t *pTMI, uint16_t wTMILen, uint8_t *pTMV)
 Calculate TMV. More...
 
phStatus_t phalMfpEVx_DecryptReaderID (void *pDataParams, uint16_t wOption, uint16_t wKeyNoTMACKey, uint16_t wKeyVerTMACKey, uint16_t wRamKeyNo, uint16_t wRamKeyVer, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pTMC, uint8_t *pUid, uint8_t bUidLen, uint8_t *pEncTMRI, uint8_t *pTMRIPrev)
 Decrypt Reader ID. More...
 

Option to configure some special operations.

#define PHAL_MFPEVX_WRAPPED_MODE   0xA1U
 Option for GetConfig/SetConfig to get/set current status of command wrapping in ISO 7816-4 APDUs.
 
#define PHAL_MFPEVX_EXTENDED_APDU   0xA2U
 Option for GetConfig/SetConfig to get/set current status of extended wrapping in ISO 7816-4 APDUs.
 
#define PHAL_MFPEVX_AUTH_MODE   0xA3U
 Option to set the Authentication mode to perform negative testing.
 

Option to enable or disable the Wrapped or Extended APDU options.

#define PHAL_MFPEVX_DISABLE   0x00U
 Option to disable Wrapping or Extended Length APDU feature for ISO7816 support.
 
#define PHAL_MFPEVX_ENABLE   0x01U
 Option to enable Wrapping or Extended Length APDU feature for ISO7816 support.
 
#define PHAL_MFPEVX_DEFAULT   PHAL_MFPEVX_DISABLE
 Default Option value. More...
 

Option to configure the Authentication state.

#define PHAL_MFPEVX_NOTAUTHENTICATED   0x00U
 Option to indicate the Authentication mode as MFP EVx not authenticated.
 
#define PHAL_MFPEVX_SL1_MIFARE_AUTHENTICATED   0x01U
 Option to indicate the Authentication mode as MFP EVx SL1 MIFARE Authentication mode.
 
#define PHAL_MFPEVX_SL1_MFP_AUTHENTICATED   0x02U
 Option to indicate the Authentication mode as MFP EVx SL1 Authentication mode.
 
#define PHAL_MFPEVX_SL3_MFP_AUTHENTICATED   0x03U
 Option to indicate the Authentication mode as MFP EVx SL3 Authentication mode.
 
#define PHAL_MFPEVX_NOT_AUTHENTICATED_L3   0x04U
 Option to indicate the Authentication mode as MFP EVx not authenticated in ISO Layer 3.
 
#define PHAL_MFPEVX_NOT_AUTHENTICATED_L4   0x05U
 Option to indicate the Authentication mode as MFP EVx not authenticated in ISO Layer 4.
 

Options to diversify the key.

#define PHAL_MFPEVX_DIVERSIFICATION_OFF   0xFFFFU
 Option to disable key diversification.
 
#define PHAL_MFPEVX_DIVERSIFICATION_ON   0x0000U
 Option to enable key diversification.
 

Detailed Description

These Components implement the utility interfaces required for MIFARE Plus EVx application layer. These are not commands.

Macro Definition Documentation

◆ PHAL_MFPEVX_DEFAULT

#define PHAL_MFPEVX_DEFAULT   PHAL_MFPEVX_DISABLE

Default Option value.

This is equal to Disable.

Function Documentation

◆ phalMfpEVx_ResetSecMsgState()

phStatus_t phalMfpEVx_ResetSecMsgState ( void *  pDataParams)

Reset the libraries internal secure messaging state.

This function must be called before interacting with the PICC to set the libraries internal card-state back to default.
E.g. when an error occurred or after a reset of the field.

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.

◆ phalMfpEVx_SetConfig()

phStatus_t phalMfpEVx_SetConfig ( void *  pDataParams,
uint16_t  wOption,
uint16_t  wValue 
)

Perform a SetConfig command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layers parameter structure.
[in]wOption[In] Option to set.
[in]wValue[In] Value for the selected option.

◆ phalMfpEVx_GetConfig()

phStatus_t phalMfpEVx_GetConfig ( void *  pDataParams,
uint16_t  wOption,
uint16_t pValue 
)

Perform a GetConfig command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layers parameter structure.
[in]wOption[In] Option to get.
[out]pValue[Out] Value of the selected option.

◆ phalMfpEVx_SetVCAParams()

phStatus_t phalMfpEVx_SetVCAParams ( void *  pDataParams,
void *  pAlVCADataParams 
)

This is a utility API which sets the VCA structure in MFP Ev1 structure params.

This interface is mandatory to be called if the Virtual Card and Proximity Check features are required.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layers parameter structure.
[in]pAlVCADataParams[In] The VCA application layer's DataParams.

◆ phalMfpEVx_CalculateTMV()

phStatus_t phalMfpEVx_CalculateTMV ( void *  pDataParams,
uint16_t  wOption,
uint16_t  wKeyNoTMACKey,
uint16_t  wKeyVerTMACKey,
uint16_t  wRamKeyNo,
uint16_t  wRamKeyVer,
uint8_t pDivInput,
uint8_t  bDivInputLen,
uint8_t pTMC,
uint8_t pUid,
uint8_t  bUidLen,
uint8_t pTMI,
uint16_t  wTMILen,
uint8_t pTMV 
)

Calculate TMV.

This utility is only valid if MIFARE Plus EVx is configured as Software.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layers parameter structure.
[in]wOption[In] Diversification option.
[in]wKeyNoTMACKey[In] Key number to be used from software KeyStore.
[in]wKeyVerTMACKey[In] Key version to be used from software KeyStore.
[in]wRamKeyNo[In] Key number of Destination Key where the computed session TMAC key will be stored. To be used for SAM AV3 only.
[in]wRamKeyVer[In] Key version of Destination Key where the computed session TMAC key will be stored. To be used for SAM AV3 only.
[in]pDivInput[In] Diversification input to diversify TMACKey.
[in]bDivInputLen[In] Length of byte available in DivInput buffer.
[in]pTMC[In] 4 bytes Transaction MAC Counter. It should be 1 time subtracted from the actual value and should be LSB first.
[in]pUid[In] UID of the card.
[in]bUidLen[In] Length of UID supplied.
[in]pTMI[In] Transaction MAC Input.
[in]wTMILen[In] Length of bytes available in TMI buffer.
[out]pTMV[Out] The computed Transaction MAC Value.

◆ phalMfpEVx_DecryptReaderID()

phStatus_t phalMfpEVx_DecryptReaderID ( void *  pDataParams,
uint16_t  wOption,
uint16_t  wKeyNoTMACKey,
uint16_t  wKeyVerTMACKey,
uint16_t  wRamKeyNo,
uint16_t  wRamKeyVer,
uint8_t pDivInput,
uint8_t  bDivInputLen,
uint8_t pTMC,
uint8_t pUid,
uint8_t  bUidLen,
uint8_t pEncTMRI,
uint8_t pTMRIPrev 
)

Decrypt Reader ID.

This utility is only valid if MIFARE Plus EVx is configured as Software.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layers parameter structure.
[in]wOption[In] Diversification option.
[in]wKeyNoTMACKey[In] Key number to be used from software KeyStore.
[in]wKeyVerTMACKey[In] Key version to be used from software KeyStore.
[in]wRamKeyNo[In] Key number of Destination Key where the computed session TMAC key will be stored. To be used for SAM AV3 only.
[in]wRamKeyVer[In] Key version of Destination Key where the computed session TMAC key will be stored. To be used for SAM AV3 only.
[in]pDivInput[In] Diversification input to diversify TMACKey.
[in]bDivInputLen[In] Length of byte available in DivInput buffer.
[in]pTMC[In] 4 bytes Transaction MAC Counter. It should be 1 time subtracted from the actual value and shold be LSB first.
[in]pUid[In] UID of the card.
[in]bUidLen[In] Length of UID supplied.
[in]pEncTMRI[In] Encrypted Transaction MAC ReaderID of the latest successful transaction.
[out]pTMRIPrev[Out] Decrypted Reader ID of the last successful transaction.