Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AVX-512 support for RSA Signing #1273

Merged
merged 36 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b9088fc
Use IFMA_AVX512 when possible for modular exponentiation.
pittma Aug 7, 2023
e6269ff
Add test coverage for consttime_x2 mod exp function
pittma Oct 23, 2023
6d2ece9
Add fuzzer coverage for BN_mod_exp_mont_consttime_x2
pittma Oct 23, 2023
e0ad9da
prevent empty translation units for compilers that don't like them
pittma Oct 30, 2023
024a9ec
properly handle AVX-512 build conditions
pittma Oct 31, 2023
cd2a3d1
fips builds require subsections
pittma Oct 31, 2023
d4d89fc
fix disallowed interaction with `OPENSSL_ia32_cap_P` in fips mode
pittma Nov 2, 2023
a0f3737
reset sections when they change for variable declaration
pittma Nov 2, 2023
8e55af5
include avx512ifma flag
pittma Nov 3, 2023
7d1ea20
handle AVX-512 mask register usage in fips delocation process
pittma Nov 15, 2023
407df8d
address review comments
pittma Jan 30, 2024
e67bbda
regen generated source
pittma Feb 1, 2024
b33709e
regenerate delocate parser
pittma Feb 1, 2024
0e7c607
AVX-512 RSA Signing: address first PR review
pittma Apr 10, 2024
b2d1327
Merge remote-tracking branch 'origin/main'
pittma Apr 10, 2024
14fefe0
Still export the parallel mod_exp implementation
pittma Apr 12, 2024
5e1c7ee
second set of review comments and documentation
pittma Apr 24, 2024
73d389d
fix generated source conflict
pittma Apr 24, 2024
087bf5c
Merge branch 'main' of github.com:aws/aws-lc into pmain
pittma Jul 25, 2024
c439bf0
address review 3 comments
pittma Jul 25, 2024
abe1124
Merge branch 'main' of github.com:aws/aws-lc
pittma Aug 7, 2024
37b4a4a
Merge branch 'main' of github.com:aws/aws-lc into pmain
pittma Sep 5, 2024
e06d8d0
further review comments
pittma Sep 4, 2024
bf9fc29
add ABI tests for new RSA AVX-512 assmebly routines
pittma Sep 5, 2024
e626c2c
add dispatch tests for AVX-512 enabled RSA signing
pittma Sep 5, 2024
92b9e3f
fix dispatch test
pittma Sep 6, 2024
1055b42
Merge remote-tracking branch 'origin/main'
pittma Sep 6, 2024
58af762
Merge branch 'main' of github.com:aws/aws-lc
pittma Sep 9, 2024
56d8fd6
fix conditional build logic in dispatch test
pittma Sep 9, 2024
f925e7c
generated asm should properly exclude when using old assembler
pittma Sep 9, 2024
2473469
Merge branch 'main' of github.com:aws/aws-lc
pittma Sep 10, 2024
ef26ced
in ninja-based build, old assembler logic is already handled
pittma Sep 10, 2024
73b7b8f
Merge branch 'main' of github.com:aws/aws-lc
pittma Sep 10, 2024
506dced
Increasing the capacity of ubuntu2004_android_fips_static_release.
nebeid Sep 11, 2024
0dd53a1
Merge branch 'main' into main
nebeid Sep 11, 2024
f3715bb
Merge branch 'main' of github.com:aws/aws-lc
pittma Sep 16, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion crypto/fipsmodule/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ if(ARCH STREQUAL "x86_64")
p256_beeu-x86_64-asm.${ASM_EXT}
rdrand-x86_64.${ASM_EXT}
rsaz-avx2.${ASM_EXT}
rsaz-2k-avx512.${ASM_EXT}
rsaz-3k-avx512.${ASM_EXT}
rsaz-4k-avx512.${ASM_EXT}
sha1-x86_64.${ASM_EXT}
sha256-x86_64.${ASM_EXT}
sha512-x86_64.${ASM_EXT}
Expand Down Expand Up @@ -147,6 +150,9 @@ if(PERL_EXECUTABLE)
perlasm(p256_beeu-armv8-asm.${ASM_EXT} ec/asm/p256_beeu-armv8-asm.pl)
perlasm(rdrand-x86_64.${ASM_EXT} rand/asm/rdrand-x86_64.pl)
perlasm(rsaz-avx2.${ASM_EXT} bn/asm/rsaz-avx2.pl)
perlasm(rsaz-2k-avx512.${ASM_EXT} bn/asm/rsaz-2k-avx512.pl)
perlasm(rsaz-3k-avx512.${ASM_EXT} bn/asm/rsaz-3k-avx512.pl)
perlasm(rsaz-4k-avx512.${ASM_EXT} bn/asm/rsaz-4k-avx512.pl)
perlasm(sha1-586.${ASM_EXT} sha/asm/sha1-586.pl)
perlasm(sha1-armv4-large.${ASM_EXT} sha/asm/sha1-armv4-large.pl)
perlasm(sha1-armv8.${ASM_EXT} sha/asm/sha1-armv8.pl)
Expand Down Expand Up @@ -175,6 +181,9 @@ if (CLANG AND (CMAKE_ASM_COMPILER_ID MATCHES "Clang" OR CMAKE_ASM_COMPILER MATCH
(CMAKE_C_COMPILER_VERSION VERSION_LESS "7.0.0") AND (ARCH STREQUAL "x86_64"))
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/aesni-gcm-avx512.${ASM_EXT} PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512bw -mavx512dq -mavx512vl")
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/aesni-xts-avx512.${ASM_EXT} PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512bw -mavx512dq -mavx512vl")
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/rsaz-2k-avx512.${ASM_EXT} PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512bw -mavx512dq -mavx512vl -mavx512ifma")
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/rsaz-3k-avx512.${ASM_EXT} PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512bw -mavx512dq -mavx512vl -mavx512ifma")
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/rsaz-4k-avx512.${ASM_EXT} PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512bw -mavx512dq -mavx512vl -mavx512ifma")
endif()

# s2n-bignum files can be compiled on Unix platforms only (except Apple),
Expand Down Expand Up @@ -384,7 +393,7 @@ if(FIPS_DELOCATE)
# The flags are not required for any other compiler we are running in the CI.
if (CLANG AND (CMAKE_ASM_COMPILER_ID MATCHES "Clang" OR CMAKE_ASM_COMPILER MATCHES "clang") AND
(CMAKE_C_COMPILER_VERSION VERSION_LESS "7.0.0") AND (ARCH STREQUAL "x86_64"))
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/bcm-delocated.S PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512bw -mavx512dq -mavx512vl")
set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/bcm-delocated.S PROPERTIES COMPILE_FLAGS "-mavx512f -mavx512bw -mavx512dq -mavx512vl -mavx512ifma")
endif()

add_library(
Expand Down
1 change: 1 addition & 0 deletions crypto/fipsmodule/bcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
#include "bn/prime.c"
#include "bn/random.c"
#include "bn/rsaz_exp.c"
#include "bn/rsaz_exp_x2.c"
#include "bn/shift.c"
#include "bn/sqrt.c"
#include "cipher/aead.c"
Expand Down
Loading
Loading