NXP Reader Library  v17.1.0.2535

SAM commands used for ICODE DNA Authentication in Non-X-Mode. More...

Collaboration diagram for ISO / IEC 29167-10:

Functions

phStatus_t phhalHw_SamAV3_Cmd_SAM_AuthenticateTAM1 (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bOption, uint8_t bKeyNo, uint8_t bKeyVer, uint8_t *pData, uint8_t bDataLen, uint8_t **ppIChallange, uint16_t *pIChallangeLen)
 Generates 10 bytes of random challange to be given to card. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_AuthenticateTAM2 (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bOption, uint16_t wKeyNo, uint16_t wKeyVer, uint8_t *pData, uint8_t bDataLen, uint8_t bBlockSize, uint8_t bBlockCount, uint8_t bProtMode, uint8_t **ppResponse, uint16_t *pResponseLen)
 Generates 10 bytes of random challange to be given to card. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_AuthenticateMAM1 (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bKeyNo, uint8_t bKeyVer, uint8_t *pData, uint8_t bDataLen, uint8_t bPurposeMAM2, uint8_t **ppIChallange, uint16_t *pIChallangeLen)
 Generates 10 bytes of random challange to be given to card. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_AuthenticateMAM2 (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t *pData, uint8_t bDataLen, uint8_t **ppIResponse, uint16_t *pIResponseLen)
 Decrypts the TResponse received from card and verifies the decrypted data for authenticity. More...
 

Sam AV3 command codes for ISO / IEC 29167-10 feature.

#define PHHAL_HW_SAMAV3_CMD_AUTHENTICATE_TAM_INS   0xB0
 Sam AV3 Instruction code for Cmd.SAM_AuthenticateTAM command.
 
#define PHHAL_HW_SAMAV3_CMD_AUTHENTICATE_MAM_INS   0xB2
 Sam AV3 Instruction code for Cmd.SAM_AuthenticateMAM command.
 

Buffer size

#define PHHAL_HW_SAMAV3_CMD_TAM2_COMMAND_SIZE   40U
 Macro to represent the size of the TAM2 command.
 

Option for updating the Custom data flag.

#define PHHAL_HW_SAMAV3_CMD_TAM_CLEAR   0x00U
 Macro to represent the custom data value for Tag authentication cleared.
 
#define PHHAL_HW_SAMAV3_CMD_TAM_SET   0x02U
 Macro to represent the custom data value for Tag authentication set.
 

Option macros to differentiate between part 1 and part2 command exchange.

#define PHHAL_HW_SAMAV3_CMD_TAM_GET_RND   0x00U
 Option for exchanging Key and Div input and receive the IChallange as response.
 
#define PHHAL_HW_SAMAV3_CMD_TAM_PROCESS_TRESPONE   0x01U
 Option for exchanging TResponse and validating it.
 

Option macros for updating the PurposeMAM2 information of Cmd.SAM_AuthenticteMAM.

#define PHHAL_HW_SAMAV3_CMD_MAM_NONE   0x00U
 Option to indicate PurposeMAM2 value as None. More...
 
#define PHHAL_HW_SAMAV3_CMD_MAM_DISABLE_PRIVACY_HF_RESET   0x08U
 Option to indicate PurposeMAM2 value as Privacy disable until HF reset.
 
#define PHHAL_HW_SAMAV3_CMD_MAM_ENABLE_PRIVACY   0x09U
 Option to indicate PurposeMAM2 value as Privacy enable.
 
#define PHHAL_HW_SAMAV3_CMD_MAM_DISABLE_PRIVACY   0x0AU
 Option to indicate PurposeMAM2 value as Privacy disable.
 
#define PHHAL_HW_SAMAV3_CMD_MAM_DESTROY   0x0BU
 Option to indicate PurposeMAM2 value as Destroy.
 

Detailed Description

SAM commands used for ICODE DNA Authentication in Non-X-Mode.

Macro Definition Documentation

◆ PHHAL_HW_SAMAV3_CMD_MAM_NONE

#define PHHAL_HW_SAMAV3_CMD_MAM_NONE   0x00U

Option to indicate PurposeMAM2 value as None.

Here only authentication will be performed.

Function Documentation

◆ phhalHw_SamAV3_Cmd_SAM_AuthenticateTAM1()

