#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 96 of file mode_pad.h.
| std::string Botan::OneAndZeros_Padding::name | ( | ) | const [inline, virtual] |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 102 of file mode_pad.h.
Referenced by unpad().
| void Botan::OneAndZeros_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 93 of file mode_pad.cpp.
00094 { 00095 block[0] = 0x80; 00096 for(u32bit j = 1; j != size; ++j) 00097 block[j] = 0x00; 00098 }
| 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 103 of file mode_pad.cpp.
References name().
00104 { 00105 while(size) 00106 { 00107 if(block[size-1] == 0x80) 00108 break; 00109 if(block[size-1] != 0x00) 00110 throw Decoding_Error(name()); 00111 size--; 00112 } 00113 if(!size) 00114 throw Decoding_Error(name()); 00115 return (size-1); 00116 }
| bool Botan::OneAndZeros_Padding::valid_blocksize | ( | u32bit | block_size | ) | const [virtual] |
| block_size | of the cipher |
Implements Botan::BlockCipherModePaddingMethod.
Definition at line 121 of file mode_pad.cpp.
1.5.8