NXP Reader Library  v17.1.0.2535

These Components implement the Virtual Card Architecture (R) commands for Proximity Check feature. More...

Collaboration diagram for Proximity Check commands:

Functions

phStatus_t phalVca_ProximityCheck (void *pDataParams, uint8_t bGenerateRndC, uint8_t *pRndC, uint8_t bPps1, uint8_t bNumSteps, uint16_t wKeyNumber, uint16_t wKeyVersion, uint8_t *pUsedRndC)
 Performs the whole Proximity Check command chain which calls all the three commands(PreparePC, ExecutePC and VerifyPC) together. More...
 
phStatus_t phalVca_ProximityCheckNew (void *pDataParams, uint8_t bOption, uint8_t *pPrndC, uint8_t bNumSteps, uint16_t wKeyNumber, uint16_t wKeyVersion, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pOption, uint8_t *pPubRespTime, uint8_t *pResponse, uint16_t *pRespLen, uint8_t *pCumRndRC)
 Performs the whole Proximity Check New command chain which calls all the three commands(PreparePC, PC and VerifyPC) together. More...
 
phStatus_t phalVca_PrepareProximityCheckNew (void *pDataParams, uint8_t *pOption, uint8_t *pPubRespTime, uint8_t *pResponse, uint16_t *pRespLen)
 "PrepareProximityCheckNew" command shall prepare the card by generating the Option, publish response time and optional PPS. More...
 
phStatus_t phalVca_ExecuteProximityCheckNew (void *pDataParams, uint8_t bGenerateRndC, uint8_t *pPrndC, uint8_t bNumSteps, uint8_t *pPubRespTime, uint8_t *pCumRndRC)
 This new command is implementated to support VCA for Desfire Ev2, future and Mifare Plus EV1, future. More...
 
phStatus_t phalVca_VerifyProximityCheckNew (void *pDataParams, uint8_t bOption, uint8_t *pPubRespTime, uint8_t *pResponse, uint16_t wRespLen, uint16_t wKeyNumber, uint16_t wKeyVersion, uint8_t *pRndCmdResp)
 "VerifyProximityCheckNew" command verifies all random numbers received after execution of command "ExecuteProximityCheckNew" using cryptographic methods. More...
 
phStatus_t phalVca_VerifyProximityCheckUtility (void *pDataParams, uint8_t *pCmdMac, uint8_t *pCmdResp)
 It does all the operations as is which the above API "phalVca_VerifyProximityCheckNew" does. More...
 

Option to be used for ProximityCheckNew command.

#define PHAL_VCA_PC_RNDC_PROVIDED   0x00
 Option mask to indicate the Random number C is given by the user.
 
#define PHAL_VCA_PC_RNDC_GENERATE   0x01
 Option mask to indicate the Random number C to be generated by the library.
 
#define PHAL_VCA_PC_NORMAL_PROCESSING   0x00
 Option mask to indicate VerifyProcessing should be Normal.
 
#define PHAL_VCA_PC_RANDOM_PROCESSING   0x02
 Option mask to indicate VerifyProcessing should be Random.
 

Detailed Description

These Components implement the Virtual Card Architecture (R) commands for Proximity Check feature.

Function Documentation

◆ phalVca_ProximityCheck()

phStatus_t phalVca_ProximityCheck ( void *  pDataParams,
uint8_t  bGenerateRndC,
uint8_t pRndC,
uint8_t  bPps1,
uint8_t  bNumSteps,
uint16_t  wKeyNumber,
uint16_t  wKeyVersion,
uint8_t pUsedRndC 
)

