Botan
1.11.15
|
#include <mode_pad.h>
Public Member Functions | |
void | add_padding (secure_vector< byte > &buffer, size_t final_block_bytes, size_t block_size) const override |
std::string | name () const |
size_t | unpad (const byte[], size_t) const |
bool | valid_blocksize (size_t bs) const |
ANSI X9.23 Padding
Definition at line 76 of file mode_pad.h.
void Botan::ANSI_X923_Padding::add_padding | ( | secure_vector< byte > & | buffer, |
size_t | final_block_bytes, | ||
size_t | block_size | ||
) | const [override, virtual] |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 66 of file mode_pad.cpp.
{ const byte pad_value = block_size - last_byte_pos; for(size_t i = last_byte_pos; i < block_size; ++i) buffer.push_back(0); buffer.push_back(pad_value); }
std::string Botan::ANSI_X923_Padding::name | ( | ) | const [inline, virtual] |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 87 of file mode_pad.h.
Referenced by unpad().
{ return "X9.23"; }
size_t Botan::ANSI_X923_Padding::unpad | ( | const byte | block[], |
size_t | size | ||
) | const [virtual] |
block | the last block |
size | the of the block |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 80 of file mode_pad.cpp.
References name().
bool Botan::ANSI_X923_Padding::valid_blocksize | ( | size_t | block_size | ) | const [inline, virtual] |
block_size | of the cipher |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 85 of file mode_pad.h.
{ return (bs > 0 && bs < 256); }