NXP Reader Library  v17.1.0.2535
Commands_Utility

Describes about the MIFARE DUOX Utility functions. These are not part of actual MIFARE DUOX data sheet rather its for internal purpose. More...

Collaboration diagram for Commands_Utility:

Modules

 Defines
 Macro Definitions for Utility interface support.
 

Functions

phStatus_t phalMfDuoX_GetConfig (void *pDataParams, uint16_t wConfig, uint16_t *pValue)
 Perform a GetConfig command. More...
 
phStatus_t phalMfDuoX_SetConfig (void *pDataParams, uint16_t wConfig, uint16_t wValue)
 Perform a SetConfig command. More...
 
phStatus_t phalMfDuoX_ResetAuthentication (void *pDataParams)
 Reset the authentication. More...
 
phStatus_t phalMfDuoX_ISOGeneralAuthenticateVerify (void *pDataParams, uint8_t *pPubBKey, uint16_t wPubBKeyLen, uint8_t *pOptsB, uint8_t bOptsBLen, uint8_t *pE_PubBKey, uint16_t wE_PubBKeyLen, uint8_t *pSignature, uint16_t wSignLen)
 Performs verification of Message B (Msg.B.ext). More...
 
phStatus_t phalMfDuoX_GenerateDAMEncKey (void *pDataParams, uint16_t wKeyNo_PICCDAMEncKey, uint16_t wKeyVer_PICCDAMEncKey, uint16_t wKeyNo_AppDAMDefault, uint16_t wKeyVer_AppDAMDefault, uint8_t bAppDAMDefaultKeyVer, uint8_t **ppDAMEncKey, uint16_t *pDAMEncKeyLen)
 Generates Encrypted Key for Delegated application management. More...
 
phStatus_t phalMfDuoX_GenerateDAMMAC (void *pDataParams, uint8_t bOption, uint16_t wKeyNo_PICCDAMMAC, uint16_t wKeyVer_PICCDAMMAC, uint8_t *pAid, uint8_t *pDamParams, uint8_t bDamParamsLen, uint8_t bKeySettings1, uint8_t bKeySettings2, uint8_t bKeySettings3, uint8_t *pKeySetValues, uint8_t bKeySetValuesLen, uint8_t *pISOFileId, uint8_t *pISODFName, uint8_t bISODFNameLen, uint8_t *pEncK, uint8_t bEncKLen, uint8_t **ppDAMMAC, uint16_t *pDAMMACLen)
 Generate MAC for Delegated Application Creation and Delete Application. More...
 
phStatus_t phalMfDuoX_GenerateDAMMACSetConfig (void *pDataParams, uint16_t wKeyNo_PICCDAMMAC, uint16_t wKeyVer_PICCDAMMAC, uint8_t *pOld_ISODFName, uint8_t bOld_DFNameLen, uint8_t *pNew_ISODFName, uint8_t bNew_DFNameLen, uint8_t **ppDAMMAC, uint16_t *pDAMMACLen)
 Generates DAMMAC for Set Configuration with option 0x06 for Delegated Application. More...
 
phStatus_t phalMfDuoX_CalculateTMV (void *pDataParams, uint16_t wOption, uint16_t wKeyNo_TMACKey, uint16_t wKeyVer_TMACKey, 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 **ppTMV, uint16_t *pTMVLen)
 Computes the Transaction MAC value based on the Transaction MAC Input as performed on the PICC. More...
 
phStatus_t phalMfDuoX_VerifyTransationSignature (void *pDataParams, uint8_t bCurveID, uint8_t *pPubKey, uint16_t wPubKey_Len, uint8_t *pTMI, uint16_t wTMILen, uint8_t *pTMC, uint8_t *pTSV, uint16_t wTSVLen)
 Verifies the Transaction MAC Signature provided by PICC. More...
 
phStatus_t phalMfDuoX_DecryptReaderID (void *pDataParams, uint16_t wOption, uint16_t wKeyNo_TMACKey, uint16_t wKeyVer_TMACKey, 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 bEncTMRILen, uint8_t **ppTMRIPrev, uint16_t *pTMRIPrevLen)
 Provides the previous Decrypted Reader ID. More...
 
