19 #if (CRYPTOPP_SSSE3_AVAILABLE)
21 # include <pmmintrin.h>
22 # include <tmmintrin.h>
26 # include <ammintrin.h>
29 #if defined(__AVX512F__)
30 # define CRYPTOPP_AVX512_ROTATE 1
31 # include <immintrin.h>
35 #if (CRYPTOPP_ARM_NEON_AVAILABLE)
38 # include <arm_neon.h>
42 #if (CRYPTOPP_ARM_ACLE_AVAILABLE)
44 # include <arm_acle.h>
47 #if defined(CRYPTOPP_POWER8_AVAILABLE)
53 extern const char SPECK128_SIMD_FNAME[] = __FILE__;
55 ANONYMOUS_NAMESPACE_BEGIN
58 using CryptoPP::word32;
59 using CryptoPP::word64;
63 #if (CRYPTOPP_ARM_NEON_AVAILABLE)
66 #if defined(_MSC_VER) && !defined(_M_ARM64)
67 inline uint64x2_t vld1q_dup_u64(
const uint64_t* ptr)
69 return vmovq_n_u64(*ptr);
74 inline T UnpackHigh64(
const T& a,
const T& b)
76 const uint64x1_t x(vget_high_u64((uint64x2_t)a));
77 const uint64x1_t y(vget_high_u64((uint64x2_t)b));
78 return (T)vcombine_u64(x, y);
82 inline T UnpackLow64(
const T& a,
const T& b)
84 const uint64x1_t x(vget_low_u64((uint64x2_t)a));
85 const uint64x1_t y(vget_low_u64((uint64x2_t)b));
86 return (T)vcombine_u64(x, y);
89 template <
unsigned int R>
90 inline uint64x2_t RotateLeft64(
const uint64x2_t& val)
92 const uint64x2_t a(vshlq_n_u64(val, R));
93 const uint64x2_t b(vshrq_n_u64(val, 64 - R));
94 return vorrq_u64(a, b);
97 template <
unsigned int R>
98 inline uint64x2_t RotateRight64(
const uint64x2_t& val)
100 const uint64x2_t a(vshlq_n_u64(val, 64 - R));
101 const uint64x2_t b(vshrq_n_u64(val, R));
102 return vorrq_u64(a, b);
105 #if defined(__aarch32__) || defined(__aarch64__)
108 inline uint64x2_t RotateLeft64<8>(
const uint64x2_t& val)
110 const uint8_t maskb[16] = { 7,0,1,2, 3,4,5,6, 15,8,9,10, 11,12,13,14 };
111 const uint8x16_t mask = vld1q_u8(maskb);
113 return vreinterpretq_u64_u8(
114 vqtbl1q_u8(vreinterpretq_u8_u64(val), mask));
119 inline uint64x2_t RotateRight64<8>(
const uint64x2_t& val)
121 const uint8_t maskb[16] = { 1,2,3,4, 5,6,7,0, 9,10,11,12, 13,14,15,8 };
122 const uint8x16_t mask = vld1q_u8(maskb);
124 return vreinterpretq_u64_u8(
125 vqtbl1q_u8(vreinterpretq_u8_u64(val), mask));
129 inline void SPECK128_Enc_Block(uint64x2_t &block0, uint64x2_t &block1,
130 const word64 *subkeys,
unsigned int rounds)
133 uint64x2_t x1 = UnpackHigh64(block0, block1);
134 uint64x2_t y1 = UnpackLow64(block0, block1);
136 for (
int i=0; i < static_cast<int>(rounds); ++i)
138 const uint64x2_t rk = vld1q_dup_u64(subkeys+i);
140 x1 = RotateRight64<8>(x1);
141 x1 = vaddq_u64(x1, y1);
142 x1 = veorq_u64(x1, rk);
143 y1 = RotateLeft64<3>(y1);
144 y1 = veorq_u64(y1, x1);
148 block0 = UnpackLow64(y1, x1);
149 block1 = UnpackHigh64(y1, x1);
152 inline void SPECK128_Enc_6_Blocks(uint64x2_t &block0, uint64x2_t &block1,
153 uint64x2_t &block2, uint64x2_t &block3, uint64x2_t &block4, uint64x2_t &block5,
154 const word64 *subkeys,
unsigned int rounds)
157 uint64x2_t x1 = UnpackHigh64(block0, block1);
158 uint64x2_t y1 = UnpackLow64(block0, block1);
159 uint64x2_t x2 = UnpackHigh64(block2, block3);
160 uint64x2_t y2 = UnpackLow64(block2, block3);
161 uint64x2_t x3 = UnpackHigh64(block4, block5);
162 uint64x2_t y3 = UnpackLow64(block4, block5);
164 for (
int i=0; i < static_cast<int>(rounds); ++i)
166 const uint64x2_t rk = vld1q_dup_u64(subkeys+i);
168 x1 = RotateRight64<8>(x1);
169 x2 = RotateRight64<8>(x2);
170 x3 = RotateRight64<8>(x3);
171 x1 = vaddq_u64(x1, y1);
172 x2 = vaddq_u64(x2, y2);
173 x3 = vaddq_u64(x3, y3);
174 x1 = veorq_u64(x1, rk);
175 x2 = veorq_u64(x2, rk);
176 x3 = veorq_u64(x3, rk);
177 y1 = RotateLeft64<3>(y1);
178 y2 = RotateLeft64<3>(y2);
179 y3 = RotateLeft64<3>(y3);
180 y1 = veorq_u64(y1, x1);
181 y2 = veorq_u64(y2, x2);
182 y3 = veorq_u64(y3, x3);
186 block0 = UnpackLow64(y1, x1);
187 block1 = UnpackHigh64(y1, x1);
188 block2 = UnpackLow64(y2, x2);
189 block3 = UnpackHigh64(y2, x2);
190 block4 = UnpackLow64(y3, x3);
191 block5 = UnpackHigh64(y3, x3);
194 inline void SPECK128_Dec_Block(uint64x2_t &block0, uint64x2_t &block1,
195 const word64 *subkeys,
unsigned int rounds)
198 uint64x2_t x1 = UnpackHigh64(block0, block1);
199 uint64x2_t y1 = UnpackLow64(block0, block1);
201 for (
int i =
static_cast<int>(rounds-1); i >= 0; --i)
203 const uint64x2_t rk = vld1q_dup_u64(subkeys+i);
205 y1 = veorq_u64(y1, x1);
206 y1 = RotateRight64<3>(y1);
207 x1 = veorq_u64(x1, rk);
208 x1 = vsubq_u64(x1, y1);
209 x1 = RotateLeft64<8>(x1);
213 block0 = UnpackLow64(y1, x1);
214 block1 = UnpackHigh64(y1, x1);
217 inline void SPECK128_Dec_6_Blocks(uint64x2_t &block0, uint64x2_t &block1,
218 uint64x2_t &block2, uint64x2_t &block3, uint64x2_t &block4, uint64x2_t &block5,
219 const word64 *subkeys,
unsigned int rounds)
222 uint64x2_t x1 = UnpackHigh64(block0, block1);
223 uint64x2_t y1 = UnpackLow64(block0, block1);
224 uint64x2_t x2 = UnpackHigh64(block2, block3);
225 uint64x2_t y2 = UnpackLow64(block2, block3);
226 uint64x2_t x3 = UnpackHigh64(block4, block5);
227 uint64x2_t y3 = UnpackLow64(block4, block5);
229 for (
int i =
static_cast<int>(rounds-1); i >= 0; --i)
231 const uint64x2_t rk = vld1q_dup_u64(subkeys+i);
233 y1 = veorq_u64(y1, x1);
234 y2 = veorq_u64(y2, x2);
235 y3 = veorq_u64(y3, x3);
236 y1 = RotateRight64<3>(y1);
237 y2 = RotateRight64<3>(y2);
238 y3 = RotateRight64<3>(y3);
239 x1 = veorq_u64(x1, rk);
240 x2 = veorq_u64(x2, rk);
241 x3 = veorq_u64(x3, rk);
242 x1 = vsubq_u64(x1, y1);
243 x2 = vsubq_u64(x2, y2);
244 x3 = vsubq_u64(x3, y3);
245 x1 = RotateLeft64<8>(x1);
246 x2 = RotateLeft64<8>(x2);
247 x3 = RotateLeft64<8>(x3);
251 block0 = UnpackLow64(y1, x1);
252 block1 = UnpackHigh64(y1, x1);
253 block2 = UnpackLow64(y2, x2);
254 block3 = UnpackHigh64(y2, x2);
255 block4 = UnpackLow64(y3, x3);
256 block5 = UnpackHigh64(y3, x3);
263 #if defined(CRYPTOPP_SSSE3_AVAILABLE)
267 # define M128_CAST(x) ((__m128i *)(void *)(x))
269 #ifndef CONST_M128_CAST
270 # define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x))
275 # define DOUBLE_CAST(x) ((double *)(void *)(x))
277 #ifndef CONST_DOUBLE_CAST
278 # define CONST_DOUBLE_CAST(x) ((const double *)(const void *)(x))
281 template <
unsigned int R>
282 inline __m128i RotateLeft64(
const __m128i& val)
284 #if defined(CRYPTOPP_AVX512_ROTATE)
285 return _mm_rol_epi64(val, R);
286 #elif defined(__XOP__)
287 return _mm_roti_epi64(val, R);
290 _mm_slli_epi64(val, R), _mm_srli_epi64(val, 64-R));
294 template <
unsigned int R>
295 inline __m128i RotateRight64(
const __m128i& val)
297 #if defined(CRYPTOPP_AVX512_ROTATE)
298 return _mm_ror_epi64(val, R);
299 #elif defined(__XOP__)
300 return _mm_roti_epi64(val, 64-R);
303 _mm_slli_epi64(val, 64-R), _mm_srli_epi64(val, R));
309 __m128i RotateLeft64<8>(
const __m128i& val)
312 return _mm_roti_epi64(val, 8);
314 const __m128i mask = _mm_set_epi8(14,13,12,11, 10,9,8,15, 6,5,4,3, 2,1,0,7);
315 return _mm_shuffle_epi8(val, mask);
321 __m128i RotateRight64<8>(
const __m128i& val)
324 return _mm_roti_epi64(val, 64-8);
326 const __m128i mask = _mm_set_epi8(8,15,14,13, 12,11,10,9, 0,7,6,5, 4,3,2,1);
327 return _mm_shuffle_epi8(val, mask);
331 inline void SPECK128_Enc_Block(__m128i &block0, __m128i &block1,
332 const word64 *subkeys,
unsigned int rounds)
335 __m128i x1 = _mm_unpackhi_epi64(block0, block1);
336 __m128i y1 = _mm_unpacklo_epi64(block0, block1);
338 for (
int i=0; i < static_cast<int>(rounds); ++i)
340 const __m128i rk = _mm_castpd_si128(
341 _mm_loaddup_pd(CONST_DOUBLE_CAST(subkeys+i)));
343 x1 = RotateRight64<8>(x1);
344 x1 = _mm_add_epi64(x1, y1);
345 x1 = _mm_xor_si128(x1, rk);
346 y1 = RotateLeft64<3>(y1);
347 y1 = _mm_xor_si128(y1, x1);
351 block0 = _mm_unpacklo_epi64(y1, x1);
352 block1 = _mm_unpackhi_epi64(y1, x1);
355 inline void SPECK128_Enc_6_Blocks(__m128i &block0, __m128i &block1,
356 __m128i &block2, __m128i &block3, __m128i &block4, __m128i &block5,
357 const word64 *subkeys,
unsigned int rounds)
360 __m128i x1 = _mm_unpackhi_epi64(block0, block1);
361 __m128i y1 = _mm_unpacklo_epi64(block0, block1);
362 __m128i x2 = _mm_unpackhi_epi64(block2, block3);
363 __m128i y2 = _mm_unpacklo_epi64(block2, block3);
364 __m128i x3 = _mm_unpackhi_epi64(block4, block5);
365 __m128i y3 = _mm_unpacklo_epi64(block4, block5);
367 for (
int i=0; i < static_cast<int>(rounds); ++i)
369 const __m128i rk = _mm_castpd_si128(
370 _mm_loaddup_pd(CONST_DOUBLE_CAST(subkeys+i)));
372 x1 = RotateRight64<8>(x1);
373 x2 = RotateRight64<8>(x2);
374 x3 = RotateRight64<8>(x3);
375 x1 = _mm_add_epi64(x1, y1);
376 x2 = _mm_add_epi64(x2, y2);
377 x3 = _mm_add_epi64(x3, y3);
378 x1 = _mm_xor_si128(x1, rk);
379 x2 = _mm_xor_si128(x2, rk);
380 x3 = _mm_xor_si128(x3, rk);
381 y1 = RotateLeft64<3>(y1);
382 y2 = RotateLeft64<3>(y2);
383 y3 = RotateLeft64<3>(y3);
384 y1 = _mm_xor_si128(y1, x1);
385 y2 = _mm_xor_si128(y2, x2);
386 y3 = _mm_xor_si128(y3, x3);
390 block0 = _mm_unpacklo_epi64(y1, x1);
391 block1 = _mm_unpackhi_epi64(y1, x1);
392 block2 = _mm_unpacklo_epi64(y2, x2);
393 block3 = _mm_unpackhi_epi64(y2, x2);
394 block4 = _mm_unpacklo_epi64(y3, x3);
395 block5 = _mm_unpackhi_epi64(y3, x3);
398 inline void SPECK128_Dec_Block(__m128i &block0, __m128i &block1,
399 const word64 *subkeys,
unsigned int rounds)
402 __m128i x1 = _mm_unpackhi_epi64(block0, block1);
403 __m128i y1 = _mm_unpacklo_epi64(block0, block1);
405 for (
int i =
static_cast<int>(rounds-1); i >= 0; --i)
407 const __m128i rk = _mm_castpd_si128(
408 _mm_loaddup_pd(CONST_DOUBLE_CAST(subkeys+i)));
410 y1 = _mm_xor_si128(y1, x1);
411 y1 = RotateRight64<3>(y1);
412 x1 = _mm_xor_si128(x1, rk);
413 x1 = _mm_sub_epi64(x1, y1);
414 x1 = RotateLeft64<8>(x1);
418 block0 = _mm_unpacklo_epi64(y1, x1);
419 block1 = _mm_unpackhi_epi64(y1, x1);
422 inline void SPECK128_Dec_6_Blocks(__m128i &block0, __m128i &block1,
423 __m128i &block2, __m128i &block3, __m128i &block4, __m128i &block5,
424 const word64 *subkeys,
unsigned int rounds)
427 __m128i x1 = _mm_unpackhi_epi64(block0, block1);
428 __m128i y1 = _mm_unpacklo_epi64(block0, block1);
429 __m128i x2 = _mm_unpackhi_epi64(block2, block3);
430 __m128i y2 = _mm_unpacklo_epi64(block2, block3);
431 __m128i x3 = _mm_unpackhi_epi64(block4, block5);
432 __m128i y3 = _mm_unpacklo_epi64(block4, block5);
434 for (
int i =
static_cast<int>(rounds-1); i >= 0; --i)
436 const __m128i rk = _mm_castpd_si128(
437 _mm_loaddup_pd(CONST_DOUBLE_CAST(subkeys+i)));
439 y1 = _mm_xor_si128(y1, x1);
440 y2 = _mm_xor_si128(y2, x2);
441 y3 = _mm_xor_si128(y3, x3);
442 y1 = RotateRight64<3>(y1);
443 y2 = RotateRight64<3>(y2);
444 y3 = RotateRight64<3>(y3);
445 x1 = _mm_xor_si128(x1, rk);
446 x2 = _mm_xor_si128(x2, rk);
447 x3 = _mm_xor_si128(x3, rk);
448 x1 = _mm_sub_epi64(x1, y1);
449 x2 = _mm_sub_epi64(x2, y2);
450 x3 = _mm_sub_epi64(x3, y3);
451 x1 = RotateLeft64<8>(x1);
452 x2 = RotateLeft64<8>(x2);
453 x3 = RotateLeft64<8>(x3);
457 block0 = _mm_unpacklo_epi64(y1, x1);
458 block1 = _mm_unpackhi_epi64(y1, x1);
459 block2 = _mm_unpacklo_epi64(y2, x2);
460 block3 = _mm_unpackhi_epi64(y2, x2);
461 block4 = _mm_unpacklo_epi64(y3, x3);
462 block5 = _mm_unpackhi_epi64(y3, x3);
469 #if defined(CRYPTOPP_POWER8_AVAILABLE)
481 template<
unsigned int C>
485 return vec_rl(val, m);
489 template<
unsigned int C>
493 return vec_rl(val, m);
496 void SPECK128_Enc_Block(
uint32x4_p &block,
const word64 *subkeys,
unsigned int rounds)
498 #if (CRYPTOPP_BIG_ENDIAN)
499 const uint8x16_p m1 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
500 const uint8x16_p m2 = {23,22,21,20,19,18,17,16, 7,6,5,4,3,2,1,0};
502 const uint8x16_p m1 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
503 const uint8x16_p m2 = {15,14,13,12,11,10,9,8, 31,30,29,28,27,26,25,24};
510 for (
int i=0; i < static_cast<int>(rounds); ++i)
512 const uint64x2_p rk = vec_splats((
unsigned long long)subkeys[i]);
514 x1 = RotateRight64<8>(x1);
518 y1 = RotateLeft64<3>(y1);
522 #if (CRYPTOPP_BIG_ENDIAN)
523 const uint8x16_p m3 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
526 const uint8x16_p m3 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
534 void SPECK128_Dec_Block(
uint32x4_p &block,
const word64 *subkeys,
unsigned int rounds)
536 #if (CRYPTOPP_BIG_ENDIAN)
537 const uint8x16_p m1 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
538 const uint8x16_p m2 = {23,22,21,20,19,18,17,16, 7,6,5,4,3,2,1,0};
540 const uint8x16_p m1 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
541 const uint8x16_p m2 = {15,14,13,12,11,10,9,8, 31,30,29,28,27,26,25,24};
548 for (
int i =
static_cast<int>(rounds-1); i >= 0; --i)
550 const uint64x2_p rk = vec_splats((
unsigned long long)subkeys[i]);
553 y1 = RotateRight64<3>(y1);
556 x1 = RotateLeft64<8>(x1);
559 #if (CRYPTOPP_BIG_ENDIAN)
560 const uint8x16_p m3 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
563 const uint8x16_p m3 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
573 uint32x4_p &block5,
const word64 *subkeys,
unsigned int rounds)
575 #if (CRYPTOPP_BIG_ENDIAN)
576 const uint8x16_p m1 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
577 const uint8x16_p m2 = {23,22,21,20,19,18,17,16, 7,6,5,4,3,2,1,0};
579 const uint8x16_p m1 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
580 const uint8x16_p m2 = {15,14,13,12,11,10,9,8, 31,30,29,28,27,26,25,24};
591 for (
int i=0; i < static_cast<int>(rounds); ++i)
593 const uint64x2_p rk = vec_splats((
unsigned long long)subkeys[i]);
595 x1 = RotateRight64<8>(x1);
596 x2 = RotateRight64<8>(x2);
597 x3 = RotateRight64<8>(x3);
605 y1 = RotateLeft64<3>(y1);
606 y2 = RotateLeft64<3>(y2);
607 y3 = RotateLeft64<3>(y3);
613 #if (CRYPTOPP_BIG_ENDIAN)
614 const uint8x16_p m3 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
615 const uint8x16_p m4 = {23,22,21,20,19,18,17,16, 7,6,5,4,3,2,1,0};
617 const uint8x16_p m3 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
618 const uint8x16_p m4 = {15,14,13,12,11,10,9,8, 31,30,29,28,27,26,25,24};
632 uint32x4_p &block5,
const word64 *subkeys,
unsigned int rounds)
634 #if (CRYPTOPP_BIG_ENDIAN)
635 const uint8x16_p m1 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
636 const uint8x16_p m2 = {23,22,21,20,19,18,17,16, 7,6,5,4,3,2,1,0};
638 const uint8x16_p m1 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
639 const uint8x16_p m2 = {15,14,13,12,11,10,9,8, 31,30,29,28,27,26,25,24};
650 for (
int i =
static_cast<int>(rounds-1); i >= 0; --i)
652 const uint64x2_p rk = vec_splats((
unsigned long long)subkeys[i]);
657 y1 = RotateRight64<3>(y1);
658 y2 = RotateRight64<3>(y2);
659 y3 = RotateRight64<3>(y3);
667 x1 = RotateLeft64<8>(x1);
668 x2 = RotateLeft64<8>(x2);
669 x3 = RotateLeft64<8>(x3);
672 #if (CRYPTOPP_BIG_ENDIAN)
673 const uint8x16_p m3 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
674 const uint8x16_p m4 = {23,22,21,20,19,18,17,16, 7,6,5,4,3,2,1,0};
676 const uint8x16_p m3 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
677 const uint8x16_p m4 = {15,14,13,12,11,10,9,8, 31,30,29,28,27,26,25,24};
691 ANONYMOUS_NAMESPACE_END
699 #if (CRYPTOPP_ARM_NEON_AVAILABLE)
700 size_t SPECK128_Enc_AdvancedProcessBlocks_NEON(
const word64* subKeys,
size_t rounds,
701 const byte *inBlocks,
const byte *xorBlocks,
byte *outBlocks,
size_t length, word32 flags)
703 return AdvancedProcessBlocks128_6x2_NEON(SPECK128_Enc_Block, SPECK128_Enc_6_Blocks,
704 subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
707 size_t SPECK128_Dec_AdvancedProcessBlocks_NEON(
const word64* subKeys,
size_t rounds,
708 const byte *inBlocks,
const byte *xorBlocks,
byte *outBlocks,
size_t length, word32 flags)
710 return AdvancedProcessBlocks128_6x2_NEON(SPECK128_Dec_Block, SPECK128_Dec_6_Blocks,
711 subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
717 #if defined(CRYPTOPP_SSSE3_AVAILABLE)
718 size_t SPECK128_Enc_AdvancedProcessBlocks_SSSE3(
const word64* subKeys,
size_t rounds,
719 const byte *inBlocks,
const byte *xorBlocks,
byte *outBlocks,
size_t length, word32 flags)
721 return AdvancedProcessBlocks128_6x2_SSE(SPECK128_Enc_Block, SPECK128_Enc_6_Blocks,
722 subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
725 size_t SPECK128_Dec_AdvancedProcessBlocks_SSSE3(
const word64* subKeys,
size_t rounds,
726 const byte *inBlocks,
const byte *xorBlocks,
byte *outBlocks,
size_t length, word32 flags)
728 return AdvancedProcessBlocks128_6x2_SSE(SPECK128_Dec_Block, SPECK128_Dec_6_Blocks,
729 subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
735 #if defined(CRYPTOPP_POWER8_AVAILABLE)
736 size_t SPECK128_Enc_AdvancedProcessBlocks_POWER8(
const word64* subKeys,
size_t rounds,
737 const byte *inBlocks,
const byte *xorBlocks,
byte *outBlocks,
size_t length, word32 flags)
739 return AdvancedProcessBlocks128_6x1_ALTIVEC(SPECK128_Enc_Block, SPECK128_Enc_6_Blocks,
740 subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
743 size_t SPECK128_Dec_AdvancedProcessBlocks_POWER8(
const word64* subKeys,
size_t rounds,
744 const byte *inBlocks,
const byte *xorBlocks,
byte *outBlocks,
size_t length, word32 flags)
746 return AdvancedProcessBlocks128_6x1_ALTIVEC(SPECK128_Dec_Block, SPECK128_Dec_6_Blocks,
747 subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
Template for AdvancedProcessBlocks and SIMD processing.
Library configuration file.
Utility functions for the Crypto++ library.
Crypto++ library namespace.
Support functions for PowerPC and vector operations.
__vector unsigned int uint32x4_p
Vector of 32-bit elements.
T1 VecPermute(const T1 vec, const T2 mask)
Permutes a vector.
__vector unsigned char uint8x16_p
Vector of 8-bit elements.
T1 VecXor(const T1 vec1, const T2 vec2)
XOR two vectors.
__vector unsigned long long uint64x2_p
Vector of 64-bit elements.
T1 VecSub(const T1 vec1, const T2 vec2)
Subtract two vectors.
T1 VecAdd(const T1 vec1, const T2 vec2)
Add two vectors.
Classes for the Speck block cipher.