Shorter CI run: less repetitions and a single KAT per level
Fixes a few memory leaks in debug code Fix for big-endian support Sync test vectors for prof testing
This commit is contained in:
47
.github/workflows/cmake.yml
vendored
47
.github/workflows/cmake.yml
vendored
@@ -19,29 +19,21 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
sqisign_build_type: [opt]
|
sqisign_build_type: [ref]
|
||||||
|
sqisign_test_reps: [10]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
- name: Set up Python 3.10
|
|
||||||
uses: actions/setup-python@v3
|
|
||||||
with:
|
|
||||||
python-version: "3.10"
|
|
||||||
|
|
||||||
- name: Install dependencies Valgrind, GMP, Doxygen, TeX
|
- name: Install dependencies Valgrind, GMP, Doxygen, TeX
|
||||||
run: |
|
run: |
|
||||||
sudo apt --fix-missing install valgrind libgmp-dev doxygen texlive-xetex
|
sudo apt update && sudo apt --fix-missing install valgrind libgmp-dev doxygen texlive-xetex
|
||||||
echo "Valgrind installed"
|
echo "Valgrind installed"
|
||||||
|
|
||||||
- name: Install Valgrind dependencies
|
|
||||||
run: |
|
|
||||||
python -m pip install --upgrade pip
|
|
||||||
pip install ValgrindCI
|
|
||||||
|
|
||||||
- name: Configure CMake
|
- name: Configure CMake
|
||||||
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
||||||
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
||||||
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }}
|
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DSQISIGN_TEST_REPS=${{ matrix.sqisign_test_reps }}
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
# Build your program with the given configuration
|
# Build your program with the given configuration
|
||||||
@@ -61,23 +53,21 @@ jobs:
|
|||||||
working-directory: ${{github.workspace}}/build
|
working-directory: ${{github.workspace}}/build
|
||||||
# Execute tests defined by the CMake configuration.
|
# Execute tests defined by the CMake configuration.
|
||||||
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
|
||||||
run: ctest -C ${{env.BUILD_TYPE}}
|
run: ctest -j4 -C ${{env.BUILD_TYPE}}
|
||||||
|
|
||||||
- name: Examples
|
- name: Examples
|
||||||
if: false
|
|
||||||
working-directory: ${{github.workspace}}/build/apps
|
working-directory: ${{github.workspace}}/build/apps
|
||||||
run: |
|
run: |
|
||||||
./PQCgenKAT_sign_lvl1
|
|
||||||
./PQCgenKAT_sign_lvl1_varp6983
|
|
||||||
./example_nistapi_lvl1
|
./example_nistapi_lvl1
|
||||||
./example_nistapi_lvl1_varp6983
|
./example_nistapi_lvl3
|
||||||
|
./example_nistapi_lvl5
|
||||||
|
|
||||||
- name: CT-Tests
|
- name: CT-Tests
|
||||||
# TODO: re-enable for those tests that should be ct
|
# TODO: re-enable for those tests that should be ct
|
||||||
if: false
|
if: false
|
||||||
run: |
|
run: |
|
||||||
rm -rf build
|
rm -rf build
|
||||||
cmake -Bbuild -DENABLE_CT_TESTING=ON -DCMAKE_BUILD_TYPE=Debug -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }}
|
cmake -Bbuild -DENABLE_CT_TESTING=ON -DCMAKE_BUILD_TYPE=Debug -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DSQISIGN_TEST_REPS=${{ matrix.sqisign_test_reps }}
|
||||||
cmake --build build
|
cmake --build build
|
||||||
# valgrind --track-origins=yes build/
|
# valgrind --track-origins=yes build/
|
||||||
# valgrind --track-origins=yes build/
|
# valgrind --track-origins=yes build/
|
||||||
@@ -87,7 +77,7 @@ jobs:
|
|||||||
- name: Memcheck
|
- name: Memcheck
|
||||||
run: |
|
run: |
|
||||||
rm -rf build
|
rm -rf build
|
||||||
cmake -Bbuild -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DSQISIGN_TEST_REPS=10
|
cmake -Bbuild -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DSQISIGN_TEST_REPS=${{ matrix.sqisign_test_reps }}
|
||||||
cmake --build build
|
cmake --build build
|
||||||
ctest -T memcheck --test-dir build
|
ctest -T memcheck --test-dir build
|
||||||
if: false
|
if: false
|
||||||
@@ -95,27 +85,30 @@ jobs:
|
|||||||
- name: Address Sanitizer ASAN
|
- name: Address Sanitizer ASAN
|
||||||
run: |
|
run: |
|
||||||
rm -rf build
|
rm -rf build
|
||||||
cmake -Bbuild -DCMAKE_BUILD_TYPE=ASAN -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DCMAKE_C_COMPILER=clang
|
cmake -Bbuild -DCMAKE_BUILD_TYPE=ASAN -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DCMAKE_C_COMPILER=clang -DSQISIGN_TEST_REPS=1
|
||||||
cmake --build build
|
cmake --build build
|
||||||
ctest -v --test-dir build
|
ctest -j4 -v --test-dir build
|
||||||
|
|
||||||
|
# MSAN needs instrumented gmp
|
||||||
- name: Memory Sanitizer MSAN
|
- name: Memory Sanitizer MSAN
|
||||||
run: |
|
run: |
|
||||||
rm -rf build
|
rm -rf build
|
||||||
cmake -Bbuild -DCMAKE_BUILD_TYPE=MSAN -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DCMAKE_C_COMPILER=clang
|
cmake -Bbuild -DCMAKE_BUILD_TYPE=MSAN -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DCMAKE_C_COMPILER=clang -DSQISIGN_TEST_REPS=1
|
||||||
cmake --build build
|
cmake --build build
|
||||||
ctest -v --test-dir build
|
ctest -j4 -v --test-dir build
|
||||||
|
|
||||||
|
if: false
|
||||||
|
|
||||||
- name: Leak Sanitizer LSAN
|
- name: Leak Sanitizer LSAN
|
||||||
run: |
|
run: |
|
||||||
rm -rf build
|
rm -rf build
|
||||||
cmake -Bbuild -DCMAKE_BUILD_TYPE=LSAN -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DCMAKE_C_COMPILER=clang
|
cmake -Bbuild -DCMAKE_BUILD_TYPE=LSAN -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DCMAKE_C_COMPILER=clang -DSQISIGN_TEST_REPS=1
|
||||||
cmake --build build
|
cmake --build build
|
||||||
ctest -v --test-dir build
|
ctest -j4 -v --test-dir build
|
||||||
|
|
||||||
- name: Undefined Behavior Sanitizer UBSAN
|
- name: Undefined Behavior Sanitizer UBSAN
|
||||||
run: |
|
run: |
|
||||||
rm -rf build
|
rm -rf build
|
||||||
cmake -Bbuild -DCMAKE_BUILD_TYPE=UBSAN -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DCMAKE_C_COMPILER=clang
|
cmake -Bbuild -DCMAKE_BUILD_TYPE=UBSAN -DSQISIGN_BUILD_TYPE=${{ matrix.sqisign_build_type }} -DCMAKE_C_COMPILER=clang -DSQISIGN_TEST_REPS=1
|
||||||
cmake --build build
|
cmake --build build
|
||||||
ctest -v --test-dir build
|
ctest -j4 -v --test-dir build
|
||||||
|
|||||||
@@ -38,6 +38,7 @@ set(SELECT_SQISIGN_VARIANT ${PROJECT_SOURCE_DIR}/.cmake/sqisign_variant.cmake)
|
|||||||
|
|
||||||
set(INC_PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
set(INC_PUBLIC ${PROJECT_SOURCE_DIR}/include)
|
||||||
|
|
||||||
|
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
add_subdirectory(apps)
|
add_subdirectory(apps)
|
||||||
|
|
||||||
|
|||||||
@@ -218,12 +218,17 @@ int id2iso_test_long_id2iso() {
|
|||||||
// var finalize
|
// var finalize
|
||||||
quat_alg_elem_finalize(&gen_key);
|
quat_alg_elem_finalize(&gen_key);
|
||||||
quat_alg_elem_finalize(&gen_check);
|
quat_alg_elem_finalize(&gen_check);
|
||||||
|
quat_alg_elem_finalize(&quat_temp);
|
||||||
ibq_finalize(&ibq_norm);
|
ibq_finalize(&ibq_norm);
|
||||||
ibz_finalize(&temp);ibz_finalize(&remainder);
|
ibz_finalize(&temp);ibz_finalize(&remainder);ibz_finalize(&n);
|
||||||
quat_alg_elem_finalize(&gen);
|
quat_alg_elem_finalize(&gen);
|
||||||
quat_alg_elem_finalize(&gen_two);
|
quat_alg_elem_finalize(&gen_two);
|
||||||
|
quat_left_ideal_finalize(&lideal_small);
|
||||||
|
quat_left_ideal_finalize(&lideal_check);
|
||||||
|
quat_left_ideal_finalize(&lideal_two);
|
||||||
quat_left_ideal_finalize(&lideal_two_one);
|
quat_left_ideal_finalize(&lideal_two_one);
|
||||||
quat_left_ideal_finalize(&lideal_small_one);
|
quat_left_ideal_finalize(&lideal_small_one);
|
||||||
|
quat_left_ideal_finalize(&ideal_test);
|
||||||
quat_order_finalize(&right_order);
|
quat_order_finalize(&right_order);
|
||||||
quat_alg_coord_finalize(&coeffs);
|
quat_alg_coord_finalize(&coeffs);
|
||||||
ibz_mat_4x4_finalize(&reduced);ibz_mat_4x4_finalize(&gram);
|
ibz_mat_4x4_finalize(&reduced);ibz_mat_4x4_finalize(&gram);
|
||||||
|
|||||||
@@ -40,6 +40,8 @@ int _id2iso_test_ker2id() {
|
|||||||
id2iso_kernel_dlogs_to_ideal(&I, &vec2, &vec3);
|
id2iso_kernel_dlogs_to_ideal(&I, &vec2, &vec3);
|
||||||
// quat_left_ideal_print(&I);
|
// quat_left_ideal_print(&I);
|
||||||
quat_left_ideal_finalize(&I);
|
quat_left_ideal_finalize(&I);
|
||||||
|
ibz_vec_2_finalize(&vec2);
|
||||||
|
ibz_vec_2_finalize(&vec3);
|
||||||
|
|
||||||
//TODO FIXME this really only tests that the function doesn't crash
|
//TODO FIXME this really only tests that the function doesn't crash
|
||||||
|
|
||||||
|
|||||||
@@ -441,6 +441,11 @@ void hash_to_challenge(ibz_vec_2_t *scalars, const ec_curve_t *curve, const unsi
|
|||||||
//FIXME should use SHAKE128 for smaller parameter sets?
|
//FIXME should use SHAKE128 for smaller parameter sets?
|
||||||
SHAKE256((void *) digits, sizeof(digits), buf, FP2_ENCODED_BYTES + length);
|
SHAKE256((void *) digits, sizeof(digits), buf, FP2_ENCODED_BYTES + length);
|
||||||
|
|
||||||
|
#ifdef TARGET_BIG_ENDIAN
|
||||||
|
for (size_t i = 0; i < NWORDS_FIELD; i++)
|
||||||
|
digits[i] = BSWAP_DIGIT(digits[i]);
|
||||||
|
#endif
|
||||||
|
|
||||||
ibz_set(&(*scalars)[0], 1); //FIXME
|
ibz_set(&(*scalars)[0], 1); //FIXME
|
||||||
ibz_copy_digit_array(&(*scalars)[1], digits);
|
ibz_copy_digit_array(&(*scalars)[1], digits);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -61,6 +61,8 @@ void protocols_commit(quat_left_ideal_t *ideal, ec_curve_t *E1, ec_basis_t *basi
|
|||||||
ibz_gcd(&temp,&temp,&DEGREE_COMMITMENT);
|
ibz_gcd(&temp,&temp,&DEGREE_COMMITMENT);
|
||||||
ibz_div(&temp,&remainder,&temp,&DEGREE_COMMITMENT);
|
ibz_div(&temp,&remainder,&temp,&DEGREE_COMMITMENT);
|
||||||
assert(0==ibz_cmp(&remainder,&ibz_const_zero));
|
assert(0==ibz_cmp(&remainder,&ibz_const_zero));
|
||||||
|
ibz_finalize(&temp);ibz_finalize(&remainder);
|
||||||
|
quat_alg_coord_finalize(&coeffs);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@@ -699,6 +701,7 @@ int protocols_sign(signature_t *sig,const public_key_t *pk, const secret_key_t *
|
|||||||
quat_alg_conj(&delta,&gen);
|
quat_alg_conj(&delta,&gen);
|
||||||
quat_lideal_create_from_primitive(&ideal_signing_test,&delta,&ideal_eichler_rand.norm,&right_order_key,&QUATALG_PINFTY);
|
quat_lideal_create_from_primitive(&ideal_signing_test,&delta,&ideal_eichler_rand.norm,&right_order_key,&QUATALG_PINFTY);
|
||||||
assert(quat_lideal_equals(&ideal_signing_test,&ideal_eichler_rand,&QUATALG_PINFTY));
|
assert(quat_lideal_equals(&ideal_signing_test,&ideal_eichler_rand,&QUATALG_PINFTY));
|
||||||
|
quat_left_ideal_finalize(&ideal_signing_test);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// checking cyclicity
|
// checking cyclicity
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ FOREACH(SVARIANT ${SVARIANT_S})
|
|||||||
target_link_libraries(sqisign_test_prof_${SVARIANT} sqisign_${SVARIANT_LOWER})
|
target_link_libraries(sqisign_test_prof_${SVARIANT} sqisign_${SVARIANT_LOWER})
|
||||||
target_include_directories(sqisign_test_prof_${SVARIANT} PUBLIC ${PROJECT_SOURCE_DIR}/src/common ${INC_PUBLIC} ${PROJECT_SOURCE_DIR}/src/nistapi/${SVARIANT_LOWER})
|
target_include_directories(sqisign_test_prof_${SVARIANT} PUBLIC ${PROJECT_SOURCE_DIR}/src/common ${INC_PUBLIC} ${PROJECT_SOURCE_DIR}/src/nistapi/${SVARIANT_LOWER})
|
||||||
|
|
||||||
add_test(sqisign_${SVARIANT}_KAT sqisign_test_kat_${SVARIANT})
|
add_test(sqisign_${SVARIANT}_KAT sqisign_test_kat_${SVARIANT} 0) # testing only the first KAT
|
||||||
add_test(sqisign_${SVARIANT}_SELFTEST sqisign_test_scheme_${SVARIANT})
|
add_test(sqisign_${SVARIANT}_SELFTEST sqisign_test_scheme_${SVARIANT})
|
||||||
|
|
||||||
set_tests_properties(sqisign_${SVARIANT}_KAT PROPERTIES TIMEOUT 0)
|
set_tests_properties(sqisign_${SVARIANT}_KAT PROPERTIES TIMEOUT 0)
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user