Public Types |
Public Member Functions |
Static Public Member Functions |
Static Public Attributes |
List of all members
nil::crypto3::block::modes::padding::pkcs7< Cipher > Struct Template Reference
#include <padding.hpp>
Inheritance diagram for nil::crypto3::block::modes::padding::pkcs7< Cipher >:
Collaboration diagram for nil::crypto3::block::modes::padding::pkcs7< Cipher >:
Public Types | |
typedef basic_padding< Cipher >::block_type | block_type |
typedef basic_padding< Cipher >::cipher_type | cipher_type |
typedef basic_padding< Cipher >::size_type | size_type |
Public Member Functions | |
BOOST_STATIC_ASSERT (block_bits > 0 &&block_bits< 256) | |
Static Public Member Functions | |
static void | pad (const block_type &block, size_type bytes_in_block) |
static void | unpad (const block_type &block, size_type bytes_in_block) |
Static Public Attributes | |
constexpr static const size_type | block_bits = basic_padding<Cipher>::block_bits |
constexpr static const size_type | block_words = basic_padding<Cipher>::block_words |
Detailed Description
template<typename Cipher>
struct nil::crypto3::block::modes::padding::pkcs7< Cipher >
- Template Parameters
-
Cipher Block cipher used RFC 2315 (10.3.2) Some content-encryption algorithms assume the input length is a multiple of k octets, where k > 1, and let the application define a method for handling inputs whose lengths are not a multiple of k octets. For such algorithms, the method shall be to pad the input at the trailing end with k - (l mod k) octets all having value k - (l mod k), where l is the length of the input. In other words, the input is padded at the trailing end with one of the following strings: 01 -- if l mod k = k-1 02 02 -- if l mod k = k-2 . . . k k ... k k -- if l mod k = 0
The padding can be removed unambiguously since all input is padded and no padding string is a suffix of another. This padding method is well-defined if and only if k < 256; methods for larger k are an open issue for further study.
Member Typedef Documentation
◆ block_type
template<typename Cipher >
typedef basic_padding<Cipher>::block_type nil::crypto3::block::modes::padding::pkcs7< Cipher >::block_type |
◆ cipher_type
template<typename Cipher >
typedef basic_padding<Cipher>::cipher_type nil::crypto3::block::modes::padding::pkcs7< Cipher >::cipher_type |
◆ size_type
template<typename Cipher >
typedef basic_padding<Cipher>::size_type nil::crypto3::block::modes::padding::pkcs7< Cipher >::size_type |
Member Function Documentation
◆ BOOST_STATIC_ASSERT()
template<typename Cipher >
nil::crypto3::block::modes::padding::pkcs7< Cipher >::BOOST_STATIC_ASSERT | ( | block_bits | ) |
◆ pad()
template<typename Cipher >
|
inlinestatic |
◆ unpad()
template<typename Cipher >
|
inlinestatic |
Member Data Documentation
◆ block_bits
template<typename Cipher >
|
staticconstexpr |
◆ block_words
template<typename Cipher >
|
staticconstexpr |
The documentation for this struct was generated from the following file: