diff options
author | Christian Pointner <equinox@anytun.org> | 2014-06-21 19:48:12 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2014-06-21 19:48:12 +0000 |
commit | b0eb467680943a45f7ef2346d37efce073b837b2 (patch) | |
tree | 6b26bf687a2e6fb22f57db12b7b14ea70a91a210 /src/cipher.h | |
parent | fixed typo in description (diff) | |
parent | implemented key derivation in nettle (diff) |
merged nettle branch to trunk
Diffstat (limited to 'src/cipher.h')
-rw-r--r-- | src/cipher.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/cipher.h b/src/cipher.h index 5758fde..e5976b0 100644 --- a/src/cipher.h +++ b/src/cipher.h @@ -37,10 +37,12 @@ #define UANYTUN_cipher_h_INCLUDED #ifndef NO_CRYPT -#ifndef USE_SSL_CRYPTO -#include <gcrypt.h> -#else +#if defined(USE_SSL_CRYPTO) #include <openssl/aes.h> +#elif defined(USE_NETTLE) +#include <nettle/aes.h> +#else // USE_GCRYPT is the default +#include <gcrypt.h> #endif #include "key_derivation.h" #else @@ -94,11 +96,13 @@ union __attribute__((__packed__)) cipher_aesctr_ctr_union { typedef union cipher_aesctr_ctr_union cipher_aesctr_ctr_t; struct cipher_aesctr_param_struct { -#ifndef USE_SSL_CRYPTO - gcry_cipher_hd_t handle_; -#else +#if defined(USE_SSL_CRYPTO) AES_KEY aes_key_; u_int8_t ecount_buf_[AES_BLOCK_SIZE]; +#elif defined(USE_NETTLE) + struct aes_ctx ctx_; +#else // USE_GCRYPT is the default + gcry_cipher_hd_t handle_; #endif cipher_aesctr_ctr_t ctr_; }; |