Botan 3.9.0
Crypto and TLS for C&
|
#include <mode_pad.h>
Public Member Functions | |
void | add_padding (std::span< uint8_t >, size_t, size_t) const override |
std::string | name () const override |
size_t | output_length (size_t input_length, size_t) const override |
size_t | remove_padding (std::span< const uint8_t > last_block) const override |
size_t | unpad (std::span< const uint8_t > last_block) const |
bool | valid_blocksize (size_t) const override |
Static Public Member Functions | |
static std::unique_ptr< BlockCipherModePaddingMethod > | create (std::string_view algo_spec) |
Null Padding
Definition at line 162 of file mode_pad.h.
|
inlineoverridevirtual |
Add padding bytes to buffer.
buffer | data to pad, span must be large enough to hold the padding behind the final (partial) block |
final_block_bytes | size of the final block in bytes |
block_size | size of each block in bytes |
Reimplemented from Botan::BlockCipherModePaddingMethod.
Definition at line 164 of file mode_pad.h.
|
staticinherited |
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 20 of file mode_pad.cpp.
Referenced by Botan::Cipher_Mode::create().
|
inlineoverridevirtual |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 176 of file mode_pad.h.
|
inlineoverridevirtual |
input_length | number of bytes to be padded |
block_size | size of each block in bytes |
Reimplemented from Botan::BlockCipherModePaddingMethod.
Definition at line 174 of file mode_pad.h.
|
inlineoverridevirtual |
Removes the padding from last_block
and returns the number of data bytes. If the padding is invalid, this returns the byte length of last_block
.
Concrete implementations of this function must ensure not to leak the size or validity of the padding via side channels. The bytes of last_block
are passed in with CT::poison applied to them.
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 170 of file mode_pad.h.
|
inherited |
Remove padding bytes from block
last_block | the last block containing the padding |
last_block
(i.e. the block size) Definition at line 54 of file mode_pad.cpp.
References Botan::CT::driveby_unpoison(), remove_padding(), Botan::CT::scoped_poison(), and valid_blocksize().
|
inlineoverridevirtual |
block_size | of the cipher |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 172 of file mode_pad.h.