Performs the whole Proximity Check command chain which calls all the three commands(PreparePC, ExecutePC and VerifyPC) together.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bGenerateRndC[In] 0: RndC provided; 1: generate RndC;
[in]pRndC[In] Provided RndC (7 bytes), ignored if bGenerateRndC == 1.
[in]bPps1[In] Speed(PPS1). This indicates communication data rate between PD and PCD.
[in]bNumSteps[In] Number of ProximityCheck cycles; RFU, must be 1.
[in]wKeyNumber[In] Proximity Check MAC Key number.
[in]wKeyVersion[In] Proximity Check MAC Key version.
[out]pUsedRndC[Out] Used RndC (7 bytes), can be NULL.

◆ phalVca_ProximityCheckNew()

phStatus_t phalVca_ProximityCheckNew ( void *  pDataParams,
uint8_t  bOption,
uint8_t pPrndC,
uint8_t  bNumSteps,
uint16_t  wKeyNumber,
uint16_t  wKeyVersion,
uint8_t pDivInput,
uint8_t  bDivInputLen,
uint8_t pOption,
uint8_t pPubRespTime,
uint8_t pResponse,
uint16_t pRespLen,
uint8_t pCumRndRC 
)

Performs the whole Proximity Check New command chain which calls all the three commands(PreparePC, PC and VerifyPC) together.

This command is supported by Desfire EV2, future and Mifare Plus Ev1, future product only.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] One of the below Option values.
For Software and SAM S mode.
[in]pPrndC[In] One of the below contents.
For Software mode and SAM S, if PHAL_VCA_PC_RNDC_GENERATE the buffer can be null else the random number should be provided by the user.

For Sam X mode, the buffer will not be utilized as the random number will be generated by SAM.

Parameters
[in]bNumSteps[In] Number of ProximityCheck cycles. The value should be from 1 - 8.
[in]wKeyNumber[In] Proximity Check MAC Key number in Software or SAM keystore.
[in]wKeyVersion[In] Proximity Check MAC Key version in Software or SAM keystore.
[in]pDivInput[In] Diversification input in case of SAM.
[in]bDivInputLen[In] Diversification input length in case of SAM.
[out]pOption[Out] Option field defining subsequent response content
bit[0] of bOption denotes presence of PPS
bit[1] of bOption denotes presence of ActBitRate
[out]pPubRespTime[Out] Published response time: time in microseconds. The PD will transmit the Cmd.ProximityCheck response as close as possible to this time.
[out]pResponse[Out] The response received by the PICC. Can be
Speed(PPS1). This indicates communication data rate between PD and PCD. OR
ActBitRate information.
[out]pRespLen[Out] Length of byte(s) available in Response buffer. One byte Speed(PPS1) OR
N bytes of ActBitRate information.
[out]pCumRndRC[Out] Combination of both pRndCmd(cumulative of 8 bytes of Random data sent from PCD) and pRndResp(cumulative of 8 bytes response data received from PD).

◆ phalVca_PrepareProximityCheckNew()

phStatus_t phalVca_PrepareProximityCheckNew ( void *  pDataParams,
uint8_t pOption,
uint8_t pPubRespTime,
uint8_t pResponse,
uint16_t pRespLen 
)

"PrepareProximityCheckNew" command shall prepare the card by generating the Option, publish response time and optional PPS.

This command is supported by Desfire EV2, future and Mifare Plus Ev1, future product only.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[out]pOption[Out] Option field defining subsequent response content
bit[0] of bOption denotes presence of PPS
bit[1] of bOption denotes presence of ActBitRate
[out]pPubRespTime[Out] Published response time: time in microseconds. The PD will transmit the Cmd.ProximityCheck response as close as possible to this time.
[out]pResponse[Out] The response received by the PICC. Can be
Speed(PPS1). This indicates communication data rate between PD and PCD. OR
ActBitRate information.
[out]pRespLen[Out] Length of byte(s) available in Response buffer. One byte Speed(PPS1) OR
N bytes of ActBitRate information.

◆ phalVca_ExecuteProximityCheckNew()

phStatus_t phalVca_ExecuteProximityCheckNew ( void *  pDataParams,
uint8_t  bGenerateRndC,
uint8_t pPrndC,
uint8_t  bNumSteps,
uint8_t pPubRespTime,
uint8_t pCumRndRC 
)

