forked from len0rd/rockbox
imxtools: Replace use of "byte" with its underlying uint8_t.
libtomcrypt uses a macro "byte" which conflicts with this type. Since the underlying type is uint8_t and there's no real benefit from using a custom type use the actual underlying type. Change-Id: I982c9b8bdcb657b99fa645a5235303af7afda25b
This commit is contained in:
parent
387a45923c
commit
815b289cb3
8 changed files with 69 additions and 70 deletions
|
|
@ -30,8 +30,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef uint8_t byte;
|
||||
|
||||
/* crypto.cpp */
|
||||
enum crypto_method_t
|
||||
{
|
||||
|
|
@ -52,7 +50,7 @@ struct crypto_key_t
|
|||
enum crypto_method_t method;
|
||||
union
|
||||
{
|
||||
byte key[16];
|
||||
uint8_t key[16];
|
||||
union xorcrypt_key_t xor_key[2];
|
||||
}u;
|
||||
};
|
||||
|
|
@ -68,28 +66,28 @@ int crypto_setup(struct crypto_key_t *key);
|
|||
|
||||
/* return 0 on success, <0 on error */
|
||||
int crypto_apply(
|
||||
byte *in_data, /* Input data */
|
||||
byte *out_data, /* Output data (or NULL) */
|
||||
uint8_t *in_data, /* Input data */
|
||||
uint8_t *out_data, /* Output data (or NULL) */
|
||||
int nr_blocks, /* Number of blocks (one block=16 bytes) */
|
||||
byte iv[16], /* IV */
|
||||
byte (*out_cbc_mac)[16], /* CBC-MAC of the result (or NULL) */
|
||||
uint8_t iv[16], /* IV */
|
||||
uint8_t (*out_cbc_mac)[16], /* CBC-MAC of the result (or NULL) */
|
||||
bool encrypt);
|
||||
|
||||
/* crc.c */
|
||||
uint32_t crc(byte *data, int size);
|
||||
uint32_t crc_continue(uint32_t previous_crc, byte *data, int size);
|
||||
uint32_t crc(uint8_t *data, int size);
|
||||
uint32_t crc_continue(uint32_t previous_crc, uint8_t *data, int size);
|
||||
|
||||
/* sha1.c */
|
||||
struct sha_1_params_t
|
||||
{
|
||||
byte hash[20]; /* final hash */
|
||||
uint8_t hash[20]; /* final hash */
|
||||
void *object; /* pointer to CryptoPP::SHA1 object */
|
||||
};
|
||||
|
||||
void sha_1_init(struct sha_1_params_t *params);
|
||||
void sha_1_update(struct sha_1_params_t *params, byte *buffer, int size);
|
||||
void sha_1_update(struct sha_1_params_t *params, uint8_t *buffer, int size);
|
||||
void sha_1_finish(struct sha_1_params_t *params);
|
||||
void sha_1_output(struct sha_1_params_t *params, byte *out);
|
||||
void sha_1_output(struct sha_1_params_t *params, uint8_t *out);
|
||||
|
||||
/* xorcrypt.c */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue