recover_pk.py: replace secp192r1 by prime192v1
[RRG-proxmark3.git] / client / src / mifare / desfiresecurechan.h
blobf3f232032c831f3e16f7e8abd7ee66c38f7c3d1d
1 //-----------------------------------------------------------------------------
2 // Borrowed initially from https://github.com/nfc-tools/libfreefare
3 // Copyright (C) 2010, Romain Tartiere.
4 // Copyright (C) Proxmark3 contributors. See AUTHORS.md for details.
5 //
6 // This program is free software: you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation, either version 3 of the License, or
9 // (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // See LICENSE.txt for the text of the license.
17 //-----------------------------------------------------------------------------
18 // High frequency Desfire secure channel functions
19 //-----------------------------------------------------------------------------
21 #ifndef __DESFIRESECURECHAN_H
22 #define __DESFIRESECURECHAN_H
24 #include "common.h"
25 #include "mifare/desfirecore.h"
26 #include "mifare/desfirecrypto.h"
27 #include "mifare/mifare4.h"
29 typedef struct {
30 uint8_t cmd;
31 DesfireSecureChannel secureChannel;
32 DesfireCommandSet cmdSet;
33 DesfireCommunicationMode commMode;
34 } AllowedChannelModes_t;
36 typedef struct {
37 uint8_t cmd;
38 uint32_t len;
39 } CmdHeaderLengths_t;
41 void DesfireSecureChannelEncode(DesfireContext_t *ctx, uint8_t cmd, uint8_t *srcdata, size_t srcdatalen, uint8_t *dstdata, size_t *dstdatalen);
42 void DesfireSecureChannelDecode(DesfireContext_t *ctx, uint8_t *srcdata, size_t srcdatalen, uint8_t respcode, uint8_t *dstdata, size_t *dstdatalen);
44 bool PrintChannelModeWarning(uint8_t cmd, DesfireSecureChannel secureChannel, DesfireCommandSet cmdSet, DesfireCommunicationMode commMode);
46 #endif // __DESFIRESECURECHAN_H