phStatus_t phalMfDuoX_CalculateMACSDM (void *pDataParams, uint8_t bSdmOption, uint16_t wKeyNo_SDMMac, uint16_t wKeyVer_SDMMac, uint16_t wRamKeyNo, uint16_t wRamKeyVer, uint8_t *pUid, uint8_t bUidLen, uint8_t *pSDMReadCtr, uint8_t *pInData, uint16_t wInDataLen, uint8_t **ppSDMMAC, uint16_t *pSDMMACLen)
 Performs computation of SDM MAC information. More...
 
phStatus_t phalMfDuoX_VerifySDMSignature (void *pDataParams, uint16_t wPubKeyNo_SDMSig, uint16_t wPubKeyPos_SDMSig, uint8_t *pInData, uint16_t wInDataLen, uint8_t *pSignature, uint16_t wSigLen)
 Performs verification of SDM Signature information. More...
 
phStatus_t phalMfDuoX_DecryptSDMENCFileData (void *pDataParams, uint8_t bSdmOption, uint16_t wKeyNo_SDMEnc, uint16_t wKeyVer_SDMEnc, uint16_t wRamKeyNo, uint16_t wRamKeyVer, uint8_t *pUid, uint8_t bUidLen, uint8_t *pSDMReadCtr, uint8_t *pEncData, uint16_t wEncDataLen, uint8_t **ppPlainData, uint16_t *pPlainDataLen)
 Performs decryption of SDM File Data. More...
 
phStatus_t phalMfDuoX_DecryptSDMPICCData (void *pDataParams, uint16_t wKeyNo, uint16_t wKeyVer, uint8_t *pEncData, uint16_t wEncDataLen, uint8_t **ppPlainData, uint16_t *pPlainDataLen)
 Performs decryption of SDM PICC Data. More...
 

Detailed Description

Describes about the MIFARE DUOX Utility functions. These are not part of actual MIFARE DUOX data sheet rather its for internal purpose.

Function Documentation

◆ phalMfDuoX_GetConfig()

phStatus_t phalMfDuoX_GetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t pValue 
)

Perform a GetConfig command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETERIf the return buffer is null
PH_ERR_UNSUPPORTED_PARAMETERIf configuration (wConfig) option provided is not supported.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wConfig[In] Configuration to read. Will be one of the below values. for list of supported configurations refer Configuration Identifier
[out]pValue[Out] The value for the mentioned configuration.

◆ phalMfDuoX_SetConfig()

phStatus_t phalMfDuoX_SetConfig ( void *  pDataParams,
uint16_t  wConfig,
uint16_t  wValue 
)

Perform a SetConfig command.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_UNSUPPORTED_PARAMETERIf configuration (wConfig) option provided is not supported.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wConfig[In] Configuration to set. Will be one of the below values. for list of supported configurations refer Configuration Identifier
[in]wValue[In] The value for the mentioned configuration.

◆ phalMfDuoX_ResetAuthentication()

phStatus_t phalMfDuoX_ResetAuthentication ( void *  pDataParams)

Reset the authentication.

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.

◆ phalMfDuoX_ISOGeneralAuthenticateVerify()

phStatus_t phalMfDuoX_ISOGeneralAuthenticateVerify ( void *  pDataParams,
uint8_t pPubBKey,
uint16_t  wPubBKeyLen,
uint8_t pOptsB,
uint8_t  bOptsBLen,
uint8_t pE_PubBKey,
uint16_t  wE_PubBKeyLen,
uint8_t pSignature,
uint16_t  wSignLen 
)

Performs verification of Message B (Msg.B.ext).

This interface needs to be called after performing ISOGeneral Authenticate if Authentication type is Mutual Authentication.

Note
This is not an actual command of MIFARE DUOX. Its an utility interface to verify message. There is no exchange performed with PICC.
Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETERIf the buffers are null.
PH_ERR_VERIFICATION_FAILEDVerification of Message / Signature combination failed.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]pPubBKey[In] Device Public Key (Pub.B) to be used for verification.
[in]wPubBKeyLen[In] Length of bytes available in pPubBKey buffer.
[in]pOptsB[In] Options received from the PICC.
[in]bOptsBLen[In] Length of bytes available in pOptsB buffer.
[in]pE_PubBKey[In] Device Ephemeral Public Key (E.Pub.B) received from PICC.
[in]wE_PubBKeyLen[In] The Length of bytes available in pE_PubKeyB buffer
[in]pSignature[In] The signature of the message. The Signature should be in R and S integer format. pSignature = R data followed by S data.
Here R and S length should be based on the curve length.
Ex: If curve length is 256 bit, then R and S length will be 32 bytes each.
[in]wSignLen[In] Length of bytes available in pSignature buffer.

