From 228b885b41652a015a91770dfd993456d76ad102 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 9 Apr 2012 16:29:18 +0000 Subject: Blowfish works in it's new split form, which will make it much easier to add other types of ciphers down the road, should we choose to. --- src/experimental/cipher.h | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/experimental/cipher.h (limited to 'src/experimental/cipher.h') diff --git a/src/experimental/cipher.h b/src/experimental/cipher.h new file mode 100644 index 0000000..2327aa6 --- /dev/null +++ b/src/experimental/cipher.h @@ -0,0 +1,29 @@ +#ifndef BU_CIPHER_H +#define BU_CIPHER_H + +#include "bu/filter.h" + +namespace Bu +{ + class Cipher : Bu::Filter + { + public: + Cipher( Bu::Stream &rNext ); + virtual ~Cipher(); + + virtual void start(); + virtual Bu::size stop(); + + virtual Bu::size read( void *pBuf, Bu::size iBytes ); + virtual Bu::size write( const void *pBuf, Bu::size iBytes ); + + using Bu::Stream::read; + using Bu::Stream::write; + + protected: + virtual void encipher( void *pData )=0; + virtual void decipher( void *pData )=0; + }; +}; + +#endif -- cgit v1.2.3