aes.h 905 B

12345678910111213141516171819202122232425262728293031
  1. /* Copyright (c) 2003, Roger Dingledine
  2. * Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
  3. * Copyright (c) 2007-2018, 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 "lib/cc/torint.h"
  13. #include "lib/malloc/malloc.h"
  14. typedef struct aes_cnt_cipher aes_cnt_cipher_t;
  15. aes_cnt_cipher_t* aes_new_cipher(const uint8_t *key, const uint8_t *iv,
  16. int key_bits);
  17. void aes_cipher_free_(aes_cnt_cipher_t *cipher);
  18. #define aes_cipher_free(cipher) \
  19. FREE_AND_NULL(aes_cnt_cipher_t, aes_cipher_free_, (cipher))
  20. void aes_crypt_inplace(aes_cnt_cipher_t *cipher, char *data, size_t len);
  21. int evaluate_evp_for_aes(int force_value);
  22. int evaluate_ctr_for_aes(void);
  23. #endif /* !defined(TOR_AES_H) */