tor  master
Macros | Typedefs | Functions
aes.h File Reference

Headers for aes.c. More...

This graph shows which files directly or indirectly include this file:

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_taes_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)
 

Detailed Description

Headers for aes.c.

Function Documentation

◆ aes_cipher_free_()

void aes_cipher_free_ ( aes_cnt_cipher_t cipher)

Release storage held by cipher

Here is the call graph for this function:

◆ aes_crypt_inplace()

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.

Here is the caller graph for this function:

◆ aes_new_cipher()

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.

Here is the caller graph for this function:

◆ evaluate_ctr_for_aes()

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.

◆ evaluate_evp_for_aes()

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.