NXP Reader Library  v17.1.0.2535

SAM commands used for MIFARE DESFire PICC communication in X and S Mode. More...

Collaboration diagram for MIFARE DESFire:

Modules

 S Mode
 SAM commands used for MIFARE DESFire communication in S-Mode.
 
 X Mode
 SAM commands used for MIFARE DESFire communication in X-Mode.
 

Option macros for SAM AV3 Cmd.SAM_AuthenticatePICC, Cmd.SAM_IsoAuthenticatePICC, Cmd.DESFIRE_AuthenticatePICC command.

#define PHHAL_HW_CMD_SAMAV3_AUTH_MODE_D40_EV1   0x00
 Sam DESFire Authentication mode as D40 and EV1.
 
#define PHHAL_HW_CMD_SAMAV3_AUTH_MODE_EV2_FIRST_AUTH   0x80
 Sam DESFire Authentication mode as EV2 First.
 
#define PHHAL_HW_CMD_SAMAV3_AUTH_MODE_EV2_NON_FIRST_AUTH   0xC0
 Sam DESFire Authentication mode as EV2 Non First.
 
#define PHHAL_HW_CMD_SAMAV3_ALLOW_SECURE_MESSAGING   0x00
 Sam DESFire Allow Secure Messaging.
 
#define PHHAL_HW_CMD_SAMAV3_SUPPRESS_SECURE_MESSAGING   0x20
 Sam DESFire Supress Secure Messaging. More...
 
#define PHHAL_HW_CMD_SAMAV3_KDF_AV1   0x00
 Sam DESFire key derivation type as AV1.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_AV1_DOUBLE_ENCRYPTION   0x00
 Sam DESFire key derivation type as AV1 double encryption round.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_AV1_SINGLE_ENCRYPTION   0x08
 Sam DESFire key derivation type as AV1 single encryption round.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_AV2   0x10
 Sam DESFire key derivation type as AV2.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_RFU   0x18
 Sam DESFire key derivation type as RFU.
 
#define PHHAL_HW_CMD_SAMAV3_KEY_SELECTION_KEY_ENTRY_NUMBER   0x00
 Sam DESFire key selection by key entry number.
 
#define PHHAL_HW_CMD_SAMAV3_KEY_SELECTION_DESFIRE_KEY_NUMBER   0x02
 Sam DESFire key selection by DESFIRE key number.
 
#define PHHAL_HW_CMD_SAMAV3_KEY_DIVERSIFICATION_OFF   0x00
 Sam DESFire key derivation disabled.
 
#define PHHAL_HW_CMD_SAMAV3_KEY_DIVERSIFICATION_ON   0x01
 Sam DESFire key derivation enabled.
 

Option macros for Key to be used for when EV2 Authentication is selected.

#define PHHAL_HW_CMD_SAMAV3_AUTH_MODE_NONE   0x00
 Sam DESFire Auth mode as D40, EV1.
 
#define PHHAL_HW_CMD_SAMAV3_AUTH_MODE_EV2   0x00
 Sam DESFire Auth mode as EV2.
 
#define PHHAL_HW_CMD_SAMAV3_AUTH_MODE_LRP   0x01
 Sam DESFire Auth mode as LRP.
 

Option macros for ISO mode selection.

#define PHHAL_HW_CMD_SAMAV3_ISO_MODE_NATIVE   0x00
 Sam DESFire ISO mode selection for Native command set.
 
#define PHHAL_HW_CMD_SAMAV3_ISO_MODE_ISO7816   0x40
 Sam DESFire ISO mode selection for ISO 7816-4 command set.
 
#define PHHAL_HW_CMD_SAMAV3_ISO_MODE_ISO_AUTHENTICATION   0x80
 Sam DESFire ISO mode selection for Iso complaint Authentication.
 
#define PHHAL_HW_CMD_SAMAV3_TMRI_ISO_MODE_NATIVE   0x00
 Sam CommitReaderID ISO mode selection for Native command set.
 
#define PHHAL_HW_CMD_SAMAV3_TMRI_ISO_MODE_ISO7816   0x40
 Sam CommitReaderID ISO mode selection for ISO 7816-4 command set.
 

Option macros for SAM AV3 Cmd.SAM_ChangeKey command

