style define
[RRG-proxmark3.git] / armsrc / mifaresim.h
blobb22659df6761a1f8607fa31126bb5d37010de579
1 //-----------------------------------------------------------------------------
2 // Copyright (C) Gerhard de Koning Gans - May 2008
3 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // See LICENSE.txt for the text of the license.
16 //-----------------------------------------------------------------------------
17 // Mifare Classic Card Simulation
18 //-----------------------------------------------------------------------------
20 #ifndef __MIFARESIM_H
21 #define __MIFARESIM_H
23 #include "common.h"
25 #ifndef CheckCrc14A
26 # define CheckCrc14A(data, len) check_crc(CRC_14443_A, (data), (len))
27 #endif
29 #define AC_DATA_READ 0
30 #define AC_DATA_WRITE 1
31 #define AC_DATA_INC 2
32 #define AC_DATA_DEC_TRANS_REST 3
33 #define AC_KEYA_READ 0
34 #define AC_KEYA_WRITE 1
35 #define AC_KEYB_READ 2
36 #define AC_KEYB_WRITE 3
37 #define AC_AC_READ 4
38 #define AC_AC_WRITE 5
40 #define AUTHKEYA 0
41 #define AUTHKEYB 1
42 #define AUTHKEYNONE 0xff
44 void Mifare1ksim(uint16_t flags, uint8_t exitAfterNReads, uint8_t *datain, uint16_t atqa, uint8_t sak);
46 #endif