From 03e8c5ad314252cde58c53688c70b9f836a1d5b4 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 28 Nov 2012 17:39:09 +0000 Subject: More comments; moved the encryption system to unstable. --- src/experimental/ciphermodeofb.h | 56 ---------------------------------------- 1 file changed, 56 deletions(-) delete mode 100644 src/experimental/ciphermodeofb.h (limited to 'src/experimental/ciphermodeofb.h') diff --git a/src/experimental/ciphermodeofb.h b/src/experimental/ciphermodeofb.h deleted file mode 100644 index e1b5108..0000000 --- a/src/experimental/ciphermodeofb.h +++ /dev/null @@ -1,56 +0,0 @@ -#ifndef BU_MODE_OFB_H -#define BU_MODE_OFB_H - -#include "bu/filter.h" -#include "bu/string.h" - -namespace Bu -{ - template - class CipherModeOfb : public CipherType - { - public: - CipherModeOfb(class Stream &rNext ) : - CipherType( rNext ), - bStart( true ) - { - memset( aVector, 0, iBlockSize ); - } - - virtual ~CipherModeOfb() - { - } - - void setIv( const Bu::String &sIv ) - { - memcpy( aVector, sIv.getStr(), iBlockSize ); - } - - protected: - void decipher( void *pBuf ) - { - CipherType::encipher( aVector ); - uint8_t aTmp[iBlockSize]; - memcpy( aTmp, aVector, iBlockSize ); - for( int j = 0; j < iBlockSize; j++ ) - ((uint8_t *)pBuf)[j] ^= aVector[j]; - memcpy( aVector, aTmp, iBlockSize ); - } - - void encipher( void *pBuf ) - { - CipherType::encipher( aVector ); - uint8_t aTmp[iBlockSize]; - memcpy( aTmp, aVector, iBlockSize ); - for( int j = 0; j < iBlockSize; j++ ) - ((uint8_t *)pBuf)[j] ^= aVector[j]; - memcpy( aVector, aTmp, iBlockSize ); - } - - private: - bool bStart; - uint8_t aVector[iBlockSize]; - }; -}; - -#endif -- cgit v1.2.3