1 //-----------------------------------------------------------------------------
2 // Copyright (C) 2010, Flavio D. Garcia, Peter van Rossum, Roel Verdult
3 // and Ronny Wichers Schreur. Radboud University Nijmegen
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 // SecureMemory, CryptoMemory and CryptoRF library
19 //-----------------------------------------------------------------------------
30 // A nibble is actually only 4 bits, but there is no such type ;)
31 typedef uint8_t nibble
;
43 typedef crypto_state_t
*crypto_state
;
45 void print_crypto_state(const char *text
, crypto_state s
);
46 void sm_auth(const uint8_t *Gc
, const uint8_t *Ci
, const uint8_t *Q
, uint8_t *Ch
, uint8_t *Ci_1
, crypto_state s
);
47 void cm_auth(const uint8_t *Gc
, const uint8_t *Ci
, const uint8_t *Q
, uint8_t *Ch
, uint8_t *Ci_1
, uint8_t *Ci_2
, crypto_state s
);
48 void cm_encrypt(const uint8_t offset
, const uint8_t len
, const uint8_t *pt
, uint8_t *ct
, crypto_state s
);
49 void cm_decrypt(const uint8_t offset
, const uint8_t len
, const uint8_t *ct
, uint8_t *pt
, crypto_state s
);
50 void cm_grind_read_system_zone(const uint8_t offset
, const uint8_t len
, const uint8_t *pt
, crypto_state s
);
51 void cm_grind_set_user_zone(const uint8_t zone
, crypto_state s
);
52 void cm_mac(uint8_t *mac
, crypto_state s
);
53 void cm_password(const uint8_t *pt
, uint8_t *ct
, crypto_state s
);
58 #endif // _CRYPTOLIB_H_