#define PHHAL_HW_CMD_SAMAV3_DIV_METHOD_AV1   0x00
 Sam DESFire diversification method as AV1.
 
#define PHHAL_HW_CMD_SAMAV3_DIV_METHOD_AV2   0x20
 Sam DESFire diversification method as AV2.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_SAMAV2_RFU   0x00
 Sam DESFire diversification method as RFU if its SAM AV2.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_CURRENT_KEY_DOUBLE_ENCRYPTION   0x00
 Sam DESFire diversification method of current key for AV1 as double encryption.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_CURRENT_KEY_SINGLE_ENCRYPTION   0x10
 Sam DESFire diversification method of current key for AV1 as single encryption.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_NEW_KEY_DOUBLE_ENCRYPTION   0x00
 Sam DESFire diversification method of new key for AV1 as double encryption.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_NEW_KEY_SINGLE_ENCRYPTION   0x08
 Sam DESFire diversification method of new key for AV1 as single encryption.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_CURRENT_KEY_OFF   0x00
 Sam DESFire diversification usage for current key is disabled.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_CURRENT_KEY_ON   0x04
 Sam DESFire diversification usage for current key is enabled.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_NEW_KEY_OFF   0x00
 Sam DESFire diversification usage for new key is disabled.
 
#define PHHAL_HW_CMD_SAMAV3_KDF_NEW_KEY_ON   0x02
 Sam DESFire diversification usage for new key is enabled.
 
#define PHHAL_HW_CMD_SAMAV3_CRYPTO_MODE_DIFFERENT_KEY   0x00
 Sam DESFire crypto computation mode are different for target and auth keys.
 
#define PHHAL_HW_CMD_SAMAV3_CRYPTO_MODE_SAME_KEY   0x01
 Sam DESFire crypto computation mode are same for target and auth keys.
 
#define PHHAL_HW_CMD_SAMAV3_CMD_TYPE_CHANGE_KEY   0x00
 Sam DESFire Change Key command type as Change Key.
 
#define PHHAL_HW_CMD_SAMAV3_CMD_TYPE_CHANGE_KEY_EV2   0x20
 Sam DESFire Change Key command type as Change Key EV2.
 
#define PHHAL_HW_CMD_SAMAV3_MASTER_KEY_UPDATE_EXCLUDE_KEYTYPE   0x00
 Sam DESFire PICC Master key update to exclude key type in cryptogram.
 
#define PHHAL_HW_CMD_SAMAV3_MASTER_KEY_UPDATE_INCLUDE_KEYTYPE   0x10
 Sam DESFire PICC Master key update to include key type in cryptogram. More...
 

Option for Cmd.DESFire_CreateTMFilePICC command.

#define PHHAL_HW_CMD_SAMAV3_CREATE_TM_FILE_COMM_MODE_PLAIN   0x00
 Sam DESFire communication mode as Plain.
 
#define PHHAL_HW_CMD_SAMAV3_CREATE_TM_FILE_COMM_MODE_MAC   0x01
 Sam DESFire communication mode as MAC.
 
#define PHHAL_HW_CMD_SAMAV3_CREATE_TM_FILE_COMM_MODE_FULL   0x03
 Sam DESFire communication mode as Full.
 
#define PHHAL_HW_CMD_SAMAV3_CREATE_TM_FILE_AES_KEY   0x02
 Sam DESFire TMKeyOption as AES.
 

Detailed Description

SAM commands used for MIFARE DESFire PICC communication in X and S Mode.

Macro Definition Documentation

◆ PHHAL_HW_CMD_SAMAV3_SUPPRESS_SECURE_MESSAGING

#define PHHAL_HW_CMD_SAMAV3_SUPPRESS_SECURE_MESSAGING   0x20

Sam DESFire Supress Secure Messaging.

To be used if originality keys are used.

◆ PHHAL_HW_CMD_SAMAV3_MASTER_KEY_UPDATE_INCLUDE_KEYTYPE

#define PHHAL_HW_CMD_SAMAV3_MASTER_KEY_UPDATE_INCLUDE_KEYTYPE   0x10

Sam DESFire PICC Master key update to include key type in cryptogram.

This byte will be right shifted 2 time to update the bit 4.