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/ciphermodecbc.h | 54 ---------------------------------------- 1 file changed, 54 deletions(-) delete mode 100644 src/experimental/ciphermodecbc.h (limited to 'src/experimental/ciphermodecbc.h') diff --git a/src/experimental/ciphermodecbc.h b/src/experimental/ciphermodecbc.h deleted file mode 100644 index b06a972..0000000 --- a/src/experimental/ciphermodecbc.h +++ /dev/null @@ -1,54 +0,0 @@ -#ifndef BU_MODE_CBC_H -#define BU_MODE_CBC_H - -#include "bu/filter.h" -#include "bu/string.h" - -namespace Bu -{ - template - class CipherModeCbc : public CipherType - { - public: - CipherModeCbc(class Stream &rNext ) : - CipherType( rNext ), - bStart( true ) - { - memset( aVector, 0, iBlockSize ); - } - - virtual ~CipherModeCbc() - { - } - - void setIv( const Bu::String &sIv ) - { - memcpy( aVector, sIv.getStr(), iBlockSize ); - } - - protected: - void decipher( void *pBuf ) - { - uint8_t aTmp[iBlockSize]; - memcpy( aTmp, pBuf, iBlockSize ); - CipherType::decipher( pBuf ); - for( int j = 0; j < iBlockSize; j++ ) - ((uint8_t *)pBuf)[j] ^= aVector[j]; - memcpy( aVector, aTmp, iBlockSize ); - } - - void encipher( void *pBuf ) - { - for( int j = 0; j < iBlockSize; j++ ) - ((uint8_t *)pBuf)[j] ^= aVector[j]; - CipherType::encipher( pBuf ); - memcpy( aVector, pBuf, iBlockSize ); - } - - private: - bool bStart; - uint8_t aVector[iBlockSize]; - }; -}; - -#endif -- cgit v1.2.3