32 #ifndef __Random123_ars_dot_hpp__
33 #define __Random123_ars_dot_hpp__
40 #ifndef ARS1xm128i_DEFAULT_ROUNDS
41 #define ARS1xm128i_DEFAULT_ROUNDS 7
58 __m128i kweyl = _mm_set_epi64x(R123_64BIT(0xBB67AE8584CAA73B),
59 R123_64BIT(0x9E3779B97F4A7C15));
63 __m128i kk = k.v[0].m;
64 __m128i v = _mm_xor_si128(in.v[0].m, kk);
66 R123_ASSERT(Nrounds<=10);
68 kk = _mm_add_epi64(kk, kweyl);
69 v = _mm_aesenc_si128(v, kk);
72 kk = _mm_add_epi64(kk, kweyl);
73 v = _mm_aesenc_si128(v, kk);
76 kk = _mm_add_epi64(kk, kweyl);
77 v = _mm_aesenc_si128(v, kk);
80 kk = _mm_add_epi64(kk, kweyl);
81 v = _mm_aesenc_si128(v, kk);
84 kk = _mm_add_epi64(kk, kweyl);
85 v = _mm_aesenc_si128(v, kk);
88 kk = _mm_add_epi64(kk, kweyl);
89 v = _mm_aesenc_si128(v, kk);
92 kk = _mm_add_epi64(kk, kweyl);
93 v = _mm_aesenc_si128(v, kk);
96 kk = _mm_add_epi64(kk, kweyl);
97 v = _mm_aesenc_si128(v, kk);
100 kk = _mm_add_epi64(kk, kweyl);
101 v = _mm_aesenc_si128(v, kk);
103 kk = _mm_add_epi64(kk, kweyl);
104 v = _mm_aesenclast_si128(v, kk);
112 #define ars1xm128i(c,k) ars1xm128i_R(ars1xm128i_rounds, c, k)
128 c128.v[0].m = _mm_set_epi32(c.v[3], c.v[2], c.v[1], c.v[0]);
129 k128.v[0].m = _mm_set_epi32(k.v[3], k.v[2], k.v[1], k.v[0]);
131 _mm_storeu_si128((__m128i*)&c.v[0], c128.v[0].m);
138 #define ars4x32(c,k) ars4x32_R(ars4x32_rounds, c, k)
163 template<
unsigned int ROUNDS>
178 template<
unsigned int ROUNDS>
struct r123array4x32 ars4x32_ukey_t
Definition: ars.h:119
ars4x32_key_t key_type
Definition: ars.h:181
struct r123array1xm128i ars1xm128i_ctr_t
Definition: ars.h:49
static const unsigned int rounds
Definition: ars.h:183
static ars4x32_key_t ars4x32keyinit(ars4x32_ukey_t uk)
Definition: ars.h:123
static ars4x32_ctr_t ars4x32_R(unsigned int Nrounds, ars4x32_ctr_t c, ars4x32_key_t k)
Definition: ars.h:125
struct r123array1xm128i ars1xm128i_ukey_t
Definition: ars.h:53
struct r123array1xm128i ars1xm128i_key_t
Definition: ars.h:51
static ars1xm128i_ctr_t ars1xm128i_R(unsigned int Nrounds, ars1xm128i_ctr_t in, ars1xm128i_key_t k)
Definition: ars.h:57
ars4x32_key_t ukey_type
Definition: ars.h:182
ars1xm128i_ctr_t ctr_type
Definition: ars.h:165
struct r123array4x32 ars4x32_key_t
Definition: ars.h:117
struct r123array4x32 ars4x32_ctr_t
Definition: ars.h:115
ARS1xm128i_R< ars1xm128i_rounds > ARS1xm128i
Definition: ars.h:196
r123_enum_ars1xm128i
Definition: ars.h:45
ars1xm128i_key_t key_type
Definition: ars.h:166
ars4x32_ctr_t ctr_type
Definition: ars.h:180
ars1xm128i_key_t ukey_type
Definition: ars.h:167
ARS4x32_R< ars4x32_rounds > ARS4x32
Definition: ars.h:197
static ars1xm128i_key_t ars1xm128ikeyinit(ars1xm128i_ukey_t uk)
Definition: ars.h:55
r123_enum_ars4x32
Definition: ars.h:121
static const unsigned int rounds
Definition: ars.h:168
#define ARS1xm128i_DEFAULT_ROUNDS
Definition: ars.h:41