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.
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
25 #include "mifare/desfirecore.h"
26 #include "mifare/desfirecrypto.h"
27 #include "mifare/mifare4.h"
31 DesfireSecureChannel secureChannel
;
32 DesfireCommandSet cmdSet
;
33 DesfireCommunicationMode commMode
;
34 } AllowedChannelModes_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