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

Modified posix builds to enable dilithium by default #2034

Merged
merged 7 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 2 additions & 1 deletion crypto/dilithium/pqcrystals_dilithium_ref_common/sign.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ int crypto_sign_keypair_internal(ml_dsa_params *params,
uint8_t tr[TRBYTES];
const uint8_t *rho, *rhoprime, *key;
polyvecl mat[DILITHIUM_K_MAX];
polyvecl s1, s1hat;
polyvecl s1 = {{{{0}}}};
polyvecl s1hat;
polyveck s2, t1, t0;

OPENSSL_memcpy(seedbuf, seed, SEEDBYTES);
Expand Down
4 changes: 2 additions & 2 deletions tests/ci/run_posix_sanitizers.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set -exo pipefail
source tests/ci/common_posix_setup.sh

build_type=Release
cflags=("-DCMAKE_BUILD_TYPE=${build_type}")
cflags=("-DCMAKE_BUILD_TYPE=${build_type}" "-DENABLE_DILITHIUM=ON")
if [ $(uname -p) == "aarch64" ]; then
# BoringSSL provides two sets tests: the C/C++ tests and the blackbox tests.
# Details: https://github.com/google/boringssl/blob/master/BUILDING.md
Expand Down Expand Up @@ -47,4 +47,4 @@ if [ $(uname -p) == "x86_64" ]; then
else
echo "Testing AWS-LC in ${build_type} mode with thread sanitizer."
build_and_test -DTSAN=1 -DUSE_CUSTOM_LIBCXX=1 "${cflags[@]}"
fi
fi
28 changes: 14 additions & 14 deletions tests/ci/run_posix_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,36 @@ set -exo pipefail
source tests/ci/common_posix_setup.sh

echo "Testing AWS-LC in debug mode."
build_and_test
build_and_test -DENABLE_DILITHIUM=ON

echo "Testing AWS-LC in release mode."
build_and_test -DCMAKE_BUILD_TYPE=Release
build_and_test -DCMAKE_BUILD_TYPE=Release -DENABLE_DILITHIUM=ON

echo "Testing AWS-LC with Dilithium3 enabled."
build_and_test -DENABLE_DILITHIUM=ON
echo "Testing AWS-LC with Dilithium3 disabled."
build_and_test -DENABLE_DILITHIUM=OFF

echo "Testing AWS-LC small compilation."
build_and_test -DOPENSSL_SMALL=1 -DCMAKE_BUILD_TYPE=Release
build_and_test -DOPENSSL_SMALL=1 -DCMAKE_BUILD_TYPE=Release -DENABLE_DILITHIUM=ON

echo "Testing AWS-LC with libssl off."
build_and_test -DBUILD_LIBSSL=OFF -DCMAKE_BUILD_TYPE=Release
build_and_test -DBUILD_LIBSSL=OFF -DCMAKE_BUILD_TYPE=Release -DENABLE_DILITHIUM=ON

echo "Testing AWS-LC in no asm mode."
build_and_test -DOPENSSL_NO_ASM=1 -DCMAKE_BUILD_TYPE=Release
build_and_test -DOPENSSL_NO_ASM=1 -DCMAKE_BUILD_TYPE=Release -DENABLE_DILITHIUM=ON

echo "Testing building shared lib."
build_and_test -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=Release
build_and_test -DBUILD_SHARED_LIBS=1 -DCMAKE_BUILD_TYPE=Release -DENABLE_DILITHIUM=ON

echo "Testing with a SysGenId."
TEST_SYSGENID_PATH=$(mktemp)
dd if=/dev/zero of="${TEST_SYSGENID_PATH}" bs=1 count=4096
build_and_test -DTEST_SYSGENID_PATH="${TEST_SYSGENID_PATH}"
build_and_test -DTEST_SYSGENID_PATH="${TEST_SYSGENID_PATH}" -DENABLE_DILITHIUM=ON

echo "Testing with pre-generated assembly code."
build_and_test -DDISABLE_PERL=ON
build_and_test -DDISABLE_PERL=ON -DENABLE_DILITHIUM=ON

echo "Testing building with AArch64 Data-Independent Timing (DIT) on."
build_and_test -DENABLE_DATA_INDEPENDENT_TIMING=ON -DCMAKE_BUILD_TYPE=Release
build_and_test -DENABLE_DATA_INDEPENDENT_TIMING=ON -DCMAKE_BUILD_TYPE=Release -DENABLE_DILITHIUM=ON

if [[ "${AWSLC_C99_TEST}" == "1" ]]; then
echo "Testing the C99 compatability of AWS-LC headers."
Expand All @@ -54,10 +54,10 @@ build_options_to_test=("" "-DBUILD_SHARED_LIBS=1" "-DCMAKE_BUILD_TYPE=Release" "

## Build option: MY_ASSEMBLER_IS_TOO_OLD_FOR_AVX
for build_option in "${build_options_to_test[@]}"; do
run_build ${build_option} -DMY_ASSEMBLER_IS_TOO_OLD_FOR_AVX=ON
run_build ${build_option} -DMY_ASSEMBLER_IS_TOO_OLD_FOR_AVX=ON -DENABLE_DILITHIUM=ON
done

## Build option: MY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX
for build_option in "${build_options_to_test[@]}"; do
run_build ${build_option} -DMY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX=ON
done
run_build ${build_option} -DMY_ASSEMBLER_IS_TOO_OLD_FOR_512AVX=ON -DENABLE_DILITHIUM=ON
done
Loading