◆ phalMfDuoX_GenerateDAMEncKey()

phStatus_t phalMfDuoX_GenerateDAMEncKey ( void *  pDataParams,
uint16_t  wKeyNo_PICCDAMEncKey,
uint16_t  wKeyVer_PICCDAMEncKey,
uint16_t  wKeyNo_AppDAMDefault,
uint16_t  wKeyVer_AppDAMDefault,
uint8_t  bAppDAMDefaultKeyVer,
uint8_t **  ppDAMEncKey,
uint16_t pDAMEncKeyLen 
)

Generates Encrypted Key for Delegated application management.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETERIf the buffer is null.
PH_ERR_KEYIf key number passed is not of a support key type.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wKeyNo_PICCDAMEncKey[In] Key number in key store of PICC DAM Encryption key.
[in]wKeyVer_PICCDAMEncKey[In] Key version in key store of PICC DAM Encryption key.
[in]wKeyNo_AppDAMDefault[In] Key number in key store of APP DAM default key.
[in]wKeyVer_AppDAMDefault[In] Key version in key store of APP DAM default key.
[in]bAppDAMDefaultKeyVer[In] APP DAM Default Key version.
[out]ppDAMEncKey[Out] The initial application key for the DAM application.
[out]pDAMEncKeyLen[Out] Length of bytes available in pDAMEncKey buffer.

◆ phalMfDuoX_GenerateDAMMAC()

phStatus_t phalMfDuoX_GenerateDAMMAC ( void *  pDataParams,
uint8_t  bOption,
uint16_t  wKeyNo_PICCDAMMAC,
uint16_t  wKeyVer_PICCDAMMAC,
uint8_t pAid,
uint8_t pDamParams,
uint8_t  bDamParamsLen,
uint8_t  bKeySettings1,
uint8_t  bKeySettings2,
uint8_t  bKeySettings3,
uint8_t pKeySetValues,
uint8_t  bKeySetValuesLen,
uint8_t pISOFileId,
uint8_t pISODFName,
uint8_t  bISODFNameLen,
uint8_t pEncK,
uint8_t  bEncKLen,
uint8_t **  ppDAMMAC,
uint16_t pDAMMACLen 
)

Generate MAC for Delegated Application Creation and Delete Application.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETER
  • If the buffers are null.
  • For Invalid options information. (bOption)
PH_ERR_KEYIf key number passed is not of a support key type.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bOption[In] Option to represent the
[in]wKeyNo_PICCDAMMAC[In] Key number in key store of PICC DAM MAC key.
[in]wKeyVer_PICCDAMMAC[In] Key version in key store of PICC DAM MAC key.
[in]pAid[In] The application identifier to be used. Will be of 3 bytes with LSB first.
  • If application 01 need to be created, then the Aid will be 01 00 00.
[in]pDamParams[In] The DAM information. Should as mentioned below.
  • Byte0 = DAM Slot No [LSB]
  • Byte1 = DAM Slot No [MSB]
  • Byte2 = DAM Slot Version
  • Byte3 = Quota Limit [LSB]
  • Byte4 = Quota Limit [MSB]
[in]bDamParamsLen[In] Length of bytes available in pDamParams buffer.
[in]bKeySettings1[In] Application Key settings.
[in]bKeySettings2[In] Several other key settings.
[in]bKeySettings3[In] Additional optional key settings.
[in]pKeySetValues[In] The Key set values for the application. Should as mentioned below.
  • Byte0 = AKS Version
  • Byte1 = Number of KeySets
  • Byte2 = MaxKeysize
  • Byte3 = Application KeySet Settings.
[in]bKeySetValuesLen[In] Length of bytes available in pKeySetValues buffer.
[in]pISOFileId[In] ISO File ID to be used. Should be two bytes.
[in]pISODFName[In] ISO DF Name to be used. Should be upto 16 bytes and can also be NULL based on the option.
  • If bOption = DF Name, then upto 16 bytes of ISO application name should be provided.
  • NULL for other option types.
