nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits > Struct Template Reference

#include <chacha_policy.hpp>

+ Inheritance diagram for nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >:
+ Collaboration diagram for nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >:

Public Types

typedef std::array< byte_type, block_sizeblock_type
 
typedef basic_functions< 32 >::byte_type byte_type
 
typedef std::array< byte_type, iv_sizeiv_type
 
typedef std::array< word_type, key_schedule_sizekey_schedule_type
 
typedef std::array< byte_type, key_sizekey_type
 
typedef std::array< word_type, round_constants_sizeround_constants_type
 
typedef byte_type value_type
 
typedef basic_functions< 32 >::word_type word_type
 

Public Member Functions

 BOOST_STATIC_ASSERT (key_size % 16==0)
 
 BOOST_STATIC_ASSERT (min_key_bits<=KeyBits<=max_key_bits)
 
 BOOST_STATIC_ASSERT (Rounds % 2==0)
 
 CRYPTO3_INLINE_VARIABLE (round_constants_type, sigma,({0x61707865, 0x3320646e, 0x79622d32, 0x6b206574}))
 
 CRYPTO3_INLINE_VARIABLE (round_constants_type, tau,({0x61707865, 0x3120646e, 0x79622d36, 0x6b206574}))
 

Static Public Member Functions

static word_type rotl (word_type x)
 
static word_type rotl (word_type x, std::size_t n)
 
static word_type rotr (word_type x)
 
static word_type rotr (word_type x, std::size_t n)
 
static word_type shl (word_type x)
 
static word_type shl (word_type x, std::size_t n)
 
static word_type shr (word_type x)
 
static word_type shr (word_type x, std::size_t n)
 

Static Public Attributes

constexpr static const std::size_t block_bits = block_size * value_bits
 
constexpr static const std::size_t block_size = 64
 
constexpr static const std::size_t iv_bits = IVBits
 
constexpr static const std::size_t iv_size = IVBits / CHAR_BIT
 
constexpr static const std::size_t key_bits = KeyBits
 
constexpr static const std::size_t key_schedule_bits = key_schedule_size * word_bits
 
constexpr static const std::size_t key_schedule_size = 16
 
constexpr static const std::size_t key_size = key_bits / CHAR_BIT
 
constexpr static const std::size_t max_key_bits = 32 * CHAR_BIT
 
constexpr static const std::size_t min_key_bits = 16 * CHAR_BIT
 
constexpr static const std::size_t round_constants_size = 4
 
constexpr static const std::size_t rounds = Rounds
 
constexpr static const std::size_t value_bits = CHAR_BIT
 
constexpr static const std::size_t word_bits = basic_functions<32>::word_bits
 

Member Typedef Documentation

◆ block_type

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
typedef std::array<byte_type, block_size> nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::block_type

◆ byte_type

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
typedef basic_functions<32>::byte_type nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::byte_type

◆ iv_type

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
typedef std::array<byte_type, iv_size> nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::iv_type

◆ key_schedule_type

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
typedef std::array<word_type, key_schedule_size> nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::key_schedule_type

◆ key_type

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
typedef std::array<byte_type, key_size> nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::key_type

◆ round_constants_type

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
typedef std::array<word_type, round_constants_size> nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::round_constants_type

◆ value_type

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
typedef byte_type nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::value_type

◆ word_type

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
typedef basic_functions<32>::word_type nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::word_type

Member Function Documentation

◆ BOOST_STATIC_ASSERT() [1/3]

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::BOOST_STATIC_ASSERT ( key_size 16 = =0)

◆ BOOST_STATIC_ASSERT() [2/3]

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::BOOST_STATIC_ASSERT ( min_key_bits<=KeyBits<=  max_key_bits)

◆ BOOST_STATIC_ASSERT() [3/3]

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::BOOST_STATIC_ASSERT ( Rounds %  2 = =0)

◆ CRYPTO3_INLINE_VARIABLE() [1/2]

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::CRYPTO3_INLINE_VARIABLE ( round_constants_type  ,
sigma  ,
({0x61707865, 0x3320646e, 0x79622d32, 0x6b206574})   
)

◆ CRYPTO3_INLINE_VARIABLE() [2/2]

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::CRYPTO3_INLINE_VARIABLE ( round_constants_type  ,
tau  ,
({0x61707865, 0x3120646e, 0x79622d36, 0x6b206574})   
)

◆ rotl() [1/2]

static word_type nil::crypto3::stream::detail::basic_functions< WordBits >::rotl ( word_type  x)
inlinestaticinherited

◆ rotl() [2/2]

static word_type nil::crypto3::stream::detail::basic_functions< WordBits >::rotl ( word_type  x,
std::size_t  n 
)
inlinestaticinherited

◆ rotr() [1/2]

static word_type nil::crypto3::stream::detail::basic_functions< WordBits >::rotr ( word_type  x)
inlinestaticinherited

◆ rotr() [2/2]

static word_type nil::crypto3::stream::detail::basic_functions< WordBits >::rotr ( word_type  x,
std::size_t  n 
)
inlinestaticinherited

◆ shl() [1/2]

static word_type nil::crypto3::stream::detail::basic_functions< WordBits >::shl ( word_type  x)
inlinestaticinherited

◆ shl() [2/2]

static word_type nil::crypto3::stream::detail::basic_functions< WordBits >::shl ( word_type  x,
std::size_t  n 
)
inlinestaticinherited

◆ shr() [1/2]

static word_type nil::crypto3::stream::detail::basic_functions< WordBits >::shr ( word_type  x)
inlinestaticinherited

◆ shr() [2/2]

static word_type nil::crypto3::stream::detail::basic_functions< WordBits >::shr ( word_type  x,
std::size_t  n 
)
inlinestaticinherited

Member Data Documentation

◆ block_bits

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::block_bits = block_size * value_bits
staticconstexpr

◆ block_size

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::block_size = 64
staticconstexpr

◆ iv_bits

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::iv_bits = IVBits
staticconstexpr

◆ iv_size

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::iv_size = IVBits / CHAR_BIT
staticconstexpr

◆ key_bits

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::key_bits = KeyBits
staticconstexpr

◆ key_schedule_bits

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::key_schedule_bits = key_schedule_size * word_bits
staticconstexpr

◆ key_schedule_size

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::key_schedule_size = 16
staticconstexpr

◆ key_size

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::key_size = key_bits / CHAR_BIT
staticconstexpr

◆ max_key_bits

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::max_key_bits = 32 * CHAR_BIT
staticconstexpr

◆ min_key_bits

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::min_key_bits = 16 * CHAR_BIT
staticconstexpr

◆ round_constants_size

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::round_constants_size = 4
staticconstexpr

◆ rounds

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::rounds = Rounds
staticconstexpr

◆ value_bits

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::value_bits = CHAR_BIT
staticconstexpr

◆ word_bits

template<std::size_t Rounds, std::size_t IVBits, std::size_t KeyBits>
constexpr static const std::size_t nil::crypto3::stream::detail::chacha_policy< Rounds, IVBits, KeyBits >::word_bits = basic_functions<32>::word_bits
staticconstexpr

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