20 #if (CRYPTOPP_SSSE3_AVAILABLE) 21 # include <pmmintrin.h> 22 # include <tmmintrin.h> 26 # include <ammintrin.h> 29 #if defined(__AVX512F__) && defined(__AVX512VL__) 30 # define CRYPTOPP_AVX512_ROTATE 1 31 # include <immintrin.h> 34 #if (CRYPTOPP_ARM_NEON_AVAILABLE) 35 # include <arm_neon.h> 40 #if (CRYPTOPP_ARM_ACLE_AVAILABLE) 42 # include <arm_acle.h> 45 #if defined(CRYPTOPP_POWER8_AVAILABLE) 50 extern const char SPECK128_SIMD_FNAME[] = __FILE__;
52 ANONYMOUS_NAMESPACE_BEGIN
55 using CryptoPP::word32;
56 using CryptoPP::word64;
60 #if (CRYPTOPP_ARM_NEON_AVAILABLE) 63 inline T UnpackHigh64(
const T& a,
const T& b)
65 const uint64x1_t x(vget_high_u64((uint64x2_t)a));
66 const uint64x1_t y(vget_high_u64((uint64x2_t)b));
67 return (T)vcombine_u64(x, y);
71 inline T UnpackLow64(
const T& a,
const T& b)
73 const uint64x1_t x(vget_low_u64((uint64x2_t)a));
74 const uint64x1_t y(vget_low_u64((uint64x2_t)b));
75 return (T)vcombine_u64(x, y);
78 template <
unsigned int R>
79 inline uint64x2_t RotateLeft64(
const uint64x2_t& val)
81 const uint64x2_t a(vshlq_n_u64(val, R));
82 const uint64x2_t b(vshrq_n_u64(val, 64 - R));
83 return vorrq_u64(a, b);
86 template <
unsigned int R>
87 inline uint64x2_t RotateRight64(
const uint64x2_t& val)
89 const uint64x2_t a(vshlq_n_u64(val, 64 - R));
90 const uint64x2_t b(vshrq_n_u64(val, R));
91 return vorrq_u64(a, b);
94 #if defined(__aarch32__) || defined(__aarch64__) 97 inline uint64x2_t RotateLeft64<8>(
const uint64x2_t& val)
99 #if (CRYPTOPP_BIG_ENDIAN) 100 const uint8_t maskb[16] = { 14,13,12,11, 10,9,8,15, 6,5,4,3, 2,1,0,7 };
101 const uint8x16_t mask = vld1q_u8(maskb);
103 const uint8_t maskb[16] = { 7,0,1,2, 3,4,5,6, 15,8,9,10, 11,12,13,14 };
104 const uint8x16_t mask = vld1q_u8(maskb);
107 return vreinterpretq_u64_u8(
108 vqtbl1q_u8(vreinterpretq_u8_u64(val), mask));
113 inline uint64x2_t RotateRight64<8>(
const uint64x2_t& val)
115 #if (CRYPTOPP_BIG_ENDIAN) 116 const uint8_t maskb[16] = { 8,15,14,13, 12,11,10,9, 0,7,6,5, 4,3,2,1 };
117 const uint8x16_t mask = vld1q_u8(maskb);
119 const uint8_t maskb[16] = { 1,2,3,4, 5,6,7,0, 9,10,11,12, 13,14,15,8 };
120 const uint8x16_t mask = vld1q_u8(maskb);
123 return vreinterpretq_u64_u8(
124 vqtbl1q_u8(vreinterpretq_u8_u64(val), mask));
128 inline void SPECK128_Enc_Block(uint64x2_t &block0, uint64x2_t &block1,
129 const word64 *subkeys,
unsigned int rounds)
132 uint64x2_t x1 = UnpackHigh64(block0, block1);
133 uint64x2_t y1 = UnpackLow64(block0, block1);
135 for (
int i=0; i < static_cast<int>(rounds); ++i)
137 const uint64x2_t rk = vld1q_dup_u64(subkeys+i);
139 x1 = RotateRight64<8>(x1);
140 x1 = vaddq_u64(x1, y1);
141 x1 = veorq_u64(x1, rk);
142 y1 = RotateLeft64<3>(y1);
143 y1 = veorq_u64(y1, x1);
147 block0 = UnpackLow64(y1, x1);
148 block1 = UnpackHigh64(y1, x1);
151 inline void SPECK128_Enc_6_Blocks(uint64x2_t &block0, uint64x2_t &block1,
152 uint64x2_t &block2, uint64x2_t &block3, uint64x2_t &block4, uint64x2_t &block5,
153 const word64 *subkeys,
unsigned int rounds)
156 uint64x2_t x1 = UnpackHigh64(block0, block1);
157 uint64x2_t y1 = UnpackLow64(block0, block1);
158 uint64x2_t x2 = UnpackHigh64(block2, block3);
159 uint64x2_t y2 = UnpackLow64(block2, block3);
160 uint64x2_t x3 = UnpackHigh64(block4, block5);
161 uint64x2_t y3 = UnpackLow64(block4, block5);
163 for (
int i=0; i < static_cast<int>(rounds); ++i)
165 const uint64x2_t rk = vld1q_dup_u64(subkeys+i);
167 x1 = RotateRight64<8>(x1);
168 x2 = RotateRight64<8>(x2);
169 x3 = RotateRight64<8>(x3);
170 x1 = vaddq_u64(x1, y1);
171 x2 = vaddq_u64(x2, y2);
172 x3 = vaddq_u64(x3, y3);
173 x1 = veorq_u64(x1, rk);
174 x2 = veorq_u64(x2, rk);
175 x3 = veorq_u64(x3, rk);
176 y1 = RotateLeft64<3>(y1);
177 y2 = RotateLeft64<3>(y2);
178 y3 = RotateLeft64<3>(y3);
179 y1 = veorq_u64(y1, x1);
180 y2 = veorq_u64(y2, x2);
181 y3 = veorq_u64(y3, x3);
185 block0 = UnpackLow64(y1, x1);
186 block1 = UnpackHigh64(y1, x1);
187 block2 = UnpackLow64(y2, x2);
188 block3 = UnpackHigh64(y2, x2);
189 block4 = UnpackLow64(y3, x3);
190 block5 = UnpackHigh64(y3, x3);
193 inline void SPECK128_Dec_Block(uint64x2_t &block0, uint64x2_t &block1,
194 const word64 *subkeys,
unsigned int rounds)
197 uint64x2_t x1 = UnpackHigh64(block0, block1);
198 uint64x2_t y1 = UnpackLow64(block0, block1);
200 for (
int i = static_cast<int>(rounds-1); i >= 0; --i)
202 const uint64x2_t rk = vld1q_dup_u64(subkeys+i);
204 y1 = veorq_u64(y1, x1);
205 y1 = RotateRight64<3>(y1);
206 x1 = veorq_u64(x1, rk);
207 x1 = vsubq_u64(x1, y1);
208 x1 = RotateLeft64<8>(x1);
212 block0 = UnpackLow64(y1, x1);
213 block1 = UnpackHigh64(y1, x1);
216 inline void SPECK128_Dec_6_Blocks(uint64x2_t &block0, uint64x2_t &block1,
217 uint64x2_t &block2, uint64x2_t &block3, uint64x2_t &block4, uint64x2_t &block5,
218 const word64 *subkeys,
unsigned int rounds)
221 uint64x2_t x1 = UnpackHigh64(block0, block1);
222 uint64x2_t y1 = UnpackLow64(block0, block1);
223 uint64x2_t x2 = UnpackHigh64(block2, block3);
224 uint64x2_t y2 = UnpackLow64(block2, block3);
225 uint64x2_t x3 = UnpackHigh64(block4, block5);
226 uint64x2_t y3 = UnpackLow64(block4, block5);
228 for (
int i = static_cast<int>(rounds-1); i >= 0; --i)
230 const uint64x2_t rk = vld1q_dup_u64(subkeys+i);
232 y1 = veorq_u64(y1, x1);
233 y2 = veorq_u64(y2, x2);
234 y3 = veorq_u64(y3, x3);
235 y1 = RotateRight64<3>(y1);
236 y2 = RotateRight64<3>(y2);
237 y3 = RotateRight64<3>(y3);
238 x1 = veorq_u64(x1, rk);
239 x2 = veorq_u64(x2, rk);
240 x3 = veorq_u64(x3, rk);
241 x1 = vsubq_u64(x1, y1);
242 x2 = vsubq_u64(x2, y2);
243 x3 = vsubq_u64(x3, y3);
244 x1 = RotateLeft64<8>(x1);
245 x2 = RotateLeft64<8>(x2);
246 x3 = RotateLeft64<8>(x3);
250 block0 = UnpackLow64(y1, x1);
251 block1 = UnpackHigh64(y1, x1);
252 block2 = UnpackLow64(y2, x2);
253 block3 = UnpackHigh64(y2, x2);
254 block4 = UnpackLow64(y3, x3);
255 block5 = UnpackHigh64(y3, x3);
258 #endif // CRYPTOPP_ARM_NEON_AVAILABLE 262 #if defined(CRYPTOPP_SSSE3_AVAILABLE) 266 # define M128_CAST(x) ((__m128i *)(void *)(x)) 268 #ifndef CONST_M128_CAST 269 # define CONST_M128_CAST(x) ((const __m128i *)(const void *)(x)) 274 # define DOUBLE_CAST(x) ((double *)(void *)(x)) 276 #ifndef CONST_DOUBLE_CAST 277 # define CONST_DOUBLE_CAST(x) ((const double *)(const void *)(x)) 280 template <
unsigned int R>
281 inline __m128i RotateLeft64(
const __m128i& val)
283 #if defined(CRYPTOPP_AVX512_ROTATE) 284 return _mm_rol_epi64(val, R);
285 #elif defined(__XOP__) 286 return _mm_roti_epi64(val, R);
289 _mm_slli_epi64(val, R), _mm_srli_epi64(val, 64-R));
293 template <
unsigned int R>
294 inline __m128i RotateRight64(
const __m128i& val)
296 #if defined(CRYPTOPP_AVX512_ROTATE) 297 return _mm_ror_epi64(val, R);
298 #elif defined(__XOP__) 299 return _mm_roti_epi64(val, 64-R);
302 _mm_slli_epi64(val, 64-R), _mm_srli_epi64(val, R));
308 __m128i RotateLeft64<8>(
const __m128i& val)
311 return _mm_roti_epi64(val, 8);
313 const __m128i mask = _mm_set_epi8(14,13,12,11, 10,9,8,15, 6,5,4,3, 2,1,0,7);
314 return _mm_shuffle_epi8(val, mask);
320 __m128i RotateRight64<8>(
const __m128i& val)
323 return _mm_roti_epi64(val, 64-8);
325 const __m128i mask = _mm_set_epi8(8,15,14,13, 12,11,10,9, 0,7,6,5, 4,3,2,1);
326 return _mm_shuffle_epi8(val, mask);
330 inline void SPECK128_Enc_Block(__m128i &block0, __m128i &block1,
331 const word64 *subkeys,
unsigned int rounds)
334 __m128i x1 = _mm_unpackhi_epi64(block0, block1);
335 __m128i y1 = _mm_unpacklo_epi64(block0, block1);
337 for (
int i=0; i < static_cast<int>(rounds); ++i)
339 const __m128i rk = _mm_castpd_si128(
340 _mm_loaddup_pd(CONST_DOUBLE_CAST(subkeys+i)));
342 x1 = RotateRight64<8>(x1);
343 x1 = _mm_add_epi64(x1, y1);
344 x1 = _mm_xor_si128(x1, rk);
345 y1 = RotateLeft64<3>(y1);
346 y1 = _mm_xor_si128(y1, x1);
350 block0 = _mm_unpacklo_epi64(y1, x1);
351 block1 = _mm_unpackhi_epi64(y1, x1);
354 inline void SPECK128_Enc_6_Blocks(__m128i &block0, __m128i &block1,
355 __m128i &block2, __m128i &block3, __m128i &block4, __m128i &block5,
356 const word64 *subkeys,
unsigned int rounds)
359 __m128i x1 = _mm_unpackhi_epi64(block0, block1);
360 __m128i y1 = _mm_unpacklo_epi64(block0, block1);
361 __m128i x2 = _mm_unpackhi_epi64(block2, block3);
362 __m128i y2 = _mm_unpacklo_epi64(block2, block3);
363 __m128i x3 = _mm_unpackhi_epi64(block4, block5);
364 __m128i y3 = _mm_unpacklo_epi64(block4, block5);
366 for (
int i=0; i < static_cast<int>(rounds); ++i)
368 const __m128i rk = _mm_castpd_si128(
369 _mm_loaddup_pd(CONST_DOUBLE_CAST(subkeys+i)));
371 x1 = RotateRight64<8>(x1);
372 x2 = RotateRight64<8>(x2);
373 x3 = RotateRight64<8>(x3);
374 x1 = _mm_add_epi64(x1, y1);
375 x2 = _mm_add_epi64(x2, y2);
376 x3 = _mm_add_epi64(x3, y3);
377 x1 = _mm_xor_si128(x1, rk);
378 x2 = _mm_xor_si128(x2, rk);
379 x3 = _mm_xor_si128(x3, rk);
380 y1 = RotateLeft64<3>(y1);
381 y2 = RotateLeft64<3>(y2);
382 y3 = RotateLeft64<3>(y3);
383 y1 = _mm_xor_si128(y1, x1);
384 y2 = _mm_xor_si128(y2, x2);
385 y3 = _mm_xor_si128(y3, x3);
389 block0 = _mm_unpacklo_epi64(y1, x1);
390 block1 = _mm_unpackhi_epi64(y1, x1);
391 block2 = _mm_unpacklo_epi64(y2, x2);
392 block3 = _mm_unpackhi_epi64(y2, x2);
393 block4 = _mm_unpacklo_epi64(y3, x3);
394 block5 = _mm_unpackhi_epi64(y3, x3);
397 inline void SPECK128_Dec_Block(__m128i &block0, __m128i &block1,
398 const word64 *subkeys,
unsigned int rounds)
401 __m128i x1 = _mm_unpackhi_epi64(block0, block1);
402 __m128i y1 = _mm_unpacklo_epi64(block0, block1);
404 for (
int i = static_cast<int>(rounds-1); i >= 0; --i)
406 const __m128i rk = _mm_castpd_si128(
407 _mm_loaddup_pd(CONST_DOUBLE_CAST(subkeys+i)));
409 y1 = _mm_xor_si128(y1, x1);
410 y1 = RotateRight64<3>(y1);
411 x1 = _mm_xor_si128(x1, rk);
412 x1 = _mm_sub_epi64(x1, y1);
413 x1 = RotateLeft64<8>(x1);
417 block0 = _mm_unpacklo_epi64(y1, x1);
418 block1 = _mm_unpackhi_epi64(y1, x1);
421 inline void SPECK128_Dec_6_Blocks(__m128i &block0, __m128i &block1,
422 __m128i &block2, __m128i &block3, __m128i &block4, __m128i &block5,
423 const word64 *subkeys,
unsigned int rounds)
426 __m128i x1 = _mm_unpackhi_epi64(block0, block1);
427 __m128i y1 = _mm_unpacklo_epi64(block0, block1);
428 __m128i x2 = _mm_unpackhi_epi64(block2, block3);
429 __m128i y2 = _mm_unpacklo_epi64(block2, block3);
430 __m128i x3 = _mm_unpackhi_epi64(block4, block5);
431 __m128i y3 = _mm_unpacklo_epi64(block4, block5);
433 for (
int i = static_cast<int>(rounds-1); i >= 0; --i)
435 const __m128i rk = _mm_castpd_si128(
436 _mm_loaddup_pd(CONST_DOUBLE_CAST(subkeys+i)));
438 y1 = _mm_xor_si128(y1, x1);
439 y2 = _mm_xor_si128(y2, x2);
440 y3 = _mm_xor_si128(y3, x3);
441 y1 = RotateRight64<3>(y1);
442 y2 = RotateRight64<3>(y2);
443 y3 = RotateRight64<3>(y3);
444 x1 = _mm_xor_si128(x1, rk);
445 x2 = _mm_xor_si128(x2, rk);
446 x3 = _mm_xor_si128(x3, rk);
447 x1 = _mm_sub_epi64(x1, y1);
448 x2 = _mm_sub_epi64(x2, y2);
449 x3 = _mm_sub_epi64(x3, y3);
450 x1 = RotateLeft64<8>(x1);
451 x2 = RotateLeft64<8>(x2);
452 x3 = RotateLeft64<8>(x3);
456 block0 = _mm_unpacklo_epi64(y1, x1);
457 block1 = _mm_unpackhi_epi64(y1, x1);
458 block2 = _mm_unpacklo_epi64(y2, x2);
459 block3 = _mm_unpackhi_epi64(y2, x2);
460 block4 = _mm_unpacklo_epi64(y3, x3);
461 block5 = _mm_unpackhi_epi64(y3, x3);
464 #endif // CRYPTOPP_SSSE3_AVAILABLE 468 #if defined(CRYPTOPP_POWER8_AVAILABLE) 480 template<
unsigned int C>
484 return vec_rl(val, m);
488 template<
unsigned int C>
492 return vec_rl(val, m);
495 void SPECK128_Enc_Block(
uint32x4_p &block,
const word64 *subkeys,
unsigned int rounds)
497 #if (CRYPTOPP_BIG_ENDIAN) 498 const uint8x16_p m1 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
499 const uint8x16_p m2 = {23,22,21,20,19,18,17,16, 7,6,5,4,3,2,1,0};
501 const uint8x16_p m1 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
502 const uint8x16_p m2 = {15,14,13,12,11,10,9,8, 31,30,29,28,27,26,25,24};
509 for (
int i=0; i < static_cast<int>(rounds); ++i)
511 const uint64x2_p rk = vec_splats((
unsigned long long)subkeys[i]);
513 x1 = RotateRight64<8>(x1);
517 y1 = RotateLeft64<3>(y1);
521 #if (CRYPTOPP_BIG_ENDIAN) 522 const uint8x16_p m3 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
525 const uint8x16_p m3 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
533 void SPECK128_Dec_Block(
uint32x4_p &block,
const word64 *subkeys,
unsigned int rounds)
535 #if (CRYPTOPP_BIG_ENDIAN) 536 const uint8x16_p m1 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
537 const uint8x16_p m2 = {23,22,21,20,19,18,17,16, 7,6,5,4,3,2,1,0};
539 const uint8x16_p m1 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
540 const uint8x16_p m2 = {15,14,13,12,11,10,9,8, 31,30,29,28,27,26,25,24};
547 for (
int i = static_cast<int>(rounds-1); i >= 0; --i)
549 const uint64x2_p rk = vec_splats((
unsigned long long)subkeys[i]);
552 y1 = RotateRight64<3>(y1);
555 x1 = RotateLeft64<8>(x1);
558 #if (CRYPTOPP_BIG_ENDIAN) 559 const uint8x16_p m3 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
562 const uint8x16_p m3 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
572 uint32x4_p &block5,
const word64 *subkeys,
unsigned int rounds)
574 #if (CRYPTOPP_BIG_ENDIAN) 575 const uint8x16_p m1 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
576 const uint8x16_p m2 = {23,22,21,20,19,18,17,16, 7,6,5,4,3,2,1,0};
578 const uint8x16_p m1 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
579 const uint8x16_p m2 = {15,14,13,12,11,10,9,8, 31,30,29,28,27,26,25,24};
590 for (
int i=0; i < static_cast<int>(rounds); ++i)
592 const uint64x2_p rk = vec_splats((
unsigned long long)subkeys[i]);
594 x1 = RotateRight64<8>(x1);
595 x2 = RotateRight64<8>(x2);
596 x3 = RotateRight64<8>(x3);
604 y1 = RotateLeft64<3>(y1);
605 y2 = RotateLeft64<3>(y2);
606 y3 = RotateLeft64<3>(y3);
612 #if (CRYPTOPP_BIG_ENDIAN) 613 const uint8x16_p m3 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
614 const uint8x16_p m4 = {23,22,21,20,19,18,17,16, 7,6,5,4,3,2,1,0};
616 const uint8x16_p m3 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
617 const uint8x16_p m4 = {15,14,13,12,11,10,9,8, 31,30,29,28,27,26,25,24};
631 uint32x4_p &block5,
const word64 *subkeys,
unsigned int rounds)
633 #if (CRYPTOPP_BIG_ENDIAN) 634 const uint8x16_p m1 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
635 const uint8x16_p m2 = {23,22,21,20,19,18,17,16, 7,6,5,4,3,2,1,0};
637 const uint8x16_p m1 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
638 const uint8x16_p m2 = {15,14,13,12,11,10,9,8, 31,30,29,28,27,26,25,24};
649 for (
int i = static_cast<int>(rounds-1); i >= 0; --i)
651 const uint64x2_p rk = vec_splats((
unsigned long long)subkeys[i]);
656 y1 = RotateRight64<3>(y1);
657 y2 = RotateRight64<3>(y2);
658 y3 = RotateRight64<3>(y3);
666 x1 = RotateLeft64<8>(x1);
667 x2 = RotateLeft64<8>(x2);
668 x3 = RotateLeft64<8>(x3);
671 #if (CRYPTOPP_BIG_ENDIAN) 672 const uint8x16_p m3 = {31,30,29,28,27,26,25,24, 15,14,13,12,11,10,9,8};
673 const uint8x16_p m4 = {23,22,21,20,19,18,17,16, 7,6,5,4,3,2,1,0};
675 const uint8x16_p m3 = {7,6,5,4,3,2,1,0, 23,22,21,20,19,18,17,16};
676 const uint8x16_p m4 = {15,14,13,12,11,10,9,8, 31,30,29,28,27,26,25,24};
688 #endif // CRYPTOPP_POWER8_AVAILABLE 690 ANONYMOUS_NAMESPACE_END
698 #if (CRYPTOPP_ARM_NEON_AVAILABLE) 699 size_t SPECK128_Enc_AdvancedProcessBlocks_NEON(
const word64* subKeys,
size_t rounds,
700 const byte *inBlocks,
const byte *xorBlocks, byte *outBlocks,
size_t length, word32 flags)
702 return AdvancedProcessBlocks128_6x2_NEON(SPECK128_Enc_Block, SPECK128_Enc_6_Blocks,
703 subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
706 size_t SPECK128_Dec_AdvancedProcessBlocks_NEON(
const word64* subKeys,
size_t rounds,
707 const byte *inBlocks,
const byte *xorBlocks, byte *outBlocks,
size_t length, word32 flags)
709 return AdvancedProcessBlocks128_6x2_NEON(SPECK128_Dec_Block, SPECK128_Dec_6_Blocks,
710 subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
712 #endif // CRYPTOPP_ARM_NEON_AVAILABLE 716 #if defined(CRYPTOPP_SSSE3_AVAILABLE) 717 size_t SPECK128_Enc_AdvancedProcessBlocks_SSSE3(
const word64* subKeys,
size_t rounds,
718 const byte *inBlocks,
const byte *xorBlocks, byte *outBlocks,
size_t length, word32 flags)
720 return AdvancedProcessBlocks128_6x2_SSE(SPECK128_Enc_Block, SPECK128_Enc_6_Blocks,
721 subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
724 size_t SPECK128_Dec_AdvancedProcessBlocks_SSSE3(
const word64* subKeys,
size_t rounds,
725 const byte *inBlocks,
const byte *xorBlocks, byte *outBlocks,
size_t length, word32 flags)
727 return AdvancedProcessBlocks128_6x2_SSE(SPECK128_Dec_Block, SPECK128_Dec_6_Blocks,
728 subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
730 #endif // CRYPTOPP_SSSE3_AVAILABLE 734 #if defined(CRYPTOPP_POWER8_AVAILABLE) 735 size_t SPECK128_Enc_AdvancedProcessBlocks_POWER8(
const word64* subKeys,
size_t rounds,
736 const byte *inBlocks,
const byte *xorBlocks, byte *outBlocks,
size_t length, word32 flags)
738 return AdvancedProcessBlocks128_6x1_ALTIVEC(SPECK128_Enc_Block, SPECK128_Enc_6_Blocks,
739 subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
742 size_t SPECK128_Dec_AdvancedProcessBlocks_POWER8(
const word64* subKeys,
size_t rounds,
743 const byte *inBlocks,
const byte *xorBlocks, byte *outBlocks,
size_t length, word32 flags)
745 return AdvancedProcessBlocks128_6x1_ALTIVEC(SPECK128_Dec_Block, SPECK128_Dec_6_Blocks,
746 subKeys, rounds, inBlocks, xorBlocks, outBlocks, length, flags);
748 #endif // CRYPTOPP_POWER8_AVAILABLE Utility functions for the Crypto++ library.
T1 VecSub(const T1 vec1, const T2 vec2)
Subtract two vectors.
Library configuration file.
T1 VecAdd(const T1 vec1, const T2 vec2)
Add two vectors.
T1 VecPermute(const T1 vec, const T2 mask)
Permutes a vector.
__vector unsigned int uint32x4_p
Vector of 32-bit elements.
Support functions for PowerPC and vector operations.
Template for AdvancedProcessBlocks and SIMD processing.
Classes for the Speck block cipher.
T1 VecXor(const T1 vec1, const T2 vec2)
XOR two vectors.
__vector unsigned long long uint64x2_p
Vector of 64-bit elements.
Crypto++ library namespace.
__vector unsigned char uint8x16_p
Vector of 8-bit elements.