Botan  2.8.0
Crypto and TLS for C++11
Public Member Functions | List of all members
Botan::Null_Padding Class Referencefinal

#include <mode_pad.h>

Inheritance diagram for Botan::Null_Padding:
Botan::BlockCipherModePaddingMethod

Public Member Functions

void add_padding (secure_vector< uint8_t > &, size_t, size_t) const override
 
std::string name () const override
 
size_t unpad (const uint8_t[], size_t size) const override
 
bool valid_blocksize (size_t) const override
 

Detailed Description

Null Padding

Definition at line 135 of file mode_pad.h.

Member Function Documentation

◆ add_padding()

void Botan::Null_Padding::add_padding ( secure_vector< uint8_t > &  buffer,
size_t  final_block_bytes,
size_t  block_size 
) const
inlineoverridevirtual

Add padding bytes to buffer.

Parameters
bufferdata to pad
final_block_bytessize of the final block in bytes
block_sizesize of each block in bytes

Implements Botan::BlockCipherModePaddingMethod.

Definition at line 138 of file mode_pad.h.

139  {
140  /* no padding */
141  }

◆ name()

std::string Botan::Null_Padding::name ( ) const
inlineoverridevirtual
Returns
name of the mode

Implements Botan::BlockCipherModePaddingMethod.

Definition at line 147 of file mode_pad.h.

147 { return "NoPadding"; }

◆ unpad()

size_t Botan::Null_Padding::unpad ( const uint8_t  block[],
size_t  len 
) const
inlineoverridevirtual

Remove padding bytes from block

Parameters
blockthe last block
lenthe size of the block in bytes
Returns
number of data bytes, or if the padding is invalid returns len

Implements Botan::BlockCipherModePaddingMethod.

Definition at line 143 of file mode_pad.h.

143 { return size; }

◆ valid_blocksize()

bool Botan::Null_Padding::valid_blocksize ( size_t  block_size) const
inlineoverridevirtual
Parameters
block_sizeof the cipher
Returns
valid block size for this padding mode

Implements Botan::BlockCipherModePaddingMethod.

Definition at line 145 of file mode_pad.h.

145 { return true; }

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