aboutsummaryrefslogtreecommitdiff
path: root/.github/workflows
diff options
context:
space:
mode:
Diffstat (limited to '.github/workflows')
-rw-r--r--.github/workflows/libecc_cifuzz.yml26
-rw-r--r--.github/workflows/libecc_compilation_tests.yml57
-rw-r--r--.github/workflows/libecc_crossarch_tests.yml55
-rw-r--r--.github/workflows/libecc_examples.yml39
-rw-r--r--.github/workflows/libecc_meson_build.yml37
-rw-r--r--.github/workflows/libecc_python_tests.yml43
-rw-r--r--.github/workflows/libecc_runtime_tests.yml39
7 files changed, 296 insertions, 0 deletions
diff --git a/.github/workflows/libecc_cifuzz.yml b/.github/workflows/libecc_cifuzz.yml
new file mode 100644
index 000000000000..d315da238fc6
--- /dev/null
+++ b/.github/workflows/libecc_cifuzz.yml
@@ -0,0 +1,26 @@
+name: CIFuzz
+on: [pull_request]
+jobs:
+ Fuzzing:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Build Fuzzers
+ id: build
+ uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master
+ with:
+ oss-fuzz-project-name: 'libecc'
+ dry-run: false
+ language: c++
+ - name: Run Fuzzers
+ uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master
+ with:
+ oss-fuzz-project-name: 'libecc'
+ fuzz-seconds: 300
+ dry-run: false
+ language: c++
+ - name: Upload Crash
+ uses: actions/upload-artifact@v3
+ if: failure() && steps.build.outcome == 'success'
+ with:
+ name: artifacts
+ path: ./out/artifacts
diff --git a/.github/workflows/libecc_compilation_tests.yml b/.github/workflows/libecc_compilation_tests.yml
new file mode 100644
index 000000000000..76aae957f362
--- /dev/null
+++ b/.github/workflows/libecc_compilation_tests.yml
@@ -0,0 +1,57 @@
+name: libecc
+
+# Run this workflow every time a new commit pushed to your repository
+on: push
+
+jobs:
+ compilation_tests:
+ runs-on: ubuntu-22.04
+ strategy:
+ #max-parallel: 10
+ matrix:
+ cc: [gcc, clang, g++, clang++]
+ blinding: [0, 1]
+ complete: [0, 1]
+ ladder: [0, 1]
+ cryptofuzz: [0, 1]
+ optflags: ["-O3", "-O2", "-O1"]
+ steps:
+ # Checkout repository
+ - name: checkout repository
+ uses: actions/checkout@v2
+ # Run actions
+ # libecc compilation tests
+ - name: libecc compilation tests
+ env:
+ CC: ${{ matrix.cc }}
+ BLINDING: ${{ matrix.blinding }}
+ COMPLETE: ${{ matrix.complete }}
+ LADDER: ${{ matrix.ladder }}
+ CRYPTOFUZZ: ${{ matrix.cryptofuzz }}
+ EXTRA_LIB_CFLAGS: ${{ matrix.optflags }}
+ EXTRA_BIN_CFLAGS: ${{ matrix.optflags }}
+ shell: bash
+ run: |
+ # Compilation tests of all cases
+ #
+ make && cd src/arithmetic_tests/ && make clean && make bin && make clean && cd -;
+ cd src/examples/ && make clean && make && cd - && make clean;
+ make 16;
+ cd src/examples/ && make clean && make 16 && cd - && make clean;
+ make 32;
+ cd src/examples/ && make clean && make 32 && cd - && make clean;
+ make 64;
+ cd src/examples/ && make clean && make 64 && cd - && make clean;
+ # We perform one test with the sanitizers
+ USE_SANITIZERS=1 make;
+ cd src/examples/ && make clean && USE_SANITIZERS=1 make && cd - && make clean;
+ #
+ make debug;
+ cd src/examples/ && make clean && make debug && cd - && make clean;
+ make debug16;
+ cd src/examples/ && make clean && make debug16 && cd - && make clean;
+ make debug32;
+ cd src/examples/ && make clean && make debug32 && cd - && make clean;
+ make debug64;
+ cd src/examples/ && make clean && make debug64 && cd - && make clean;
+ continue-on-error: false
diff --git a/.github/workflows/libecc_crossarch_tests.yml b/.github/workflows/libecc_crossarch_tests.yml
new file mode 100644
index 000000000000..93dbca1b5719
--- /dev/null
+++ b/.github/workflows/libecc_crossarch_tests.yml
@@ -0,0 +1,55 @@
+name: libecc
+
+# Run this workflow every time a new commit pushed to your repository
+on: push
+
+jobs:
+ cross_arch_tests:
+ runs-on: ubuntu-20.04
+ strategy:
+ #max-parallel: 10
+ matrix:
+ blinding: [0, 1]
+ complete: [1]
+ ladder: [1]
+ #cross_target: [arm-linux-gnueabi, arm-linux-gnueabihf, aarch64-linux-gnu, powerpc64le-linux-gnu, mipsel-linux-gnu, i686-w64-mingw32, x86_64-w64-mingw32, i386-apple-darwin, x86_64-apple-darwin, x86_64h-apple-darwin]
+ cross_target: [arm-linux-gnueabi, arm-linux-gnueabihf, aarch64-linux-gnu, powerpc64le-linux-gnu, mipsel-linux-gnu, i686-w64-mingw32, x86_64-w64-mingw32]
+ cross_size: [16, 32, 64]
+ steps:
+ # Add swap because of possible out of memory issues
+ - name: Set Swap Space
+ uses: pierotofy/set-swap-space@master
+ with:
+ swap-size-gb: 10
+ # Checkout repository
+ - name: checkout repository
+ uses: actions/checkout@v2
+ # Run actions
+ # Cross build and cross run tests
+ - name: libecc cross-arch tests
+ env:
+ BLINDING: ${{ matrix.blinding }}
+ COMPLETE: ${{ matrix.complete }}
+ LADDER: ${{ matrix.ladder }}
+ CROSS_TARGET: ${{ matrix.cross_target }}
+ CROSS_SIZE: ${{ matrix.cross_size }}
+ CRYPTOFUZZ: 1
+ shell: bash
+ run: |
+ # Install stuff
+ sudo apt-get update;
+ # This oddity is due to ubuntu (18.04 and 20.04) issue with wine32 in
+ # githbub actions runners ...
+ sudo apt-get -y install software-properties-common;
+ sudo apt-add-repository "ppa:ondrej/php" -y;
+ sudo dpkg --add-architecture i386;
+ sudo apt-get update;
+ sudo apt-get -y install qemu-user-static wine-stable wine32 wine64;
+ # Cross build jobs
+ docker pull multiarch/crossbuild;
+ sh scripts/crossbuild.sh -triplet "${CROSS_TARGET}" "${CROSS_SIZE}";
+ # Check for errors
+ [ ! -z "$(ls -A scripts/crossbuild_out/error_log/)" ] && exit -1;
+ # Test generated cross binaries through qemu-static;
+ sh scripts/crossrun.sh -triplet "${CROSS_TARGET}" "${CROSS_SIZE}";
+ continue-on-error: false
diff --git a/.github/workflows/libecc_examples.yml b/.github/workflows/libecc_examples.yml
new file mode 100644
index 000000000000..f50e6da9ee60
--- /dev/null
+++ b/.github/workflows/libecc_examples.yml
@@ -0,0 +1,39 @@
+name: libecc
+
+# Run this workflow every time a new commit pushed to your repository
+on: push
+
+jobs:
+ examples:
+ runs-on: ubuntu-22.04
+ strategy:
+ #max-parallel: 10
+ matrix:
+ cc: [gcc, clang]
+ blinding: [0, 1]
+ cryptofuzz: [1]
+ steps:
+ # Checkout repository
+ - name: checkout repository
+ uses: actions/checkout@v2
+ # Run actions
+ # libecc examples tests
+ - name: libecc examples tests
+ env:
+ CC: ${{ matrix.cc }}
+ BLINDING: ${{ matrix.blinding }}
+ CRYPTOFUZZ: ${{ matrix.cryptofuzz }}
+ ASSERT_PRINT: 1
+ # We want to parallelize self tests
+ OPENMP_SELF_TESTS: 1
+ shell: bash
+ run: |
+ # Install OpenMP
+ sudo apt-get update;
+ sudo apt-get -y install libomp-dev;
+ # Compile and compile the tests
+ #
+ EXTRA_CFLAGS="-DUSER_NN_BIT_LEN=4096" make && cd src/examples/ && EXTRA_CFLAGS="-DUSER_NN_BIT_LEN=4096" make && ./sig/rsa/rsa && ./sig/dsa/dsa && ./sig/kcdsa/kcdsa && ./sig/sdsa/sdsa && ./sig/gostr34_10_94/gostr34_10_94 && ./sss/sss && ./basic/curve_basic_examples && ./basic/curve_ecdh && make clean && cd - && make clean;
+ make 32 && cd src/examples/ && make 32 && ./sss/sss && ./basic/curve_basic_examples && ./basic/curve_ecdh && make clean && cd - && make clean;
+ make 16 && cd src/examples/ && make 16 && ./sss/sss && ./basic/curve_basic_examples && ./basic/curve_ecdh && make clean && cd - && make clean;
+ continue-on-error: false
diff --git a/.github/workflows/libecc_meson_build.yml b/.github/workflows/libecc_meson_build.yml
new file mode 100644
index 000000000000..e942ae9c2470
--- /dev/null
+++ b/.github/workflows/libecc_meson_build.yml
@@ -0,0 +1,37 @@
+name: libecc
+
+# Run this workflow every time a new commit pushed to your repository
+on: push
+
+jobs:
+ compilation_tests:
+ runs-on: ubuntu-22.04
+ strategy:
+ #max-parallel: 10
+ matrix:
+ cc: [gcc, clang, g++, clang++]
+ blinding: [0, 1]
+ complete: [0, 1]
+ ladder: [0, 1]
+ cryptofuzz: [0, 1]
+ optflags: ["-O3", "-O2", "-O1"]
+ steps:
+ # Checkout repository
+ - name: checkout repository
+ uses: actions/checkout@v2
+ # Run actions
+ # libecc compilation tests using meson
+ - name: libecc meson compilation tests
+ shell: bash
+ run: |
+ sudo apt-get update;
+ sudo apt-get -y install python3-pip;
+ pip install meson;
+ pip install ninja;
+ pip install dunamai;
+ # Compilation tests of all cases
+ #
+ rm -rf builddir/ && meson setup -Dwith_wordsize=16 builddir && cd builddir && meson dist && cd -;
+ rm -rf builddir/ && meson setup -Dwith_wordsize=32 builddir && cd builddir && meson dist && cd -;
+ rm -rf builddir/ && meson setup -Dwith_wordsize=64 builddir && cd builddir && meson dist && cd -;
+ continue-on-error: false
diff --git a/.github/workflows/libecc_python_tests.yml b/.github/workflows/libecc_python_tests.yml
new file mode 100644
index 000000000000..895760f7369e
--- /dev/null
+++ b/.github/workflows/libecc_python_tests.yml
@@ -0,0 +1,43 @@
+name: libecc
+
+# Run this workflow every time a new commit pushed to your repository
+on: push
+
+jobs:
+ runtime_tests:
+ runs-on: ubuntu-22.04
+ strategy:
+ #max-parallel: 10
+ matrix:
+ cc: [gcc, clang]
+ blinding: [0, 1]
+ cryptofuzz: [1]
+ steps:
+ # Checkout repository
+ - name: checkout repository
+ uses: actions/checkout@v2
+ # Run actions
+ # libecc python tests
+ - name: libecc python tests
+ env:
+ CC: ${{ matrix.cc }}
+ BLINDING: ${{ matrix.blinding }}
+ CRYPTOFUZZ: ${{ matrix.cryptofuzz }}
+ ASSERT_PRINT: 1
+ # We want to parallelize self tests
+ OPENMP_SELF_TESTS: 1
+ shell: bash
+ run: |
+ # Install Python2 and OpenMP
+ sudo apt-get update;
+ sudo apt-get -y install python2 libomp-dev;
+ # Test our Python libecc expanding script
+ # Python3
+ echo "y" | python3 scripts/expand_libecc.py --remove-all && PYTHON=python3 sh scripts/gen_curves_tests.sh && make clean && make && ./build/ec_self_tests vectors rand;
+ # Clean
+ echo "y" | python3 scripts/expand_libecc.py --remove-all && make clean;
+ # Python2
+ echo "y" | python2 scripts/expand_libecc.py --remove-all && PYTHON=python2 sh scripts/gen_curves_tests.sh && make clean && make && ./build/ec_self_tests vectors rand;
+ # Clean
+ echo "y" | python2 scripts/expand_libecc.py --remove-all && make clean;
+ continue-on-error: false
diff --git a/.github/workflows/libecc_runtime_tests.yml b/.github/workflows/libecc_runtime_tests.yml
new file mode 100644
index 000000000000..2432511a1be0
--- /dev/null
+++ b/.github/workflows/libecc_runtime_tests.yml
@@ -0,0 +1,39 @@
+name: libecc
+
+# Run this workflow every time a new commit pushed to your repository
+on: push
+
+jobs:
+ runtime_tests:
+ runs-on: ubuntu-22.04
+ strategy:
+ #max-parallel: 10
+ matrix:
+ cc: [gcc, clang]
+ blinding: [1]
+ cryptofuzz: [1]
+ wordsize: [64, 32, 16]
+ steps:
+ # Checkout repository
+ - name: checkout repository
+ uses: actions/checkout@v2
+ # Run actions
+ # libecc runtime tests
+ - name: libecc runtime tests
+ env:
+ CC: ${{ matrix.cc }}
+ BLINDING: ${{ matrix.blinding }}
+ CRYPTOFUZZ: ${{ matrix.cryptofuzz }}
+ ASSERT_PRINT: 1
+ # We want to parallelize self tests
+ OPENMP_SELF_TESTS: 1
+ WORDSIZE: ${{ matrix.wordsize }}
+ shell: bash
+ run: |
+ # Install OpenMP
+ sudo apt-get update;
+ sudo apt-get -y install libomp-dev;
+ # Vanilla tests
+ #
+ make "${WORDSIZE}" && ./build/ec_self_tests vectors rand;
+ continue-on-error: false