summaryrefslogtreecommitdiff
path: root/cipher.h
diff options
context:
space:
mode:
authorChristian Pointner <equinox@anytun.org>2008-02-19 21:37:22 +0000
committerChristian Pointner <equinox@anytun.org>2008-02-19 21:37:22 +0000
commitcf18c2f73465f82a43a61c58d6bac8505f7cf07a (patch)
tree0ddf73b1cc95ddc12b250a88c2cbfa102564788a /cipher.h
parentreplaces cypher with cipher (diff)
further cleanups
Diffstat (limited to 'cipher.h')
-rw-r--r--cipher.h18
1 files changed, 10 insertions, 8 deletions
diff --git a/cipher.h b/cipher.h
index 7ff9e01..cabb076 100644
--- a/cipher.h
+++ b/cipher.h
@@ -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);
};