]> git.zerfleddert.de Git - proxmark3-svn/blob - include/hitag2.h
coverity scan bug fixes
[proxmark3-svn] / include / hitag2.h
1 //-----------------------------------------------------------------------------
2 // (c) 2012 Roel Verdult
3 //
4 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
5 // at your option, any later version. See the LICENSE.txt file for the text of
6 // the license.
7 //-----------------------------------------------------------------------------
8 // Hitag2 type prototyping
9 //-----------------------------------------------------------------------------
10 // HitagS added
11 //-----------------------------------------------------------------------------
12
13 #ifndef _HITAG2_H_
14 #define _HITAG2_H_
15
16 #ifdef _MSC_VER
17 #define PACKED
18 #else
19 #define PACKED __attribute__((packed))
20 #endif
21
22 typedef enum {
23 RHTSF_CHALLENGE = 01,
24 RHTSF_KEY = 02,
25 WHTSF_CHALLENGE = 03,
26 WHTSF_KEY = 04,
27 RHT2F_PASSWORD = 21,
28 RHT2F_AUTHENTICATE = 22,
29 RHT2F_CRYPTO = 23,
30 RHT2F_TEST_AUTH_ATTEMPTS = 25,
31 RHT2F_UID_ONLY = 26
32 } hitag_function;
33
34 typedef struct {
35 byte_t password[4];
36 } PACKED rht2d_password;
37
38 typedef struct {
39 byte_t NrAr[8];
40 byte_t data[4];
41 } PACKED rht2d_authenticate;
42
43 typedef struct {
44 byte_t key[6];
45 byte_t data[4];
46 } PACKED rht2d_crypto;
47
48 typedef union {
49 rht2d_password pwd;
50 rht2d_authenticate auth;
51 rht2d_crypto crypto;
52 } hitag_data;
53
54 #endif
Impressum, Datenschutz