|
NXP Reader Library
v17.1.0.2535
|
|
Example code to configure HAL and BAL for Pegoda 2 (RD710) reader with SAM AV2 in X mode.
More...
Example code to configure HAL and BAL for Pegoda 2 (RD710) reader with SAM AV2 in X mode.
#define CHECK_SUCCESS(x) \
if ( (x) != PH_ERR_SUCCESS ) \
{ \
printf ( "\n\n" ); \
printf ( "An error occurred: (0x%04X)\n", (x) ); \
printf ( "Pressing any key will exit the demo.\n" ); \
_getch (); \
return 0; \
}
uint8_t aHostAuthKey[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
void* pBal_Generic = NULL;
void* pHal_Generic = NULL;
aKeyUsageCounter, 0xFF );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
memset ( aSeed, 0x00, 0x08 );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
aRx_SamBuffer, sizeof ( aRx_SamBuffer ) );
CHECK_SUCCESS ( wStatus );
pBal_Generic = &stBal_Rd710;
pHal_Generic = &stHal_SamAv2;
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
CHECK_SUCCESS ( wStatus );
PCSC (Windows) BAL parameter structure.
Definition: phbalReg.h:600
phStatus_t phKeyStore_Sw_Init(phKeyStore_Sw_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, phKeyStore_Sw_KeyEntry_t *pKeyEntries, uint16_t wNoOfKeyEntries, phKeyStore_Sw_KeyVersionPair_t *pKeyVersionPairs, uint16_t wNoOfVersionPairs, phKeyStore_Sw_KUCEntry_t *pKUCEntries, uint16_t wNoOfKUCEntries)
Initializes the KeyStore component as software component.
phStatus_t phCryptoSym_Sw_Init(phCryptoSym_Sw_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, void *pKeyStoreDataParams)
Initialize the CryptoSym with Software as sub-component.
Sam parameter structure.
Definition: phKeyStore.h:299
Software KeyEntry structure.
Definition: phKeyStore.h:66
Software parameter structure.
Definition: phKeyStore.h:82
phStatus_t phKeyStore_SetKeyAtPos(void *pDataParams, uint16_t wKeyNo, uint16_t wPos, uint16_t wKeyType, uint8_t *pNewKey, uint16_t wNewKeyVersion)
Change a symmetric key entry at the specified position.
Software KeyVersionPair structure for Symmetric and ASymmetric keys.
Definition: phKeyStore.h:51
uint16_t phStatus_t
phcsBfl_Status_t is a signed short value, using the positive range.
Definition: ph_TypeDefs.h:158
#define PH_KEYSTORE_KEY_TYPE_AES128
AES 128 Key [16].
Definition: phKeyStore.h:1067
phStatus_t phCryptoRng_Sw_Init(phCryptoRng_Sw_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, void *pCryptoDataParams)
Initialize the CryptoRng with software as sub-component.
phStatus_t phhalHw_SamAV2_Cmd_RC_Init(phhalHw_SamAV2_DataParams_t *pDataParams, uint8_t bLoadReg)
Initialize the RC522 with a given register value set.
phStatus_t phKeyStore_SamAV2_Init(phKeyStore_SamAV2_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, phhalHw_SamAV2_DataParams_t *pHalDataParams)
Initializes the KeyStore component as SAM AV2 component.
Data structure for Symmetric Crypto Software layer implementation.
Definition: phCryptoSym.h:435
phStatus_t phbalReg_SetPort(void *pDataParams, uint8_t *pPortName)
Select Port to be used.
Software KeyUsageCounter structure.
Definition: phKeyStore.h:75
phStatus_t phhalHw_SamAV2_DetectMode(phhalHw_SamAV2_DataParams_t *pDataParams)
Detect UID, AV1/AV2 mode and HostAuth settings.
Data structure for Random Number's Software layer implementation.
Definition: phCryptoRng.h:52
phStatus_t phCryptoRng_Seed(void *pDataParams, uint8_t *pSeed, uint8_t bSeedLength)
Seeds the random number generator with the given seed.
phStatus_t phbalReg_OpenPort(void *pDataParams)
Open communication port.
#define PHHAL_HW_SAMAV2_OPMODE_X_RC523
X-Mode operation (using Rc523).
Definition: phhalHw.h:259
phStatus_t phbalReg_PcscWin_Init(phbalReg_PcscWin_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, uint8_t *pAtrBuffer, uint16_t wAtrBufSize)
Initialise the PCSC BAL component.
phStatus_t phhalHw_SamAV2_Cmd_SAM_AuthenticateHost(phhalHw_SamAV2_DataParams_t *pDataParams, uint8_t bAuthType_HostMode, uint16_t wRdKeyNo, uint16_t wRdKeyV, uint8_t bSamKeyNo, uint8_t bSamKeyV, uint8_t *pDivInput, uint8_t bDivInputLength)
Mutual 2-pass-AV1 or 3-pass-AV2 authentication between Host and SAM.
phStatus_t phhalHw_SamAV2_Init(phhalHw_SamAV2_DataParams_t *pDataParams, uint16_t wSizeOfDataParams, void *pBalDataParams, void *pReaderHalDataParams, void *pKeyStoreDataParams, void *pCryptoENCDataParams, void *pCryptoMACDataParams, void *pCryptoRngDataParams, uint8_t bOpMode, uint8_t bLogicalChannel, uint8_t *pTxBuffer, uint16_t wTxBufSize, uint8_t *pRxBuffer, uint16_t wRxBufSize)
Initialise the HAL component.
unsigned char uint8_t
8 bit unsigned integer
Definition: ph_TypeDefs.h:56
SamAV2 HAL parameter structure.
Definition: phhalHw.h:293
phStatus_t phKeyStore_FormatKeyEntry(void *pDataParams, uint16_t wKeyNo, uint16_t wNewKeyType)
Format a key entry to a new KeyType.