NXP Reader Library  v17.1.0.2535

SAM commands used for key management related configuration. More...

Collaboration diagram for Key Management:

Functions

phStatus_t phhalHw_SamAV3_Cmd_SAM_ChangeKeyEntry (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bKeyNo, uint8_t bProMas, uint8_t *pKeyData, uint8_t bKeyDataLen)
 Change a symmetric key entry in the key table of the SAM. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_ChangeKeyEntryOffline (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bKeyNo, uint8_t bProMas, uint16_t wChangeCtr, uint8_t *pOfflineCrypto, uint8_t bOfflineCryptLen, uint8_t bEnableOfflineAck, uint8_t *pOfflineAck)
 Change a Offline symmetric key entry in the key entry table of the SAM. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_GetKeyEntry (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bKeyNo, uint8_t bMode, uint8_t *pKeyEntry, uint8_t *pKeyEntryLen)
 Get information about a key entry. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_ChangeKUCEntry (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bKucNo, uint8_t bProMas, uint8_t *pKucData, uint8_t bKucDataLen)
 Change the key usage counter (KUC). More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_ChangeKUCEntryOffline (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bKucNo, uint8_t bProMas, uint16_t wChangeCtr, uint8_t *pOfflineCrypto, uint8_t bOfflineCryptLen, uint8_t bEnableOfflineAck, uint8_t *pOfflineAck)
 Change a Offline KUC entry in the key entry table of the SAM. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_GetKUCEntry (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bKucNo, uint8_t *pKucEntry)
 Get information about a key usage counter (KUC). More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_DumpSessionKey (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bDumpMode, uint8_t *pSessionKey, uint8_t *pSessionKeyLen)
 Dump the current session key. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_DumpSecretKey (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bDumpMode, uint8_t bKeyNo, uint8_t bKeyVer, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pSecretKey, uint8_t *pSecretKeyLen)
 Retrive a PICC key stored in the key table. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_DisableKeyEntry (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bKeyNo, uint8_t *pOfflineCrypto, uint8_t bCryptoLen)
 Disable a key entry. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_DisableKeyEntryOffline (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bKeyNo, uint16_t wChangeCtr, uint8_t *pOfflineCrypto, uint8_t bOfflineCryptLen, uint8_t bEnableOfflineAck, uint8_t *pOfflineAck)
 Disable a key entry using offline cryptogram. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_EncipherKeyEntry (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bPersoKeyNo, uint8_t bKeyNo, uint8_t bOption, uint16_t wPersoCtr, uint8_t *pDivInput, uint8_t bDivInputLen, uint8_t *pOfflineCryptogram, uint8_t *pCryptogramLen)
 Is a Personalization SAM command, used to prepare a cryptogram (according to Offline change protection) for the OfflineChange key on a target SAM. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_DeriveKey (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bSrcKeyNo, uint8_t bSrcKeyVer, uint8_t bDstKeyNo, uint8_t *pDeriveIn, uint8_t bDeriveInLen)
 Is used to derive a key from a source key (in other contexts often called master key) based on a CMAC operation. More...
 
phStatus_t phhalHw_SamAV3_Cmd_SAM_GenerateMFCLicMAC (phhalHw_SamAV3_DataParams_t *pDataParams, uint8_t bOption, uint8_t bInputLen, uint8_t *pInput, uint8_t bKeyCount, uint8_t *pMFCSectorKeys, uint8_t *pMFUID, uint8_t *pMFCLicMAC)
 Is used to generate the MIFARE License key. More...
 

Sam AV3 command code for Sam Key Management feature.

