Skip to content

Commit

Permalink
Fix hax extraction and run hax on CI for Kyber reference implementati…
Browse files Browse the repository at this point in the history
…on . (#83)
  • Loading branch information
franziskuskiefer authored Sep 21, 2023
1 parent 97fe462 commit 704d8d9
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/hax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: hax

on:
push:
branches: ["dev"]
pull_request:
branches: ["dev"]
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: ⤵ Clone hax repository
uses: actions/checkout@v4
with:
repository: hacspec/hacspec-v2
path: hax

- name: 🔨 Setup hax
working-directory: hax
run: |
sudo apt-get update
sudo apt-get install --yes nodejs
./setup.sh
- name: 🏃🏻‍♀️ Run hax
run: |
eval $(opam env)
cargo hax into -i '-** +kem::kyber768::** -kem::kyber768::arithmetic::mutable_operations::**' fstar
10 changes: 9 additions & 1 deletion src/kem/kyber768.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
// This module is declared here since otherwise, hax reports the following error:
//
// The THIR body of item
// DefId(0:986 ~ libcrux[92b3]::kem::kyber768::parameters::COEFFICIENTS_IN_RING_ELEMENT)
// was stolen.
//
// This is being tracked in https://github.com/hacspec/hacspec-v2/issues/27
mod parameters;

mod arithmetic;
mod compress;
mod constant_time_ops;
mod conversions;
mod ind_cpa;
mod ntt;
mod parameters;
mod sampling;
mod serialize;

Expand Down

0 comments on commit 704d8d9

Please sign in to comment.