Add checksum KAT to Github Workflow #28
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-License-Identifier: Apache-2.0 | |
name: Build | |
on: | |
push: | |
branches: [ '*' ] | |
pull_request: | |
branches: [ "main" ] | |
jobs: | |
build_test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup nix | |
uses: ./.github/actions/setup-nix | |
- name: Astyle | |
shell: nix develop .#ci -c bash -e {0} | |
run: | | |
err=$(astyle $(git ls-files "*.c" "*.h") --options=.astylerc --dry-run --formatted | awk '{print $2}') | |
if [[ ${#err} != 0 ]]; then | |
echo "$err" | while IFS= read -r file; do | |
echo "::error file={"$file"},title={checking}::Formatted $file" | |
done | |
exit 1 | |
fi | |
- name: Build targets | |
shell: nix develop .#ci -c bash -e {0} | |
run: | | |
make mlkem | |
./checksum.sh ./test/test_kyber512 880e1fe907682fb5a9029fc7da114131a0740f4f3328d6ddfae46728b5ac8db0 | |
./checksum.sh ./test/test_kyber768 2b32e7f5aa91fe47b0ca9a1d5aa70d7dc7c4ff1ffcb7e8967e51bf15cc5d2095 | |
./checksum.sh ./test/test_kyber1024 87da552c0878350fa7643a6b49996893d4dba4d8be2badb32c4298c5c2b512c6 | |
- name: Compare gen_KAT with known hash | |
shell: nix develop .#ci -c bash -e {0} | |
run: | | |
make kat; | |
./checksum.sh ./test/gen_KAT512 ec4ac397e595ac7457cb7d8830921faf3290898a10d7dd3864aab89ea61fe9a3 | |
./checksum.sh ./test/gen_KAT768 9a0826ad3c5232dfd3b21bc4801408655c565a491b760f509b2ee2cd7180babe | |
./checksum.sh ./test/gen_KAT1024 6dafb867599b750a6a831b03e494cf41dea748c78a0e275e7b268bbb893cf37d | |
- name: Compare gen_NISTKAT with known hash | |
shell: nix develop .#ci -c bash -e {0} | |
run: | | |
make nistkat; | |
./checksum.sh ./test/gen_NISTKAT512 4b88ac7643ff60209af1175e025f354272e88df827a0ce1c056e403629b88e04 | |
./checksum.sh ./test/gen_NISTKAT768 21b4a1e1ea34a13c26a9da5eeb9325afb5ca11596ca6f3704c3f2637e3ea7524 | |
./checksum.sh ./test/gen_NISTKAT1024 6471398b0a728ee1ef39e93bb89b526fbf59587a3662edadbcfc6c88a512cd71 | |
- name: Clean up | |
shell: nix develop .#ci -c bash -e {0} | |
run: | | |
make clean |