diff options
Diffstat (limited to 'utils/imxtools/sbtools/crypto.h')
-rw-r--r-- | utils/imxtools/sbtools/crypto.h | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/utils/imxtools/sbtools/crypto.h b/utils/imxtools/sbtools/crypto.h index 169197790b..bdb94bb881 100644 --- a/utils/imxtools/sbtools/crypto.h +++ b/utils/imxtools/sbtools/crypto.h | |||
@@ -30,8 +30,6 @@ | |||
30 | extern "C" { | 30 | extern "C" { |
31 | #endif | 31 | #endif |
32 | 32 | ||
33 | typedef uint8_t byte; | ||
34 | |||
35 | /* crypto.cpp */ | 33 | /* crypto.cpp */ |
36 | enum crypto_method_t | 34 | enum crypto_method_t |
37 | { | 35 | { |
@@ -52,7 +50,7 @@ struct crypto_key_t | |||
52 | enum crypto_method_t method; | 50 | enum crypto_method_t method; |
53 | union | 51 | union |
54 | { | 52 | { |
55 | byte key[16]; | 53 | uint8_t key[16]; |
56 | union xorcrypt_key_t xor_key[2]; | 54 | union xorcrypt_key_t xor_key[2]; |
57 | }u; | 55 | }u; |
58 | }; | 56 | }; |
@@ -68,28 +66,28 @@ int crypto_setup(struct crypto_key_t *key); | |||
68 | 66 | ||
69 | /* return 0 on success, <0 on error */ | 67 | /* return 0 on success, <0 on error */ |
70 | int crypto_apply( | 68 | int crypto_apply( |
71 | byte *in_data, /* Input data */ | 69 | uint8_t *in_data, /* Input data */ |
72 | byte *out_data, /* Output data (or NULL) */ | 70 | uint8_t *out_data, /* Output data (or NULL) */ |
73 | int nr_blocks, /* Number of blocks (one block=16 bytes) */ | 71 | int nr_blocks, /* Number of blocks (one block=16 bytes) */ |
74 | byte iv[16], /* IV */ | 72 | uint8_t iv[16], /* IV */ |
75 | byte (*out_cbc_mac)[16], /* CBC-MAC of the result (or NULL) */ | 73 | uint8_t (*out_cbc_mac)[16], /* CBC-MAC of the result (or NULL) */ |
76 | bool encrypt); | 74 | bool encrypt); |
77 | 75 | ||
78 | /* crc.c */ | 76 | /* crc.c */ |
79 | uint32_t crc(byte *data, int size); | 77 | uint32_t crc(uint8_t *data, int size); |
80 | uint32_t crc_continue(uint32_t previous_crc, byte *data, int size); | 78 | uint32_t crc_continue(uint32_t previous_crc, uint8_t *data, int size); |
81 | 79 | ||
82 | /* sha1.c */ | 80 | /* sha1.c */ |
83 | struct sha_1_params_t | 81 | struct sha_1_params_t |
84 | { | 82 | { |
85 | byte hash[20]; /* final hash */ | 83 | uint8_t hash[20]; /* final hash */ |
86 | void *object; /* pointer to CryptoPP::SHA1 object */ | 84 | void *object; /* pointer to CryptoPP::SHA1 object */ |
87 | }; | 85 | }; |
88 | 86 | ||
89 | void sha_1_init(struct sha_1_params_t *params); | 87 | void sha_1_init(struct sha_1_params_t *params); |
90 | void sha_1_update(struct sha_1_params_t *params, byte *buffer, int size); | 88 | void sha_1_update(struct sha_1_params_t *params, uint8_t *buffer, int size); |
91 | void sha_1_finish(struct sha_1_params_t *params); | 89 | void sha_1_finish(struct sha_1_params_t *params); |
92 | void sha_1_output(struct sha_1_params_t *params, byte *out); | 90 | void sha_1_output(struct sha_1_params_t *params, uint8_t *out); |
93 | 91 | ||
94 | /* xorcrypt.c */ | 92 | /* xorcrypt.c */ |
95 | 93 | ||