AnCH Framework  0.1
Another C++ Hack Framework
Public Member Functions | Protected Member Functions | List of all members
anch::crypto::PCBC< Cipher, Padding > Class Template Reference

Propagating cipher-block chaining implementation. More...

#include <pcbc.hpp>

Inheritance diagram for anch::crypto::PCBC< Cipher, Padding >:
Collaboration diagram for anch::crypto::PCBC< Cipher, Padding >:

Public Member Functions

 PCBC (const std::array< uint8_t, Cipher::getBlockSize()> &initVect, unsigned int nbThread=1)
 
virtual ~PCBC ()
 
- Public Member Functions inherited from anch::crypto::BlockCipherModeOfOperation< PCBC< Cipher, Padding >, Cipher >
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 ()
 
- Protected Member Functions inherited from anch::crypto::BlockCipherModeOfOperation< PCBC< Cipher, Padding >, Cipher >
 BlockCipherModeOfOperation (bool cipherParallelizable, bool decipherParallelizable, unsigned int nbThread=1)
 
virtual ~BlockCipherModeOfOperation ()
 

Detailed Description

template<typename Cipher, typename Padding>
class anch::crypto::PCBC< Cipher, Padding >

Propagating cipher-block chaining implementation.

PCBC algorithm is used in Kerberos v4 and WASTE.

Since
0.1
Author
Vincent Lachenal

Constructor & Destructor Documentation

template<typename Cipher , typename Padding >
anch::crypto::PCBC< Cipher, Padding >::PCBC ( const std::array< uint8_t, Cipher::getBlockSize()> &  initVect,
unsigned int  nbThread = 1 
)
inline

PCBC constructor

Parameters
initVectthe initialization vector
nbThreadthe 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).
template<typename Cipher , typename Padding >
virtual anch::crypto::PCBC< Cipher, Padding >::~PCBC ( )
inlinevirtual

PCBC destructor

Member Function Documentation

template<typename Cipher , typename Padding >
virtual std::size_t anch::crypto::PCBC< Cipher, Padding >::cipherBlock ( std::array< uint8_t, Cipher::getBlockSize()> &  input,
std::streamsize  nbRead,
std::array< uint8_t, Cipher::getBlockSize()> &  output,
uint32_t  ,
Cipher &  cipher 
)
inlineoverrideprotectedvirtual

Cipher a block.
This method will handle initialization vector management.

Parameters
inputthe input block to cipher
nbReadthe size of block which has been read
outputthe output block
cipherthe cipher instance
Returns
the number of bytes to write

Implements anch::crypto::BlockCipherModeOfOperation< PCBC< Cipher, Padding >, Cipher >.

template<typename Cipher , typename Padding >
virtual std::size_t anch::crypto::PCBC< Cipher, Padding >::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 
)
inlineoverrideprotectedvirtual

Decipher a block.
This method will handle initialization vector management.

Parameters
inputthe input block to decipher
nbReadthe size of block which has been read
lastBlockis last block to decipher
outputthe output block
cipherthe cipher instance
Returns
the number of bytes to write

Implements anch::crypto::BlockCipherModeOfOperation< PCBC< Cipher, Padding >, Cipher >.

template<typename Cipher , typename Padding >
virtual const std::array<uint8_t,Cipher::getBlockSize()>& anch::crypto::PCBC< Cipher, Padding >::reset ( )
inlineprotectedvirtual

Reset block cipher mode of operation context

Returns
the initial context

Implements anch::crypto::BlockCipherModeOfOperation< PCBC< Cipher, Padding >, Cipher >.


The documentation for this class was generated from the following file: