Skip to content

More kyber code refactoring #58

More kyber code refactoring

More kyber code refactoring #58

Workflow file for this run

name: hax
on:
push:
branches: ["dev"]
paths:
- 'specs/kyber/src/**'
- 'src/kem/kyber/**'
pull_request:
branches: ["dev"]
paths:
- 'specs/kyber/src/**'
- 'src/kem/kyber/**'
schedule:
- cron: '0 0 * * *'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
hax:
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- name: 🔨 OCaml Setup
uses: ocaml/setup-ocaml@v2
with:
ocaml-compiler: 4.14.1
- name: ⤵ Get Fstar binaries
run: |
curl -L https://github.com/FStarLang/FStar/releases/download/v2023.09.03/fstar_2023.09.03_Linux_x86_64.tar.gz \
--output Fstar.tar.gz
tar --extract --file Fstar.tar.gz
- name: ⤵ Clone HACL-star repository
uses: actions/checkout@v4
with:
repository: hacl-star/hacl-star
path: hacl-star
- name: ⤵ Clone hax repository
uses: actions/checkout@v4
with:
repository: hacspec/hacspec-v2
path: hax
- name: 🏃🏻‍ Lax typecheck Fstar extraction
run: |
ls ..
env FSTAR_HOME=${{ github.workspace }}/fstar \
HACL_HOME=${{ github.workspace }}/hacl-star \
HAX_LIBS_HOME=${{ github.workspace }}/hax/proof-libs/fstar \
./hax-driver.py typecheck --admit
- name: 🔨 Setup hax
working-directory: hax
run: |
sudo apt-get update
sudo apt-get install --yes nodejs
./setup.sh
- name: 🏃🏻‍♀️ Run hax extraction
run: |
eval $(opam env)
./hax-driver.py --kyber-reference
# Extract the functions in the compress module individually to test
# the function-extraction code.
# Extract functions from the remaining modules to test the
# module-extraction code.
./hax-driver.py --crate-path specs/kyber \
--functions hacspec_kyber::compress::compress \
hacspec_kyber::compress::decompress \
hacspec_kyber::compress::compress_d \
hacspec::kyber::compress::decompress_d \
--modules ind_cpa \
hacspec_kyber \
matrix \
ntt \
parameters \
sampling \
serialize \
--exclude-modules libcrux::hacl::sha3 libcrux::digest