aes.h 994 B

123456789101112131415161718192021222324252627282930313233343536
  1. /* Copyright (c) 2003, Roger Dingledine
  2. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  3. * Copyright (c) 2007, The Tor Project, Inc. */
  4. /* See LICENSE for licensing information */
  5. /* $Id$ */
  6. /* Implements a minimal interface to counter-mode AES. */
  7. #ifndef __AES_H
  8. #define __AES_H
  9. #define AES_H_ID "$Id$"
  10. /**
  11. * \file aes.h
  12. * \brief Headers for aes.c
  13. */
  14. #include "torint.h"
  15. struct aes_cnt_cipher;
  16. typedef struct aes_cnt_cipher aes_cnt_cipher_t;
  17. aes_cnt_cipher_t* aes_new_cipher(void);
  18. void aes_free_cipher(aes_cnt_cipher_t *cipher);
  19. void aes_set_key(aes_cnt_cipher_t *cipher, const char *key, int key_bits);
  20. void aes_crypt(aes_cnt_cipher_t *cipher, const char *input, size_t len,
  21. char *output);
  22. void aes_set_iv(aes_cnt_cipher_t *cipher, const char *iv);
  23. #if 0
  24. uint64_t aes_get_counter(aes_cnt_cipher_t *cipher);
  25. void aes_set_counter(aes_cnt_cipher_t *cipher, uint64_t counter);
  26. void aes_adjust_counter(aes_cnt_cipher_t *cipher, long delta);
  27. #endif
  28. #endif