00001 /* Copyright (c) 2003, Roger Dingledine 00002 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson. 00003 * Copyright (c) 2007-2010, The Tor Project, Inc. */ 00004 /* See LICENSE for licensing information */ 00005 00006 /* Implements a minimal interface to counter-mode AES. */ 00007 00008 #ifndef _TOR_AES_H 00009 #define _TOR_AES_H 00010 00016 #include "torint.h" 00017 00018 struct aes_cnt_cipher; 00019 typedef struct aes_cnt_cipher aes_cnt_cipher_t; 00020 00021 aes_cnt_cipher_t* aes_new_cipher(void); 00022 void aes_free_cipher(aes_cnt_cipher_t *cipher); 00023 void aes_set_key(aes_cnt_cipher_t *cipher, const char *key, int key_bits); 00024 void aes_crypt(aes_cnt_cipher_t *cipher, const char *input, size_t len, 00025 char *output); 00026 void aes_crypt_inplace(aes_cnt_cipher_t *cipher, char *data, size_t len); 00027 void aes_set_iv(aes_cnt_cipher_t *cipher, const char *iv); 00028 00029 #endif 00030