From ec05778d5718a7912e506764d443a78d6a6179e3 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Mon, 5 Nov 2012 22:41:51 +0000 Subject: Converted tabs to spaces with tabconv. --- src/experimental/ciphermodecfb.h | 84 ++++++++++++++++++++-------------------- 1 file changed, 42 insertions(+), 42 deletions(-) (limited to 'src/experimental/ciphermodecfb.h') diff --git a/src/experimental/ciphermodecfb.h b/src/experimental/ciphermodecfb.h index dab6c2e..34c682f 100644 --- a/src/experimental/ciphermodecfb.h +++ b/src/experimental/ciphermodecfb.h @@ -6,48 +6,48 @@ namespace Bu { - template - class CipherModeCfb : public CipherType - { - public: - CipherModeCfb(class Stream &rNext ) : - CipherType( rNext ), - bStart( true ) - { - memset( aVector, 0, iBlockSize ); - } - - virtual ~CipherModeCfb() - { - } - - 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::encipher( aVector ); - for( int j = 0; j < iBlockSize; j++ ) - ((uint8_t *)pBuf)[j] ^= aVector[j]; - memcpy( aVector, aTmp, iBlockSize ); - } - - void encipher( void *pBuf ) - { - CipherType::encipher( aVector ); - for( int j = 0; j < iBlockSize; j++ ) - aVector[j] = ((uint8_t *)pBuf)[j] ^= aVector[j]; - } - - private: - bool bStart; - uint8_t aVector[iBlockSize]; - }; + template + class CipherModeCfb : public CipherType + { + public: + CipherModeCfb(class Stream &rNext ) : + CipherType( rNext ), + bStart( true ) + { + memset( aVector, 0, iBlockSize ); + } + + virtual ~CipherModeCfb() + { + } + + 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::encipher( aVector ); + for( int j = 0; j < iBlockSize; j++ ) + ((uint8_t *)pBuf)[j] ^= aVector[j]; + memcpy( aVector, aTmp, iBlockSize ); + } + + void encipher( void *pBuf ) + { + CipherType::encipher( aVector ); + for( int j = 0; j < iBlockSize; j++ ) + aVector[j] = ((uint8_t *)pBuf)[j] ^= aVector[j]; + } + + private: + bool bStart; + uint8_t aVector[iBlockSize]; + }; }; #endif -- cgit v1.2.3