diff options
author | Christian Pointner <equinox@anytun.org> | 2008-02-19 21:37:22 +0000 |
---|---|---|
committer | Christian Pointner <equinox@anytun.org> | 2008-02-19 21:37:22 +0000 |
commit | cf18c2f73465f82a43a61c58d6bac8505f7cf07a (patch) | |
tree | 0ddf73b1cc95ddc12b250a88c2cbfa102564788a /cipher.h | |
parent | replaces cypher with cipher (diff) |
further cleanups
Diffstat (limited to 'cipher.h')
-rw-r--r-- | cipher.h | 18 |
1 files changed, 10 insertions, 8 deletions
@@ -42,15 +42,16 @@ class Cipher { public: - Cipher() {}; virtual ~Cipher() {}; - - void setKey(Buffer key) {}; - void setSalt(Buffer salt) {}; + void encrypt(const PlainPacket & in,EncryptedPacket & out, seq_nr_t seq_nr, sender_id_t sender_id); void decrypt(const EncryptedPacket & in,PlainPacket & out); -private: - virtual void cipher(u_int8_t * in, u_int8_t * out, u_int32_t length, seq_nr_t seq_nr, sender_id_t sender_id) {}; + + virtual void setKey(Buffer key) = 0; + virtual void setSalt(Buffer salt) = 0; + +protected: + virtual void cipher(u_int8_t * in, u_int8_t * out, u_int32_t length, seq_nr_t seq_nr, sender_id_t sender_id) = 0; }; //****** NullCipher ****** @@ -58,8 +59,9 @@ private: class NullCipher : public Cipher { public: - NullCipher() {}; - ~NullCipher() {}; + void setKey(Buffer key) {}; + void setSalt(Buffer salt) {}; + protected: void cipher(u_int8_t * in, u_int8_t * out, u_int32_t length, seq_nr_t seq_nr, sender_id_t sender_id); }; |