#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KEY_ENTRY_INS   0xC1U
 Sam AV3 Insturction code for SAM_ChangeKeyEntry command.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_GET_KEY_ENTRY_INS   0x64U
 Sam AV3 Insturction code for SAM_GetKeyEntry command.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KUC_ENTRY_INS   0xCCU
 Sam AV3 Insturction code for SAM_ChangeKUCEntry command.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_GET_KUC_ENTRY_INS   0x6CU
 Sam AV3 Insturction code for SAM_GetKUCEntry command.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_DUMP_SESSION_KEY_INS   0xD5U
 Sam AV3 Insturction code for SAM_DumpSessionKey command.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_DUMP_SECRET_KEY_INS   0xD6U
 Sam AV3 Insturction code for SAM_DumpSecretKey command.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_DISABLE_KEY_ENTRY_INS   0xD8U
 Sam AV3 Insturction code for SAM_DisableKeyEntry command.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_ENCHIPHER_KEY_ENTRY_INS   0xE1U
 Sam AV3 Insturction code for SAM_EnchipherKeyEntry command.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_DERIVE_KEY_INS   0xD7U
 Sam AV3 Insturction code for SAM_DeriveKey command.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_GENERATE_MFC_LIC_MAC   0x7DU
 Sam AV3 Insturction code for SAM_Generate_MFCLicMAC command.
 

Option macros for Sam AV3 Key Management Cmd.SAM_ChangeKeyEntry command.

#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KEY_ENTRY_UPDATE_KEY_VA   0x80
 Option mask for updating key number and version A.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KEY_ENTRY_UPDATE_KEY_VB   0x40
 Option mask for updating key number and version B.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KEY_ENTRY_UPDATE_KEY_VC   0x20
 Option mask for updating key number and version C.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KEY_ENTRY_UPDATE_DF_AID   0x10
 Option mask for updating DESFire application identifier.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KEY_ENTRY_UPDATE_KEY_CEK   0x08
 Option mask for updating key number and version of change entry key (CEK).
 
#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KEY_ENTRY_UPDATE_REF_NO_KUC   0x04
 Option mask for updating reference key usage counter.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KEY_ENTRY_UPDATE_SET_EXTSET   0x02
 Option mask for updating SET and Extended SET.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KEY_ENTRY_INCLUDE_VERSION   0x01
 Option mask for specifying the versions in the data field after SET and ExtSET.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KUC_ENTRY_UPDATE_LIMIT   0x80
 Option mask for updating the limit.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KUC_ENTRY_UPDATE_KEY_NO_CKUC   0x40
 Option mask for updating CKUC key number.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_CHANGE_KUC_ENTRY_UPDATE_VCKUC   0x20
 Option mask for updating the VCKUC.
 

Option macros for Sam AV3 Key Management Cmd.SAM_GetKeyEntry command.

#define PHHAL_HW_SAMAV3_CMD_SAM_GET_KEY_ENTRY_KEY_ENTRY_SAM_AV2   0x00
 Option mask for enabling Sam AV2 Format as key entry format.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_GET_KEY_ENTRY_KEY_ENTRY_NEW   0x01
 Option mask for enabling New Format as key entry format.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_GET_KEY_ENTRY_RAM_KEY   0x00
 Option mask for receiving the Ram key.
 

Option macros for Sam AV3 Key Management Cmd.SAM_DumpSessionKey and Cmd.SAM_DumpSecretKey command.

#define PHHAL_HW_SAMAV3_CMD_SAM_DUMP_MODE_PLAIN   0x00
 Option mask for dumping session or seceret keys in plain.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_DUMP_MODE_ENCIPHERED   0x01
 Option mask for dumping session or seceret keys in enciphered.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_DUMP_MODE_DIVERSIFICATION_OFF   0x00
 Option mask for disabling the diversification of the provided key.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_DUMP_MODE_DIVERSIFICATION_ON   0x02
 Option mask for enabling the diversification of the provided key.
 

Option macros for Sam AV3 Key Management Cmd.SAM_EncipherKeyEntry command.

#define PHHAL_HW_SAMAV3_CMD_SAM_ENCIPHER_KEY_ENTRY_DIV_OFF   0x00
 Option mask to exclude the diversification input in command frame.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_ENCIPHER_KEY_ENTRY_DIV_ON   0x01
 Option mask to include the diversification input in command frame.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_ENCIPHER_KEY_ENTRY_SAM_UID_OFF   0x00
 Option mask to exclude the Sam UID in command frame.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_ENCIPHER_KEY_ENTRY_SAM_UID_ON   0x02
 Option mask to include the Sam UID in command frame.
 