phStatus_t phhalHw_SamAV3_Cmd_SAM_AuthenticateTAM1 ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bOption,
uint8_t  bKeyNo,
uint8_t  bKeyVer,
uint8_t pData,
uint8_t  bDataLen,
uint8_t **  ppIChallange,
uint16_t pIChallangeLen 
)

Generates 10 bytes of random challange to be given to card.

Also Decrypts the TResponse received from card and verifies the decrypted data for authenticity.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_SUCCESS_CHAININGfor successfull chaining operation.
OtherDepending on implementation and underlaying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] The command to be framed for SAM.
[in]bKeyNo[In] Key reference number in hardware keytsore.
[in]bKeyVer[In] Key version to be used in hardware key store.
[in]pData[In] Diversification Input or TResponse received from card.
[in]bDataLen[In] Length of diversification input. If 0, no diversification is performed. Or length of TResponse
[out]ppIChallange[Out] The IChallange to be sent to card. This will contain 10 bytes of random challange data.
[out]pIChallangeLen[Out] The length of challange data received from sam.

◆ phhalHw_SamAV3_Cmd_SAM_AuthenticateTAM2()

phStatus_t phhalHw_SamAV3_Cmd_SAM_AuthenticateTAM2 ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bOption,
uint16_t  wKeyNo,
uint16_t  wKeyVer,
uint8_t pData,
uint8_t  bDataLen,
uint8_t  bBlockSize,
uint8_t  bBlockCount,
uint8_t  bProtMode,
uint8_t **  ppResponse,
uint16_t pResponseLen 
)

Generates 10 bytes of random challange to be given to card.

Also Decrypts the TResponse received from card and verifies the decrypted data for authenticity and provides the custom data received form card.

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]bOption[In] The command to be framed for SAM.
[in]wKeyNo[In] Key reference number in hardware keytsore.
[in]wKeyVer[In] Key version to be used in hardware key store.
[in]pData[In] Diversification Input or TResponse received from card.
[in]bDataLen[In] Length of diversification input. If 0, no diversification is performed. Or length of TResponse.
[in]bBlockSize[In] To select the size of custom data block to be used. The value should either be 0x00 for 16 bit block size or 0x01 for 64 bit block size. As per ISO 29167
[in]bBlockCount[In] To select the custom data block to be used from the offset specified. The BlockCount range is from 1 - 16.
[in]bProtMode[In] To specify the mode of operation to be used for encryption/decryption. The ProtMode ranges form 0 - 3. As per ISO 29167
[out]ppResponse[Out] The IChallange to be sent to card. This will contain 10 bytes of random challange data. Or the Custom Data received from card.
[out]pResponseLen[Out] The length of challange data received from sam or the length of Custom Data.

◆ phhalHw_SamAV3_Cmd_SAM_AuthenticateMAM1()

phStatus_t phhalHw_SamAV3_Cmd_SAM_AuthenticateMAM1 ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bKeyNo,
uint8_t  bKeyVer,
uint8_t pData,
uint8_t  bDataLen,
uint8_t  bPurposeMAM2,
uint8_t **  ppIChallange,
uint16_t pIChallangeLen 
)

Generates 10 bytes of random challange to be given to card.

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]bKeyNo[In] Key reference number in hardware keytsore.
[in]bKeyVer[In] Key version to be used in hardware key store.
[in]pData[In] Diversification Input.
[in]bDataLen[In] Length of diversification input. If 0, no diversification is performed.
[in]bPurposeMAM2[In] Purpose MAM 2 data. A 4 bit value.
[out]ppIChallange[Out] The IChallange to be sent to card. This will contain 10 bytes of random challange data.
[out]pIChallangeLen[Out] The length of challange data received from sam.

◆ phhalHw_SamAV3_Cmd_SAM_AuthenticateMAM2()

phStatus_t phhalHw_SamAV3_Cmd_SAM_AuthenticateMAM2 ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t pData,
uint8_t  bDataLen,
uint8_t **  ppIResponse,
uint16_t pIResponseLen 
)

Decrypts the TResponse received from card and verifies the decrypted data for authenticity.

Also frames the IResponse with will be sent to the card.

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]pData[In] TResponse received from card.
[in]bDataLen[In] Length of TResponse
[out]ppIResponse[Out] The IResponse generated by SAM that will be sent to card. This will contain 16 bytes of data.
[out]pIResponseLen[Out] The length of IResponse data received from sam.