![]() |
AnCH Framework
0.1
Another C++ Hack Framework
|
Propagating cipher-block chaining implementation. More...
#include <pcbc.hpp>
Public Member Functions | |
PCBC (const std::array< uint8_t, Cipher::getBlockSize()> &initVect, unsigned int nbThread=1) | |
virtual | ~PCBC () |
![]() | |
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()> &, 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 () |
Propagating cipher-block chaining implementation.
PCBC algorithm is used in Kerberos v4 and WASTE.
|
inline |
PCBC 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 |
PCBC 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< PCBC< Cipher, Padding >, Cipher >.
|
inlineoverrideprotectedvirtual |
Decipher a block.
This method will handle initialization vector management.
input | the 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< PCBC< Cipher, Padding >, Cipher >.
|
inlineprotectedvirtual |
Reset block cipher mode of operation context
Implements anch::crypto::BlockCipherModeOfOperation< PCBC< Cipher, Padding >, Cipher >.