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/ciphermodeofb.h | 90 ++++++++++++++++++++-------------------- 1 file changed, 45 insertions(+), 45 deletions(-) (limited to 'src/experimental/ciphermodeofb.h') diff --git a/src/experimental/ciphermodeofb.h b/src/experimental/ciphermodeofb.h index 8c2aa20..e1b5108 100644 --- a/src/experimental/ciphermodeofb.h +++ b/src/experimental/ciphermodeofb.h @@ -6,51 +6,51 @@ 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]; - }; + 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