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

Output feedback implementation. More...

#include <ofb.hpp>

Inheritance diagram for anch::crypto::OFB< Cipher >:
Collaboration diagram for anch::crypto::OFB< Cipher >:

Public Member Functions

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

Detailed Description

template<typename Cipher>
class anch::crypto::OFB< Cipher >

Output feedback implementation.

OFB can not be parallelized.

Since
0.1
Author
Vincent Lachenal

Constructor & Destructor Documentation

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

OFB 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 >
virtual anch::crypto::OFB< Cipher >::~OFB ( )
inlinevirtual

OFB destructor

Member Function Documentation

template<typename Cipher >
virtual std::size_t anch::crypto::OFB< Cipher >::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< OFB< Cipher >, Cipher >.

template<typename Cipher >
virtual std::size_t anch::crypto::OFB< Cipher >::decipherBlock ( std::array< uint8_t, Cipher::getBlockSize()> &  input,
std::array< uint8_t, Cipher::getBlockSize()> &  ,
std::streamsize  nbRead,
bool  ,
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
outputthe output block
cipherthe cipher instance
Returns
the number of bytes to write

Implements anch::crypto::BlockCipherModeOfOperation< OFB< Cipher >, Cipher >.

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

Reset block cipher mode of operation context

Returns
the initial context

Implements anch::crypto::BlockCipherModeOfOperation< OFB< Cipher >, Cipher >.


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