root / aes.h @ 94909d9f
History | View | Annotate | Download (717 Bytes)
1 | e4d4fe3c | bellard | #ifndef QEMU_AES_H
|
---|---|---|---|
2 | e4d4fe3c | bellard | #define QEMU_AES_H
|
3 | e4d4fe3c | bellard | |
4 | e4d4fe3c | bellard | #define AES_MAXNR 14 |
5 | e4d4fe3c | bellard | #define AES_BLOCK_SIZE 16 |
6 | e4d4fe3c | bellard | |
7 | e4d4fe3c | bellard | struct aes_key_st {
|
8 | e4d4fe3c | bellard | uint32_t rd_key[4 *(AES_MAXNR + 1)]; |
9 | e4d4fe3c | bellard | int rounds;
|
10 | e4d4fe3c | bellard | }; |
11 | e4d4fe3c | bellard | typedef struct aes_key_st AES_KEY; |
12 | e4d4fe3c | bellard | |
13 | e4d4fe3c | bellard | int AES_set_encrypt_key(const unsigned char *userKey, const int bits, |
14 | e4d4fe3c | bellard | AES_KEY *key); |
15 | e4d4fe3c | bellard | int AES_set_decrypt_key(const unsigned char *userKey, const int bits, |
16 | e4d4fe3c | bellard | AES_KEY *key); |
17 | e4d4fe3c | bellard | |
18 | e4d4fe3c | bellard | void AES_encrypt(const unsigned char *in, unsigned char *out, |
19 | e4d4fe3c | bellard | const AES_KEY *key);
|
20 | e4d4fe3c | bellard | void AES_decrypt(const unsigned char *in, unsigned char *out, |
21 | e4d4fe3c | bellard | const AES_KEY *key);
|
22 | e4d4fe3c | bellard | void AES_cbc_encrypt(const unsigned char *in, unsigned char *out, |
23 | e4d4fe3c | bellard | const unsigned long length, const AES_KEY *key, |
24 | e4d4fe3c | bellard | unsigned char *ivec, const int enc); |
25 | e4d4fe3c | bellard | |
26 | e4d4fe3c | bellard | #endif |