Option macros for Sam AV3 Key Management Cmd.SAM_Generate_MFCLicMAC command.

#define PHHAL_HW_SAMAV3_CMD_SAM_GENERATE_MFC_LIC_MAC_DIV_OFF   0x00
 Option mask to exclude the diversification input in command frame.
 
#define PHHAL_HW_SAMAV3_CMD_SAM_GENERATE_MFC_LIC_MAC_DIV_ON   0x01
 Option mask to include the diversification input in command frame.
 

Detailed Description

SAM commands used for key management related configuration.

Function Documentation

◆ phhalHw_SamAV3_Cmd_SAM_ChangeKeyEntry()

phStatus_t phhalHw_SamAV3_Cmd_SAM_ChangeKeyEntry ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bKeyNo,
uint8_t  bProMas,
uint8_t pKeyData,
uint8_t  bKeyDataLen 
)

Change a symmetric key entry in the key table of the SAM.

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] Reference number of the key entry to be changed (00h to 7Fh).
[in]bProMas[In] Program mask indicating the fields that should be changed. All the below option can be combined by using bitwise OR operator.
[in]pKeyData[In] Buffer containing the key data.
[in]bKeyDataLen[In] Length of the key data buffer.

◆ phhalHw_SamAV3_Cmd_SAM_ChangeKeyEntryOffline()

phStatus_t phhalHw_SamAV3_Cmd_SAM_ChangeKeyEntryOffline ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bKeyNo,
uint8_t  bProMas,
uint16_t  wChangeCtr,
uint8_t pOfflineCrypto,
uint8_t  bOfflineCryptLen,
uint8_t  bEnableOfflineAck,
uint8_t pOfflineAck 
)

Change a Offline symmetric key entry in the key entry table of the SAM.

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] Reference number of the key entry to be changed (00h to 7Fh).
[in]bProMas[In] Program mask indicating the fields that should be changed. All the below option can be combined by using bitwise OR operator.
[in]wChangeCtr[In] Change Counter to avoid replay attacks.
[in]pOfflineCrypto[In] Offline Cryptogram returned from SAM (EncKeyEntry[80] + OfflineMAC[8])
[in]bOfflineCryptLen[In] Offline Cryptogram Length
[in]bEnableOfflineAck[In] To Enable reception of Offline Acknowledge
0x00: Disable
0x01: Enable
[out]pOfflineAck[Out] Offline Acknowledge information.

◆ phhalHw_SamAV3_Cmd_SAM_GetKeyEntry()

phStatus_t phhalHw_SamAV3_Cmd_SAM_GetKeyEntry ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bKeyNo,
uint8_t  bMode,
uint8_t pKeyEntry,
uint8_t pKeyEntryLen 
)

Get information about a key entry.

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] Reference number of the key entry to be returned (00h to 7Fh).
[in]bMode[In] Key entry format to be used.
[out]pKeyEntry[Out] Buffer containing the information about the key entry.
[out]pKeyEntryLen[Out] Amount of valid bytes in pKeyEntry.

◆ phhalHw_SamAV3_Cmd_SAM_ChangeKUCEntry()

phStatus_t phhalHw_SamAV3_Cmd_SAM_ChangeKUCEntry ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bKucNo,
uint8_t  bProMas,
uint8_t pKucData,
uint8_t  bKucDataLen 
)

Change the key usage counter (KUC).

Selection is done by its reference number.

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]bKucNo[In] Reference number of the key usage counter to be updated (00h to 0Fh).
[in]bProMas[In] Program mask indicating the fields that should be changed. All the below option can be combined by using bitwise OR operator.
[in]pKucData[In] Buffer containing the KUC data.
[in]bKucDataLen[In] Length of the KUC data.

◆ phhalHw_SamAV3_Cmd_SAM_ChangeKUCEntryOffline()

