nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator > Struct Template Reference

#include <ccm.hpp>

+ Collaboration diagram for nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >:

Public Types

typedef std::vector< boost::uint_t< CHAR_BIT >, Allocator< boost::uint_t< CHAR_BIT > > > associated_data_type
 
typedef cipher_type::block_type block_type
 
typedef Cipher cipher_type
 
typedef std::array< std::uint8_t, nonce_sizenonce_type
 
typedef Padding padding_type
 

Public Member Functions

 BOOST_STATIC_ASSERT (block_bits==128)
 
 BOOST_STATIC_ASSERT (length_bits >=2 &&length_bits<=8)
 
 BOOST_STATIC_ASSERT (nonce_bits >=min_nonce_bits &&nonce_bits<=max_nonce_bits)
 
 BOOST_STATIC_ASSERT (tag_bits % 2)
 
 BOOST_STATIC_ASSERT (tag_bits >=4 *CHAR_BIT &&tag_bits<=16 *CHAR_BIT)
 

Static Public Member Functions

static void encode_length (std::size_t len, uint8_t out[])
 
static block_type format_b0 (const associated_data_type &ad, const nonce_type &nonce, size_t sz)
 
static block_type format_c0 (const nonce_type &nonce)
 
template<typename Container >
static void inc (Container &C)
 

Static Public Attributes

constexpr static const std::size_t block_bits = cipher_type::block_bits
 
constexpr static const std::size_t block_words = cipher_type::block_words
 
constexpr static const std::size_t length_bits = LengthBits
 
constexpr static const std::size_t max_nonce_bits = 15 * CHAR_BIT - length_bits
 
constexpr static const std::size_t min_nonce_bits = 0
 
constexpr static const std::size_t nonce_bits = NonceBits
 
constexpr static const std::size_t nonce_size = nonce_bits / CHAR_BIT
 
constexpr static const std::size_t tag_bits = TagBits
 

Member Typedef Documentation

◆ associated_data_type

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
typedef std::vector<boost::uint_t<CHAR_BIT>, Allocator<boost::uint_t<CHAR_BIT> > > nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::associated_data_type

◆ block_type

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
typedef cipher_type::block_type nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::block_type

◆ cipher_type

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
typedef Cipher nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::cipher_type

◆ nonce_type

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
typedef std::array<std::uint8_t, nonce_size> nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::nonce_type

◆ padding_type

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
typedef Padding nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::padding_type

Member Function Documentation

◆ BOOST_STATIC_ASSERT() [1/5]

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::BOOST_STATIC_ASSERT ( block_bits  = =128)

◆ BOOST_STATIC_ASSERT() [2/5]

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::BOOST_STATIC_ASSERT ( length_bits >=2 &&length_bits<=  8)

◆ BOOST_STATIC_ASSERT() [3/5]

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::BOOST_STATIC_ASSERT ( nonce_bits >=min_nonce_bits &&nonce_bits<=  max_nonce_bits)

◆ BOOST_STATIC_ASSERT() [4/5]

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::BOOST_STATIC_ASSERT ( tag_bits 2)

◆ BOOST_STATIC_ASSERT() [5/5]

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::BOOST_STATIC_ASSERT ( tag_bits >=4 *CHAR_BIT &&tag_bits<=16 *  CHAR_BIT)

◆ encode_length()

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
static void nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::encode_length ( std::size_t  len,
uint8_t  out[] 
)
inlinestatic

◆ format_b0()

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
static block_type nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::format_b0 ( const associated_data_type ad,
const nonce_type nonce,
size_t  sz 
)
inlinestatic

◆ format_c0()

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
static block_type nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::format_c0 ( const nonce_type nonce)
inlinestatic

◆ inc()

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
template<typename Container >
static void nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::inc ( Container &  C)
inlinestatic

Member Data Documentation

◆ block_bits

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
constexpr static const std::size_t nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::block_bits = cipher_type::block_bits
staticconstexpr

◆ block_words

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
constexpr static const std::size_t nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::block_words = cipher_type::block_words
staticconstexpr

◆ length_bits

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
constexpr static const std::size_t nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::length_bits = LengthBits
staticconstexpr

◆ max_nonce_bits

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
constexpr static const std::size_t nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::max_nonce_bits = 15 * CHAR_BIT - length_bits
staticconstexpr

◆ min_nonce_bits

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
constexpr static const std::size_t nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::min_nonce_bits = 0
staticconstexpr

◆ nonce_bits

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
constexpr static const std::size_t nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::nonce_bits = NonceBits
staticconstexpr

◆ nonce_size

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
constexpr static const std::size_t nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::nonce_size = nonce_bits / CHAR_BIT
staticconstexpr

◆ tag_bits

template<typename Cipher , typename Padding , std::size_t NonceBits, std::size_t TagBits = 16 * CHAR_BIT, std::size_t LengthBits = 3 * CHAR_BIT, template< typename > class Allocator = std::allocator>
constexpr static const std::size_t nil::crypto3::block::modes::detail::ccm_policy< Cipher, Padding, NonceBits, TagBits, LengthBits, Allocator >::tag_bits = TagBits
staticconstexpr

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