diff options
author | Christian Pointner <equinox@anytun.org> | 2014-06-22 23:09:15 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2014-06-22 23:09:15 +0000 |
commit | fac90fc49e667b18522b442ff15edd3bb8eb804b (patch) | |
tree | 7530b98b4b7c50f0512184e9a2369a0b196306a7 /src/cipher.h | |
parent | fixed typo in license header (diff) | |
parent | implemented key derivation using libnettle (diff) |
merged nettle featuer branch to trunk
Diffstat (limited to 'src/cipher.h')
-rw-r--r-- | src/cipher.h | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/cipher.h b/src/cipher.h index 9de463a..0eca1b5 100644 --- a/src/cipher.h +++ b/src/cipher.h @@ -39,11 +39,15 @@ #include "keyDerivation.h" #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 + #endif class Cipher @@ -96,12 +100,15 @@ private: void calcCtr(KeyDerivation& kd, seq_nr_t seq_nr, sender_id_t sender_id, mux_t mux); void calc(KeyDerivation& kd, uint8_t* in, uint32_t ilen, uint8_t* out, uint32_t olen, seq_nr_t seq_nr, sender_id_t sender_id, mux_t mux); -#ifndef USE_SSL_CRYPTO - gcry_cipher_hd_t handle_; -#else +#if defined(USE_SSL_CRYPTO) AES_KEY aes_key_; uint8_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 + Buffer key_; Buffer salt_; |