]> git.zerfleddert.de Git - proxmark3-svn/blame - include/hitag2.h
re-organize lfdemod.c
[proxmark3-svn] / include / hitag2.h
CommitLineData
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//-----------------------------------------------------------------------------
4e12287d
RS
10// HitagS added
11//-----------------------------------------------------------------------------
2e68bd40 12
d19929cb 13#ifndef _HITAG2_H_
14#define _HITAG2_H_
e30c654b 15
b8e461ff 16#ifdef _MSC_VER
17#define PACKED
18#else
19#define PACKED __attribute__((packed))
20#endif
21
d19929cb 22typedef enum {
f86d6b55 23 RHTSF_CHALLENGE = 01,
24 RHTSF_KEY = 02,
4e12287d
RS
25 WHTSF_CHALLENGE = 03,
26 WHTSF_KEY = 04,
bde10a50 27 RHT2F_PASSWORD = 21,
28 RHT2F_AUTHENTICATE = 22,
f71f4deb 29 RHT2F_CRYPTO = 23,
30 RHT2F_TEST_AUTH_ATTEMPTS = 25,
f86d6b55 31 RHT2F_UID_ONLY = 26
d19929cb 32} hitag_function;
2e68bd40 33
d19929cb 34typedef struct {
35 byte_t password[4];
36} PACKED rht2d_password;
37
38typedef struct {
39 byte_t NrAr[8];
4e12287d 40 byte_t data[4];
d19929cb 41} PACKED rht2d_authenticate;
42
bde10a50 43typedef struct {
4e12287d
RS
44 byte_t key[6];
45 byte_t data[4];
bde10a50 46} PACKED rht2d_crypto;
47
d19929cb 48typedef union {
49 rht2d_password pwd;
50 rht2d_authenticate auth;
f71f4deb 51 rht2d_crypto crypto;
d19929cb 52} hitag_data;
e30c654b 53
54#endif
Impressum, Datenschutz