tor
master
|
Go to the source code of this file.
Macros | |
#define | aes_cipher_free(cipher) FREE_AND_NULL(aes_cnt_cipher_t, aes_cipher_free_, (cipher)) |
Typedefs | |
typedef struct aes_cnt_cipher | aes_cnt_cipher_t |
Functions | |
aes_cnt_cipher_t * | aes_new_cipher (const uint8_t *key, const uint8_t *iv, int key_bits) |
void | aes_cipher_free_ (aes_cnt_cipher_t *cipher) |
void | aes_crypt_inplace (aes_cnt_cipher_t *cipher, char *data, size_t len) |
int | evaluate_evp_for_aes (int force_value) |
int | evaluate_ctr_for_aes (void) |
Headers for aes.c.
void aes_cipher_free_ | ( | aes_cnt_cipher_t * | cipher | ) |
Release storage held by cipher
void aes_crypt_inplace | ( | aes_cnt_cipher_t * | cipher, |
char * | data, | ||
size_t | len | ||
) |
Encrypt len bytes from input, storing the results in place. Uses the key in cipher, and advances the counter by len bytes as it encrypts.
aes_cnt_cipher_t* aes_new_cipher | ( | const uint8_t * | key, |
const uint8_t * | iv, | ||
int | bits | ||
) |
Return a newly allocated counter-mode AES128 cipher implementation, using the 128-bit key key and the 128-bit IV iv.
int evaluate_ctr_for_aes | ( | void | ) |
Test the OpenSSL counter mode implementation to see whether it has the counter-mode bug from OpenSSL 1.0.0. If the implementation works, then we will use it for future encryption/decryption operations.
We can't just look at the OpenSSL version, since some distributions update their OpenSSL packages without changing the version number.
int evaluate_evp_for_aes | ( | int | force_val | ) |
Check whether we should use the EVP interface for AES. If force_val is nonnegative, we use use EVP iff it is true. Otherwise, we use EVP if there is an engine enabled for aes-ecb.