]>
Commit | Line | Data |
---|---|---|
bd20f8f4 | 1 | //----------------------------------------------------------------------------- |
d19929cb | 2 | // (c) 2012 Roel Verdult |
bd20f8f4 | 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 | //----------------------------------------------------------------------------- | |
d19929cb | 8 | // Hitag2 type prototyping |
bd20f8f4 | 9 | //----------------------------------------------------------------------------- |
0db11b71 | 10 | // HitagS added |
11 | //----------------------------------------------------------------------------- | |
2e68bd40 | 12 | |
d19929cb | 13 | #ifndef _HITAG2_H_ |
14 | #define _HITAG2_H_ | |
e30c654b | 15 | |
d19929cb | 16 | typedef enum { |
0db11b71 | 17 | RHTSF_CHALLENGE = 01, |
18 | RHTSF_KEY = 02, | |
19 | WHTSF_CHALLENGE = 03, | |
20 | WHTSF_KEY = 04, | |
bde10a50 | 21 | RHT2F_PASSWORD = 21, |
22 | RHT2F_AUTHENTICATE = 22, | |
f71f4deb | 23 | RHT2F_CRYPTO = 23, |
24 | RHT2F_TEST_AUTH_ATTEMPTS = 25, | |
69784c38 | 25 | RHT2F_UID_ONLY = 26 |
d19929cb | 26 | } hitag_function; |
2e68bd40 | 27 | |
d19929cb | 28 | typedef struct { |
29 | byte_t password[4]; | |
30 | } PACKED rht2d_password; | |
31 | ||
32 | typedef struct { | |
33 | byte_t NrAr[8]; | |
0db11b71 | 34 | byte_t data[4]; |
d19929cb | 35 | } PACKED rht2d_authenticate; |
36 | ||
bde10a50 | 37 | typedef struct { |
0db11b71 | 38 | byte_t key[6]; |
39 | byte_t data[4]; | |
bde10a50 | 40 | } PACKED rht2d_crypto; |
41 | ||
d19929cb | 42 | typedef union { |
43 | rht2d_password pwd; | |
44 | rht2d_authenticate auth; | |
f71f4deb | 45 | rht2d_crypto crypto; |
d19929cb | 46 | } hitag_data; |
e30c654b | 47 | |
48 | #endif |