nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds > Class Template Reference

DJB's ChaCha (https://cr.yp.to/chacha.html) More...

#include <chacha.hpp>

+ Collaboration diagram for nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >:

Public Types

typedef policy_type::block_type block_type
 
typedef policy_type::iv_type iv_type
 
typedef policy_type::key_schedule_type key_schedule_type
 
typedef policy_type::key_type key_type
 

Public Member Functions

 chacha (key_schedule_type &schedule, const key_type &key, const iv_type &iv=iv_type())
 
template<typename InputRange , typename OutputRange >
void process (InputRange &in, OutputRange &out, key_schedule_type &schedule, block_type &block)
 
void seek (block_type &block, key_schedule_type &schedule, uint64_t offset)
 

Static Public Attributes

constexpr static const std::size_t block_bits = policy_type::block_bits
 
constexpr static const std::size_t block_size = policy_type::block_size
 
constexpr static const std::size_t iv_bits = policy_type::iv_bits
 
constexpr static const std::size_t key_bits = policy_type::key_bits
 
constexpr static const std::size_t max_key_bits = policy_type::max_key_bits
 
constexpr static const std::size_t min_key_bits = policy_type::min_key_bits
 
constexpr static const std::size_t min_key_schedule_bits = policy_type::min_key_schedule_bits
 
constexpr static const std::size_t min_key_schedule_size = policy_type::min_key_schedule_size
 
constexpr static const std::size_t rounds = policy_type::rounds
 

Detailed Description

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
class nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >

DJB's ChaCha (https://cr.yp.to/chacha.html)

Template Parameters
RoundsAmount of rounds
Note
Currently only 8, 12 or 20 rounds are supported, all others will throw an exception

Member Typedef Documentation

◆ block_type

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
typedef policy_type::block_type nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::block_type

◆ iv_type

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
typedef policy_type::iv_type nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::iv_type

◆ key_schedule_type

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
typedef policy_type::key_schedule_type nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::key_schedule_type

◆ key_type

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
typedef policy_type::key_type nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::key_type

Constructor & Destructor Documentation

◆ chacha()

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::chacha ( key_schedule_type schedule,
const key_type key,
const iv_type iv = iv_type() 
)
inline

Member Function Documentation

◆ process()

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
template<typename InputRange , typename OutputRange >
void nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::process ( InputRange &  in,
OutputRange &  out,
key_schedule_type schedule,
block_type block 
)
inline

◆ seek()

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
void nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::seek ( block_type block,
key_schedule_type schedule,
uint64_t  offset 
)
inline

Member Data Documentation

◆ block_bits

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
constexpr static const std::size_t nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::block_bits = policy_type::block_bits
staticconstexpr

◆ block_size

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
constexpr static const std::size_t nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::block_size = policy_type::block_size
staticconstexpr

◆ iv_bits

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
constexpr static const std::size_t nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::iv_bits = policy_type::iv_bits
staticconstexpr

◆ key_bits

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
constexpr static const std::size_t nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::key_bits = policy_type::key_bits
staticconstexpr

◆ max_key_bits

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
constexpr static const std::size_t nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::max_key_bits = policy_type::max_key_bits
staticconstexpr

◆ min_key_bits

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
constexpr static const std::size_t nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::min_key_bits = policy_type::min_key_bits
staticconstexpr

◆ min_key_schedule_bits

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
constexpr static const std::size_t nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::min_key_schedule_bits = policy_type::min_key_schedule_bits
staticconstexpr

◆ min_key_schedule_size

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
constexpr static const std::size_t nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::min_key_schedule_size = policy_type::min_key_schedule_size
staticconstexpr

◆ rounds

template<std::size_t IVBits = 64, std::size_t KeyBits = 128, std::size_t Rounds = 20>
constexpr static const std::size_t nil::crypto3::stream::chacha< IVBits, KeyBits, Rounds >::rounds = policy_type::rounds
staticconstexpr

The documentation for this class was generated from the following files: