NXP Reader Library  v17.1.0.2535

Implementation of Utility interfaces. More...

Collaboration diagram for Utility:

Modules

 RC523 Reader IC
 Implementation of helper interfaces for RC663 Reader IC.
 
 RC663 Reader IC
 Implementation of helper interfaces for RC663 Reader IC.
 

Functions

phStatus_t phhalHw_Sam_Utils_GetCheckLcLe (uint8_t *pCmd, uint16_t wCmdLen, uint8_t *pIsLcPresent, uint8_t *pLcLen, uint8_t *pIsLePresent)
 Get the length of LC and also check is LC and LE are present in the command frame. More...
 
phStatus_t phhalHw_Sam_Utils_TruncateMacBuffer (uint8_t *pIoBuffer, uint8_t *pMacLen)
 Truncate a 16-Bytes MAC buffer into a 8-Bytes Buffer. More...
 
phStatus_t phhalHw_Sam_Utils_GetLc (phhalHw_Sam_DataParams_t *pDataParams, uint8_t *pLC)
 Gets the current updated LC information. More...
 
phStatus_t phhalHw_Sam_Utils_UpdateLc (phhalHw_Sam_DataParams_t *pDataParams)
 Update LC byte according to data already available in Buffer. More...
 
phStatus_t phhalHw_Sam_Utils_UpdateP1 (phhalHw_Sam_DataParams_t *pDataParams, uint8_t p1)
 Update P1 byte according to data already available in Buffer. More...
 
phStatus_t phhalHw_Sam_Utils_UpdateP2 (phhalHw_Sam_DataParams_t *pDataParams, uint8_t p2)
 Update P1byte according to data already available in Buffer. More...
 
phStatus_t phhalHw_Sam_Utils_ResolveErrorCode (phhalHw_Sam_DataParams_t *pDataParams, uint8_t *pSw1Sw2)
 Parse Status Word Sw1Sw2 from the SAM and assign a equivalent custom code. More...
 
phStatus_t phhalHw_Sam_Utils_GenerateHostAuthSessionKey (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bKeyType, uint8_t *pRnd1, uint8_t *pRnd2, uint8_t *pSessionKey, uint8_t *pKeyLen)
 Session key generation for LockUnlock command. More...
 
phStatus_t phhalHw_Sam_Utils_GenerateSessionKey (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bKeyType, uint8_t *pRnd1, uint8_t *pRnd2, uint8_t *pSessionEncKey, uint8_t *pSessionMacKey, uint8_t *pKeyLen)
 Session key generation for AuthenticateHost command. More...
 
phStatus_t phhalHw_Sam_Utils_GetSessionUploadKey (phhalHw_Sam_DataParams_t *pDataParams, uint8_t bMode, uint16_t wUploadCtr, uint8_t bKeyNo, uint8_t bKeyVer, uint8_t *pSessionKey, uint8_t *pKeyType)
 Session key generation for the command PLUpload. More...
 

Detailed Description

Implementation of Utility interfaces.

Function Documentation

◆ phhalHw_Sam_Utils_GetCheckLcLe()

phStatus_t phhalHw_Sam_Utils_GetCheckLcLe ( uint8_t pCmd,
uint16_t  wCmdLen,
uint8_t pIsLcPresent,
uint8_t pLcLen,
uint8_t pIsLePresent 
)

Get the length of LC and also check is LC and LE are present in the command frame.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in]pCmd[In] Address of buffer that contains the command.
[in]wCmdLen[In] Length of the command.
[out]pIsLcPresent[Out] LC byte presence indicator.
[out]pLcLen[Out] Length of the payload of the command.
[out]pIsLePresent[Out] LE byte presence indicator.

◆ phhalHw_Sam_Utils_TruncateMacBuffer()

phStatus_t phhalHw_Sam_Utils_TruncateMacBuffer ( uint8_t pIoBuffer,
uint8_t pMacLen 
)

Truncate a 16-Bytes MAC buffer into a 8-Bytes Buffer.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
OtherDepending on implementation and underlaying component.
Parameters
[in,out]pIoBuffer[In, Out] The 16 bytes of computed MAC as input and 8 bytes of truncated MAC as output.
[in,out]pMacLen[In, Out] Non-Truncated MAC length as input and Truncated MAC length as output.

