fix little endian vs big endian in the macros... again... but this time correct
[RRG-proxmark3.git] / client / src / cmdhfemrtd.h
blob81f59b88c467b615900f447d63ae13ba0d40c649
1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2020 A. Ozkal
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 // High frequency Electronic Machine Readable Travel Document commands
9 //-----------------------------------------------------------------------------
11 #ifndef CMDHFEMRTD_H__
12 #define CMDHFEMRTD_H__
14 #include "common.h"
16 typedef struct emrtd_dg_s {
17 uint8_t tag;
18 uint8_t dgnum;
19 uint16_t fileid;
20 const char *filename;
21 const char *desc;
22 bool pace;
23 bool eac; // EAC only (we can't dump these)
24 bool required; // some are required only if PACE
25 bool fastdump; // fast to dump
26 int (*parser)(uint8_t *data, size_t datalen);
27 int (*dumper)(uint8_t *data, size_t datalen, const char *path);
28 } emrtd_dg_t;
30 typedef struct emrtd_hashalg_s {
31 const char *name;
32 int (*hasher)(uint8_t *datain, int datainlen, uint8_t *dataout);
33 size_t hashlen;
34 size_t descriptorlen;
35 const uint8_t descriptor[15];
36 } emrtd_hashalg_t;
38 typedef struct emrtd_pacealg_s {
39 const char *name;
40 int (*keygenerator)(uint8_t *datain, int datainlen, uint8_t *dataout);
41 const uint8_t descriptor[10];
42 } emrtd_pacealg_t;
44 // Standardized Domain Parameters
45 typedef struct emrtd_pacesdp_s {
46 uint8_t id;
47 const char *name;
48 size_t size;
49 } emrtd_pacesdp_t;
51 int CmdHFeMRTD(const char *Cmd);
53 int dumpHF_EMRTD(char *documentnumber, char *dob, char *expiry, bool BAC_available, const char *path);
54 int infoHF_EMRTD(char *documentnumber, char *dob, char *expiry, bool BAC_available);
55 int infoHF_EMRTD_offline(const char *path);
56 #endif