Botan 2.1.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
Botan::BlockCipherModePaddingMethod Class Referenceabstract

`#include <mode_pad.h>`

Inheritance diagram for Botan::BlockCipherModePaddingMethod:

## Public Member Functions
virtual void | add_padding (secure_vector< uint8_t > &buffer, size_t final_block_bytes, size_t block_size) const =0
virtual std::string | name () const =0
virtual size_t | unpad (const uint8_t block[], size_t size) const =0
virtual bool | valid_blocksize (size_t block_size) const =0
virtual | ~BlockCipherModePaddingMethod ()=default

## Detailed Description

Block Cipher Mode Padding Method This class is pretty limited, it cannot deal well with randomized padding methods, or any padding method that wants to add more than one block. For instance, it should be possible to define cipher text stealing mode as simply a padding mode for CBC, which happens to consume the last two block (and requires use of the block cipher).

Definition at line 26 of file mode_pad.h.

## Constructor & Destructor Documentation

virtual Botan::BlockCipherModePaddingMethod::~BlockCipherModePaddingMethod | ( |  | ) |
| virtual default

virtual destructor

## Member Function Documentation

virtual void Botan::BlockCipherModePaddingMethod::add_padding | ( | secure_vector< uint8_t > & | buffer,
|  | size_t | final_block_bytes,
|  | size_t | block_size
| ) |  | const
| pure virtual

Add padding bytes to buffer.

Parameters

  buffer | data to pad
  final_block_bytes | size of the final block in bytes
  block_size | size of each block in bytes

Implemented in Botan::Null_Padding, Botan::ESP_Padding, Botan::OneAndZeros_Padding, Botan::ANSI_X923_Padding, and Botan::PKCS7_Padding.

Referenced by Botan::CBC_Encryption::finish().

virtual std::string Botan::BlockCipherModePaddingMethod::name | ( |  | ) | const
| pure virtual

Returns
  name of the mode

Implemented in Botan::Null_Padding, Botan::ESP_Padding, Botan::OneAndZeros_Padding, Botan::ANSI_X923_Padding, and Botan::PKCS7_Padding.

Referenced by Botan::CBC_Decryption::finish(), and Botan::CBC_Mode::name().

virtual size_t Botan::BlockCipherModePaddingMethod::unpad | ( | const uint8_t | block[],
|  | size_t | size
| ) |  | const
| pure virtual

Remove padding bytes from block

Parameters

  block | the last block
  size | the size of the block in bytes

Returns
  number of padding bytes

Implemented in Botan::Null_Padding, Botan::ESP_Padding, Botan::OneAndZeros_Padding, Botan::ANSI_X923_Padding, and Botan::PKCS7_Padding.

Referenced by Botan::CBC_Decryption::finish().

virtual bool Botan::BlockCipherModePaddingMethod::valid_blocksize | ( | size_t | block_size | ) | const
| pure virtual

Parameters

  block_size | of the cipher

Returns
  valid block size for this padding mode

Implemented in Botan::Null_Padding, Botan::ESP_Padding, Botan::OneAndZeros_Padding, Botan::ANSI_X923_Padding, and Botan::PKCS7_Padding.

The documentation for this class was generated from the following file:

- src/lib/modes/mode_pad/mode_pad.h