#include <mode_pad.h>

Public Member Functions | |
| std::string | name () const |
| void | pad (byte[], u32bit, u32bit) const |
| virtual u32bit | pad_bytes (u32bit block_size, u32bit position) const |
| u32bit | unpad (const byte[], u32bit) const |
| bool | valid_blocksize (u32bit) const |
Definition at line 72 of file mode_pad.h.
| std::string Botan::PKCS7_Padding::name | ( | ) | const [inline, virtual] |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 78 of file mode_pad.h.
Referenced by unpad().
| void Botan::PKCS7_Padding::pad | ( | byte | block[], | |
| u32bit | size, | |||
| u32bit | current_position | |||
| ) | const [virtual] |
| block | output buffer | |
| size | of the block | |
| current_position | in the last block |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 24 of file mode_pad.cpp.
00025 { 00026 for(u32bit j = 0; j != size; ++j) 00027 block[j] = (size-position); 00028 }
| u32bit Botan::BlockCipherModePaddingMethod::pad_bytes | ( | u32bit | block_size, | |
| u32bit | position | |||
| ) | const [virtual, inherited] |
| block_size | of the cipher | |
| position | in the current block |
Reimplemented in Botan::Null_Padding.
Definition at line 16 of file mode_pad.cpp.
| block | the last block | |
| size | the of the block |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 33 of file mode_pad.cpp.
References name().
00034 { 00035 u32bit position = block[size-1]; 00036 if(position > size) 00037 throw Decoding_Error(name()); 00038 for(u32bit j = size-position; j != size-1; ++j) 00039 if(block[j] != position) 00040 throw Decoding_Error(name()); 00041 return (size-position); 00042 }
| bool Botan::PKCS7_Padding::valid_blocksize | ( | u32bit | block_size | ) | const [virtual] |
| block_size | of the cipher |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 47 of file mode_pad.cpp.
1.5.8