Merge pull request #1331 from Guilhem7/master
[RRG-proxmark3.git] / armsrc / mifaresim.h
blobd8c15aee2a5f1f41319c59b96080b35b9aaf6b82
1 //-----------------------------------------------------------------------------
2 // Merlok - June 2011, 2012
3 // Gerhard de Koning Gans - May 2008
4 // Hagen Fritsch - June 2010
5 //
6 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
7 // at your option, any later version. See the LICENSE.txt file for the text of
8 // the license.
9 //-----------------------------------------------------------------------------
10 // Mifare Classic Card Simulation
11 //-----------------------------------------------------------------------------
13 #ifndef __MIFARESIM_H
14 #define __MIFARESIM_H
16 #include "common.h"
18 #ifndef CheckCrc14A
19 # define CheckCrc14A(data, len) check_crc(CRC_14443_A, (data), (len))
20 #endif
22 #define AC_DATA_READ 0
23 #define AC_DATA_WRITE 1
24 #define AC_DATA_INC 2
25 #define AC_DATA_DEC_TRANS_REST 3
26 #define AC_KEYA_READ 0
27 #define AC_KEYA_WRITE 1
28 #define AC_KEYB_READ 2
29 #define AC_KEYB_WRITE 3
30 #define AC_AC_READ 4
31 #define AC_AC_WRITE 5
33 #define AUTHKEYA 0
34 #define AUTHKEYB 1
35 #define AUTHKEYNONE 0xff
37 void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *datain, uint16_t atqa, uint8_t sak);
39 #endif