From dd056636dd2cd8c83822ebecfc2448cf8b4b713c Mon Sep 17 00:00:00 2001 From: Erwin Nindl Date: Wed, 7 Nov 2007 19:08:25 +0000 Subject: * TunDevice: changed 'char* getTypeString()' to 'const char* getTypeString()' to fix warning: deprecated conversion from string constant to ‘char*’ * removed libsrtp, use libgcrypt instead now * added buffer funcitons MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit TODO: * fix IV issues * add authentification --- cypher.h | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'cypher.h') diff --git a/cypher.h b/cypher.h index c42b79b..ae56881 100644 --- a/cypher.h +++ b/cypher.h @@ -31,9 +31,15 @@ #ifndef _CYPHER_H_ #define _CYPHER_H_ + + #include "datatypes.h" #include "buffer.h" +extern "C" { +#include +} + class Cypher { @@ -59,17 +65,22 @@ protected: class AesIcmCypher : public Cypher { public: - AesIcmCypher() : key_(Buffer(0)), salt_(Buffer(14)) {}; + AesIcmCypher(); + ~AesIcmCypher(); void setKey(Buffer key); void setSalt(Buffer salt); -// void cypher(Buffer& buf, seq_nr_t seq_nr, sender_id_t sender_id); + + static const char* MIN_GCRYPT_VERSION; + static const u_int32_t GCRYPT_SEC_MEM = 16384; // 16k secure memory protected: - Buffer getBitStream(u_int32_t length, seq_nr_t seq_nr, sender_id_t sender_id); + Buffer getBitStream(u_int32_t length, seq_nr_t seq_nr, sender_id_t sender_id); + gcry_cipher_hd_t cipher_; + Buffer salt_; private: - Buffer key_; - Buffer salt_; // size: 112 bit + static bool gcrypt_initialized_; }; + #endif -- cgit v1.2.3