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/unstable/ciphermodeecb.h | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/unstable/ciphermodeecb.h (limited to 'src/unstable/ciphermodeecb.h') diff --git a/src/unstable/ciphermodeecb.h b/src/unstable/ciphermodeecb.h new file mode 100644 index 0000000..c4a7f23 --- /dev/null +++ b/src/unstable/ciphermodeecb.h @@ -0,0 +1,40 @@ +#ifndef BU_MODE_ECB_H +#define BU_MODE_ECB_H + +namespace Bu +{ + /** + * Electronic Code Book mode. This cipher mode is the simplest, it's + * effectively a pass-through mode. It's the same as using the encryption + * scheme without a mode, but at least you absolutely know that you've got + * the correct mode. I recommend using this instead of the raw mode if for + * no other reason than it makes your code more self-documenting, and with + * optomization shouldn't add any extra calls to your code. + */ + template + class CipherModeEcb : public CipherType + { + public: + CipherModeEcb( class Stream &rNext ) : + CipherType( rNext ) + { + } + + virtual ~CipherModeEcb() + { + } + + protected: + virtual void decipher( void *pBuf ) + { + CipherType::decipher( pBuf ); + } + + virtual void encipher( void *pBuf ) + { + CipherType::encipher( pBuf ); + } + }; +}; + +#endif -- cgit v1.2.3