9#ifndef BOTAN_MODE_PADDING_H_
10#define BOTAN_MODE_PADDING_H_
12#include <botan/secmem.h>
32 static std::unique_ptr<BlockCipherModePaddingMethod> create(std::string_view algo_spec);
48 virtual size_t unpad(
const uint8_t block[],
size_t len)
const = 0;
59 virtual std::string
name()
const = 0;
72 void add_padding(
secure_vector<uint8_t>& buffer,
size_t final_block_bytes,
size_t block_size)
const override;
74 size_t unpad(
const uint8_t[],
size_t)
const override;
78 std::string
name()
const override {
return "PKCS7"; }
86 void add_padding(
secure_vector<uint8_t>& buffer,
size_t final_block_bytes,
size_t block_size)
const override;
88 size_t unpad(
const uint8_t[],
size_t)
const override;
92 std::string
name()
const override {
return "X9.23"; }
100 void add_padding(
secure_vector<uint8_t>& buffer,
size_t final_block_bytes,
size_t block_size)
const override;
102 size_t unpad(
const uint8_t[],
size_t)
const override;
106 std::string
name()
const override {
return "OneAndZeros"; }
114 void add_padding(
secure_vector<uint8_t>& buffer,
size_t final_block_bytes,
size_t block_size)
const override;
116 size_t unpad(
const uint8_t[],
size_t)
const override;
120 std::string
name()
const override {
return "ESP"; }
131 size_t unpad(
const uint8_t[],
size_t size)
const override {
return size; }
135 std::string
name()
const override {
return "NoPadding"; }
std::string name() const override
bool valid_blocksize(size_t bs) const override
virtual std::string name() const =0
virtual bool valid_blocksize(size_t block_size) const =0
virtual size_t unpad(const uint8_t block[], size_t len) const =0
virtual ~BlockCipherModePaddingMethod()=default
virtual void add_padding(secure_vector< uint8_t > &buffer, size_t final_block_bytes, size_t block_size) const =0
std::string name() const override
bool valid_blocksize(size_t bs) const override
size_t unpad(const uint8_t[], size_t size) const override
std::string name() const override
bool valid_blocksize(size_t) const override
void add_padding(secure_vector< uint8_t > &, size_t, size_t) const override
std::string name() const override
bool valid_blocksize(size_t bs) const override
bool valid_blocksize(size_t bs) const override
std::string name() const override
int(* final)(unsigned char *, CTX *)
std::vector< T, secure_allocator< T > > secure_vector