Botan 2.13.0 Crypto and TLS for C++11

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

aes_power8.cpp
Go to the documentation of this file.
1 /*
2 * AES using POWER8/POWER9 crypto extensions
3 *
4 * Contributed by Jeffrey Walton
5 *
6 * Further changes
7 * (C) 2018,2019 Jack Lloyd
8 *
9 * Botan is released under the Simplified BSD License (see license.txt)
10 */
11
12 #include <botan/aes.h>
13 #include <botan/cpuid.h>
14
15 #include <altivec.h>
16 #undef vector
17 #undef bool
18
19 namespace Botan {
20
21 typedef __vector unsigned long long Altivec64x2;
22 typedef __vector unsigned int Altivec32x4;
23 typedef __vector unsigned char Altivec8x16;
24
25 namespace {
26
27 inline Altivec64x2 load_key(const uint32_t key[])
28 {
29 Altivec32x4 vec = vec_vsx_ld(0, key);
30
31 if(CPUID::is_little_endian())
32 {
33 const Altivec8x16 mask = {12,13,14,15, 8,9,10,11, 4,5,6,7, 0,1,2,3};
34 const Altivec8x16 zero = {0};
35 return (Altivec64x2)vec_perm((Altivec8x16)vec, zero, mask);
36 }
37 else
38 {
39 return (Altivec64x2)vec;
40 }
41 }
42
43 inline Altivec8x16 reverse_vec(Altivec8x16 src)
44 {
45 if(CPUID::is_little_endian())
46 {
47 const Altivec8x16 mask = {15,14,13,12, 11,10,9,8, 7,6,5,4, 3,2,1,0};
48 const Altivec8x16 zero = {0};
49 return vec_perm(src, zero, mask);
50 }
51 else
52 {
53 return src;
54 }
55 }
56
57 inline Altivec64x2 load_block(const uint8_t src[])
58 {
59 return (Altivec64x2)reverse_vec(vec_vsx_ld(0, src));
60 }
61
62 inline void store_block(Altivec64x2 src, uint8_t dest[])
63 {
64 vec_vsx_st(reverse_vec((Altivec8x16)src), 0, dest);
65 }
66
67 inline void store_blocks(Altivec64x2 B0, Altivec64x2 B1,
68 Altivec64x2 B2, Altivec64x2 B3,
69 uint8_t out[])
70 {
71 store_block(B0, out);
72 store_block(B1, out+16);
73 store_block(B2, out+16*2);
74 store_block(B3, out+16*3);
75 }
76
77 #define AES_XOR_4(B0, B1, B2, B3, K) do { \
78 B0 = vec_xor(B0, K); \
79 B1 = vec_xor(B1, K); \
80 B2 = vec_xor(B2, K); \
81 B3 = vec_xor(B3, K); \
82 } while(0)
83
84 #define AES_ENCRYPT_4(B0, B1, B2, B3, K) do { \
85 B0 = __builtin_crypto_vcipher(B0, K); \
86 B1 = __builtin_crypto_vcipher(B1, K); \
87 B2 = __builtin_crypto_vcipher(B2, K); \
88 B3 = __builtin_crypto_vcipher(B3, K); \
89 } while(0)
90
91 #define AES_ENCRYPT_4_LAST(B0, B1, B2, B3, K) do { \
92 B0 = __builtin_crypto_vcipherlast(B0, K); \
93 B1 = __builtin_crypto_vcipherlast(B1, K); \
94 B2 = __builtin_crypto_vcipherlast(B2, K); \
95 B3 = __builtin_crypto_vcipherlast(B3, K); \
96 } while(0)
97
98 #define AES_DECRYPT_4(B0, B1, B2, B3, K) do { \
99 B0 = __builtin_crypto_vncipher(B0, K); \
100 B1 = __builtin_crypto_vncipher(B1, K); \
101 B2 = __builtin_crypto_vncipher(B2, K); \
102 B3 = __builtin_crypto_vncipher(B3, K); \
103 } while(0)
104
105 #define AES_DECRYPT_4_LAST(B0, B1, B2, B3, K) do { \
106 B0 = __builtin_crypto_vncipherlast(B0, K); \
107 B1 = __builtin_crypto_vncipherlast(B1, K); \
108 B2 = __builtin_crypto_vncipherlast(B2, K); \
109 B3 = __builtin_crypto_vncipherlast(B3, K); \
110 } while(0)
111
112 }
113
114 BOTAN_FUNC_ISA("crypto")
115 void AES_128::power8_encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
116 {
117 const Altivec64x2 K0 = load_key(&m_EK[0]);
118 const Altivec64x2 K1 = load_key(&m_EK[4]);
119 const Altivec64x2 K2 = load_key(&m_EK[8]);
120 const Altivec64x2 K3 = load_key(&m_EK[12]);
121 const Altivec64x2 K4 = load_key(&m_EK[16]);
122 const Altivec64x2 K5 = load_key(&m_EK[20]);
123 const Altivec64x2 K6 = load_key(&m_EK[24]);
124 const Altivec64x2 K7 = load_key(&m_EK[28]);
125 const Altivec64x2 K8 = load_key(&m_EK[32]);
126 const Altivec64x2 K9 = load_key(&m_EK[36]);
127 const Altivec64x2 K10 = load_block(m_ME.data());
128
129 while(blocks >= 4)
130 {
131 Altivec64x2 B0 = load_block(in);
132 Altivec64x2 B1 = load_block(in+16);
133 Altivec64x2 B2 = load_block(in+16*2);
134 Altivec64x2 B3 = load_block(in+16*3);
135
136 AES_XOR_4(B0, B1, B2, B3, K0);
137 AES_ENCRYPT_4(B0, B1, B2, B3, K1);
138 AES_ENCRYPT_4(B0, B1, B2, B3, K2);
139 AES_ENCRYPT_4(B0, B1, B2, B3, K3);
140 AES_ENCRYPT_4(B0, B1, B2, B3, K4);
141 AES_ENCRYPT_4(B0, B1, B2, B3, K5);
142 AES_ENCRYPT_4(B0, B1, B2, B3, K6);
143 AES_ENCRYPT_4(B0, B1, B2, B3, K7);
144 AES_ENCRYPT_4(B0, B1, B2, B3, K8);
145 AES_ENCRYPT_4(B0, B1, B2, B3, K9);
146 AES_ENCRYPT_4_LAST(B0, B1, B2, B3, K10);
147
148 store_blocks(B0, B1, B2, B3, out);
149
150 out += 4*16;
151 in += 4*16;
152 blocks -= 4;
153 }
154
155 for(size_t i = 0; i != blocks; ++i)
156 {
157 Altivec64x2 B = load_block(in);
158
159 B = vec_xor(B, K0);
160 B = __builtin_crypto_vcipher(B, K1);
161 B = __builtin_crypto_vcipher(B, K2);
162 B = __builtin_crypto_vcipher(B, K3);
163 B = __builtin_crypto_vcipher(B, K4);
164 B = __builtin_crypto_vcipher(B, K5);
165 B = __builtin_crypto_vcipher(B, K6);
166 B = __builtin_crypto_vcipher(B, K7);
167 B = __builtin_crypto_vcipher(B, K8);
168 B = __builtin_crypto_vcipher(B, K9);
169 B = __builtin_crypto_vcipherlast(B, K10);
170
171 store_block(B, out);
172
173 out += 16;
174 in += 16;
175 }
176 }
177
178 BOTAN_FUNC_ISA("crypto")
179 void AES_128::power8_decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
180 {
181 const Altivec64x2 K0 = load_block(m_ME.data());
182 const Altivec64x2 K1 = load_key(&m_EK[36]);
183 const Altivec64x2 K2 = load_key(&m_EK[32]);
184 const Altivec64x2 K3 = load_key(&m_EK[28]);
185 const Altivec64x2 K4 = load_key(&m_EK[24]);
186 const Altivec64x2 K5 = load_key(&m_EK[20]);
187 const Altivec64x2 K6 = load_key(&m_EK[16]);
188 const Altivec64x2 K7 = load_key(&m_EK[12]);
189 const Altivec64x2 K8 = load_key(&m_EK[8]);
190 const Altivec64x2 K9 = load_key(&m_EK[4]);
191 const Altivec64x2 K10 = load_key(&m_EK[0]);
192
193 while(blocks >= 4)
194 {
195 Altivec64x2 B0 = load_block(in);
196 Altivec64x2 B1 = load_block(in+16);
197 Altivec64x2 B2 = load_block(in+16*2);
198 Altivec64x2 B3 = load_block(in+16*3);
199
200 AES_XOR_4(B0, B1, B2, B3, K0);
201 AES_DECRYPT_4(B0, B1, B2, B3, K1);
202 AES_DECRYPT_4(B0, B1, B2, B3, K2);
203 AES_DECRYPT_4(B0, B1, B2, B3, K3);
204 AES_DECRYPT_4(B0, B1, B2, B3, K4);
205 AES_DECRYPT_4(B0, B1, B2, B3, K5);
206 AES_DECRYPT_4(B0, B1, B2, B3, K6);
207 AES_DECRYPT_4(B0, B1, B2, B3, K7);
208 AES_DECRYPT_4(B0, B1, B2, B3, K8);
209 AES_DECRYPT_4(B0, B1, B2, B3, K9);
210 AES_DECRYPT_4_LAST(B0, B1, B2, B3, K10);
211
212 store_blocks(B0, B1, B2, B3, out);
213
214 out += 4*16;
215 in += 4*16;
216 blocks -= 4;
217 }
218
219 for(size_t i = 0; i != blocks; ++i)
220 {
221 Altivec64x2 B = load_block(in);
222
223 B = vec_xor(B, K0);
224 B = __builtin_crypto_vncipher(B, K1);
225 B = __builtin_crypto_vncipher(B, K2);
226 B = __builtin_crypto_vncipher(B, K3);
227 B = __builtin_crypto_vncipher(B, K4);
228 B = __builtin_crypto_vncipher(B, K5);
229 B = __builtin_crypto_vncipher(B, K6);
230 B = __builtin_crypto_vncipher(B, K7);
231 B = __builtin_crypto_vncipher(B, K8);
232 B = __builtin_crypto_vncipher(B, K9);
233 B = __builtin_crypto_vncipherlast(B, K10);
234
235 store_block(B, out);
236
237 out += 16;
238 in += 16;
239 }
240 }
241
242 BOTAN_FUNC_ISA("crypto")
243 void AES_192::power8_encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
244 {
245 const Altivec64x2 K0 = load_key(&m_EK[0]);
246 const Altivec64x2 K1 = load_key(&m_EK[4]);
247 const Altivec64x2 K2 = load_key(&m_EK[8]);
248 const Altivec64x2 K3 = load_key(&m_EK[12]);
249 const Altivec64x2 K4 = load_key(&m_EK[16]);
250 const Altivec64x2 K5 = load_key(&m_EK[20]);
251 const Altivec64x2 K6 = load_key(&m_EK[24]);
252 const Altivec64x2 K7 = load_key(&m_EK[28]);
253 const Altivec64x2 K8 = load_key(&m_EK[32]);
254 const Altivec64x2 K9 = load_key(&m_EK[36]);
255 const Altivec64x2 K10 = load_key(&m_EK[40]);
256 const Altivec64x2 K11 = load_key(&m_EK[44]);
257 const Altivec64x2 K12 = load_block(m_ME.data());
258
259 while(blocks >= 4)
260 {
261 Altivec64x2 B0 = load_block(in);
262 Altivec64x2 B1 = load_block(in+16);
263 Altivec64x2 B2 = load_block(in+16*2);
264 Altivec64x2 B3 = load_block(in+16*3);
265
266 AES_XOR_4(B0, B1, B2, B3, K0);
267 AES_ENCRYPT_4(B0, B1, B2, B3, K1);
268 AES_ENCRYPT_4(B0, B1, B2, B3, K2);
269 AES_ENCRYPT_4(B0, B1, B2, B3, K3);
270 AES_ENCRYPT_4(B0, B1, B2, B3, K4);
271 AES_ENCRYPT_4(B0, B1, B2, B3, K5);
272 AES_ENCRYPT_4(B0, B1, B2, B3, K6);
273 AES_ENCRYPT_4(B0, B1, B2, B3, K7);
274 AES_ENCRYPT_4(B0, B1, B2, B3, K8);
275 AES_ENCRYPT_4(B0, B1, B2, B3, K9);
276 AES_ENCRYPT_4(B0, B1, B2, B3, K10);
277 AES_ENCRYPT_4(B0, B1, B2, B3, K11);
278 AES_ENCRYPT_4_LAST(B0, B1, B2, B3, K12);
279
280 store_blocks(B0, B1, B2, B3, out);
281
282 out += 4*16;
283 in += 4*16;
284 blocks -= 4;
285 }
286
287 for(size_t i = 0; i != blocks; ++i)
288 {
289 Altivec64x2 B = load_block(in);
290
291 B = vec_xor(B, K0);
292 B = __builtin_crypto_vcipher(B, K1);
293 B = __builtin_crypto_vcipher(B, K2);
294 B = __builtin_crypto_vcipher(B, K3);
295 B = __builtin_crypto_vcipher(B, K4);
296 B = __builtin_crypto_vcipher(B, K5);
297 B = __builtin_crypto_vcipher(B, K6);
298 B = __builtin_crypto_vcipher(B, K7);
299 B = __builtin_crypto_vcipher(B, K8);
300 B = __builtin_crypto_vcipher(B, K9);
301 B = __builtin_crypto_vcipher(B, K10);
302 B = __builtin_crypto_vcipher(B, K11);
303 B = __builtin_crypto_vcipherlast(B, K12);
304
305 store_block(B, out);
306
307 out += 16;
308 in += 16;
309 }
310 }
311
312 BOTAN_FUNC_ISA("crypto")
313 void AES_192::power8_decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
314 {
315 const Altivec64x2 K0 = load_block(m_ME.data());
316 const Altivec64x2 K1 = load_key(&m_EK[44]);
317 const Altivec64x2 K2 = load_key(&m_EK[40]);
318 const Altivec64x2 K3 = load_key(&m_EK[36]);
319 const Altivec64x2 K4 = load_key(&m_EK[32]);
320 const Altivec64x2 K5 = load_key(&m_EK[28]);
321 const Altivec64x2 K6 = load_key(&m_EK[24]);
322 const Altivec64x2 K7 = load_key(&m_EK[20]);
323 const Altivec64x2 K8 = load_key(&m_EK[16]);
324 const Altivec64x2 K9 = load_key(&m_EK[12]);
325 const Altivec64x2 K10 = load_key(&m_EK[8]);
326 const Altivec64x2 K11 = load_key(&m_EK[4]);
327 const Altivec64x2 K12 = load_key(&m_EK[0]);
328
329 while(blocks >= 4)
330 {
331 Altivec64x2 B0 = load_block(in);
332 Altivec64x2 B1 = load_block(in+16);
333 Altivec64x2 B2 = load_block(in+16*2);
334 Altivec64x2 B3 = load_block(in+16*3);
335
336 AES_XOR_4(B0, B1, B2, B3, K0);
337 AES_DECRYPT_4(B0, B1, B2, B3, K1);
338 AES_DECRYPT_4(B0, B1, B2, B3, K2);
339 AES_DECRYPT_4(B0, B1, B2, B3, K3);
340 AES_DECRYPT_4(B0, B1, B2, B3, K4);
341 AES_DECRYPT_4(B0, B1, B2, B3, K5);
342 AES_DECRYPT_4(B0, B1, B2, B3, K6);
343 AES_DECRYPT_4(B0, B1, B2, B3, K7);
344 AES_DECRYPT_4(B0, B1, B2, B3, K8);
345 AES_DECRYPT_4(B0, B1, B2, B3, K9);
346 AES_DECRYPT_4(B0, B1, B2, B3, K10);
347 AES_DECRYPT_4(B0, B1, B2, B3, K11);
348 AES_DECRYPT_4_LAST(B0, B1, B2, B3, K12);
349
350 store_blocks(B0, B1, B2, B3, out);
351
352 out += 4*16;
353 in += 4*16;
354 blocks -= 4;
355 }
356
357 for(size_t i = 0; i != blocks; ++i)
358 {
359 Altivec64x2 B = load_block(in);
360
361 B = vec_xor(B, K0);
362 B = __builtin_crypto_vncipher(B, K1);
363 B = __builtin_crypto_vncipher(B, K2);
364 B = __builtin_crypto_vncipher(B, K3);
365 B = __builtin_crypto_vncipher(B, K4);
366 B = __builtin_crypto_vncipher(B, K5);
367 B = __builtin_crypto_vncipher(B, K6);
368 B = __builtin_crypto_vncipher(B, K7);
369 B = __builtin_crypto_vncipher(B, K8);
370 B = __builtin_crypto_vncipher(B, K9);
371 B = __builtin_crypto_vncipher(B, K10);
372 B = __builtin_crypto_vncipher(B, K11);
373 B = __builtin_crypto_vncipherlast(B, K12);
374
375 store_block(B, out);
376
377 out += 16;
378 in += 16;
379 }
380 }
381
382 BOTAN_FUNC_ISA("crypto")
383 void AES_256::power8_encrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
384 {
385 const Altivec64x2 K0 = load_key(&m_EK[0]);
386 const Altivec64x2 K1 = load_key(&m_EK[4]);
387 const Altivec64x2 K2 = load_key(&m_EK[8]);
388 const Altivec64x2 K3 = load_key(&m_EK[12]);
389 const Altivec64x2 K4 = load_key(&m_EK[16]);
390 const Altivec64x2 K5 = load_key(&m_EK[20]);
391 const Altivec64x2 K6 = load_key(&m_EK[24]);
392 const Altivec64x2 K7 = load_key(&m_EK[28]);
393 const Altivec64x2 K8 = load_key(&m_EK[32]);
394 const Altivec64x2 K9 = load_key(&m_EK[36]);
395 const Altivec64x2 K10 = load_key(&m_EK[40]);
396 const Altivec64x2 K11 = load_key(&m_EK[44]);
397 const Altivec64x2 K12 = load_key(&m_EK[48]);
398 const Altivec64x2 K13 = load_key(&m_EK[52]);
399 const Altivec64x2 K14 = load_block(m_ME.data());
400
401 while(blocks >= 4)
402 {
403 Altivec64x2 B0 = load_block(in);
404 Altivec64x2 B1 = load_block(in+16);
405 Altivec64x2 B2 = load_block(in+16*2);
406 Altivec64x2 B3 = load_block(in+16*3);
407
408 AES_XOR_4(B0, B1, B2, B3, K0);
409 AES_ENCRYPT_4(B0, B1, B2, B3, K1);
410 AES_ENCRYPT_4(B0, B1, B2, B3, K2);
411 AES_ENCRYPT_4(B0, B1, B2, B3, K3);
412 AES_ENCRYPT_4(B0, B1, B2, B3, K4);
413 AES_ENCRYPT_4(B0, B1, B2, B3, K5);
414 AES_ENCRYPT_4(B0, B1, B2, B3, K6);
415 AES_ENCRYPT_4(B0, B1, B2, B3, K7);
416 AES_ENCRYPT_4(B0, B1, B2, B3, K8);
417 AES_ENCRYPT_4(B0, B1, B2, B3, K9);
418 AES_ENCRYPT_4(B0, B1, B2, B3, K10);
419 AES_ENCRYPT_4(B0, B1, B2, B3, K11);
420 AES_ENCRYPT_4(B0, B1, B2, B3, K12);
421 AES_ENCRYPT_4(B0, B1, B2, B3, K13);
422 AES_ENCRYPT_4_LAST(B0, B1, B2, B3, K14);
423
424 store_blocks(B0, B1, B2, B3, out);
425
426 out += 4*16;
427 in += 4*16;
428 blocks -= 4;
429 }
430
431 for(size_t i = 0; i != blocks; ++i)
432 {
433 Altivec64x2 B = load_block(in);
434
435 B = vec_xor(B, K0);
436 B = __builtin_crypto_vcipher(B, K1);
437 B = __builtin_crypto_vcipher(B, K2);
438 B = __builtin_crypto_vcipher(B, K3);
439 B = __builtin_crypto_vcipher(B, K4);
440 B = __builtin_crypto_vcipher(B, K5);
441 B = __builtin_crypto_vcipher(B, K6);
442 B = __builtin_crypto_vcipher(B, K7);
443 B = __builtin_crypto_vcipher(B, K8);
444 B = __builtin_crypto_vcipher(B, K9);
445 B = __builtin_crypto_vcipher(B, K10);
446 B = __builtin_crypto_vcipher(B, K11);
447 B = __builtin_crypto_vcipher(B, K12);
448 B = __builtin_crypto_vcipher(B, K13);
449 B = __builtin_crypto_vcipherlast(B, K14);
450
451 store_block(B, out);
452
453 out += 16;
454 in += 16;
455 }
456 }
457
458 BOTAN_FUNC_ISA("crypto")
459 void AES_256::power8_decrypt_n(const uint8_t in[], uint8_t out[], size_t blocks) const
460 {
461 const Altivec64x2 K0 = load_block(m_ME.data());
462 const Altivec64x2 K1 = load_key(&m_EK[52]);
463 const Altivec64x2 K2 = load_key(&m_EK[48]);
464 const Altivec64x2 K3 = load_key(&m_EK[44]);
465 const Altivec64x2 K4 = load_key(&m_EK[40]);
466 const Altivec64x2 K5 = load_key(&m_EK[36]);
467 const Altivec64x2 K6 = load_key(&m_EK[32]);
468 const Altivec64x2 K7 = load_key(&m_EK[28]);
469 const Altivec64x2 K8 = load_key(&m_EK[24]);
470 const Altivec64x2 K9 = load_key(&m_EK[20]);
471 const Altivec64x2 K10 = load_key(&m_EK[16]);
472 const Altivec64x2 K11 = load_key(&m_EK[12]);
473 const Altivec64x2 K12 = load_key(&m_EK[8]);
474 const Altivec64x2 K13 = load_key(&m_EK[4]);
475 const Altivec64x2 K14 = load_key(&m_EK[0]);
476
477 while(blocks >= 4)
478 {
479 Altivec64x2 B0 = load_block(in);
480 Altivec64x2 B1 = load_block(in+16);
481 Altivec64x2 B2 = load_block(in+16*2);
482 Altivec64x2 B3 = load_block(in+16*3);
483
484 AES_XOR_4(B0, B1, B2, B3, K0);
485 AES_DECRYPT_4(B0, B1, B2, B3, K1);
486 AES_DECRYPT_4(B0, B1, B2, B3, K2);
487 AES_DECRYPT_4(B0, B1, B2, B3, K3);
488 AES_DECRYPT_4(B0, B1, B2, B3, K4);
489 AES_DECRYPT_4(B0, B1, B2, B3, K5);
490 AES_DECRYPT_4(B0, B1, B2, B3, K6);
491 AES_DECRYPT_4(B0, B1, B2, B3, K7);
492 AES_DECRYPT_4(B0, B1, B2, B3, K8);
493 AES_DECRYPT_4(B0, B1, B2, B3, K9);
494 AES_DECRYPT_4(B0, B1, B2, B3, K10);
495 AES_DECRYPT_4(B0, B1, B2, B3, K11);
496 AES_DECRYPT_4(B0, B1, B2, B3, K12);
497 AES_DECRYPT_4(B0, B1, B2, B3, K13);
498 AES_DECRYPT_4_LAST(B0, B1, B2, B3, K14);
499
500 store_blocks(B0, B1, B2, B3, out);
501
502 out += 4*16;
503 in += 4*16;
504 blocks -= 4;
505 }
506
507 for(size_t i = 0; i != blocks; ++i)
508 {
509 Altivec64x2 B = load_block(in);
510
511 B = vec_xor(B, K0);
512 B = __builtin_crypto_vncipher(B, K1);
513 B = __builtin_crypto_vncipher(B, K2);
514 B = __builtin_crypto_vncipher(B, K3);
515 B = __builtin_crypto_vncipher(B, K4);
516 B = __builtin_crypto_vncipher(B, K5);
517 B = __builtin_crypto_vncipher(B, K6);
518 B = __builtin_crypto_vncipher(B, K7);
519 B = __builtin_crypto_vncipher(B, K8);
520 B = __builtin_crypto_vncipher(B, K9);
521 B = __builtin_crypto_vncipher(B, K10);
522 B = __builtin_crypto_vncipher(B, K11);
523 B = __builtin_crypto_vncipher(B, K12);
524 B = __builtin_crypto_vncipher(B, K13);
525 B = __builtin_crypto_vncipherlast(B, K14);
526
527 store_block(B, out);
528
529 out += 16;
530 in += 16;
531 }
532 }
533
534 #undef AES_XOR_4
535 #undef AES_ENCRYPT_4
536 #undef AES_ENCRYPT_4_LAST
537 #undef AES_DECRYPT_4
538 #undef AES_DECRYPT_4_LAST
539
540 }
Botan::Altivec8x16
__vector unsigned char Altivec8x16
Definition: aes_power8.cpp:23
BOTAN_FUNC_ISA
#define BOTAN_FUNC_ISA(isa)
Definition: compiler.h:71
AES_XOR_4
#define AES_XOR_4(B0, B1, B2, B3, K)
Definition: aes_power8.cpp:77
Botan::Altivec32x4
__vector unsigned int Altivec32x4
Definition: aes_power8.cpp:22
Botan::CPUID::is_little_endian
static bool is_little_endian()
Definition: cpuid.h:73
Botan
Definition: alg_id.cpp:13
AES_ENCRYPT_4_LAST
#define AES_ENCRYPT_4_LAST(B0, B1, B2, B3, K)
Definition: aes_power8.cpp:91
AES_ENCRYPT_4
#define AES_ENCRYPT_4(B0, B1, B2, B3, K)
Definition: aes_power8.cpp:84
Botan::PKCS8::load_key
std::unique_ptr< Private_Key > load_key(DataSource &source, std::function< std::string()> get_pass)
Definition: pkcs8.cpp:366
Botan::Altivec64x2
__vector unsigned long long Altivec64x2
Definition: aes_power8.cpp:21
AES_DECRYPT_4
#define AES_DECRYPT_4(B0, B1, B2, B3, K)
Definition: aes_power8.cpp:98
AES_DECRYPT_4_LAST
#define AES_DECRYPT_4_LAST(B0, B1, B2, B3, K)
Definition: aes_power8.cpp:105