|
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 |
PKCS#7 Padding
Definition at line 59 of file mode_pad.h.
| void Botan::PKCS7_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 36 of file mode_pad.cpp.
{
const byte pad_value = block_size - last_byte_pos;
for(size_t i = 0; i != pad_value; ++i)
buffer.push_back(pad_value);
}
| std::string Botan::PKCS7_Padding::name | ( | ) | const [inline, virtual] |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 70 of file mode_pad.h.
Referenced by unpad().
{ return "PKCS7"; }
| size_t Botan::PKCS7_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 49 of file mode_pad.cpp.
References name().
| bool Botan::PKCS7_Padding::valid_blocksize | ( | size_t | block_size | ) | const [inline, virtual] |
| block_size | of the cipher |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 68 of file mode_pad.h.
{ return (bs > 0 && bs < 256); }
1.7.6.1