1 #if defined(WITH_SSL) || defined(WITH_LIBCRYPTO)
2 # include <openssl/aes.h>
10 /* Because array size can't be a const in C, the following two are macros.
11 Both sizes are in bytes. */
13 #define AES_BLOCK_SIZE 16
15 # define GETU32(pt) (((uint32_t)(pt)[0] << 24) ^ ((uint32_t)(pt)[1] << 16) ^ ((uint32_t)(pt)[2] << 8) ^ ((uint32_t)(pt)[3]))
16 # define PUTU32(ct, st) { (ct)[0] = (uint8_t)((st) >> 24); (ct)[1] = (uint8_t)((st) >> 16); (ct)[2] = (uint8_t)((st) >> 8); (ct)[3] = (uint8_t)(st); }
20 #define MAXKC (256/32)
24 /* This controls loop-unrolling in aes_core.c */
27 /* This should be a hidden type, but EVP requires that the size be known */
30 uint32_t rd_key
[4 * (AES_MAXNR
+ 1)];
33 typedef struct aes_key_st AES_KEY
;
35 int AES_set_encrypt_key(const uint8_t *userKey
, const int bits
, AES_KEY
*key
);
36 int AES_set_decrypt_key(const uint8_t *userKey
, const int bits
, AES_KEY
*key
);
38 void AES_encrypt(const uint8_t *in
, uint8_t *out
, const AES_KEY
*key
);
39 void AES_decrypt(const uint8_t *in
, uint8_t *out
, const AES_KEY
*key
);
41 void AES_cbc_encrypt(const uint8_t *in
, uint8_t *out
, const unsigned long length
,
42 const AES_KEY
*key
, uint8_t *ivec
, const int enc
);
43 #endif /* !HEADER_AES_H */