◆ phhalHw_Sam_Utils_GetLc()

phStatus_t phhalHw_Sam_Utils_GetLc ( phhalHw_Sam_DataParams_t pDataParams,
uint8_t pLC 
)

Gets the current updated LC information.

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.
[out]pLC[Out] Provides the current updated LC information.

◆ phhalHw_Sam_Utils_UpdateLc()

phStatus_t phhalHw_Sam_Utils_UpdateLc ( phhalHw_Sam_DataParams_t pDataParams)

Update LC byte according to data already available in Buffer.

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.

◆ phhalHw_Sam_Utils_UpdateP1()

phStatus_t phhalHw_Sam_Utils_UpdateP1 ( phhalHw_Sam_DataParams_t pDataParams,
uint8_t  p1 
)

Update P1 byte according to data already available in Buffer.

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]p1[In] Value for P1.

◆ phhalHw_Sam_Utils_UpdateP2()

phStatus_t phhalHw_Sam_Utils_UpdateP2 ( phhalHw_Sam_DataParams_t pDataParams,
uint8_t  p2 
)

Update P1byte according to data already available in Buffer.

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]p2[In] Value for P1.

◆ phhalHw_Sam_Utils_ResolveErrorCode()

phStatus_t phhalHw_Sam_Utils_ResolveErrorCode ( phhalHw_Sam_DataParams_t pDataParams,
uint8_t pSw1Sw2 
)

Parse Status Word Sw1Sw2 from the SAM and assign a equivalent custom code.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]pSw1Sw2[In] Pointer to the status code sent by the SAM.

◆ phhalHw_Sam_Utils_GenerateHostAuthSessionKey()

phStatus_t phhalHw_Sam_Utils_GenerateHostAuthSessionKey ( phhalHw_Sam_DataParams_t pDataParams,
uint8_t  bKeyType,
uint8_t pRnd1,
uint8_t pRnd2,
uint8_t pSessionKey,
uint8_t pKeyLen 
)

Session key generation for LockUnlock command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bKeyType[In] The key type to be used (AES128 or AES192)
[in]pRnd1[In] Pointer to Rnd1 data.
[in]pRnd2[In] Pointer to Rnd2 data.
[out]pSessionKey[Out] The generated session key.
[out]pKeyLen[Out] Length of the Session key.

◆ phhalHw_Sam_Utils_GenerateSessionKey()

phStatus_t phhalHw_Sam_Utils_GenerateSessionKey ( phhalHw_Sam_DataParams_t pDataParams,
uint8_t  bKeyType,
uint8_t pRnd1,
uint8_t pRnd2,
uint8_t pSessionEncKey,
uint8_t pSessionMacKey,
uint8_t pKeyLen 
)

Session key generation for AuthenticateHost command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bKeyType[In] The key type to be used (AES128 or AES192)
[in]pRnd1[In] Pointer to Rnd1 data.
[in]pRnd2[In] Pointer to Rnd2 data.
[out]pSessionEncKey[Out] The generate session encryption key.
[out]pSessionMacKey[Out] The generate session mac key.
[out]pKeyLen[Out] Length of the Session key.

◆ phhalHw_Sam_Utils_GetSessionUploadKey()

phStatus_t phhalHw_Sam_Utils_GetSessionUploadKey ( phhalHw_Sam_DataParams_t pDataParams,
uint8_t  bMode,
uint16_t  wUploadCtr,
uint8_t  bKeyNo,
uint8_t  bKeyVer,
uint8_t pSessionKey,
uint8_t pKeyType 
)

Session key generation for the command PLUpload.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bMode[In] Mode to use for session key generation. Can be one of the below options.
  • PHHAL_HW_CMD_SAM_SESSION_KEY_ENC "Session Encryption Key"
  • PHHAL_HW_CMD_SAM_SESSION_KEY_MAC "Session MAC Key"
[in]wUploadCtr[In] The upload counter value.
[in]bKeyNo[In] Key number using which the key will be taken from keystore for macing the session vectors.
[in]bKeyVer[In] Key version to be used.
[out]pSessionKey[Out] The generated session key.
[out]pKeyType[Out] The type of key used for session key generation.