projects
/
proxmark3-svn
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
CHG: minor textual change to fit the minimum two calls nature for the zero parity...
[proxmark3-svn]
/
armsrc
/
desfire_crypto.c
diff --git
a/armsrc/desfire_crypto.c
b/armsrc/desfire_crypto.c
index 469a8ec46761a807978d376066269840a586a150..e7eceb3ccf59f89ac70157ddfcdb6aa3f1f3ee09 100644
(file)
--- a/
armsrc/desfire_crypto.c
+++ b/
armsrc/desfire_crypto.c
@@
-161,7
+161,7
@@
size_t enciphered_data_length (const desfiretag_t tag, const size_t nbytes, int
return padded_data_length (nbytes + crc_length, block_size);
}
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;
uint8_t *res = data;
uint8_t mac[4];
size_t edl;
@@
-226,8
+226,8
@@
void* mifare_cryto_preprocess_data (desfiretag_t tag, void *data, size_t *nbytes
cmac (key, DESFIRE (tag)->ivect, res, *nbytes, DESFIRE (tag)->cmac);
if (append_mac) {
cmac (key, DESFIRE (tag)->ivect, res, *nbytes, DESFIRE (tag)->cmac);
if (append_mac) {
- maced_data_length (key, *nbytes);
-
+
size_t len =
maced_data_length (key, *nbytes);
+ ++len;
memcpy (res, data, *nbytes);
memcpy (res + *nbytes, DESFIRE (tag)->cmac, CMAC_LENGTH);
*nbytes += CMAC_LENGTH;
memcpy (res, data, *nbytes);
memcpy (res + *nbytes, DESFIRE (tag)->cmac, CMAC_LENGTH);
*nbytes += CMAC_LENGTH;
@@
-289,7
+289,7
@@
void* mifare_cryto_preprocess_data (desfiretag_t tag, void *data, size_t *nbytes
}
}
-void* mifare_cryto_postprocess_data (desfiretag_t tag, void *data, s
s
ize_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;
{
void *res = data;
size_t edl;
@@
-580,7
+580,7
@@
void mifare_cypher_single_block (desfirekey_t key, uint8_t *data, uint8_t *ivect
{
AesCtx ctx;
AesCtxIni(&ctx, ivect, key->data, KEY128,CBC);
{
AesCtx ctx;
AesCtxIni(&ctx, ivect, key->data, KEY128,CBC);
- AesEncrypt(&ctx, data, edata, sizeof(data) );
+ AesEncrypt(&ctx, data, edata, sizeof(
e
data) );
break;
}
case MCO_DECYPHER:
break;
}
case MCO_DECYPHER:
Impressum
,
Datenschutz