aboutsummaryrefslogtreecommitdiff
path: root/src/common/aes.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/aes.c')
-rw-r--r--src/common/aes.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/common/aes.c b/src/common/aes.c
index 7e332b050..c2fdeb594 100644
--- a/src/common/aes.c
+++ b/src/common/aes.c
@@ -21,7 +21,7 @@
#include "compat.h"
#include "aes.h"
#include "util.h"
-#include "log.h"
+#include "torlog.h"
/* We have 3 strategies for getting AES: Via OpenSSL's AES_encrypt function,
* via OpenSSL's EVP_EncryptUpdate function, or via the built-in AES
@@ -100,6 +100,9 @@
/* Figure out which AES optimizations to use. */
#ifdef USE_BUILTIN_AES
+/** If this is defined, we take advantage of the fact that AES treats its
+ * input as a set of 4 32-bit words, so that there is no need to encode and
+ * decode the 128-bit counter before every block encryption */
# define USE_RIJNDAEL_COUNTER_OPTIMIZATION
# if 0 && (defined(__powerpc__) || defined(__powerpc64__))
/* XXXX do more experimentation before concluding this is actually
@@ -263,7 +266,8 @@ aes_set_key(aes_cnt_cipher_t *cipher, const char *key, int key_bits)
void
aes_free_cipher(aes_cnt_cipher_t *cipher)
{
- tor_assert(cipher);
+ if (!cipher)
+ return;
#ifdef USE_OPENSSL_EVP
EVP_CIPHER_CTX_cleanup(&cipher->key);
#endif