cppchecker shadow

This commit is contained in:
iceman1001 2021-02-24 14:17:23 +01:00
parent 9395f8c8ac
commit bb6ea597b4

View file

@ -242,7 +242,6 @@ void Desfire_session_key_new(const uint8_t rnda[], const uint8_t rndb[], desfire
}
}
static void xor(const uint8_t *ivect, uint8_t *data, const size_t len);
static size_t key_macing_length(desfirekey_t key);
// iceman, see memxor inside string.c, dest/src swapped..
@ -264,20 +263,20 @@ void cmac_generate_subkeys(desfirekey_t key) {
mifare_cypher_blocks_chained(NULL, key, ivect, l, kbs, MCD_RECEIVE, MCO_ENCYPHER);
bool xor = false;
bool txor = false;
// Used to compute CMAC on complete blocks
memcpy(key->cmac_sk1, l, kbs);
xor = l[0] & 0x80;
txor = l[0] & 0x80;
lsl(key->cmac_sk1, kbs);
if (xor)
if (txor)
key->cmac_sk1[kbs - 1] ^= R;
// Used to compute CMAC on the last block if non-complete
memcpy(key->cmac_sk2, key->cmac_sk1, kbs);
xor = key->cmac_sk1[0] & 0x80;
txor = key->cmac_sk1[0] & 0x80;
lsl(key->cmac_sk2, kbs);
if (xor)
if (txor)
key->cmac_sk2[kbs - 1] ^= R;
}