aes.h 850 B

123456789101112131415161718192021222324252627282930
  1. /* Copyright (c) 2003, Roger Dingledine
  2. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  3. * Copyright (c) 2007-2011, The Tor Project, Inc. */
  4. /* See LICENSE for licensing information */
  5. /* Implements a minimal interface to counter-mode AES. */
  6. #ifndef _TOR_AES_H
  7. #define _TOR_AES_H
  8. /**
  9. * \file aes.h
  10. * \brief Headers for aes.c
  11. */
  12. #include "torint.h"
  13. struct aes_cnt_cipher;
  14. typedef struct aes_cnt_cipher aes_cnt_cipher_t;
  15. aes_cnt_cipher_t* aes_new_cipher(void);
  16. void aes_free_cipher(aes_cnt_cipher_t *cipher);
  17. void aes_set_key(aes_cnt_cipher_t *cipher, const char *key, int key_bits);
  18. void aes_crypt(aes_cnt_cipher_t *cipher, const char *input, size_t len,
  19. char *output);
  20. void aes_crypt_inplace(aes_cnt_cipher_t *cipher, char *data, size_t len);
  21. void aes_set_iv(aes_cnt_cipher_t *cipher, const char *iv);
  22. #endif