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/blowfish.h | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'src/experimental/blowfish.h') diff --git a/src/experimental/blowfish.h b/src/experimental/blowfish.h index 054fc82..4dbd637 100644 --- a/src/experimental/blowfish.h +++ b/src/experimental/blowfish.h @@ -1,7 +1,7 @@ #ifndef BU_BLOWFISH_H #define BU_BLOWFISH_H -#include "bu/filter.h" +#include "bu/cipher.h" #define NUM_SUBKEYS 18 #define NUM_S_BOXES 4 @@ -12,7 +12,7 @@ namespace Bu { - class Blowfish : public Bu::Filter + class Blowfish : public Bu::Cipher { public: Blowfish( Bu::Stream &rNext ); @@ -20,14 +20,6 @@ namespace Bu void setPassword( const Bu::String &sPass ); - 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; - private: uint32_t PA[NUM_SUBKEYS]; uint32_t SB[NUM_S_BOXES][NUM_ENTRIES]; @@ -65,8 +57,9 @@ namespace Bu }; void reset(); - inline void BF_En( Word *, Word * ); - inline void BF_De( Word *, Word * ); + virtual void encipher( void *pData ); + virtual void decipher( void *pData ); + inline void keyEncipher( Word &w1, Word &w2 ); }; }; -- cgit v1.2.3