Fabcoin Core
0.16.2
P2P Digital Currency
|
Interface for the data processing part of block ciphers. More...
#include <cryptlib.h>
Public Types | |
enum | FlagsForAdvancedProcessBlocks { BT_InBlockIsCounter =1, BT_DontIncrementInOutPointers =2, BT_XorInput =4, BT_ReverseDirection =8, BT_AllowParallel =16 } |
Bit flags that control AdvancedProcessBlocks() behavior. More... | |
Public Member Functions | |
virtual | ~BlockTransformation () |
virtual void | ProcessAndXorBlock (const byte *inBlock, const byte *xorBlock, byte *outBlock) const =0 |
Encrypt or decrypt a block. More... | |
void | ProcessBlock (const byte *inBlock, byte *outBlock) const |
Encrypt or decrypt a block. More... | |
void | ProcessBlock (byte *inoutBlock) const |
Encrypt or decrypt a block in place. More... | |
virtual unsigned int | BlockSize () const =0 |
Provides the block size of the cipher. More... | |
virtual unsigned int | OptimalDataAlignment () const |
Provides input and output data alignment for optimal performance. More... | |
virtual bool | IsPermutation () const |
returns true if this is a permutation (i.e. there is an inverse transformation) More... | |
virtual bool | IsForwardTransformation () const =0 |
Determines if the cipher is being operated in its forward direction. More... | |
virtual unsigned int | OptimalNumberOfParallelBlocks () const |
Determines the number of blocks that can be processed in parallel. More... | |
virtual size_t | AdvancedProcessBlocks (const byte *inBlocks, const byte *xorBlocks, byte *outBlocks, size_t length, word32 flags) const |
Encrypt and xor multiple blocks using additional flags. More... | |
CipherDir | GetCipherDirection () const |
Provides the direction of the cipher. More... | |
Public Member Functions inherited from Algorithm | |
virtual | ~Algorithm () |
Algorithm (bool checkSelfTestStatus=true) | |
Interface for all crypto algorithms. More... | |
virtual std::string | AlgorithmName () const |
Provides the name of this algorithm. More... | |
Public Member Functions inherited from Clonable | |
virtual | ~Clonable () |
virtual Clonable * | Clone () const |
Copies this object. More... | |
Interface for the data processing part of block ciphers.
Classes derived from BlockTransformation are block ciphers in ECB mode (for example the DES::Encryption class), which are stateless. These classes should not be used directly, but only in combination with a mode class (see CipherModeDocumentation in modes.h).
Definition at line 734 of file cryptlib.h.
Bit flags that control AdvancedProcessBlocks() behavior.
Definition at line 792 of file cryptlib.h.
|
inlinevirtual |
Definition at line 737 of file cryptlib.h.
|
virtual |
Encrypt and xor multiple blocks using additional flags.
inBlocks | the input message before processing |
xorBlocks | an optional XOR mask |
outBlocks | the output message after processing |
length | the size of the blocks, in bytes |
flags | additional flags to control processing |
Encrypt and xor multiple blocks according to FlagsForAdvancedProcessBlocks flags.
Definition at line 178 of file cryptlib.cpp.
|
pure virtual |
Provides the block size of the cipher.
Implemented in BlockCipherImpl< Camellia_Info >, BlockCipherImpl< RC5_Info >, BlockCipherImpl< MARS_Info >, BlockCipherImpl< CAST256_Info >, BlockCipherImpl< SHACAL2_Info >, BlockCipherImpl< SHARK_Info >, BlockCipherImpl< DES_XEX3_Info >, BlockCipherImpl< Blowfish_Info >, BlockCipherImpl< IDEA_Info >, BlockCipherImpl< MDC_Info< T > >, BlockCipherImpl< XTEA_Info >, BlockCipherImpl< LR_Info< T > >, BlockCipherImpl< Square_Info >, BlockCipherImpl< DES_Info >, BlockCipherImpl< SKIPJACK_Info >, BlockCipherImpl< Twofish_Info >, BlockCipherImpl< Rijndael_Info >, BlockCipherImpl< RC6_Info >, BlockCipherImpl< Serpent_Info >, BlockCipherImpl< DES_EDE3_Info >, BlockCipherImpl< TEA_Info >, BlockCipherImpl< SEED_Info >, BlockCipherImpl< CAST128_Info >, BlockCipherImpl< ThreeWay_Info >, BlockCipherImpl< GOST_Info >, BlockCipherImpl< RC2_Info >, BlockCipherImpl< DES_EDE2_Info >, and BTEA::Base.
|
inline |
Provides the direction of the cipher.
Definition at line 817 of file cryptlib.h.
|
pure virtual |
Determines if the cipher is being operated in its forward direction.
|
inlinevirtual |
returns true if this is a permutation (i.e. there is an inverse transformation)
Reimplemented in MDC< T >::Enc.
Definition at line 779 of file cryptlib.h.
|
virtual |
Provides input and output data alignment for optimal performance.
Reimplemented in MDC< T >::Enc, IDEA::Base, RC2::Base, SKIPJACK::Base, and SAFER::Base.
Definition at line 229 of file cryptlib.cpp.
|
inlinevirtual |
Determines the number of blocks that can be processed in parallel.
Bit-slicing is often used to improve throughput and minimize timing attacks.
Definition at line 789 of file cryptlib.h.
|
pure virtual |
Encrypt or decrypt a block.
inBlock | the input message before processing |
outBlock | the output message after processing |
xorBlock | an optional XOR mask |
ProcessAndXorBlock encrypts or decrypts inBlock, xor with xorBlock, and write to outBlock.
The size of the block is determined by the block cipher and its documentation. Use BLOCKSIZE at compile time, or BlockSize() at runtime.
Implemented in BTEA::Dec, BTEA::Enc, DES_XEX3::Base, DES_EDE3::Base, XTEA::Dec, LR< T >::Dec, XTEA::Enc, CAST256::Base, DES_EDE2::Base, Rijndael::Dec, LR< T >::Enc, CAST128::Dec, SHARK::Dec, RC2::Dec, Rijndael::Enc, GOST::Dec, SKIPJACK::Dec, ThreeWay::Dec, TEA::Dec, CAST128::Enc, DES::Base, Twofish::Dec, GOST::Enc, RC2::Enc, RC5::Dec, SAFER::Dec, Square::Dec, ThreeWay::Enc, MARS::Dec, RC6::Dec, SHACAL2::Dec, MDC< T >::Enc, SKIPJACK::Enc, Twofish::Enc, Serpent::Dec, SHARK::Enc, TEA::Enc, RC5::Enc, IDEA::Base, MARS::Enc, RC6::Enc, SAFER::Enc, SHACAL2::Enc, Serpent::Enc, Square::Enc, Blowfish::Base, SEED::Base, and Camellia::Base.
Encrypt or decrypt a block.
inBlock | the input message before processing |
outBlock | the output message after processing |
ProcessBlock encrypts or decrypts inBlock and write to outBlock.
The size of the block is determined by the block cipher and its documentation. Use BLOCKSIZE at compile time, or BlockSize() at runtime.
Definition at line 758 of file cryptlib.h.
|
inline |
Encrypt or decrypt a block in place.
inoutBlock | the input message before processing |
ProcessBlock encrypts or decrypts inoutBlock in-place.
The size of the block is determined by the block cipher and its documentation. Use BLOCKSIZE at compile time, or BlockSize() at runtime.
Definition at line 767 of file cryptlib.h.