size_t key_block_size (const desfirekey_t key) {
size_t block_size = 8;
-
switch (key->type) {
case T_DES:
case T_3DES:
block_size = 16;
break;
}
-
return block_size;
}
*/
static size_t key_macing_length (const desfirekey_t key) {
size_t mac_length = MAC_LENGTH;
-
switch (key->type) {
case T_DES:
case T_3DES:
mac_length = CMAC_LENGTH;
break;
}
-
return mac_length;
}
return padded_data_length (nbytes + crc_length, block_size);
}
-void* mifare_cryto_preprocess_data (desfiretag_t tag, void *data, size_t *nbytes, off_t offset, int communication_settings) {
+void* mifare_cryto_preprocess_data (desfiretag_t tag, void *data, size_t *nbytes, size_t offset, int communication_settings) {
uint8_t *res = data;
uint8_t mac[4];
size_t edl;
}
-void* mifare_cryto_postprocess_data (desfiretag_t tag, void *data, ssize_t *nbytes, int communication_settings)
+void* mifare_cryto_postprocess_data (desfiretag_t tag, void *data, size_t *nbytes, int communication_settings)
{
void *res = data;
size_t edl;
break;
case AS_NEW:
end_crc_pos = crc_pos + 4;
- crc32 (res, end_crc_pos, (uint8_t *)&crc);
+ crc32_ex (res, end_crc_pos, (uint8_t *)&crc);
break;
}
if (!crc) {
{
AesCtx ctx;
AesCtxIni(&ctx, ivect, key->data, KEY128,CBC);
- AesEncrypt(&ctx, data, edata, sizeof(data) );
+ AesEncrypt(&ctx, data, edata, sizeof(edata) );
break;
}
case MCO_DECYPHER: