mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2024-09-20 23:36:31 +08:00
readermac
This commit is contained in:
parent
85fd28eb2c
commit
339e598039
|
@ -267,14 +267,18 @@ void opt_doReaderMAC(uint8_t *cc_nr_p, uint8_t *div_key_p, uint8_t mac[4]) {
|
|||
memcpy(mac, dest, 4);
|
||||
}
|
||||
|
||||
void opt_doReaderMAC_2(State _init, uint8_t *nr, uint8_t mac[4], const uint8_t *div_key_p) {
|
||||
opt_suc(div_key_p, &_init, nr, 4, false);
|
||||
opt_output(div_key_p, &_init, mac);
|
||||
}
|
||||
|
||||
|
||||
void doMAC_N(uint8_t *in_p, uint8_t in_size, uint8_t *div_key_p, uint8_t mac[4]) {
|
||||
uint8_t dest [] = {0, 0, 0, 0, 0, 0, 0, 0};
|
||||
opt_MAC_N(div_key_p, in_p, in_size, dest);
|
||||
memcpy(mac, dest, 4);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void opt_doTagMAC(uint8_t *cc_p, const uint8_t *div_key_p, uint8_t mac[4]) {
|
||||
State _init = {
|
||||
((div_key_p[0] ^ 0x4c) + 0xEC) & 0xFF,// l
|
||||
|
|
|
@ -21,6 +21,9 @@ typedef struct {
|
|||
/** The reader MAC is MAC(key, CC * NR )
|
||||
**/
|
||||
void opt_doReaderMAC(uint8_t *cc_nr_p, uint8_t *div_key_p, uint8_t mac[4]);
|
||||
|
||||
void opt_doReaderMAC_2(State _init, uint8_t *nr, uint8_t mac[4], const uint8_t *div_key_p);
|
||||
|
||||
/**
|
||||
* The tag MAC is MAC(key, CC * NR * 32x0))
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue