summaryrefslogtreecommitdiff
path: root/src/key_derivation.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2014-06-21 18:26:51 +0000
committerChristian Pointner <equinox@anytun.org>2014-06-21 18:26:51 +0000
commit01ef67da5564e1dcb380adead3e7f869fa3be2c8 (patch)
tree2d61c96e2aed44703955ce731ffa28a5f055fff7 /src/key_derivation.h
parentrefactored crypto lib selection (diff)
added defines for nettle as crypto lib
further improved selection of crypto lib
Diffstat (limited to 'src/key_derivation.h')
-rw-r--r--src/key_derivation.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/key_derivation.h b/src/key_derivation.h
index 0d3c93f..01c9a26 100644
--- a/src/key_derivation.h
+++ b/src/key_derivation.h
@@ -36,8 +36,10 @@
#ifndef UANYTUN_key_derivation_h_INCLUDED
#define UANYTUN_key_derivation_h_INCLUDED
-#ifdef USE_SSL_CRYPTO
+#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
@@ -103,9 +105,12 @@ 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 {
-#ifdef USE_SSL_CRYPTO
+#if defined(USE_SSL_CRYPTO)
AES_KEY aes_key_;
u_int8_t ecount_buf_[AES_BLOCK_SIZE];
+#elif defined(USE_NETTLE)
+ // TODO: nettle
+
#else // USE_GCRYPT is the default
gcry_cipher_hd_t handle_;
#endif