diff --git a/.ci/build_options.sh b/.ci/build_options.sh new file mode 100755 index 00000000..85048be4 --- /dev/null +++ b/.ci/build_options.sh @@ -0,0 +1,46 @@ +#!/bin/bash + +if [ "$#" != "5" ]; then + echo "Usage is: ${0} \"build_options\" \"\" \"\" \"\" " + echo "CC=gcc ${0} \"build_options\" \" \" \"makefile\" \"-DUSE_LTM -DLTM_DESC -I../libtommath\" ../libtommath/libtommath.a" + exit -1 +fi + +# output version +bash .ci/printinfo.sh + +set -e + +options=( +-DLTC_EASY +-DLTC_FORTUNA_RESEED_RATELIMIT_STATIC +-DLTC_FORTUNA_USE_ENCRYPT_ONLY +-DLTC_MECC_FP +-DLTC_NO_TABLES +-DLTC_NO_FAST +-DLTC_NO_ASM +-DLTC_NO_DEPRECATED_APIS +-DLTC_NO_ECC_TIMING_RESISTANT +-DLTC_NO_RSA_BLINDING +-DLTC_PTHREAD +-DLTC_SMALL_CODE +-DLTC_SMALL_STACK +) + +make clean V=0 +make pre_gen +for opt in ${options[@]}; do + echo "Build: $opt" + CFLAGS="$2 $CFLAGS $4 $opt" EXTRALIBS="$5" make -j$(nproc) -f $3 AMALGAM=1 all 1>>gcc_1.txt 2>>gcc_2.txt + ./small + make clean V=0 +done + +# we don't want LTC_EASY when running the tests now +unset 'options[0]' + +echo "All: ${options[@]}" +CFLAGS="$2 $CFLAGS $4 ${options[@]}" EXTRALIBS="$5" make -j$(nproc) -f $3 AMALGAM=1 all 1>>gcc_1.txt 2>>gcc_2.txt +./test >test_std.txt 2>test_err.txt + +exit 0 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 68d3f7d6..0d03169e 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -45,20 +45,8 @@ jobs: - { BUILDNAME: 'META_BUILDS', BUILDOPTIONS: '-DGMP_DESC', BUILDSCRIPT: '.ci/meta_builds.sh' } - { BUILDNAME: 'VALGRIND', BUILDOPTIONS: '', BUILDSCRIPT: '.ci/valgrind.sh' } - { BUILDNAME: 'STOCK', BUILDOPTIONS: '', BUILDSCRIPT: '.ci/run.sh' } + - { BUILDNAME: 'BUILD_OPTIONS', BUILDOPTIONS: '', BUILDSCRIPT: '.ci/build_options.sh' } - { BUILDNAME: 'STOCK-MPI', BUILDOPTIONS: '-ULTM_DESC -UTFM_DESC -UUSE_LTM -UUSE_TFM', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'EASY', BUILDOPTIONS: '-DLTC_EASY', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'SMALL_CODE', BUILDOPTIONS: '-DLTC_SMALL_CODE', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'SMALL_STACK', BUILDOPTIONS: '-DLTC_SMALL_STACK', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'SMALL', BUILDOPTIONS: '-DLTC_SMALL_CODE -DLTC_SMALL_STACK', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'NO_TABLES', BUILDOPTIONS: '-DLTC_NO_TABLES', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'NO_FAST', BUILDOPTIONS: '-DLTC_NO_FAST', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'NO_FAST+SMALL+NO_TABLES', BUILDOPTIONS: '-DLTC_NO_FAST -DLTC_SMALL_CODE -DLTC_SMALL_STACK -DLTC_NO_TABLES', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'NO_ASM', BUILDOPTIONS: '-DLTC_NO_ASM', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'NO_DEPRECATED_APIS', BUILDOPTIONS: '-DLTC_NO_DEPRECATED_APIS', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'NO_TIMING_RESISTANCE', BUILDOPTIONS: '-DLTC_NO_ECC_TIMING_RESISTANT -DLTC_NO_RSA_BLINDING', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'FORTUNA_CUSTOM_OPTIONS', BUILDOPTIONS: '-DLTC_FORTUNA_USE_ENCRYPT_ONLY -DLTC_FORTUNA_RESEED_RATELIMIT_STATIC', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'ECC_FP', BUILDOPTIONS: '-DLTC_MECC_FP', BUILDSCRIPT: '.ci/run.sh' } - - { BUILDNAME: 'ECC_FP+PTHREAD', BUILDOPTIONS: '-DLTC_MECC_FP -DLTC_PTHREAD', BUILDSCRIPT: '.ci/run.sh' } - { BUILDNAME: 'STOCK+ARGTYPE=1', BUILDOPTIONS: '-DARGTYPE=1', BUILDSCRIPT: '.ci/run.sh' } - { BUILDNAME: 'STOCK+ARGTYPE=2', BUILDOPTIONS: '-DARGTYPE=2', BUILDSCRIPT: '.ci/run.sh' } - { BUILDNAME: 'STOCK+ARGTYPE=3', BUILDOPTIONS: '-DARGTYPE=3', BUILDSCRIPT: '.ci/run.sh' }