Merge branch 'maint-0.3.5' into maint-0.4.5
[tor.git] / src / lib / crypt_ops / aes.h
blobc25417b4e66e569476f682e0b3203b6d1ec3aaae
1 /* Copyright (c) 2003, Roger Dingledine
2 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
3 * Copyright (c) 2007-2020, The Tor Project, Inc. */
4 /* See LICENSE for licensing information */
6 /* Implements a minimal interface to counter-mode AES. */
8 #ifndef TOR_AES_H
9 #define TOR_AES_H
11 /**
12 * \file aes.h
13 * \brief Headers for aes.c
16 #include "lib/cc/torint.h"
17 #include "lib/malloc/malloc.h"
19 typedef struct aes_cnt_cipher_t aes_cnt_cipher_t;
21 aes_cnt_cipher_t* aes_new_cipher(const uint8_t *key, const uint8_t *iv,
22 int key_bits);
23 void aes_cipher_free_(aes_cnt_cipher_t *cipher);
24 #define aes_cipher_free(cipher) \
25 FREE_AND_NULL(aes_cnt_cipher_t, aes_cipher_free_, (cipher))
26 void aes_crypt_inplace(aes_cnt_cipher_t *cipher, char *data, size_t len);
28 int evaluate_evp_for_aes(int force_value);
29 int evaluate_ctr_for_aes(void);
31 #endif /* !defined(TOR_AES_H) */