Skip to content

Commit

Permalink
Merge pull request #662 from cryspen/dev-merge-main
Browse files Browse the repository at this point in the history
Merging main into dev
  • Loading branch information
karthikbhargavan authored Dec 1, 2024
2 parents 0eabf66 + 0a935fe commit 5a621c7
Show file tree
Hide file tree
Showing 471 changed files with 62,150 additions and 7,428 deletions.
4 changes: 2 additions & 2 deletions .docker/c/ext-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ unzip karamel.zip
rm -rf karamel.zip
mv karamel-8c3612018c25889288da6857771be3ad03b75bcd/ karamel

curl -L https://github.com/AeneasVerif/eurydice/archive/1fff1c51ae6e6c87eafd28ec9d5594f54bc91c0c.zip \
curl -L https://github.com/AeneasVerif/eurydice/archive/e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20.zip \
--output eurydice.zip
unzip eurydice.zip
rm -rf eurydice.zip
mv eurydice-1fff1c51ae6e6c87eafd28ec9d5594f54bc91c0c/ eurydice
mv eurydice-e2db6e88adc9995ca9d3dedf7fa9bc4095e9ca20/ eurydice

echo "export KRML_HOME=$HOME/karamel" >>$HOME/.profile
echo "export EURYDICE_HOME=$HOME/eurydice" >>$HOME/.profile
Expand Down
11 changes: 2 additions & 9 deletions .github/workflows/c.yml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ jobs:

- name: 🔨 Build
run: |
cmake -B build
LIBCRUX_BENCHMARKS=1 cmake -B build
cmake --build build
- name: 🏃🏻‍♀️ Test
Expand All @@ -132,7 +132,7 @@ jobs:
- name: 🔨 Build Release
run: |
rm -rf build
cmake -B build -DCMAKE_BUILD_TYPE=Release
LIBCRUX_BENCHMARKS=1 cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
if: ${{ matrix.os != 'windows-latest' }}

Expand All @@ -159,13 +159,6 @@ jobs:
cmake -B build
cmake --build build
# FIXME: Benchmark build for cg on Windows CI is not working right now.
if: ${{ matrix.os != 'windows-latest' }}

# FIXME: Benchmark build for cg on Windows CI are not working right now.
# - name: 🏃🏻‍♀️ Test (cg)
# working-directory: libcrux-ml-kem/cg
# run: ./build/Debug/ml_kem_test
# if: ${{ matrix.os == 'windows-latest' }}

- name: 🏃🏻‍♀️ Test
run: ./build/ml_kem_test
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/hax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,13 @@ jobs:
- name: 🏃 Extract ML-DSA crate
working-directory: libcrux-ml-dsa
run: cargo hax into fstar
run: ./hax.py extract

- name: 🏃 Lax ML-DSA crate
working-directory: libcrux-ml-dsa
run: |
env FSTAR_HOME=${{ github.workspace }}/fstar \
HACL_HOME=${{ github.workspace }}/hacl-star \
HAX_HOME=${{ github.workspace }}/hax \
PATH="${PATH}:${{ github.workspace }}/fstar/bin" \
./hax.py prove --admit
39 changes: 34 additions & 5 deletions .github/workflows/mlkem.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,6 @@ jobs:
rustc --print=cfg
cargo build --verbose $RUST_TARGET_FLAG --features pre-verification
- name: 🔨 Build unpacked
run: |
rustc --print=cfg
cargo build --verbose $RUST_TARGET_FLAG --features pre-verification,unpacked
- name: 🔨 Build Release
run: cargo build --verbose --release $RUST_TARGET_FLAG --features pre-verification

Expand Down Expand Up @@ -173,3 +168,37 @@ jobs:
run: |
cargo clean
cargo hack test --each-feature $EXCLUDE_FEATURES --verbose $RUST_TARGET_FLAG
fuzz:
strategy:
fail-fast: false
matrix:
os:
- macos-latest # macos-14 m1
- ubuntu-latest

runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
working-directory: libcrux-ml-kem

steps:
- uses: actions/checkout@v4

- name: 🛠️ Setup Rust Nightly
run: |
rustup toolchain install nightly
cargo install cargo-fuzz
- name: 🛠️ Update dependencies
run: cargo update

- name: 🏃🏻‍♀️ Decaps
run: CARGO_PROFILE_RELEASE_LTO=false cargo +nightly fuzz run decaps -- -runs=100000

- name: 🏃🏻‍♀️ Encaps
run: CARGO_PROFILE_RELEASE_LTO=false cargo +nightly fuzz run encaps -- -runs=100000

- name: 🏃🏻‍♀️ KeyGen
run: CARGO_PROFILE_RELEASE_LTO=false cargo +nightly fuzz run keygen -- -runs=1000000
44 changes: 44 additions & 0 deletions .github/workflows/s390x.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: s390x - Build & Test

on:
push:
pull_request:
branches: ["main", "dev"]
workflow_dispatch:
merge_group:

env:
CARGO_TERM_COLOR: always

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
s390x:
runs-on: ubuntu-latest
name: Build on ubuntu-22.04 s390x
steps:
- uses: actions/checkout@v4
- uses: uraimo/run-on-arch-action@v2
name: Run
id: runcmd
with:
arch: s390x
distro: ubuntu22.04

# Speed up builds by storing container images in
# a GitHub package registry.
githubToken: ${{ github.token }}

run: |
apt-get -y update
apt-get install -y curl gcc g++ make cmake ninja-build git
cd libcrux-ml-kem/c
cmake -B build -G"Ninja Multi-Config"
cmake --build build
./build/Debug/ml_kem_test
cd ../cg
cmake -B build -G"Ninja Multi-Config"
cmake --build build
./build/Debug/ml_kem_test
4 changes: 2 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ kyber-crate/
# F*
.fstar-cache
.depend
**/proofs/fstar/*/#*#
**/proofs/fstar/*/.#*
/proofs/fstar/*/#*#
/proofs/fstar/*/.#*
hax.fst.config.json
Loading

0 comments on commit 5a621c7

Please sign in to comment.