Skip to content

Commit

Permalink
Adapt BoringSSL implementation to mirror existing AVX assembly file
Browse files Browse the repository at this point in the history
Signed-off-by: Joel Low <joel@joelsplace.sg>
  • Loading branch information
lowjoel committed Feb 15, 2025
1 parent 1648c1c commit 0ce5f7b
Showing 1 changed file with 24 additions and 6 deletions.
30 changes: 24 additions & 6 deletions module/icp/asm-x86_64/modes/aesni-gcm-avx2.S
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
// This file is generated from a similarly-named Perl script in the BoringSSL
// source tree. Do not edit by hand.

#include <openssl/asm_base.h>
#if defined(__x86_64__) && defined(HAVE_AVX) && \
defined(HAVE_VAES) && defined(HAVE_VPCLMULQDQ)

#define _ASM
#include <sys/asm_linkage.h>

/* Windows userland links with OpenSSL */
#if !defined (_WIN32) || defined (_KERNEL)

#ifndef _CET_ENDBR
#define _CET_ENDBR
#endif

#if !defined(OPENSSL_NO_ASM) && defined(OPENSSL_X86_64) && defined(__ELF__)
.section .rodata
.align 16

Expand Down Expand Up @@ -381,8 +391,8 @@ _CET_ENDBR



movl 240(%rcx),%r10d
leal -20(,%r10,4),%r10d
movl 504-128(%rcx),%r10d // ICP has a larger offset for rounds.
leal -16(,%r10,4),%r10d // ICP uses 10,12,14 not 9,11,13 for rounds.



Expand Down Expand Up @@ -917,8 +927,8 @@ _CET_ENDBR



movl 240(%rcx),%r10d
leal -20(,%r10,4),%r10d
movl 504-128(%rcx),%r10d // ICP has a larger offset for rounds.
leal -16(,%r10,4),%r10d // ICP uses 10,12,14 not 9,11,13 for rounds.



Expand Down Expand Up @@ -1315,4 +1325,12 @@ _CET_ENDBR

.cfi_endproc
.size aes_gcm_dec_update_vaes_avx2, . - aes_gcm_dec_update_vaes_avx2

#endif /* !_WIN32 || _KERNEL */

/* Mark the stack non-executable. */
#if defined(__linux__) && defined(__ELF__)
.section .note.GNU-stack,"",%progbits
#endif

#endif /* defined(__x86_64__) && defined(HAVE_AVX) && defined(HAVE_AES) ... */

0 comments on commit 0ce5f7b

Please sign in to comment.