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

#include <salsa20_policy.hpp>

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

Public Types

typedef std::array< byte_type, block_sizeblock_type
 
typedef policy_type::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 basic_functions< 32 > policy_type
 
typedef std::array< word_type, round_constants_sizeround_constants_type
 
typedef byte_type value_type
 
typedef policy_type::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 void hsalsa20 (word_type output[8], const key_schedule_type input)
 
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 void salsa_core (block_type &block, const key_schedule_type &input)
 
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
 

Member Typedef Documentation

◆ block_type

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

◆ byte_type

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

◆ iv_type

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

◆ key_schedule_type

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

◆ key_type

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

◆ policy_type

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

◆ round_constants_type

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

◆ value_type

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

◆ word_type

template<std::size_t IVBits, std::size_t KeyBits, std::size_t Rounds>
typedef policy_type::word_type nil::crypto3::stream::detail::salsa20_policy< IVBits, KeyBits, Rounds >::word_type

Member Function Documentation

◆ BOOST_STATIC_ASSERT() [1/3]

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

◆ BOOST_STATIC_ASSERT() [2/3]

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

◆ BOOST_STATIC_ASSERT() [3/3]

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

◆ CRYPTO3_INLINE_VARIABLE() [1/2]

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

◆ CRYPTO3_INLINE_VARIABLE() [2/2]

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

◆ hsalsa20()

template<std::size_t IVBits, std::size_t KeyBits, std::size_t Rounds>
static void nil::crypto3::stream::detail::salsa20_policy< IVBits, KeyBits, Rounds >::hsalsa20 ( word_type  output[8],
const key_schedule_type  input 
)
inlinestatic

◆ 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

◆ salsa_core()

template<std::size_t IVBits, std::size_t KeyBits, std::size_t Rounds>
static void nil::crypto3::stream::detail::salsa20_policy< IVBits, KeyBits, Rounds >::salsa_core ( block_type block,
const key_schedule_type input 
)
inlinestatic

◆ 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 IVBits, std::size_t KeyBits, std::size_t Rounds>
constexpr static const std::size_t nil::crypto3::stream::detail::salsa20_policy< IVBits, KeyBits, Rounds >::block_bits = block_size * value_bits
staticconstexpr

◆ block_size

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

◆ iv_bits

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

◆ iv_size

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

◆ key_bits

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

◆ key_schedule_bits

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

◆ key_schedule_size

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

◆ key_size

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

◆ max_key_bits

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

◆ min_key_bits

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

◆ round_constants_size

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

◆ rounds

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

◆ value_bits

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

◆ word_bits

constexpr static const std::size_t nil::crypto3::stream::detail::basic_functions< WordBits >::word_bits
staticconstexprinherited

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