[in]bISODFNameLen[In] Length of bytes available in pISODFName buffer.
[in]pEncK[In] The initial application key for the DAM application.
[in]bEncKLen[In] Length of bytes available in pEncK buffer.
[out]ppDAMMAC[Out] The MAC calculated by the card issuer with PICCDAMMACKey to allow delegated application creation.
[out]pDAMMACLen[Out] Length of bytes available in ppDAMMAC buffer.

◆ phalMfDuoX_GenerateDAMMACSetConfig()

phStatus_t phalMfDuoX_GenerateDAMMACSetConfig ( void *  pDataParams,
uint16_t  wKeyNo_PICCDAMMAC,
uint16_t  wKeyVer_PICCDAMMAC,
uint8_t pOld_ISODFName,
uint8_t  bOld_DFNameLen,
uint8_t pNew_ISODFName,
uint8_t  bNew_DFNameLen,
uint8_t **  ppDAMMAC,
uint16_t pDAMMACLen 
)

Generates DAMMAC for Set Configuration with option 0x06 for Delegated Application.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETERIf the buffers are null.
PH_ERR_KEYIf key number passed is not of a support key type.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wKeyNo_PICCDAMMAC[In] Key number in key store of PICC DAM MAC key.
[in]wKeyVer_PICCDAMMAC[In] Key version in key store of PICC DAM MAC key.
[in]pOld_ISODFName[In] This means already created delegated APP ISO DF Name. Maximum 16 bytes
[in]bOld_DFNameLen[In] Length of bytes available in pOld_ISODFName buffer.
[in]pNew_ISODFName[In] This means new delegated APP ISO DF Name which will replace the existing one. Maximum 16 bytes
[in]bNew_DFNameLen[In] Length of bytes available in pNew_ISODFName buffer.
[out]ppDAMMAC[Out] Generated 8 bytes DAM MAC.
[out]pDAMMACLen[Out] Length of bytes available in ppDAMMAC buffer.

◆ phalMfDuoX_CalculateTMV()

phStatus_t phalMfDuoX_CalculateTMV ( void *  pDataParams,
uint16_t  wOption,
uint16_t  wKeyNo_TMACKey,
uint16_t  wKeyVer_TMACKey,
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 **  ppTMV,
uint16_t pTMVLen 
)

Computes the Transaction MAC value based on the Transaction MAC Input as performed on the PICC.

Supports MAC Calculation using AES128 and AES 256 key type.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETER
  • If the buffers are null.
  • For invalid diversification options (wOption).
PH_ERR_KEYIf key number passed is not of a support key type.
PH_ERR_PARAMETER_OVERFLOWIf TMC value reached maximum.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Diversification option to be used for Key diversification.
[in]wKeyNo_TMACKey[In] Key number to be used from software or hardware KeyStore.
[in]wKeyVer_TMACKey[In] Key version to be used from software or hardware KeyStore.
[in]wRamKeyNo[In] Key number of Destination Key where the computed session TMAC key will be stored. To be used for SAM only.
[in]wRamKeyVer[In] Key version of Destination Key where the computed session TMAC key will be stored. To be used for SAM only.
[in]pDivInput[In] Diversification input to diversify TMACKey.
[in]bDivInputLen[In] Length of byte available in pDivInput 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 bytes available in pUid buffer.
[in]pTMI[In] Transaction MAC Input.
[in]wTMILen[In] Length of bytes available in pTMI buffer.
[out]ppTMV[Out] The computed Transaction MAC Value.
[out]pTMVLen[Out] Length of bytes available in ppTMV buffer.

◆ phalMfDuoX_VerifyTransationSignature()

phStatus_t phalMfDuoX_VerifyTransationSignature ( void *  pDataParams,
uint8_t  bCurveID,
uint8_t pPubKey,
uint16_t  wPubKey_Len,
uint8_t pTMI,
uint16_t  wTMILen,
uint8_t pTMC,
uint8_t pTSV,
uint16_t  wTSVLen 
)

Verifies the Transaction MAC Signature provided by PICC.

