summaryrefslogtreecommitdiff
path: root/src/key_derivation.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2014-06-21 19:48:12 +0000
committerChristian Pointner <equinox@anytun.org>2014-06-21 19:48:12 +0000
commitb0eb467680943a45f7ef2346d37efce073b837b2 (patch)
tree6b26bf687a2e6fb22f57db12b7b14ea70a91a210 /src/key_derivation.h
parentfixed typo in description (diff)
parentimplemented key derivation in nettle (diff)
merged nettle branch to trunk
Diffstat (limited to 'src/key_derivation.h')
-rw-r--r--src/key_derivation.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/key_derivation.h b/src/key_derivation.h
index 19fd88b..df97765 100644
--- a/src/key_derivation.h
+++ b/src/key_derivation.h
@@ -36,10 +36,12 @@
#ifndef UANYTUN_key_derivation_h_INCLUDED
#define UANYTUN_key_derivation_h_INCLUDED
-#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 "options.h"
@@ -103,11 +105,13 @@ union __attribute__((__packed__)) key_derivation_aesctr_ctr_union {
typedef union key_derivation_aesctr_ctr_union key_derivation_aesctr_ctr_t;
struct key_derivation_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
key_derivation_aesctr_ctr_t ctr_;
};