if we rotate our onion key, publish a new descriptor, and
[tor.git] / src / common / aes.h
blob30606095b1e74ccd1825d0dbc64e1a9620c9ea58
1 /* Copyright 2003 Roger Dingledine
2 * Copyright 2004-2006 Roger Dingledine, Nick Mathewson */
3 /* See LICENSE for licensing information */
4 /* $Id$ */
6 /* Implements a minimal interface to counter-mode AES. */
8 #ifndef __AES_H
9 #define __AES_H
10 #define AES_H_ID "$Id$"
12 /**
13 * \file aes.h
14 * \brief Headers for aes.c
17 #include "../common/torint.h"
19 struct aes_cnt_cipher;
20 typedef struct aes_cnt_cipher aes_cnt_cipher_t;
22 aes_cnt_cipher_t* aes_new_cipher(void);
23 void aes_free_cipher(aes_cnt_cipher_t *cipher);
24 void aes_set_key(aes_cnt_cipher_t *cipher, const char *key, int key_bits);
25 void aes_crypt(aes_cnt_cipher_t *cipher, const char *input, size_t len,
26 char *output);
27 uint64_t aes_get_counter(aes_cnt_cipher_t *cipher);
28 void aes_set_counter(aes_cnt_cipher_t *cipher, uint64_t counter);
29 void aes_adjust_counter(aes_cnt_cipher_t *cipher, long delta);
31 #endif