Skip to content

Type-based secret independence #351

Type-based secret independence

Type-based secret independence #351

Workflow file for this run

name: ML-KEM - hax
on:
merge_group:
push:
branches: ["dev", "main"]
pull_request:
branches: ["dev", "main"]
schedule:
- cron: "0 0 * * *"
workflow_dispatch:
inputs:
hax_rev:
description: "The hax revision you want this job to use"
default: "main"
skip_diff:
description: "Skip diff jobs"
default: false
type: boolean
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
extract:
if: ${{ github.event_name != 'merge_group' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: hacspec/hax-actions@main
with:
hax_reference: ${{ github.event.inputs.hax_rev || 'main' }}
fstar: v2025.02.17
- name: 🏃 Extract ML-KEM crate
working-directory: libcrux-ml-kem
run: ./hax.py extract
- name: ↑ Upload F* extraction
uses: actions/upload-artifact@v4
with:
name: fstar-extraction-mlkem
path: libcrux-ml-kem/proofs/
include-hidden-files: true
if-no-files-found: error
diff:
needs: extract
if: ${{ github.event_name != 'merge_group' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
name: fstar-extraction-mlkem
path: ~/fstar-extraction-mlkem
- name: = Diff Extraction
if: ${{ github.event.inputs.skip_diff != 'false' }}
run: |
diff -r libcrux-ml-kem/proofs/fstar/extraction/ \
~/fstar-extraction-mlkem/fstar/extraction/
lax:
runs-on: ubuntu-latest
if: ${{ github.event_name != 'merge_group' }}
needs:
- extract
- diff
steps:
- uses: actions/checkout@v4
- uses: hacspec/hax-actions@main
with:
hax_reference: ${{ github.event.inputs.hax_rev || 'main' }}
fstar: v2025.02.17
- name: 🏃 Lax ML-KEM crate
working-directory: libcrux-ml-kem
run: ./hax.py prove --admit
prove:
runs-on: self-hosted
if: ${{ github.event_name == 'merge_group' || github.event_name == 'workflow_dispatch' }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v4
with:
repository: cryspen/hax
path: hax
ref: ${{ github.event.inputs.hax_rev || 'main' }}
- name: ⤵ Install hax
run: |
nix profile install ./hax
- name: ⤵ Install FStar
run: nix profile install github:FStarLang/FStar/v2025.02.17
- name: 🏃 Prove ML-KEM crate
working-directory: libcrux-ml-kem
run: FSTAR_HOME=~/.nix-profile ./hax.py prove
mlkem-extract-hax-status:
if: ${{ always() }}
needs: [extract]
runs-on: ubuntu-latest
steps:
- name: Successful
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing
if: ${{ (contains(needs.*.result, 'failure')) }}
run: exit 1
mlkem-diff-hax-status:
if: ${{ always() }}
needs: [diff]
runs-on: ubuntu-latest
steps:
- name: Successful
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing
if: ${{ (contains(needs.*.result, 'failure')) }}
run: exit 1
mlkem-lax-hax-status:
if: ${{ always() }}
needs: [lax]
runs-on: ubuntu-latest
steps:
- name: Successful
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing
if: ${{ (contains(needs.*.result, 'failure')) }}
run: exit 1
mlkem-prove-hax-status:
if: ${{ always() }}
needs: [prove]
runs-on: ubuntu-latest
steps:
- name: Successful
if: ${{ !(contains(needs.*.result, 'failure')) }}
run: exit 0
- name: Failing
if: ${{ (contains(needs.*.result, 'failure')) }}
run: exit 1