\r
/// 3des2k\r
\r
- mbedtls_des3_context ctx = { 0x00 };\r
+ mbedtls_des3_context ctx = { {0} };\r
uint8_t random_a[8] = {1,1,1,1,1,1,1,1};\r
uint8_t random_b[8] = {0x00};\r
uint8_t enc_random_b[8] = {0x00};\r
fseek(f, 0, SEEK_SET);
uint8_t enc_dump[8] = {0};
uint8_t *decrypted = malloc(fsize);
- mbedtls_des3_context ctx = { 0 };
+ mbedtls_des3_context ctx = { {0} };
mbedtls_des3_set2key_dec( &ctx, key);
size_t bytes_read = fread(enc_dump, 1, 8, f);
uint8_t encryptedData[16];
uint8_t *encrypted = encryptedData;
- mbedtls_des3_context ctx = { 0 };
+ mbedtls_des3_context ctx = { {0} };
mbedtls_des3_set2key_enc( &ctx, key);
mbedtls_des3_crypt_ecb(&ctx, blkData,encrypted);
mix[6] = block ^ uid[2];
mix[7] = uid[3];
- mbedtls_des3_context ctx = { 0x00 };
+ mbedtls_des3_context ctx = { {0} };
mbedtls_des3_set2key_enc(&ctx, masterkey);
mbedtls_des3_crypt_cbc(&ctx // des3_context
return;
}
-static mbedtls_des_context ctx_enc = {0};
-static mbedtls_des_context ctx_dec = {0};
+static mbedtls_des_context ctx_enc = { {0} };
+static mbedtls_des_context ctx_dec = { {0} };
void desdecrypt_iclass(uint8_t *iclass_key, uint8_t *input, uint8_t *output)
{
*/
int calculateMasterKey(uint8_t first16bytes[], uint64_t master_key[] )
{
- mbedtls_des_context ctx_e = {0};
+ mbedtls_des_context ctx_e = { {0} };
uint8_t z_0[8] = {0};
uint8_t y_0[8] = {0};
uint8_t pi[35] = {0x0F,0x17,0x1B,0x1D,0x1E,0x27,0x2B,0x2D,0x2E,0x33,0x35,0x39,0x36,0x3A,0x3C,0x47,0x4B,0x4D,0x4E,0x53,0x55,0x56,0x59,0x5A,0x5C,0x63,0x65,0x66,0x69,0x6A,0x6C,0x71,0x72,0x74,0x78};
-static mbedtls_des_context ctx_enc = {0};
-static mbedtls_des_context ctx_dec = {0};
+static mbedtls_des_context ctx_enc = { {0} };
+static mbedtls_des_context ctx_dec = { {0} };
static int debug_print = 0;