phStatus_t phhalHw_SamAV3_Cmd_SAM_ChangeKUCEntryOffline ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bKucNo,
uint8_t  bProMas,
uint16_t  wChangeCtr,
uint8_t pOfflineCrypto,
uint8_t  bOfflineCryptLen,
uint8_t  bEnableOfflineAck,
uint8_t pOfflineAck 
)

Change a Offline KUC entry in the key entry table of the SAM.

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]bKucNo[In] Reference number of the key usage counter to be updated (00h to 0Fh).
[in]bProMas[In] Program mask indicating the fields that should be changed. All the below option can be combined by using bitwise OR operator.
[in]wChangeCtr[In] Change Counter to avoid replay attacks.
[in]pOfflineCrypto[In] Offline Cryptogram returned from SAM (EncKUCEntry[16] + OfflineMAC[8])
[in]bOfflineCryptLen[In] Offline Cryptogram Length
[in]bEnableOfflineAck[In] To Enable reception of Offline Acknowledge
0x00: Disable
0x01: Enable
[out]pOfflineAck[Out] Offline Acknowledge information.

◆ phhalHw_SamAV3_Cmd_SAM_GetKUCEntry()

phStatus_t phhalHw_SamAV3_Cmd_SAM_GetKUCEntry ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bKucNo,
uint8_t pKucEntry 
)

Get information about a key usage counter (KUC).

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]bKucNo[In] Reference number of the key usage counter to be returned (00h to 0Fh).
[out]pKucEntry[Out] Buffer containing the KUC entry. This buffer has to be 10 bytes long.

◆ phhalHw_SamAV3_Cmd_SAM_DumpSessionKey()

phStatus_t phhalHw_SamAV3_Cmd_SAM_DumpSessionKey ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bDumpMode,
uint8_t pSessionKey,
uint8_t pSessionKeyLen 
)

Dump the current session key.

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]bDumpMode[In] Crypto settings.
[out]pSessionKey[Out] Buffer containig the session key.
[out]pSessionKeyLen[Out] Amount of valid bytes in session key buffer.

◆ phhalHw_SamAV3_Cmd_SAM_DumpSecretKey()

phStatus_t phhalHw_SamAV3_Cmd_SAM_DumpSecretKey ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bDumpMode,
uint8_t  bKeyNo,
uint8_t  bKeyVer,
uint8_t pDivInput,
uint8_t  bDivInputLen,
uint8_t pSecretKey,
uint8_t pSecretKeyLen 
)

Retrive a PICC key stored in the key table.

This command is only available in AV2 and AV3.

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]bDumpMode[In] Crypto settings.
[in]bKeyNo[In] Reference number of the key entry to be dumped.
[in]bKeyVer[In] Reference version of the key entry to be dumped.
[in]pDivInput[In] Diversification Input used to diversify the key.
[in]bDivInputLen[In] Length of diversification input used to diversify the key.
[out]pSecretKey[Out] Buffer containing the plain secret key.
[out]pSecretKeyLen[Out] Amount of valid bytes in secret key buffer.

◆ phhalHw_SamAV3_Cmd_SAM_DisableKeyEntry()

phStatus_t phhalHw_SamAV3_Cmd_SAM_DisableKeyEntry ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bKeyNo,
uint8_t pOfflineCrypto,
uint8_t  bCryptoLen 
)

Disable a key entry.

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] Number of the key entry to be disabled (00h to 7Fh).
[in]pOfflineCrypto[In] Buffer containing the cryptogram for offline key deactivation.
[in]bCryptoLen[In] Length of the offline cryptogram. If set to 00h no offline cryptogram is sent.

◆ phhalHw_SamAV3_Cmd_SAM_DisableKeyEntryOffline()

phStatus_t phhalHw_SamAV3_Cmd_SAM_DisableKeyEntryOffline ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bKeyNo,
uint16_t  wChangeCtr,
uint8_t pOfflineCrypto,
uint8_t  bOfflineCryptLen,
uint8_t  bEnableOfflineAck,
uint8_t pOfflineAck 
)

