diff options
author | Amaury Pouly <amaury.pouly@gmail.com> | 2017-01-03 13:56:48 +0100 |
---|---|---|
committer | Amaury Pouly <amaury.pouly@gmail.com> | 2017-01-16 19:59:26 +0100 |
commit | 8b3f5a8ad7434850804a4a664d2b07c6ffa9b1c7 (patch) | |
tree | b07d7825f81f7fae599b85c7a21f3f5b8d855576 /utils/imxtools/sbtools/crypto.h | |
parent | 5ff3a3a98f23bb1a0dd1fb97e074ddb80337ae27 (diff) | |
download | rockbox-8b3f5a8ad7434850804a4a664d2b07c6ffa9b1c7.tar.gz rockbox-8b3f5a8ad7434850804a4a664d2b07c6ffa9b1c7.zip |
imxtools/sbtools: switch AES implementation to Crypto++
Instead of having our own copy of the AES code, use a good library to do that.
Crypto++ is well-maintained, supports a lot of ciphers, works on many OSes, and
is optimized for many architectures.
Change-Id: I7d7d24b47993206d7338c5f9bac8bbdd3915a667
Diffstat (limited to 'utils/imxtools/sbtools/crypto.h')
-rw-r--r-- | utils/imxtools/sbtools/crypto.h | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/utils/imxtools/sbtools/crypto.h b/utils/imxtools/sbtools/crypto.h index 9944289a4f..a282385cf2 100644 --- a/utils/imxtools/sbtools/crypto.h +++ b/utils/imxtools/sbtools/crypto.h | |||
@@ -32,21 +32,6 @@ extern "C" { | |||
32 | 32 | ||
33 | typedef uint8_t byte; | 33 | typedef uint8_t byte; |
34 | 34 | ||
35 | /* aes128.c */ | ||
36 | void xor_(byte *a, byte *b, int n); | ||
37 | void EncryptAES(byte *msg, byte *key, byte *c); | ||
38 | void DecryptAES(byte *c, byte *key, byte *m); | ||
39 | void Pretty(byte* b,int len,const char* label); | ||
40 | void cbc_mac( | ||
41 | byte *in_data, /* Input data */ | ||
42 | byte *out_data, /* Output data (or NULL) */ | ||
43 | int nr_blocks, /* Number of blocks to encrypt/decrypt (one block=16 bytes) */ | ||
44 | byte key[16], /* Key */ | ||
45 | byte iv[16], /* Initialisation Vector */ | ||
46 | byte (*out_cbc_mac)[16], /* CBC-MAC of the result (or NULL) */ | ||
47 | int encrypt /* 1 to encrypt, 0 to decrypt */ | ||
48 | ); | ||
49 | |||
50 | /* crypto.c */ | 35 | /* crypto.c */ |
51 | enum crypto_method_t | 36 | enum crypto_method_t |
52 | { | 37 | { |
@@ -74,6 +59,7 @@ struct crypto_key_t | |||
74 | 59 | ||
75 | #define CRYPTO_ERROR_SUCCESS 0 | 60 | #define CRYPTO_ERROR_SUCCESS 0 |
76 | #define CRYPTO_ERROR_BADSETUP -1 | 61 | #define CRYPTO_ERROR_BADSETUP -1 |
62 | #define CRYPTO_ERROR_INVALID_OP -2 | ||
77 | 63 | ||
78 | /* parameter can be: | 64 | /* parameter can be: |
79 | * - CRYPTO_KEY: array of 16-bytes (the key) | 65 | * - CRYPTO_KEY: array of 16-bytes (the key) |