Botan 3.6.1
Crypto and TLS for C&
|
#include <mode_pad.h>
Public Member Functions | |
virtual void | add_padding (secure_vector< uint8_t > &buffer, size_t final_block_bytes, size_t block_size) const =0 |
virtual std::string | name () const =0 |
virtual size_t | unpad (const uint8_t block[], size_t len) const =0 |
virtual bool | valid_blocksize (size_t block_size) const =0 |
virtual | ~BlockCipherModePaddingMethod ()=default |
Static Public Member Functions | |
static std::unique_ptr< BlockCipherModePaddingMethod > | create (std::string_view algo_spec) |
Block Cipher Mode Padding Method This class is pretty limited, it cannot deal well with randomized padding methods, or any padding method that wants to add more than one block. For instance, it should be possible to define cipher text stealing mode as simply a padding mode for CBC, which happens to consume the last two block (and requires use of the block cipher).
Definition at line 26 of file mode_pad.h.
|
virtualdefault |
virtual destructor
|
pure virtual |
Add padding bytes to buffer.
buffer | data to pad |
final_block_bytes | size of the final block in bytes |
block_size | size of each block in bytes |
Implemented in Botan::ANSI_X923_Padding, Botan::ESP_Padding, Botan::Null_Padding, Botan::OneAndZeros_Padding, and Botan::PKCS7_Padding.
|
static |
Get a block cipher padding mode by name (eg "NoPadding" or "PKCS7")
algo_spec | block cipher padding mode name |
Get a block cipher padding method by name
Definition at line 19 of file mode_pad.cpp.
Referenced by Botan::Cipher_Mode::create().
|
pure virtual |
Implemented in Botan::ANSI_X923_Padding, Botan::ESP_Padding, Botan::Null_Padding, Botan::OneAndZeros_Padding, and Botan::PKCS7_Padding.
|
pure virtual |
Remove padding bytes from block
block | the last block |
len | the size of the block in bytes |
Implemented in Botan::ANSI_X923_Padding, Botan::ESP_Padding, Botan::Null_Padding, Botan::OneAndZeros_Padding, and Botan::PKCS7_Padding.
|
pure virtual |
block_size | of the cipher |
Implemented in Botan::ANSI_X923_Padding, Botan::ESP_Padding, Botan::Null_Padding, Botan::OneAndZeros_Padding, and Botan::PKCS7_Padding.