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 |
One And Zeros Padding
Definition at line 93 of file mode_pad.h.
void Botan::OneAndZeros_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 94 of file mode_pad.cpp.
{ buffer.push_back(0x80); for(size_t i = last_byte_pos + 1; i % block_size; ++i) buffer.push_back(0x00); }
std::string Botan::OneAndZeros_Padding::name | ( | ) | const [inline, virtual] |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 104 of file mode_pad.h.
Referenced by unpad().
{ return "OneAndZeros"; }
size_t Botan::OneAndZeros_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 107 of file mode_pad.cpp.
References name().
bool Botan::OneAndZeros_Padding::valid_blocksize | ( | size_t | block_size | ) | const [inline, virtual] |
block_size | of the cipher |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 102 of file mode_pad.h.
{ return (bs > 0); }