summaryrefslogtreecommitdiff
path: root/src/cipher.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2014-06-22 21:26:20 +0000
committerChristian Pointner <equinox@anytun.org>2014-06-22 21:26:20 +0000
commit79d2ca974fe095ded71de6384237f1799ab422d8 (patch)
tree889d1b0f8dca3d51374e6df576983f80a7ae8009 /src/cipher.h
parentadded feature branch for nettle support (diff)
improved selection of crypto lib
Diffstat (limited to 'src/cipher.h')
-rw-r--r--src/cipher.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/cipher.h b/src/cipher.h
index 9de463a..c39f9cb 100644
--- a/src/cipher.h
+++ b/src/cipher.h
@@ -39,11 +39,13 @@
#include "keyDerivation.h"
#ifndef NO_CRYPT
-#ifndef USE_SSL_CRYPTO
-#include <gcrypt.h>
-#else
+
+#if defined(USE_SSL_CRYPTO)
#include <openssl/aes.h>
+#else // USE_GCRYPT is the default
+#include <gcrypt.h>
#endif
+
#endif
class Cipher
@@ -96,12 +98,13 @@ 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];
+#else // USE_GCRYPT is the default
+ gcry_cipher_hd_t handle_;
#endif
+
Buffer key_;
Buffer salt_;