32 #ifndef VSMC_RNG_ARS_HPP
33 #define VSMC_RNG_ARS_HPP
40 #ifndef VSMC_RNG_ARS_BLOCKS
41 #define VSMC_RNG_ARS_BLOCKS 1
46 #ifndef VSMC_RNG_ARS_ROUNDS
47 #define VSMC_RNG_ARS_ROUNDS 7
79 template <
typename ResultType>
87 static_cast<int64_t>(traits::ARSWeylConstantTrait<0>::value),
88 static_cast<int64_t>(traits::ARSWeylConstantTrait<1>::value)))
91 template <std::
size_t Rp1>
94 m128i_pack<0>(key, key_seq.
front());
102 template <std::
size_t, std::
size_t Rp1>
105 template <std::
size_t N, std::
size_t Rp1>
108 key_seq[Position<N>()] = _mm_add_epi64(
109 key_seq[Position<N - 1>()], weyl_);
110 generate_seq<N + 1>(key_seq,
111 cxx11::integral_constant<bool, N + 1 < Rp1>());
128 template <
typename ResultType,
132 public AESNIEngine<ResultType, ARSKeySeq<ResultType>,
133 false, Rounds, Blocks>
140 explicit ARSEngine (ResultType s = 0) : base_eng_type(s) {}
142 template <
typename SeedSeq>
205 #endif // VSMC_RNG_ARS_HPP
ARSEngine< uint64_t, 7, 8 > ARS_8x64
ARS RNG engine with 64-bits integers output, 8 blocks and default rounds.
ARSEngine< uint32_t, 7, 1 > ARS_1x32
ARS RNG engine with 32-bits integers output, 1 block and default rounds.
ARSEngine(const typename base_eng_type::key_type &k)
ARSEngine< uint32_t, 7, 8 > ARS_8x32
ARS RNG engine with 32-bits integers output, 8 blocks and default rounds.
ARSEngine Weyl sequence constants.
ARSEngine< uint32_t, 7, 2 > ARS_2x32
ARS RNG engine with 32-bits integers output, 2 blocks and default rounds.
void generate(const key_type &key, Array< __m128i, Rp1 > &key_seq)
ARSEngine< uint64_t > ARS_64
ARS RNG engine with 64-bits integers output, default blocks and default rounds.
ARSEngine< uint64_t, 7, 2 > ARS_2x64
ARS RNG engine with 64-bits integers output, 2 blocks and default rounds.
ARSEngine(SeedSeq &seq, typename cxx11::enable_if< internal::is_seed_seq< SeedSeq, typename base_eng_type::result_type, typename base_eng_type::key_type, ARSEngine< ResultType, Rounds, Blocks > >::value >::type *=nullptr)
ARSEngine< uint64_t, 7, 1 > ARS_1x64
ARS RNG engine with 64-bits integers output, 1 block and default rounds.
RNG engine using AES-NI instructions.
#define VSMC_RNG_ARS_ROUNDS
ARSEngine default rounds.
#define VSMC_NULLPTR
nullptr
integral_constant< bool, true > true_type
ARSEngine(ResultType s=0)
ARSEngine< uint32_t > ARS_32
ARS RNG engine with 32-bits integers output, default blocks and default rounds.
ARSEngine< uint64_t, 7, 4 > ARS_4x64
ARS RNG engine with 64-bits integers output, 4 blocks and default rounds.
#define VSMC_RNG_ARS_BLOCKS
ARSEngine default blocks.
Default ARSEngine key sequence generator.
ARSEngine< uint32_t, 7, 4 > ARS_4x32
ARS RNG engine with 32-bits integers output, 4 blocks and default rounds.
AESNIEngine< ResultType, ARSKeySeq< ResultType >, false, Rounds, Blocks > base_eng_type