diff options
author | lloyd <[email protected]> | 2008-09-28 23:58:33 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2008-09-28 23:58:33 +0000 |
commit | c14cca7ef7338de3a8da784dd0865634b4110539 (patch) | |
tree | 069b52098e789d9cb7d0ee3fe889d9c8f860b0e9 /include | |
parent | 3bf4dc81e4b75a0dafacdc947089b3ec21193153 (diff) |
Move mode padding schemes to modes/mode_pad module
Diffstat (limited to 'include')
-rw-r--r-- | include/mode_pad.h | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/include/mode_pad.h b/include/mode_pad.h deleted file mode 100644 index 4041efcdc..000000000 --- a/include/mode_pad.h +++ /dev/null @@ -1,79 +0,0 @@ -/************************************************* -* CBC Padding Methods Header File * -* (C) 1999-2007 Jack Lloyd * -*************************************************/ - -#ifndef BOTAN_CBC_PADDING_H__ -#define BOTAN_CBC_PADDING_H__ - -#include <botan/base.h> -#include <string> - -namespace Botan { - -/************************************************* -* Block Cipher Mode Padding Method * -*************************************************/ -class BOTAN_DLL BlockCipherModePaddingMethod - { - public: - virtual void pad(byte[], u32bit, u32bit) const = 0; - virtual u32bit unpad(const byte[], u32bit) const = 0; - virtual u32bit pad_bytes(u32bit, u32bit) const; - virtual bool valid_blocksize(u32bit) const = 0; - virtual std::string name() const = 0; - virtual ~BlockCipherModePaddingMethod() {} - }; - -/************************************************* -* PKCS#7 Padding * -*************************************************/ -class BOTAN_DLL PKCS7_Padding : public BlockCipherModePaddingMethod - { - public: - void pad(byte[], u32bit, u32bit) const; - u32bit unpad(const byte[], u32bit) const; - bool valid_blocksize(u32bit) const; - std::string name() const { return "PKCS7"; } - }; - -/************************************************* -* ANSI X9.23 Padding * -*************************************************/ -class BOTAN_DLL ANSI_X923_Padding : public BlockCipherModePaddingMethod - { - public: - void pad(byte[], u32bit, u32bit) const; - u32bit unpad(const byte[], u32bit) const; - bool valid_blocksize(u32bit) const; - std::string name() const { return "X9.23"; } - }; - -/************************************************* -* One And Zeros Padding * -*************************************************/ -class BOTAN_DLL OneAndZeros_Padding : public BlockCipherModePaddingMethod - { - public: - void pad(byte[], u32bit, u32bit) const; - u32bit unpad(const byte[], u32bit) const; - bool valid_blocksize(u32bit) const; - std::string name() const { return "OneAndZeros"; } - }; - -/************************************************* -* Null Padding * -*************************************************/ -class BOTAN_DLL Null_Padding : public BlockCipherModePaddingMethod - { - public: - void pad(byte[], u32bit, u32bit) const { return; } - u32bit unpad(const byte[], u32bit size) const { return size; } - u32bit pad_bytes(u32bit, u32bit) const { return 0; } - bool valid_blocksize(u32bit) const { return true; } - std::string name() const { return "NoPadding"; } - }; - -} - -#endif |