Disable a key entry using offline cryptogram.

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] Reference number of the key entry to be disabled (00h to 7Fh).
[in]wChangeCtr[In] Change Counter to avoid replay attacks.
[in]pOfflineCrypto[In] Offline Cryptogram returned from SAM (EncGoldField[16] + OfflineMAC[8])
[in]bOfflineCryptLen[In] Offline Cryptogram Length
[in]bEnableOfflineAck[In] To Enable reception of Offline Acknowledge
0x00: Disable
0x01: Enable
[out]pOfflineAck[Out] Offline Acknowledge information.

◆ phhalHw_SamAV3_Cmd_SAM_EncipherKeyEntry()

phStatus_t phhalHw_SamAV3_Cmd_SAM_EncipherKeyEntry ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bPersoKeyNo,
uint8_t  bKeyNo,
uint8_t  bOption,
uint16_t  wPersoCtr,
uint8_t pDivInput,
uint8_t  bDivInputLen,
uint8_t pOfflineCryptogram,
uint8_t pCryptogramLen 
)

Is a Personalization SAM command, used to prepare a cryptogram (according to Offline change protection) for the OfflineChange key on a target SAM.

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]bPersoKeyNo[In] Reference number of the key entry with Perso enabled.
[in]bKeyNo[In] Reference number of the key entry to be encrypted.
[in]bOption[In] Option to include Key diversification and SAM UID in command.
[in]wPersoCtr[In] Change Counter to avoid replay attacks
[in]pDivInput[In] Diversification Input used to diversify the key.
[in]bDivInputLen[In] Length of diversification input used to diversify the key.
[out]pOfflineCryptogram[Out] Offline Cryptogram returned from SAM (EncKeyEntry[80] + OfflineMAC[8])
[out]pCryptogramLen[Out] Offline Cryptogram Length

◆ phhalHw_SamAV3_Cmd_SAM_DeriveKey()

phStatus_t phhalHw_SamAV3_Cmd_SAM_DeriveKey ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bSrcKeyNo,
uint8_t  bSrcKeyVer,
uint8_t  bDstKeyNo,
uint8_t pDeriveIn,
uint8_t  bDeriveInLen 
)

Is used to derive a key from a source key (in other contexts often called master key) based on a CMAC operation.

In a MIFARE context, this command can be used to support session key generations for the Transaction MAC and Secure Dynamic Messaging features, for backend (and / or reader) interpretation and validation of the cryptograms created by the PICC.

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]bSrcKeyNo[In] Reference key number of the key entry (00h to 7Fh).
[in]bSrcKeyVer[In] Reference key version of the key entry (00h to FFh).
[in]bDstKeyNo[In] Reference key number of the ram key entry (E0h to E3h).
[in]pDeriveIn[In] The derivation input for deriving the key.
[in]bDeriveInLen[In] Length of derivation input used to derive the key.

◆ phhalHw_SamAV3_Cmd_SAM_GenerateMFCLicMAC()

phStatus_t phhalHw_SamAV3_Cmd_SAM_GenerateMFCLicMAC ( phhalHw_SamAV3_DataParams_t pDataParams,
uint8_t  bOption,
uint8_t  bInputLen,
uint8_t pInput,
uint8_t  bKeyCount,
uint8_t pMFCSectorKeys,
uint8_t pMFUID,
uint8_t pMFCLicMAC 
)

Is used to generate the MIFARE License key.

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] One of the below values.
  • PHHAL_HW_SAMAV3_CMD_SAM_GENERATE_MFC_LIC_MAC_DIV_OFF
  • PHHAL_HW_SAMAV3_CMD_SAM_GENERATE_MFC_LIC_MAC_DIV_ON
[in]bInputLen[In] The length of bytes available in Input buffer.
[in]pInput[In] Length N of the input data for the MAC computation.
[in]bKeyCount[In] Length of bytes available in MFCSectorKeys buffer.
[in]pMFCSectorKeys[In] Length N of the input data for the MAC computation.
[in]pMFUID[In] MIFARE standard UID. Here the last four bytes of the UID should be passed regardless of 4 or 7 byte UID. This is an optional parameter, so can be NULL.
[out]pMFCLicMAC[Out] Generated MIFARE Classic License MAC information.