vSMC
vSMC: Scalable Monte Carlo
aes.hpp
Go to the documentation of this file.
1 //============================================================================
2 // vSMC/include/vsmc/rng/aes.hpp
3 //----------------------------------------------------------------------------
4 // vSMC: Scalable Monte Carlo
5 //----------------------------------------------------------------------------
6 // Copyright (c) 2013,2014, Yan Zhou
7 // All rights reserved.
8 //
9 // Redistribution and use in source and binary forms, with or without
10 // modification, are permitted provided that the following conditions are met:
11 //
12 // Redistributions of source code must retain the above copyright notice,
13 // this list of conditions and the following disclaimer.
14 //
15 // Redistributions in binary form must reproduce the above copyright notice,
16 // this list of conditions and the following disclaimer in the documentation
17 // and/or other materials provided with the distribution.
18 //
19 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS AS IS
20 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 // POSSIBILITY OF SUCH DAMAGE.
30 //============================================================================
31 
32 #ifndef VSMC_RNG_AES_HPP
33 #define VSMC_RNG_AES_HPP
34 
36 #include <vsmc/rng/aes_ni.hpp>
37 
38 #define VSMC_DEFINE_RNG_AES_ROUND_CONSTANT(N, val) \
39  template <> struct AESRoundConstantValue< N > : \
40  public cxx11::integral_constant<int, val > {};
41 
44 #ifndef VSMC_RNG_AES_BLOCKS
45 #define VSMC_RNG_AES_BLOCKS 1
46 #endif
47 
48 namespace vsmc {
49 
50 namespace internal {
51 
52 template <std::size_t N> struct AESRoundConstantValue;
53 
310 
312 {
313  template <std::size_t Offset, std::size_t N,
314  typename T, std::size_t KeySize, std::size_t Rp1>
315  static void key_init (const Array<T, KeySize> &key,
316  Array<__m128i, Rp1> &key_seq, __m128i &xmm)
317  {
318  key_init_xmm<Offset, N>(key, key_seq, xmm,
320  }
321 
322  private :
323 
324  template <std::size_t, std::size_t,
325  typename T, std::size_t KeySize, std::size_t Rp1>
326  static void key_init_xmm (const Array<T, KeySize> &,
328 
329  template <std::size_t Offset, std::size_t N,
330  typename T, std::size_t KeySize,
331  std::size_t Rp1>
332  static void key_init_xmm (const Array<T, KeySize> &key,
334  {
335  m128i_pack<Offset>(key, xmm);
336  key_seq[Position<N>()] = xmm;
337  }
338 }; // struct AESKeyInit
339 
340 } // namespace vsmc::internal
341 
344 template <typename ResultType>
346 {
347  public :
348 
349  typedef Array<ResultType, 16 / sizeof(ResultType)> key_type;
350 
351  template <std::size_t Rp1>
352  void generate (const key_type &key, Array<__m128i, Rp1> &key_seq)
353  {
354  internal::AESKeyInit::key_init<0, 0>(key, key_seq, xmm1_);
355  generate_seq<1>(key_seq, cxx11::integral_constant<bool, 1 < Rp1>());
356  }
357 
358  private :
359 
360  __m128i xmm1_;
361  __m128i xmm2_;
362  __m128i xmm3_;
363 
364  template <std::size_t, std::size_t Rp1>
365  void generate_seq (Array<__m128i, Rp1> &, cxx11::false_type) {}
366 
367  template <std::size_t N, std::size_t Rp1>
368  void generate_seq (Array<__m128i, Rp1> &key_seq, cxx11::true_type)
369  {
370  xmm2_ = _mm_aeskeygenassist_si128(xmm1_,
371  internal::AESRoundConstantValue<N>::value);
372  expand_key();
373  key_seq[Position<N>()] = xmm1_;
374  generate_seq<N + 1>(key_seq,
375  cxx11::integral_constant<bool, N + 1 < Rp1>());
376  }
377 
378  void expand_key ()
379  {
380  xmm2_ = _mm_shuffle_epi32(xmm2_, 0xFF); // pshufd xmm2, xmm2, 0xFF
381  xmm3_ = _mm_slli_si128 (xmm1_, 0x04); // pshufb xmm3, xmm5
382  xmm1_ = _mm_xor_si128 (xmm1_, xmm3_); // pxor xmm1, xmm3
383  xmm3_ = _mm_slli_si128 (xmm3_, 0x04); // pslldq xmm3, 0x04
384  xmm1_ = _mm_xor_si128 (xmm1_, xmm3_); // pxor xmm1, xmm3
385  xmm3_ = _mm_slli_si128 (xmm3_, 0x04); // pslldq xmm3, 0x04
386  xmm1_ = _mm_xor_si128 (xmm1_, xmm3_); // pxor xmm1, xmm3
387  xmm1_ = _mm_xor_si128 (xmm1_, xmm2_); // pxor xmm1, xmm2
388  }
389 }; // class AES128KeySeq
390 
404 template <typename ResultType, std::size_t Blocks = VSMC_RNG_AES_BLOCKS>
406  public AESNIEngine<ResultType, AES128KeySeq<ResultType>, true, 10, Blocks>
407 {
408 
409  public :
410 
411  typedef AESNIEngine<ResultType, AES128KeySeq<ResultType>, true, 10, Blocks>
413 
414  explicit AES128Engine (ResultType s = 0) : base_eng_type(s) {}
415 
416  template <typename SeedSeq>
417  explicit AES128Engine (SeedSeq &seq, typename cxx11::enable_if<
418  internal::is_seed_seq<SeedSeq,
420  typename base_eng_type::key_type,
422  >::value>::type * = VSMC_NULLPTR) : base_eng_type(seq) {}
423 
424  AES128Engine (const typename base_eng_type::key_type &k) :
425  base_eng_type(k) {}
426 }; // class AES128Engine
427 
431 
435 
439 
443 
447 
451 
455 
459 
463 
467 
470 template <typename ResultType>
472 {
473  public :
474 
475  typedef Array<ResultType, 24 / sizeof(ResultType)> key_type;
476 
477  template <std::size_t Rp1>
478  void generate (const key_type &key, Array<__m128i, Rp1> &key_seq)
479  {
480  Array<uint64_t, 3> key_tmp;
481  std::memcpy(key_tmp.data(), key.data(), 24);
482  internal::AESKeyInit::key_init<0, 0>(key_tmp, key_seq, xmm1_);
483  key_tmp.at<0>() = key_tmp.at<2>();
484  key_tmp.at<1>() = 0;
485  internal::AESKeyInit::key_init<0, 1>(key_tmp, key_seq, xmm7_);
486 
487  xmm3_ = _mm_setzero_si128();
488  xmm6_ = _mm_setzero_si128();
489  xmm4_ = _mm_shuffle_epi32(xmm7_, 0x4F); // pshufd xmm4, xmm7, 0x4F
490 
492  generate_seq<1, Rp1>(ks_tmp.data(),
494  copy_key(key_seq, ks_tmp.data(),
496  }
497 
498  private :
499 
500  __m128i xmm1_;
501  __m128i xmm2_;
502  __m128i xmm3_;
503  __m128i xmm4_;
504  __m128i xmm5_;
505  __m128i xmm6_;
506  __m128i xmm7_;
507 
508  template <std::size_t, std::size_t>
509  void generate_seq (unsigned char *, cxx11::false_type) {}
510 
511  template <std::size_t N, std::size_t Rp1>
512  void generate_seq (unsigned char *ks_ptr, cxx11::true_type)
513  {
514  generate_key<N>(ks_ptr);
515  complete_key<N>(ks_ptr,
516  cxx11::integral_constant<bool, N * 24 + 16 < Rp1 * 16>());
517  generate_seq<N + 1, Rp1>(ks_ptr,
518  cxx11::integral_constant<bool, N * 24 + 24 < Rp1 * 16>());
519  }
520 
521  template <std::size_t N>
522  void generate_key (unsigned char *ks_ptr)
523  {
524  // In entry, N * 24 < Rp1 * 16
525  // Required Storage: N * 24 + 16;
526 
527  xmm2_ = _mm_aeskeygenassist_si128(xmm4_,
528  internal::AESRoundConstantValue<N>::value);
529  generate_key_expansion();
530  _mm_storeu_si128(reinterpret_cast<__m128i *>(
531  ks_ptr + N * 24), xmm1_);
532  }
533 
534  template <std::size_t>
535  void complete_key (unsigned char *, cxx11::false_type) {}
536 
537  template <std::size_t N>
538  void complete_key (unsigned char *ks_ptr, cxx11::true_type)
539  {
540  // In entry, N * 24 + 16 < Rp1 * 16
541  // Required storage: N * 24 + 32
542 
543  complete_key_expansion();
544  _mm_storeu_si128(reinterpret_cast<__m128i *>(
545  ks_ptr + N * 24 + 16), xmm7_);
546  }
547 
548  void generate_key_expansion ()
549  {
550  xmm2_ = _mm_shuffle_epi32(xmm2_, 0xFF); // pshufd xmm2, xmm2, 0xFF
551  xmm3_ = _mm_castps_si128 (_mm_shuffle_ps( // shufps xmm3, xmm1, 0x10
552  _mm_castsi128_ps(xmm3_),
553  _mm_castsi128_ps(xmm1_), 0x10));
554  xmm1_ = _mm_xor_si128 (xmm1_, xmm3_); // pxor xmm1, xmm3
555  xmm3_ = _mm_castps_si128(_mm_shuffle_ps( // shufps xmm3, xmm1, 0x10
556  _mm_castsi128_ps(xmm3_),
557  _mm_castsi128_ps(xmm1_), 0x8C));
558  xmm1_ = _mm_xor_si128 (xmm1_, xmm3_); // pxor xmm1, xmm3
559  xmm1_ = _mm_xor_si128 (xmm1_, xmm2_); // pxor xmm1, xmm2
560  }
561 
562  void complete_key_expansion ()
563  {
564  xmm5_ = _mm_load_si128 (&xmm4_); // movdqa xmm5, xmm4
565  xmm5_ = _mm_slli_si128 (xmm5_, 0x04); // pslldq xmm5, 0x04
566  xmm6_ = _mm_castps_si128 (_mm_shuffle_ps( // shufps xmm6, xmm1, 0x10
567  _mm_castsi128_ps(xmm6_),
568  _mm_castsi128_ps(xmm1_), 0xF0));
569  xmm6_ = _mm_xor_si128 (xmm6_, xmm5_); // pxor xmm6, xmm5
570  xmm4_ = _mm_xor_si128 (xmm4_, xmm6_); // pxor xmm4, xmm6
571  xmm7_ = _mm_shuffle_epi32(xmm4_, 0x0E); // pshufd xmm7, xmm4, 0x0E
572  }
573 
574  template <std::size_t Rp1>
575  void copy_key (Array<__m128i, Rp1> &,
576  const unsigned char *, cxx11::false_type) {}
577 
578  template <std::size_t Rp1>
579  void copy_key (Array<__m128i, Rp1> &key_seq,
580  const unsigned char *ks_ptr, cxx11::true_type)
581  {
582  unsigned char *dst = reinterpret_cast<unsigned char *>(key_seq.data());
583  std::memcpy(dst + 24, ks_ptr + 24, Rp1 * 16 - 24);
584  }
585 }; // class AES192KeySeq
586 
592 template <typename ResultType, std::size_t Blocks = VSMC_RNG_AES_BLOCKS>
594  public AESNIEngine<ResultType, AES192KeySeq<ResultType>, true, 12, Blocks>
595 {
596 
597  public :
598 
599  typedef AESNIEngine<ResultType, AES192KeySeq<ResultType>, true, 12, Blocks>
601 
602  explicit AES192Engine (ResultType s = 0) : base_eng_type(s) {}
603 
604  template <typename SeedSeq>
605  explicit AES192Engine (SeedSeq &seq, typename cxx11::enable_if<
606  internal::is_seed_seq<SeedSeq,
608  typename base_eng_type::key_type,
610  >::value>::type * = VSMC_NULLPTR) : base_eng_type(seq) {}
611 
612  AES192Engine (const typename base_eng_type::key_type &k) :
613  base_eng_type(k) {}
614 }; // class AES192Engine
615 
619 
623 
627 
631 
635 
639 
643 
647 
651 
655 
658 template <typename ResultType>
660 {
661  public :
662 
663  typedef Array<ResultType, 32 / sizeof(ResultType)> key_type;
664 
665  template <std::size_t Rp1>
666  void generate (const key_type &key, Array<__m128i, Rp1> &key_seq)
667  {
668  internal::AESKeyInit::key_init<0, 0>(key, key_seq, xmm1_);
669  internal::AESKeyInit::key_init<16 / sizeof(ResultType), 1>(
670  key, key_seq, xmm3_);
671  generate_seq<2>(key_seq, cxx11::integral_constant<bool, 2 < Rp1>());
672  }
673 
674  private :
675 
676  __m128i xmm1_;
677  __m128i xmm2_;
678  __m128i xmm3_;
679  __m128i xmm4_;
680 
681  template <std::size_t, std::size_t Rp1>
682  void generate_seq (Array<__m128i, Rp1> &, cxx11::false_type) {}
683 
684  template <std::size_t N, std::size_t Rp1>
685  void generate_seq (Array<__m128i, Rp1> &key_seq, cxx11::true_type)
686  {
687  generate_key<N>(key_seq, cxx11::integral_constant<bool, N % 2 == 0>());
688  generate_seq<N + 1>(key_seq,
689  cxx11::integral_constant<bool, N + 1 < Rp1>());
690  }
691 
692  template <std::size_t N, std::size_t Rp1>
693  void generate_key (Array<__m128i, Rp1> &key_seq, cxx11::true_type)
694  {
695  xmm2_ = _mm_aeskeygenassist_si128(xmm3_,
696  internal::AESRoundConstantValue<N / 2>::value);
697  expand_key(cxx11::true_type());
698  key_seq[Position<N>()] = xmm1_;
699  }
700 
701  template <std::size_t N, std::size_t Rp1>
702  void generate_key (Array<__m128i, Rp1> &key_seq, cxx11::false_type)
703  {
704  xmm4_ = _mm_aeskeygenassist_si128(xmm1_, 0);
705  expand_key(cxx11::false_type());
706  key_seq[Position<N>()] = xmm3_;
707  }
708 
709  void expand_key (cxx11::true_type)
710  {
711  xmm2_ = _mm_shuffle_epi32(xmm2_, 0xFF); // pshufd xmm2, xmm2, 0xFF
712  xmm4_ = _mm_slli_si128 (xmm1_, 0x04); // pshufb xmm4, xmm5
713  xmm1_ = _mm_xor_si128 (xmm1_, xmm4_); // pxor xmm1, xmm4
714  xmm4_ = _mm_slli_si128 (xmm4_, 0x04); // pslldq xmm4, 0x04
715  xmm1_ = _mm_xor_si128 (xmm1_, xmm4_); // pxor xmm1, xmm4
716  xmm4_ = _mm_slli_si128 (xmm4_, 0x04); // pslldq xmm4, 0x04
717  xmm1_ = _mm_xor_si128 (xmm1_, xmm4_); // pxor xmm1, xmm4
718  xmm1_ = _mm_xor_si128 (xmm1_, xmm2_); // pxor xmm1, xmm2
719  }
720 
721  void expand_key (cxx11::false_type)
722  {
723  xmm2_ = _mm_shuffle_epi32(xmm4_, 0xAA); // pshufd xmm2, xmm4, 0xAA
724  xmm4_ = _mm_slli_si128 (xmm3_, 0x04); // pshufb xmm4, xmm5
725  xmm3_ = _mm_xor_si128 (xmm3_, xmm4_); // pxor xmm3, xmm4
726  xmm4_ = _mm_slli_si128 (xmm4_, 0x04); // pslldq xmm4, 0x04
727  xmm3_ = _mm_xor_si128 (xmm3_, xmm4_); // pxor xmm3, xmm4
728  xmm4_ = _mm_slli_si128 (xmm4_, 0x04); // pslldq xmm4, 0x04
729  xmm3_ = _mm_xor_si128 (xmm3_, xmm4_); // pxor xmm3, xmm4
730  xmm3_ = _mm_xor_si128 (xmm3_, xmm2_); // pxor xmm1, xmm2
731  }
732 }; // class AESKey256
733 
739 template <typename ResultType, std::size_t Blocks = VSMC_RNG_AES_BLOCKS>
741  public AESNIEngine<ResultType, AES256KeySeq<ResultType>, true, 14, Blocks>
742 {
743 
744  public :
745 
746  typedef AESNIEngine<ResultType, AES256KeySeq<ResultType>, true, 14, Blocks>
748 
749  explicit AES256Engine (ResultType s = 0) : base_eng_type(s) {}
750 
751  template <typename SeedSeq>
752  explicit AES256Engine (SeedSeq &seq, typename cxx11::enable_if<
753  internal::is_seed_seq<SeedSeq,
755  typename base_eng_type::key_type,
757  >::value>::type * = VSMC_NULLPTR) : base_eng_type(seq) {}
758 
759  AES256Engine (const typename base_eng_type::key_type &k) :
760  base_eng_type(k) {}
761 }; // class AES256Engine
762 
766 
770 
774 
778 
782 
786 
790 
794 
798 
802 
803 } // namespace vsmc
804 
805 #endif // VSMC_RNG_AES_HPP
AES192Engine(ResultType s=0)
Definition: aes.hpp:602
Definition: adapter.hpp:37
AES128Engine< uint32_t, 2 > AES128_2x32
AES-128 RNG engine with 32-bits integers output and 2 blocks.
Definition: aes.hpp:438
AES192Engine< uint32_t, 8 > AES192_8x32
AES-192 RNG engine with 32-bits integers output and 8 blocks.
Definition: aes.hpp:634
void generate(const key_type &key, Array< __m128i, Rp1 > &key_seq)
Definition: aes.hpp:478
AES256Engine< uint64_t, 8 > AES256_8x64
AES-256 RNG engine with 64-bits integers output and 8 blocks.
Definition: aes.hpp:801
AES128Engine< uint64_t, 2 > AES128_2x64
AES-128 RNG engine with 64-bits integers output and 2 blocks.
Definition: aes.hpp:458
AES192Engine< uint64_t, 8 > AES192_8x64
AES-192 RNG engine with 64-bits integers output and 8 blocks.
Definition: aes.hpp:654
AES256Engine< uint32_t, 1 > AES256_1x32
AES-256 RNG engine with 32-bits integers output and 1 block.
Definition: aes.hpp:769
AES192Engine< uint64_t, 1 > AES192_1x64
AES-192 RNG engine with 64-bits integers output and 1 block.
Definition: aes.hpp:642
AES128Engine(const typename base_eng_type::key_type &k)
Definition: aes.hpp:424
AES128Engine< uint64_t > AES128_64
AES-128 RNG engine with 64-bits integers output and default blocks.
Definition: aes.hpp:450
AES192Engine< uint32_t > AES192_32
AES-192 RNG engine with 32-bits integers output and default blocks.
Definition: aes.hpp:618
AES128Engine< uint32_t, 1 > AES128_1x32
AES-128 RNG engine with 32-bits integers output and 1 block.
Definition: aes.hpp:434
AESNIEngine< ResultType, AES256KeySeq< ResultType >, true, 14, Blocks > base_eng_type
Definition: aes.hpp:747
AES128Engine< uint64_t, 1 > AES128_1x64
AES-128 RNG engine with 64-bits integers output and 1 block.
Definition: aes.hpp:454
AES128Engine(SeedSeq &seq, typename cxx11::enable_if< internal::is_seed_seq< SeedSeq, typename base_eng_type::result_type, typename base_eng_type::key_type, AES128Engine< ResultType, Blocks > >::value >::type *=nullptr)
Definition: aes.hpp:417
integral_constant< bool, false > false_type
Function template argument used for position.
Definition: defines.hpp:126
AES256Engine< uint64_t > AES256_64
AES-256 RNG engine with 64-bits integers output and default blocks.
Definition: aes.hpp:785
AES256Engine(const typename base_eng_type::key_type &k)
Definition: aes.hpp:759
AES256Engine< uint32_t, 8 > AES256_8x32
AES-256 RNG engine with 32-bits integers output and 8 blocks.
Definition: aes.hpp:781
AES256Engine< uint32_t > AES256_32
AES-256 RNG engine with 32-bits integers output and default blocks.
Definition: aes.hpp:765
AES-192 RNG engine.
Definition: aes.hpp:593
AES128Engine< uint32_t, 8 > AES128_8x32
AES-128 RNG engine with 32-bits integers output and 8 blocks.
Definition: aes.hpp:446
AES256Engine< uint64_t, 1 > AES256_1x64
AES-256 RNG engine with 64-bits integers output and 1 block.
Definition: aes.hpp:789
AES128Engine< uint32_t, 4 > AES128_4x32
AES-128 RNG engine with 32-bits integers output and 4 blocks.
Definition: aes.hpp:442
AESNIEngine< ResultType, AES128KeySeq< ResultType >, true, 10, Blocks > base_eng_type
Definition: aes.hpp:412
AES192Engine< uint32_t, 1 > AES192_1x32
AES-192 RNG engine with 32-bits integers output and 1 block.
Definition: aes.hpp:622
void generate(const key_type &key, Array< __m128i, Rp1 > &key_seq)
Definition: aes.hpp:666
RNG engine using AES-NI instructions.
Definition: aes_ni.hpp:213
#define VSMC_NULLPTR
nullptr
Definition: defines.hpp:79
AES128Engine< uint32_t > AES128_32
AES-128 RNG engine with 32-bits integers output and default blocks.
Definition: aes.hpp:430
integral_constant< bool, true > true_type
AES256Engine< uint32_t, 2 > AES256_2x32
AES-256 RNG engine with 32-bits integers output and 2 blocks.
Definition: aes.hpp:773
AES128Engine(ResultType s=0)
Definition: aes.hpp:414
AES256Engine(ResultType s=0)
Definition: aes.hpp:749
void * memcpy(void *dst, const void *src, std::size_t n)
SIMD optimized memcpy with non-temporal store for large buffers.
Definition: cstring.hpp:923
AES128Engine< uint64_t, 4 > AES128_4x64
AES-128 RNG engine with 64-bits integers output and 4 blocks.
Definition: aes.hpp:462
pointer data()
Definition: array.hpp:127
AES192Engine< uint32_t, 2 > AES192_2x32
AES-192 RNG engine with 32-bits integers output and 2 blocks.
Definition: aes.hpp:626
AES192Engine(SeedSeq &seq, typename cxx11::enable_if< internal::is_seed_seq< SeedSeq, typename base_eng_type::result_type, typename base_eng_type::key_type, AES192Engine< ResultType, Blocks > >::value >::type *=nullptr)
Definition: aes.hpp:605
AES256Engine< uint64_t, 4 > AES256_4x64
AES-256 RNG engine with 64-bits integers output and 4 blocks.
Definition: aes.hpp:797
AES192Engine< uint64_t, 4 > AES192_4x64
AES-192 RNG engine with 64-bits integers output and 4 blocks.
Definition: aes.hpp:650
void generate(const key_type &key, Array< __m128i, Rp1 > &key_seq)
Definition: aes.hpp:352
AES192Engine< uint32_t, 4 > AES192_4x32
AES-192 RNG engine with 32-bits integers output and 4 blocks.
Definition: aes.hpp:630
#define VSMC_DEFINE_RNG_AES_ROUND_CONSTANT(N, val)
Definition: aes.hpp:38
AES128Engine key sequence generator.
Definition: aes.hpp:345
AES256Engine< uint64_t, 2 > AES256_2x64
AES-256 RNG engine with 64-bits integers output and 2 blocks.
Definition: aes.hpp:793
Static array.
Definition: array.hpp:79
AES192Engine(const typename base_eng_type::key_type &k)
Definition: aes.hpp:612
AES-256 RNG engine.
Definition: aes.hpp:740
AES192Engine< uint64_t > AES192_64
AES-192 RNG engine with 64-bits integers output and default blocks.
Definition: aes.hpp:638
static void key_init(const Array< T, KeySize > &key, Array< __m128i, Rp1 > &key_seq, __m128i &xmm)
Definition: aes.hpp:315
AES128Engine< uint64_t, 8 > AES128_8x64
AES-128 RNG engine with 64-bits integers output and 8 blocks.
Definition: aes.hpp:466
AES256Engine key sequence generator.
Definition: aes.hpp:659
AES256Engine< uint32_t, 4 > AES256_4x32
AES-256 RNG engine with 32-bits integers output and 4 blocks.
Definition: aes.hpp:777
AESNIEngine< ResultType, AES192KeySeq< ResultType >, true, 12, Blocks > base_eng_type
Definition: aes.hpp:600
AES256Engine(SeedSeq &seq, typename cxx11::enable_if< internal::is_seed_seq< SeedSeq, typename base_eng_type::result_type, typename base_eng_type::key_type, AES256Engine< ResultType, Blocks > >::value >::type *=nullptr)
Definition: aes.hpp:752
AES-128 RNG engine.
Definition: aes.hpp:405
AES192Engine< uint64_t, 2 > AES192_2x64
AES-192 RNG engine with 64-bits integers output and 2 blocks.
Definition: aes.hpp:646
AES192Engine key sequence generator.
Definition: aes.hpp:471