Here the Public Key to be used for verification is picked from KeyStore.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETERIf the buffers are null.
PH_ERR_VERIFICATION_FAILEDVerification of Message / Signature combination failed.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bCurveID[In] The targeted curve for the public key provided in pPubKey parameter. Should be one of the below values.
[in]pPubKey[In] Public Key to be used for signature verification.
[in]wPubKey_Len[In] Length of bytes available in pPubKey buffer.
[in]pTMI[In] Transaction MAC Input.
[in]wTMILen[In] Length of bytes available in pTMI buffer.
[in]pTMC[In] 4 bytes Transaction MAC Counter received from PICC during Commit Transaction command call. If 0x00000001 is the TMC received, then it will be 01 00 00 00.
[in]pTSV[In] The Transaction Signature Value received from PICC.
[in]wTSVLen[In] Length of bytes available in pTSV buffer.

◆ phalMfDuoX_DecryptReaderID()

phStatus_t phalMfDuoX_DecryptReaderID ( void *  pDataParams,
uint16_t  wOption,
uint16_t  wKeyNo_TMACKey,
uint16_t  wKeyVer_TMACKey,
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  bEncTMRILen,
uint8_t **  ppTMRIPrev,
uint16_t pTMRIPrevLen 
)

Provides the previous Decrypted Reader ID.

Supports decryption using AES128 and AES256 key type.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETER
  • If the buffers are null.
  • For invalid diversification options (wOption).
PH_ERR_KEYIf key number passed is not of a support key type.
PH_ERR_PARAMETER_OVERFLOWIf TMC value reached maximum.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wOption[In] Diversification option to be used for Key diversification.
[in]wKeyNo_TMACKey[In] Key number to be used from software or hardware KeyStore.
[in]wKeyVer_TMACKey[In] Key version to be used from software or hardware KeyStore.
[in]wRamKeyNo[In] Key number of Destination Key where the computed session TMAC key will be stored. To be used for SAM only.
[in]wRamKeyVer[In] Key version of Destination Key where the computed session TMAC key will be stored. To be used for SAM only.
[in]pDivInput[In] Diversification input to diversify TMACKey.
[in]bDivInputLen[In] Length of byte available in pDivInput 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 bytes available in pUid buffer.
[in]pEncTMRI[In] Encrypted Transaction MAC ReaderID of the latest successful transaction.
[in]bEncTMRILen[In] Length of bytes available in pEncTMRI buffer.
[out]ppTMRIPrev[Out] Decrypted Reader ID of the last successful transaction.
[out]pTMRIPrevLen[Out] Length of bytes available in ppTMRIPrev buffer.

◆ phalMfDuoX_CalculateMACSDM()

phStatus_t phalMfDuoX_CalculateMACSDM ( void *  pDataParams,
uint8_t  bSdmOption,
uint16_t  wKeyNo_SDMMac,
uint16_t  wKeyVer_SDMMac,
uint16_t  wRamKeyNo,
uint16_t  wRamKeyVer,
uint8_t pUid,
uint8_t  bUidLen,
uint8_t pSDMReadCtr,
uint8_t pInData,
uint16_t  wInDataLen,
uint8_t **  ppSDMMAC,
uint16_t pSDMMACLen 
)

Performs computation of SDM MAC information.

Supports MAC Calculation using AES128 and AES 256 key type.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETER
  • If the buffers are null.
  • If SDMOptions (bSdmOption) is not supported.
PH_ERR_KEYIf key number passed is not of a support key type.
PH_ERR_PARAMETER_OVERFLOWIf SDM Read Counter value reached maximum.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bSdmOption[In] SDM Option to indicate which parameters to be considered.
[in]wKeyNo_SDMMac[In] Key number to be used from software or hardware KeyStore.
[in]wKeyVer_SDMMac[In] Key version to be used from software or hardware KeyStore.
[in]wRamKeyNo[In] Key number of Destination Key where the computed session TMAC key will be stored. To be used for SAM only.
[in]wRamKeyVer[In] Key version of Destination Key where the computed session TMAC key will be stored. To be used for SAM only.
[in]pUid[In] UID of the card.
[in]bUidLen[In] Length of bytes available in pUid buffer.
[in]pSDMReadCtr[In] SDM Read Counter Input. Should be 4 bytes in Length.
[in]pInData[In] Data read out from PICC that is between SDMMacInputoffset until SDMMACOffset.
[in]wInDataLen[In] Length of bytes available in pInData buffer.
[out]ppSDMMAC[Out] Secure Dynamic MAC information.
[out]pSDMMACLen[Out] Length of bytes available in ppRespMac buffer.

◆ phalMfDuoX_VerifySDMSignature()

