Plus,
Following is the code we write for 3KDES (this doesn't work):
case KEY_TYPE_3KDES:
{
Is_Gigatms_Mdf_Setkey(g_tRegisters.s2.DF.bKey ,PH_KEYSTORE_KEY_TYPE_3K3DES ,STORE_KEYNUM_3K3DES);
status = phalMfdf_AuthenticateISO(psalMFDF, PHAL_MFDF_NO_DIVERSIFICATION, STORE_KEYNUM_3K3DES, 0, 0, NULL, 0);
break;
}
But following code for DES is working:
case KEY_TYPE_DES:
{
Is_Gigatms_Mdf_Setkey(g_tRegisters.s2.DF.bKey ,PH_KEYSTORE_KEY_TYPE_DES ,STORE_KEYNUM_DES);
status = phalMfdf_AuthenticateISO(psalMFDF, PHAL_MFDF_NO_DIVERSIFICATION, STORE_KEYNUM_DES, 0, 0, NULL, 0);
break;
}
Following code is to used to set key:
bool Is_Gigatms_Mdf_Setkey(uint8_t *pKey, uint8_t bKeyType, uint8_t bKeyName)
{
status = phKeyStore_FormatKeyEntry(psKeyStore, bKeyName, bKeyType);
if ((status & PH_ERR_MASK) != PH_ERR_SUCCESS)
return FALSE;
/* Set Key Store */
status = phKeyStore_SetKey(psKeyStore, bKeyName, 0, bKeyType, pKey, 0);
if ((status & PH_ERR_MASK) != PH_ERR_SUCCESS)
return FALSE;
return TRUE;
}