This new command is implementated to support VCA for Desfire Ev2, future and Mifare Plus EV1, future.

Proximity Device answers with a prepared random number at the published response time in Command "PrepareProximityCheckNew". So "PrepareProximityCheckNew" command may be repeated up to 8 times splitting the random number for different time measurements.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bGenerateRndC[In] One of the below Option values.
[in]pPrndC[In] Provided RndC (8 bytes), ignored if bGenerateRndC == PHAL_VCA_PC_RNDC_GENERATE.
[in]bNumSteps[In] Number of ProximityCheck cycles. Will be one of the below sequence.
Steps = 8: Only one iteration is made, All 8 random bytes in one Cmd.ProxmityCheck.
Steps = 7: Sends the first 7 random bytes in one Cmd.ProxmityCheck and the remaining random byte in another one.
Steps = 6: 6 in one Cmd.ProxmityCheck and remaining 2 in Second.
Steps = 5: 5 in one Cmd.ProxmityCheck and remaining 3 in Second.
Steps = 4: 4 in one Cmd.ProxmityCheck and remaining 4 in Second.
Steps = 3: 3 in one Cmd.ProxmityCheck, 3 in Second and remaining 2 in Third.
Steps = 2: 2 in one Cmd.ProxmityCheck, 2 in Second, 2 in Third and remaining 2 in fourth.
Steps = 1: Sends 8 Cmd.ProxmityCheck with one random byte for each Exchange.
[in]pPubRespTime[In] Published response time: time in microseconds. The PD will transmit the Cmd.ProximityCheck response as close as possible to this time.
[out]pCumRndRC[Out] Combination of both pRndCmd(cumulative of 8 bytes of Random data sent from PCD) and pRndResp(cumulative of 8 bytes response data received from PD).

◆ phalVca_VerifyProximityCheckNew()

phStatus_t phalVca_VerifyProximityCheckNew ( void *  pDataParams,
uint8_t  bOption,
uint8_t pPubRespTime,
uint8_t pResponse,
uint16_t  wRespLen,
uint16_t  wKeyNumber,
uint16_t  wKeyVersion,
uint8_t pRndCmdResp 
)

"VerifyProximityCheckNew" command verifies all random numbers received after execution of command "ExecuteProximityCheckNew" using cryptographic methods.

This command is supported by Desfire EV2, future and Mifare Plus Ev1, future product only.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] Option field defining subsequent response content
bit[0] of bOption denotes presence of PPS
bit[1] of bOption denotes presence of ActBitRate
[in]pPubRespTime[In] Published response time: time in microseconds. The PD will transmit the Cmd.ProximityCheck response as close as possible to this time.
[in]pResponse[In] The response received by the PICC. Can be
Speed(PPS1). This indicates communication data rate between PD and PCD. OR
ActBitRate information.
[in]wRespLen[In] Length of bytes available in Response buffer.
[in]wKeyNumber[In] Proximity Check MAC Key number.
[in]wKeyVersion[In] Proximity Check MAC Key version.
[out]pRndCmdResp[Out] Combination of both pRndCmd(cumulative of 8 bytes of Random data sent from PCD) and pRndResp(cumulative of 8 bytes response data received from PD).

◆ phalVca_VerifyProximityCheckUtility()

phStatus_t phalVca_VerifyProximityCheckUtility ( void *  pDataParams,
uint8_t pCmdMac,
uint8_t pCmdResp 
)

It does all the operations as is which the above API "phalVca_VerifyProximityCheckNew" does.

It is specially designed to fulfil the requirements for REC. It directly sends the MAC and receive it without any further operations on the sent MAC and the received MAC.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]pCmdMac[In] 8 bytes Command MAC, to be sent directly to the PICC
[out]pCmdResp[Out] 8 bytes Response MAC received from PICC