![]() |
AnCH Framework
0.1
Another C++ Hack Framework
|
Block cipher mode of operation interface. More...
#include <bcModOp.hpp>
Public Member Functions | |
void | cipher (std::istream &input, std::ostream &output, const std::string &key) |
void | decipher (std::istream &input, std::ostream &output, const std::string &key) |
void | setNbThread (unsigned int nbThread) |
Protected Member Functions | |
BlockCipherModeOfOperation (bool cipherParallelizable, bool decipherParallelizable, unsigned int nbThread=1) | |
virtual | ~BlockCipherModeOfOperation () |
virtual std::size_t | cipherBlock (std::array< uint8_t, Cipher::getBlockSize()> &input, std::streamsize nbRead, std::array< uint8_t, Cipher::getBlockSize()> &output, uint32_t index, Cipher &cipher)=0 |
virtual std::size_t | decipherBlock (std::array< uint8_t, Cipher::getBlockSize()> &input, std::array< uint8_t, Cipher::getBlockSize()> &prevInput, std::streamsize nbRead, bool lastBlock, std::array< uint8_t, Cipher::getBlockSize()> &output, uint32_t index, Cipher &cipher)=0 |
virtual const std::array< uint8_t, Cipher::getBlockSize()> & | reset ()=0 |
Friends | |
class | anch::ThreadPool |
Block cipher mode of operation interface.
Interface for all block cipher mode of operation implementations.
|
inlineprotected |
BlockCipherModeOfOperation constructor
cipherParallelizable | Is cipher parallelizable |
decipherParallelizable | Is decipher parallelizable |
nbThread | the maximum number of thread to run in parallel (default to 1). If is set to 0, it will be set to the number of CPU if found (1 otherwise). |
|
inlineprotectedvirtual |
BlockCipherModeOfOperation destructor
|
inline |
Cipher input stream
input | the input stream to cipher |
output | the ouput stream to write in |
key | the cipher key |
|
protectedpure virtual |
Cipher a block.
This method will handle initialization vector management.
input | the input block to cipher |
nbRead | the size of block which has been read |
output | the output block |
index | the block index |
cipher | the cipher instance |
Implemented in anch::crypto::PCBC< Cipher, Padding >, anch::crypto::CBC< Cipher, Padding >, anch::crypto::CFB< Cipher >, anch::crypto::OFB< Cipher >, anch::crypto::CTR< Cipher >, and anch::crypto::ECB< Cipher, Padding >.
|
inline |
Decipher input stream
input | the input stream to decipher |
output | the ouput stream to write in |
key | the decipher key |
|
protectedpure virtual |
Decipher a block.
This method will handle initialization vector management.
input | the input block to decipher |
prevInput | the previous input block to decipher |
nbRead | the size of block which has been read |
lastBlock | is last block to decipher |
output | the output block |
index | the block index |
cipher | the cipher instance |
Implemented in anch::crypto::PCBC< Cipher, Padding >, anch::crypto::CBC< Cipher, Padding >, anch::crypto::CFB< Cipher >, anch::crypto::CTR< Cipher >, anch::crypto::OFB< Cipher >, and anch::crypto::ECB< Cipher, Padding >.
|
protectedpure virtual |
Reset block cipher mode of operation context
Implemented in anch::crypto::PCBC< Cipher, Padding >, anch::crypto::CBC< Cipher, Padding >, anch::crypto::CTR< Cipher >, anch::crypto::CFB< Cipher >, anch::crypto::OFB< Cipher >, and anch::crypto::ECB< Cipher, Padding >.
|
inline |
Maximum number of parallel thread setter
nbThread | the maximum number of parallel thread to set |