2007-12-12 22:09:01 +01:00
|
|
|
/* Copyright (c) 2003, Roger Dingledine
|
|
|
|
* Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson.
|
2018-06-20 14:13:28 +02:00
|
|
|
* Copyright (c) 2007-2018, The Tor Project, Inc. */
|
2003-06-30 21:18:12 +02:00
|
|
|
/* See LICENSE for licensing information */
|
|
|
|
|
|
|
|
/* Implements a minimal interface to counter-mode AES. */
|
|
|
|
|
2012-10-12 18:13:10 +02:00
|
|
|
#ifndef TOR_AES_H
|
|
|
|
#define TOR_AES_H
|
2003-06-30 21:18:12 +02:00
|
|
|
|
2004-05-10 09:54:13 +02:00
|
|
|
/**
|
|
|
|
* \file aes.h
|
|
|
|
* \brief Headers for aes.c
|
|
|
|
*/
|
|
|
|
|
2018-06-28 19:57:23 +02:00
|
|
|
#include "lib/cc/torint.h"
|
2018-07-10 21:16:57 +02:00
|
|
|
#include "lib/malloc/malloc.h"
|
2018-06-28 19:57:23 +02:00
|
|
|
|
2003-06-30 21:18:12 +02:00
|
|
|
typedef struct aes_cnt_cipher aes_cnt_cipher_t;
|
|
|
|
|
2016-09-16 15:51:51 +02:00
|
|
|
aes_cnt_cipher_t* aes_new_cipher(const uint8_t *key, const uint8_t *iv,
|
|
|
|
int key_bits);
|
2017-11-17 18:27:25 +01:00
|
|
|
void aes_cipher_free_(aes_cnt_cipher_t *cipher);
|
2017-12-04 21:09:18 +01:00
|
|
|
#define aes_cipher_free(cipher) \
|
2017-12-07 16:44:04 +01:00
|
|
|
FREE_AND_NULL(aes_cnt_cipher_t, aes_cipher_free_, (cipher))
|
2008-02-07 17:10:33 +01:00
|
|
|
void aes_crypt_inplace(aes_cnt_cipher_t *cipher, char *data, size_t len);
|
2003-06-30 21:18:12 +02:00
|
|
|
|
2011-11-21 03:20:31 +01:00
|
|
|
int evaluate_evp_for_aes(int force_value);
|
2012-01-09 23:40:11 +01:00
|
|
|
int evaluate_ctr_for_aes(void);
|
2011-11-21 03:20:31 +01:00
|
|
|
|
2017-09-15 22:24:44 +02:00
|
|
|
#endif /* !defined(TOR_AES_H) */
|