aes.h 994 Bytes
Newer Older
1
2
3
/* Copyright (c) 2003, Roger Dingledine
 * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
 * Copyright (c) 2007, The Tor Project, Inc. */
4
5
6
7
8
9
10
/* See LICENSE for licensing information */
/* $Id$ */

/* Implements a minimal interface to counter-mode AES. */

#ifndef __AES_H
#define __AES_H
11
#define AES_H_ID "$Id$"
12

13
14
15
16
17
/**
 * \file aes.h
 * \brief Headers for aes.c
 */

18
#include "torint.h"
19
20
21
22

struct aes_cnt_cipher;
typedef struct aes_cnt_cipher aes_cnt_cipher_t;

Nick Mathewson's avatar
Nick Mathewson committed
23
aes_cnt_cipher_t* aes_new_cipher(void);
24
void aes_free_cipher(aes_cnt_cipher_t *cipher);
25
void aes_set_key(aes_cnt_cipher_t *cipher, const char *key, int key_bits);
26
27
void aes_crypt(aes_cnt_cipher_t *cipher, const char *input, size_t len,
               char *output);
28
29
void aes_set_iv(aes_cnt_cipher_t *cipher, const char *iv);
#if 0
30
31
32
uint64_t aes_get_counter(aes_cnt_cipher_t *cipher);
void aes_set_counter(aes_cnt_cipher_t *cipher, uint64_t counter);
void aes_adjust_counter(aes_cnt_cipher_t *cipher, long delta);
33
#endif
34
35

#endif
36