Crypto++
5.6.3
Free C++ class library of cryptographic schemes
|
Interface for the data processing part of block ciphers. More...
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 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) | |
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 |
virtual std::string | AlgorithmName () const |
Provides the name of this algorithm. More... | |
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 663 of file cryptlib.h.
Bit flags that control AdvancedProcessBlocks() behavior.
Enumerator | |
---|---|
BT_InBlockIsCounter |
inBlock is a counter |
BT_DontIncrementInOutPointers |
should not modify block pointers |
BT_ReverseDirection |
perform the transformation in reverse |
Definition at line 719 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 SAFER::Dec, and SAFER::Enc.
Referenced by CBC_Decryption::ProcessData().
|
inline |
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 685 of file cryptlib.h.
Referenced by RandomPool::GenerateIntoBufferedTransformation(), X917RNG::GenerateIntoBufferedTransformation(), CBC_CTS_Encryption::ProcessLastBlock(), CBC_CTS_Decryption::ProcessLastBlock(), VMAC_Base::Resynchronize(), CBC_MAC_Base::TruncatedFinal(), CMAC_Base::UncheckedSetKey(), VMAC_Base::UncheckedSetKey(), CMAC_Base::Update(), and X917RNG::X917RNG().
|
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 694 of file cryptlib.h.
References Name::BlockSize().
|
pure virtual |
Provides the block size of the cipher.
Referenced by CMAC_Base::TruncatedFinal(), CMAC_Base::UncheckedSetKey(), VMAC_Base::UncheckedSetKey(), CMAC_Base::Update(), and CBC_MAC_Base::Update().
|
virtual |
Provides input and output data alignment for optimal performance.
Reimplemented in SAFER::Base.
Definition at line 232 of file cryptlib.cpp.
Referenced by VMAC_Base::OptimalDataAlignment(), and GCM_Base::OptimalDataAlignment().
|
pure virtual |
Determines if the cipher is being operated in its forward direction.
|
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 716 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 181 of file cryptlib.cpp.
References Name::BlockSize(), and xorbuf().
Referenced by ECB_OneWay::ProcessData(), CBC_Encryption::ProcessData(), CBC_Decryption::ProcessData(), CMAC_Base::TruncatedFinal(), VMAC_Base::UncheckedSetKey(), CBC_MAC_Base::Update(), and CMAC_Base::Update().
|
inline |
Definition at line 742 of file cryptlib.h.
|
inlinevirtualinherited |
Provides the name of this algorithm.
The standard algorithm name can be a name like AES or AES/GCM. Some algorithms do not have standard names yet. For example, there is no standard algorithm name for Shoup's ECIES.
Reimplemented in AuthenticatedSymmetricCipher, SignatureVerificationFilter, SignerFilter, AuthenticatedDecryptionFilter, HashVerificationFilter, HashFilter, StreamTransformationFilter, ClassNullRNG, BitBucket, RDSEED, DH_Domain< GROUP_PARAMETERS, COFACTOR_OPTION >, HMAC< T >, RDRAND, CRC32, GCM_Base, Adler32, EAX_Base, CCM_Base, SHA3, and VMAC_Base.
Definition at line 488 of file cryptlib.h.
Referenced by VariableRounds< 6, 2 >::StaticGetDefaultRounds().
|
inlinevirtualinherited |
Copies this object.
NotImplemented |
Definition at line 464 of file cryptlib.h.