![]() |
AnCH Framework
0.1
Another C++ Hack Framework
|
Cipher-block chaining implementation. More...
#include <cbc.hpp>
Public Member Functions | |
CBC (const std::array< uint8_t, Cipher::getBlockSize()> &initVect, unsigned int nbThread=1) | |
virtual | ~CBC () |
![]() | |
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 | |
virtual std::size_t | cipherBlock (std::array< uint8_t, Cipher::getBlockSize()> &input, std::streamsize nbRead, std::array< uint8_t, Cipher::getBlockSize()> &output, uint32_t, Cipher &cipher) override |
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, Cipher &cipher) override |
virtual const std::array< uint8_t, Cipher::getBlockSize()> & | reset () |
![]() | |
BlockCipherModeOfOperation (bool cipherParallelizable, bool decipherParallelizable, unsigned int nbThread=1) | |
virtual | ~BlockCipherModeOfOperation () |
Cipher-block chaining implementation.
CBC is the most commonly used mode of operation
|
inline |
CBC constructor
initVect | the initialization vector |
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). |
|
inlinevirtual |
CBC destructor
|
inlineoverrideprotectedvirtual |
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 |
cipher | the cipher instance |
Implements anch::crypto::BlockCipherModeOfOperation< CBC< Cipher, Padding >, Cipher >.
|
inlineoverrideprotectedvirtual |
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 |
cipher | the cipher instance |
Implements anch::crypto::BlockCipherModeOfOperation< CBC< Cipher, Padding >, Cipher >.
|
inlineprotectedvirtual |
Reset block cipher mode of operation context
Implements anch::crypto::BlockCipherModeOfOperation< CBC< Cipher, Padding >, Cipher >.