diff options
author | Erwin Nindl <nine@wirdorange.org> | 2007-11-07 19:08:25 +0000 |
---|---|---|
committer | Erwin Nindl <nine@wirdorange.org> | 2007-11-07 19:08:25 +0000 |
commit | dd056636dd2cd8c83822ebecfc2448cf8b4b713c (patch) | |
tree | e2ca8e3f9565f7da7a7bbbd9a8d9ebd317b2e5b1 /cypher.h | |
parent | i bin da beste deshalb haut des jetzt endlich so hin (diff) |
* 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
TODO:
* fix IV issues
* add authentification
Diffstat (limited to 'cypher.h')
-rw-r--r-- | cypher.h | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -31,9 +31,15 @@ #ifndef _CYPHER_H_ #define _CYPHER_H_ + + #include "datatypes.h" #include "buffer.h" +extern "C" { +#include <gcrypt.h> +} + 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 |