aes.h 876 B

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