chacha_functions.hpp
Go to the documentation of this file.
1 //---------------------------------------------------------------------------//
2 // Copyright (c) 2019 Mikhail Komarov <nemo@nil.foundation>
3 //
4 // MIT License
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to deal
8 // in the Software without restriction, including without limitation the rights
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in all
14 // copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 // SOFTWARE.
23 //---------------------------------------------------------------------------//
24 
25 #ifndef CRYPTO3_STREAM_CHACHA_FUNCTIONS_HPP
26 #define CRYPTO3_STREAM_CHACHA_FUNCTIONS_HPP
27 
28 #include <boost/predef/architecture.h>
29 
30 #if defined(CRYPTO3_HAS_CHACHA_AVX2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_AVX2_VERSION
32 #elif defined(CRYPTO3_HAS_CHACHA_SSE2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2_VERSION
34 #else
36 #endif
37 
38 namespace nil {
39  namespace crypto3 {
40  namespace stream {
41  namespace detail {
42  template<std::size_t Round, std::size_t IVSize, std::size_t KeyBits>
43  struct chacha_functions : public chacha_policy<Round, IVSize, KeyBits> {
45 
46 #if defined(CRYPTO3_HAS_CHACHA_AVX2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_AVX2_VERSION
48 #elif defined(CRYPTO3_HAS_CHACHA_SSE2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2_VERSION
50 #else
52 #endif
53 
54  constexpr static const std::size_t rounds = policy_type::rounds;
55 
56  constexpr static const std::size_t min_key_schedule_bits = policy_type::key_schedule_bits;
57  constexpr static const std::size_t min_key_schedule_size = policy_type::key_schedule_size;
59 
60  constexpr static const std::size_t min_key_bits = policy_type::min_key_bits;
61  constexpr static const std::size_t max_key_bits = policy_type::max_key_bits;
62  constexpr static const std::size_t key_bits = policy_type::key_bits;
63  typedef typename policy_type::key_type key_type;
64 
65  constexpr static const std::size_t iv_bits = policy_type::iv_bits;
66  typedef typename policy_type::iv_type iv_type;
67 
68  constexpr static const std::size_t block_bits = policy_type::block_bits;
70 
71  static void schedule_key(key_schedule_type &schedule, const key_type &key) {
72  schedule[0] = policy_type::sigma()[0];
73  schedule[1] = policy_type::sigma()[1];
74  schedule[2] = policy_type::sigma()[2];
75  schedule[3] = policy_type::sigma()[3];
76 
77 
78  for (std::uint8_t itr = 0; itr < 4; itr++) {
79  schedule[itr + 4] = boost::endian::native_to_little(
80  make_uint_t(key[4 * itr + 0], key[4 * itr + 1], key[4 * itr + 2], key[4 * itr + 3]));
81  schedule[itr + 2 * 4] = boost::endian::native_to_little(
82  make_uint_t(key[4 * itr + 0], key[4 * itr + 1], key[4 * itr + 2], key[4 * itr + 3]));
83  }
84  }
85  };
86 
87  template<std::size_t Round, std::size_t IVSize>
88  struct chacha_functions<Round, IVSize, 128> : public chacha_policy<Round, IVSize, 128> {
90 
91 #if defined(CRYPTO3_HAS_CHACHA_AVX2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_AVX2_VERSION
93 #elif defined(CRYPTO3_HAS_CHACHA_SSE2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2_VERSION
95 #else
97 #endif
98 
99  constexpr static const std::size_t rounds = policy_type::rounds;
100 
101  constexpr static const std::size_t min_key_schedule_bits = policy_type::key_schedule_bits;
102  constexpr static const std::size_t min_key_schedule_size = policy_type::key_schedule_size;
104 
105  constexpr static const std::size_t min_key_bits = policy_type::min_key_bits;
106  constexpr static const std::size_t max_key_bits = policy_type::max_key_bits;
107  constexpr static const std::size_t key_bits = policy_type::key_bits;
108  typedef typename policy_type::key_type key_type;
109 
110  constexpr static const std::size_t block_bits = policy_type::block_bits;
112 
113  constexpr static const std::size_t iv_bits = policy_type::iv_bits;
114  typedef typename policy_type::iv_type iv_type;
115 
116  static void schedule_key(key_schedule_type &schedule, const key_type &key) {
117  schedule[0] = policy_type::tau()[0];
118  schedule[1] = policy_type::tau()[1];
119  schedule[2] = policy_type::tau()[2];
120  schedule[3] = policy_type::tau()[3];
121 
122 
123  for (std::uint8_t itr = 0; itr < 4; itr++) {
124  schedule[itr + 4] = boost::endian::native_to_little(
125  make_uint_t(key[4 * itr + 0], key[4 * itr + 1], key[4 * itr + 2], key[4 * itr + 3]));
126  schedule[itr + 2 * 4] = boost::endian::native_to_little(
127  make_uint_t(key[4 * itr + 0], key[4 * itr + 1], key[4 * itr + 2], key[4 * itr + 3]));
128  }
129  }
130  };
131 
132  template<std::size_t Round>
133  struct chacha_functions<Round, 64, 128> : public chacha_policy<Round, 64, 128> {
135 
136 #if defined(CRYPTO3_HAS_CHACHA_AVX2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_AVX2_VERSION
138 #elif defined(CRYPTO3_HAS_CHACHA_SSE2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2_VERSION
140 #else
142 #endif
143 
144  constexpr static const std::size_t rounds = policy_type::rounds;
145 
146  constexpr static const std::size_t min_key_schedule_bits = policy_type::key_schedule_bits;
147  constexpr static const std::size_t min_key_schedule_size = policy_type::key_schedule_size;
149 
150  constexpr static const std::size_t min_key_bits = policy_type::min_key_bits;
151  constexpr static const std::size_t max_key_bits = policy_type::max_key_bits;
152  constexpr static const std::size_t key_bits = policy_type::key_bits;
153  typedef typename policy_type::key_type key_type;
154 
155  constexpr static const std::size_t block_bits = policy_type::block_bits;
157 
158  constexpr static const std::size_t iv_bits = policy_type::iv_bits;
159  typedef typename policy_type::iv_type iv_type;
160 
161  static void schedule_iv(block_type &block, key_schedule_type &schedule, const iv_type &iv) {
162  schedule[12] = 0;
163  schedule[13] = 0;
164  schedule[14] = boost::endian::native_to_little(make_uint_t(iv[0], iv[1], iv[2], iv[3]));
165  schedule[15] = boost::endian::native_to_little(make_uint_t(iv[4], iv[5], iv[6], iv[7]));
166 
167  impl_type::chacha_x<4>(block, schedule);
168  }
169 
170  static void schedule_key(key_schedule_type &schedule, const key_type &key) {
171  schedule[0] = policy_type::tau()[0];
172  schedule[1] = policy_type::tau()[1];
173  schedule[2] = policy_type::tau()[2];
174  schedule[3] = policy_type::tau()[3];
175 
176 
177  for (std::uint8_t itr = 0; itr < 4; itr++) {
178  schedule[itr + 4] = boost::endian::native_to_little(
179  make_uint_t(key[4 * itr + 0], key[4 * itr + 1], key[4 * itr + 2], key[4 * itr + 3]));
180  schedule[itr + 2 * 4] = boost::endian::native_to_little(
181  make_uint_t(key[4 * itr + 0], key[4 * itr + 1], key[4 * itr + 2], key[4 * itr + 3]));
182  }
183  }
184  };
185 
186  template<std::size_t Round>
187  struct chacha_functions<Round, 96, 128> : public chacha_policy<Round, 96, 128> {
189 
190 #if defined(CRYPTO3_HAS_CHACHA_AVX2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_AVX2_VERSION
192 #elif defined(CRYPTO3_HAS_CHACHA_SSE2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2_VERSION
194 #else
196 #endif
197 
198  constexpr static const std::size_t rounds = policy_type::rounds;
199 
200  constexpr static const std::size_t min_key_schedule_bits = policy_type::key_schedule_bits;
201  constexpr static const std::size_t min_key_schedule_size = policy_type::key_schedule_size;
203 
204  constexpr static const std::size_t min_key_bits = policy_type::min_key_bits;
205  constexpr static const std::size_t max_key_bits = policy_type::max_key_bits;
206  constexpr static const std::size_t key_bits = policy_type::key_bits;
207  typedef typename policy_type::key_type key_type;
208 
209  constexpr static const std::size_t block_bits = policy_type::block_bits;
211 
212  constexpr static const std::size_t iv_bits = policy_type::iv_bits;
213  typedef typename policy_type::iv_type iv_type;
214 
215  static void schedule_iv(block_type &block, key_schedule_type &schedule, const iv_type &iv) {
216  schedule[12] = 0;
217  schedule[13] = boost::endian::native_to_little(make_uint_t(iv[0], iv[1], iv[2], iv[3]));
218  schedule[14] = boost::endian::native_to_little(make_uint_t(iv[4], iv[5], iv[6], iv[7]));
219  schedule[15] = boost::endian::native_to_little(make_uint_t(iv[8], iv[9], iv[10], iv[11]));
220 
221  impl_type::chacha_x<4>(block, schedule);
222  }
223 
224  static void schedule_key(key_schedule_type &schedule, const key_type &key) {
225  schedule[0] = policy_type::tau()[0];
226  schedule[1] = policy_type::tau()[1];
227  schedule[2] = policy_type::tau()[2];
228  schedule[3] = policy_type::tau()[3];
229 
230 
231  for (std::uint8_t itr = 0; itr < 4; itr++) {
232  schedule[itr + 4] = boost::endian::native_to_little(
233  make_uint_t(key[4 * itr + 0], key[4 * itr + 1], key[4 * itr + 2], key[4 * itr + 3]));
234  schedule[itr + 2 * 4] = boost::endian::native_to_little(
235  make_uint_t(key[4 * itr + 0], key[4 * itr + 1], key[4 * itr + 2], key[4 * itr + 3]));
236  }
237  }
238  };
239 
240  template<std::size_t Round, std::size_t IVSize>
241  struct chacha_functions<Round, IVSize, 256> : public chacha_policy<Round, IVSize, 256> {
242 
244 
245 #if defined(CRYPTO3_HAS_CHACHA_AVX2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_AVX2_VERSION
247 #elif defined(CRYPTO3_HAS_CHACHA_SSE2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2_VERSION
249 #else
251 #endif
252 
253  constexpr static const std::size_t rounds = policy_type::rounds;
254 
255  constexpr static const std::size_t min_key_schedule_bits = policy_type::key_schedule_bits;
256  constexpr static const std::size_t min_key_schedule_size = policy_type::key_schedule_size;
258 
259  constexpr static const std::size_t min_key_bits = policy_type::min_key_bits;
260  constexpr static const std::size_t max_key_bits = policy_type::max_key_bits;
261  constexpr static const std::size_t key_bits = policy_type::key_bits;
262  typedef typename policy_type::key_type key_type;
263 
264  constexpr static const std::size_t block_bits = policy_type::block_bits;
266 
267  constexpr static const std::size_t iv_bits = policy_type::iv_bits;
268  typedef typename policy_type::iv_type iv_type;
269 
270  static void schedule_key(key_schedule_type &schedule, const key_type &key) {
271  schedule[0] = policy_type::sigma()[0];
272  schedule[1] = policy_type::sigma()[1];
273  schedule[2] = policy_type::sigma()[2];
274  schedule[3] = policy_type::sigma()[3];
275 
276 
277  for (std::uint8_t itr = 0; itr < 8; itr++) {
278  schedule[itr + 4] = boost::endian::native_to_little(
279  make_uint_t(key[4 * itr + 0], key[4 * itr + 1], key[4 * itr + 2], key[4 * itr + 3]));
280  }
281  }
282  };
283 
284  template<std::size_t Round>
285  struct chacha_functions<Round, 64, 256> : public chacha_policy<Round, 64, 256> {
286 
288 
289 #if defined(CRYPTO3_HAS_CHACHA_AVX2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_AVX2_VERSION
291 #elif defined(CRYPTO3_HAS_CHACHA_SSE2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2_VERSION
293 #else
295 #endif
296 
297  constexpr static const std::size_t rounds = policy_type::rounds;
298 
299  constexpr static const std::size_t min_key_schedule_bits = policy_type::key_schedule_bits;
300  constexpr static const std::size_t min_key_schedule_size = policy_type::key_schedule_size;
302 
303  constexpr static const std::size_t min_key_bits = policy_type::min_key_bits;
304  constexpr static const std::size_t max_key_bits = policy_type::max_key_bits;
305  constexpr static const std::size_t key_bits = policy_type::key_bits;
306  typedef typename policy_type::key_type key_type;
307 
308  constexpr static const std::size_t block_bits = policy_type::block_bits;
309  constexpr static const std::size_t block_size = policy_type::block_size;
311 
312  constexpr static const std::size_t iv_bits = policy_type::iv_bits;
313  typedef typename policy_type::iv_type iv_type;
314 
315  static void schedule_iv(block_type &block, key_schedule_type &schedule, const iv_type &iv) {
316  schedule[12] = 0;
317  schedule[13] = 0;
318  schedule[14] = boost::endian::native_to_little(make_uint_t(iv[0], iv[1], iv[2], iv[3]));
319  schedule[15] = boost::endian::native_to_little(make_uint_t(iv[4], iv[5], iv[6], iv[7]));
320 
321  impl_type::chacha_x<4>(block, schedule);
322  }
323 
324  static void schedule_key(key_schedule_type &schedule, const key_type &key) {
325  schedule[0] = policy_type::sigma()[0];
326  schedule[1] = policy_type::sigma()[1];
327  schedule[2] = policy_type::sigma()[2];
328  schedule[3] = policy_type::sigma()[3];
329 
330 
331  for (std::uint8_t itr = 0; itr < 8; itr++) {
332  schedule[itr + 4] = boost::endian::native_to_little(
333  make_uint_t(key[4 * itr + 0], key[4 * itr + 1], key[4 * itr + 2], key[4 * itr + 3]));
334  }
335  }
336  };
337 
338  template<std::size_t Round>
339  struct chacha_functions<Round, 96, 256> : public chacha_policy<Round, 96, 256> {
340 
342 
343 #if defined(CRYPTO3_HAS_CHACHA_AVX2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_AVX2_VERSION
345 #elif defined(CRYPTO3_HAS_CHACHA_SSE2) || BOOST_HW_SIMD_X86 >= BOOST_HW_SIMD_X86_SSE2_VERSION
347 #else
349 #endif
350 
351  constexpr static const std::size_t rounds = policy_type::rounds;
352 
353  constexpr static const std::size_t min_key_schedule_bits = policy_type::key_schedule_bits;
354  constexpr static const std::size_t min_key_schedule_size = policy_type::key_schedule_size;
356 
357  constexpr static const std::size_t min_key_bits = policy_type::min_key_bits;
358  constexpr static const std::size_t max_key_bits = policy_type::max_key_bits;
359  constexpr static const std::size_t key_bits = policy_type::key_bits;
360  typedef typename policy_type::key_type key_type;
361 
362  constexpr static const std::size_t block_bits = policy_type::block_bits;
364 
365  constexpr static const std::size_t iv_bits = policy_type::iv_bits;
366  typedef typename policy_type::iv_type iv_type;
367 
368  static void schedule_iv(block_type &block, key_schedule_type &schedule, const iv_type &iv) {
369  schedule[12] = 0;
370  schedule[13] = boost::endian::native_to_little(make_uint_t(iv[0], iv[1], iv[2], iv[3]));
371  schedule[14] = boost::endian::native_to_little(make_uint_t(iv[4], iv[5], iv[6], iv[7]));
372  schedule[15] = boost::endian::native_to_little(make_uint_t(iv[8], iv[9], iv[10], iv[11]));
373 
374  impl_type::chacha_x<4>(block, schedule);
375  }
376 
377  static void schedule_key(key_schedule_type &schedule, const key_type &key) {
378  schedule[0] = policy_type::sigma()[0];
379  schedule[1] = policy_type::sigma()[1];
380  schedule[2] = policy_type::sigma()[2];
381  schedule[3] = policy_type::sigma()[3];
382 
383 
384  for (std::uint8_t itr = 0; itr < 8; itr++) {
385  schedule[itr + 4] = boost::endian::native_to_little(
386  make_uint_t(key[4 * itr + 0], key[4 * itr + 1], key[4 * itr + 2], key[4 * itr + 3]));
387  }
388  }
389  };
390  } // namespace detail
391  } // namespace stream
392  } // namespace crypto3
393 } // namespace nil
394 
395 #endif // CRYPTO3_CHACHA_FUNCTIONS_HPP
boost::mpl::apply< AccumulatorSet, tag::block< Mode > >::type::result_type block(const AccumulatorSet &acc)
Definition: accumulators/block.hpp:259
boost::mpl::apply< AccumulatorSet, tag::stream< Mode > >::type::result_type stream(const AccumulatorSet &acc)
Definition: accumulators/stream.hpp:175
Definition: pair.hpp:31
Definition: chacha_avx2_impl.hpp:39
static void schedule_iv(block_type &block, key_schedule_type &schedule, const iv_type &iv)
Definition: chacha_functions.hpp:161
policy_type::block_type block_type
Definition: chacha_functions.hpp:156
static void schedule_key(key_schedule_type &schedule, const key_type &key)
Definition: chacha_functions.hpp:170
policy_type::key_schedule_type key_schedule_type
Definition: chacha_functions.hpp:148
detail::chacha_avx2_impl< Round, 64, 128 > impl_type
Definition: chacha_functions.hpp:137
chacha_policy< Round, 64, 128 > policy_type
Definition: chacha_functions.hpp:134
policy_type::iv_type iv_type
Definition: chacha_functions.hpp:159
policy_type::key_type key_type
Definition: chacha_functions.hpp:153
policy_type::block_type block_type
Definition: chacha_functions.hpp:310
static void schedule_iv(block_type &block, key_schedule_type &schedule, const iv_type &iv)
Definition: chacha_functions.hpp:315
detail::chacha_avx2_impl< Round, 64, 256 > impl_type
Definition: chacha_functions.hpp:290
policy_type::iv_type iv_type
Definition: chacha_functions.hpp:313
policy_type::key_type key_type
Definition: chacha_functions.hpp:306
chacha_policy< Round, 64, 256 > policy_type
Definition: chacha_functions.hpp:287
static void schedule_key(key_schedule_type &schedule, const key_type &key)
Definition: chacha_functions.hpp:324
policy_type::key_schedule_type key_schedule_type
Definition: chacha_functions.hpp:301
chacha_policy< Round, 96, 128 > policy_type
Definition: chacha_functions.hpp:188
static void schedule_iv(block_type &block, key_schedule_type &schedule, const iv_type &iv)
Definition: chacha_functions.hpp:215
policy_type::key_schedule_type key_schedule_type
Definition: chacha_functions.hpp:202
static void schedule_key(key_schedule_type &schedule, const key_type &key)
Definition: chacha_functions.hpp:224
policy_type::iv_type iv_type
Definition: chacha_functions.hpp:213
policy_type::key_type key_type
Definition: chacha_functions.hpp:207
detail::chacha_avx2_impl< Round, 96, 128 > impl_type
Definition: chacha_functions.hpp:191
policy_type::block_type block_type
Definition: chacha_functions.hpp:210
policy_type::key_type key_type
Definition: chacha_functions.hpp:360
policy_type::key_schedule_type key_schedule_type
Definition: chacha_functions.hpp:355
policy_type::iv_type iv_type
Definition: chacha_functions.hpp:366
chacha_policy< Round, 96, 256 > policy_type
Definition: chacha_functions.hpp:341
detail::chacha_avx2_impl< Round, 96, 256 > impl_type
Definition: chacha_functions.hpp:344
static void schedule_iv(block_type &block, key_schedule_type &schedule, const iv_type &iv)
Definition: chacha_functions.hpp:368
static void schedule_key(key_schedule_type &schedule, const key_type &key)
Definition: chacha_functions.hpp:377
policy_type::block_type block_type
Definition: chacha_functions.hpp:363
static void schedule_key(key_schedule_type &schedule, const key_type &key)
Definition: chacha_functions.hpp:116
policy_type::key_schedule_type key_schedule_type
Definition: chacha_functions.hpp:103
policy_type::key_type key_type
Definition: chacha_functions.hpp:108
policy_type::block_type block_type
Definition: chacha_functions.hpp:111
chacha_policy< Round, IVSize, 128 > policy_type
Definition: chacha_functions.hpp:89
policy_type::iv_type iv_type
Definition: chacha_functions.hpp:114
detail::chacha_avx2_impl< Round, IVSize, 128 > impl_type
Definition: chacha_functions.hpp:92
policy_type::key_type key_type
Definition: chacha_functions.hpp:262
policy_type::block_type block_type
Definition: chacha_functions.hpp:265
policy_type::iv_type iv_type
Definition: chacha_functions.hpp:268
detail::chacha_avx2_impl< Round, IVSize, 256 > impl_type
Definition: chacha_functions.hpp:246
chacha_policy< Round, IVSize, 256 > policy_type
Definition: chacha_functions.hpp:243
static void schedule_key(key_schedule_type &schedule, const key_type &key)
Definition: chacha_functions.hpp:270
policy_type::key_schedule_type key_schedule_type
Definition: chacha_functions.hpp:257
Definition: chacha_functions.hpp:43
chacha_policy< Round, IVSize, KeyBits > policy_type
Definition: chacha_functions.hpp:44
constexpr static const std::size_t iv_bits
Definition: chacha_functions.hpp:65
constexpr static const std::size_t min_key_bits
Definition: chacha_functions.hpp:60
policy_type::key_type key_type
Definition: chacha_functions.hpp:63
constexpr static const std::size_t min_key_schedule_size
Definition: chacha_functions.hpp:57
constexpr static const std::size_t max_key_bits
Definition: chacha_functions.hpp:61
constexpr static const std::size_t block_bits
Definition: chacha_functions.hpp:68
detail::chacha_avx2_impl< Round, IVSize, KeyBits > impl_type
Definition: chacha_functions.hpp:47
constexpr static const std::size_t min_key_schedule_bits
Definition: chacha_functions.hpp:56
static void schedule_key(key_schedule_type &schedule, const key_type &key)
Definition: chacha_functions.hpp:71
constexpr static const std::size_t rounds
Definition: chacha_functions.hpp:54
policy_type::block_type block_type
Definition: chacha_functions.hpp:69
policy_type::key_schedule_type key_schedule_type
Definition: chacha_functions.hpp:58
constexpr static const std::size_t key_bits
Definition: chacha_functions.hpp:62
policy_type::iv_type iv_type
Definition: chacha_functions.hpp:66
Definition: chacha_impl.hpp:51
Definition: chacha_policy.hpp:41
constexpr static const std::size_t block_size
Definition: chacha_policy.hpp:53
constexpr static const std::size_t key_schedule_bits
Definition: chacha_policy.hpp:66
constexpr static const std::size_t rounds
Definition: chacha_policy.hpp:47
std::array< byte_type, key_size > key_type
Definition: chacha_policy.hpp:63
constexpr static const std::size_t iv_bits
Definition: chacha_policy.hpp:77
std::array< byte_type, iv_size > iv_type
Definition: chacha_policy.hpp:79
constexpr static const std::size_t min_key_bits
Definition: chacha_policy.hpp:57
constexpr static const std::size_t max_key_bits
Definition: chacha_policy.hpp:58
constexpr static const std::size_t block_bits
Definition: chacha_policy.hpp:54
constexpr static const std::size_t key_bits
Definition: chacha_policy.hpp:59
std::array< word_type, key_schedule_size > key_schedule_type
Definition: chacha_policy.hpp:67
std::array< byte_type, block_size > block_type
Definition: chacha_policy.hpp:55
constexpr static const std::size_t key_schedule_size
Definition: chacha_policy.hpp:65
Definition: chacha_sse2_impl.hpp:39