|
1 | 1 | // This file is generated from a similarly-named Perl script in the BoringSSL
|
2 | 2 | // source tree. Do not edit by hand.
|
3 | 3 |
|
4 |
| -#include <openssl/asm_base.h> |
| 4 | +#if defined(__x86_64__) && defined(HAVE_AVX) && \ |
| 5 | + defined(HAVE_VAES) && defined(HAVE_VPCLMULQDQ) |
| 6 | + |
| 7 | +#define _ASM |
| 8 | +#include <sys/asm_linkage.h> |
| 9 | + |
| 10 | +/* Windows userland links with OpenSSL */ |
| 11 | +#if !defined (_WIN32) || defined (_KERNEL) |
| 12 | + |
| 13 | +#ifndef _CET_ENDBR |
| 14 | +#define _CET_ENDBR |
| 15 | +#endif |
5 | 16 |
|
6 |
| -#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && defined(__ELF__) |
7 | 17 | .section .rodata
|
8 | 18 | .align 16
|
9 | 19 |
|
@@ -48,7 +58,11 @@ _CET_ENDBR
|
48 | 58 |
|
49 | 59 |
|
50 | 60 |
|
51 |
| - vpshufd $0x4e,(%rsi),%xmm3 |
| 61 | + vmovdqu (%rsi),%xmm3 |
| 62 | + // KCF/ICP stores H in network byte order with the hi qword first |
| 63 | + // so we need to swap all bytes, not the 2 qwords. |
| 64 | + vmovdqu .Lbswap_mask(%rip),%xmm4 |
| 65 | + vpshufb %xmm4,%xmm3,%xmm3 |
52 | 66 |
|
53 | 67 |
|
54 | 68 |
|
@@ -381,8 +395,8 @@ _CET_ENDBR
|
381 | 395 |
|
382 | 396 |
|
383 | 397 |
|
384 |
| - movl 240(%rcx),%r10d |
385 |
| - leal -20(,%r10,4),%r10d |
| 398 | + movl 504(%rcx),%r10d // ICP has a larger offset for rounds. |
| 399 | + leal -24(,%r10,4),%r10d // ICP uses 10,12,14 not 9,11,13 for rounds. |
386 | 400 |
|
387 | 401 |
|
388 | 402 |
|
@@ -917,8 +931,8 @@ _CET_ENDBR
|
917 | 931 |
|
918 | 932 |
|
919 | 933 |
|
920 |
| - movl 240(%rcx),%r10d |
921 |
| - leal -20(,%r10,4),%r10d |
| 934 | + movl 504(%rcx),%r10d // ICP has a larger offset for rounds. |
| 935 | + leal -24(,%r10,4),%r10d // ICP uses 10,12,14 not 9,11,13 for rounds. |
922 | 936 |
|
923 | 937 |
|
924 | 938 |
|
@@ -1315,4 +1329,12 @@ _CET_ENDBR
|
1315 | 1329 |
|
1316 | 1330 | .cfi_endproc
|
1317 | 1331 | .size aes_gcm_dec_update_vaes_avx2, . - aes_gcm_dec_update_vaes_avx2
|
| 1332 | + |
| 1333 | +#endif /* !_WIN32 || _KERNEL */ |
| 1334 | + |
| 1335 | +/* Mark the stack non-executable. */ |
| 1336 | +#if defined(__linux__) && defined(__ELF__) |
| 1337 | +.section .note.GNU-stack,"",%progbits |
1318 | 1338 | #endif
|
| 1339 | + |
| 1340 | +#endif /* defined(__x86_64__) && defined(HAVE_AVX) && defined(HAVE_AES) ... */ |
0 commit comments