phStatus_t phalMfDuoX_VerifySDMSignature ( void *  pDataParams,
uint16_t  wPubKeyNo_SDMSig,
uint16_t  wPubKeyPos_SDMSig,
uint8_t pInData,
uint16_t  wInDataLen,
uint8_t pSignature,
uint16_t  wSigLen 
)

Performs verification of SDM Signature information.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETERIf the buffers are null.
PH_ERR_VERIFICATION_FAILEDVerification of Message / Signature combination failed.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wPubKeyNo_SDMSig[In] Key number to be used from KeyStore.
[in]wPubKeyPos_SDMSig[In] Key position to be used from KeyStore.
[in]pInData[In] Data read out from PICC that is between SDMMacInputoffset until SDMMACOffset.
[in]wInDataLen[In] Length of bytes available in pInData buffer.
[in]pSignature[In] Secure Dynamic Signature information.
[in]wSigLen[In] Length of bytes available in pSignature buffer.

◆ phalMfDuoX_DecryptSDMENCFileData()

phStatus_t phalMfDuoX_DecryptSDMENCFileData ( void *  pDataParams,
uint8_t  bSdmOption,
uint16_t  wKeyNo_SDMEnc,
uint16_t  wKeyVer_SDMEnc,
uint16_t  wRamKeyNo,
uint16_t  wRamKeyVer,
uint8_t pUid,
uint8_t  bUidLen,
uint8_t pSDMReadCtr,
uint8_t pEncData,
uint16_t  wEncDataLen,
uint8_t **  ppPlainData,
uint16_t pPlainDataLen 
)

Performs decryption of SDM File Data.

Supports decryption using AES128 and AES 256 key type.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETER
  • If the buffers are null.
  • If SDMOptions (bSdmOption) is not supported.
PH_ERR_KEYIf key number passed is not of a support key type.
PH_ERR_PARAMETER_OVERFLOWIf SDM Read Counter value reached maximum.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]bSdmOption[In] SDM Option to indicate which parameters to be considered.
[in]wKeyNo_SDMEnc[In] Key number to be used from software or hardware KeyStore.
[in]wKeyVer_SDMEnc[In] Key version to be used from software or hardware KeyStore.
[in]wRamKeyNo[In] Key number of Destination Key where the computed session TMAC key will be stored. To be used for SAM only.
[in]wRamKeyVer[In] Key version of Destination Key where the computed session TMAC key will be stored. To be used for SAM only.
[in]pUid[In] UID of the card.
[in]bUidLen[In] Length of bytes available in pUid buffer.
[in]pSDMReadCtr[In] SDM Read Counter Input.
[in]pEncData[In] Encrypted NonASCII SDM Encrypted File data.
[in]wEncDataLen[In] Length of bytes available in pEncData buffer.
[out]ppPlainData[Out] The decrypted SDMFile data.
[out]pPlainDataLen[Out] Length of bytes available in ppPlainData buffer.

◆ phalMfDuoX_DecryptSDMPICCData()

phStatus_t phalMfDuoX_DecryptSDMPICCData ( void *  pDataParams,
uint16_t  wKeyNo,
uint16_t  wKeyVer,
uint8_t pEncData,
uint16_t  wEncDataLen,
uint8_t **  ppPlainData,
uint16_t pPlainDataLen 
)

Performs decryption of SDM PICC Data.

Supports decryption using AES128 and AES 256 key type.

Returns
Status code
Return values
PH_ERR_SUCCESSOperation successful.
PH_ERR_INVALID_DATA_PARAMSIf any of the DataParams are null.
PH_ERR_INVALID_PARAMETERIf the buffers are null.
PH_ERR_KEYIf key number passed is not of a support key type.
PH_ERR_PARAMETER_OVERFLOWIf SDM Read Counter value reached maximum.
XXXXOther Depending on implementation and underlying component.
Parameters
[in]pDataParams[In] Pointer to this layer's parameter structure.
[in]wKeyNo[In] Key number to be used from KeyStore.
[in]wKeyVer[In] Key version to be used from KeyStore.
[in]pEncData[In] Encrypted NonASCII SDM PICC data.
[in]wEncDataLen[In] Length of bytes available in pEncData buffer.
[out]ppPlainData[Out] The decrypted SDMPICC data.
[out]pPlainDataLen[Out] Length of bytes available in ppPlainData buffer.