Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate simd crates for ml-kem vectors #248

Merged
merged 18 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
rustflags = ["-Ctarget-cpu=native"]
10 changes: 5 additions & 5 deletions .github/workflows/hax.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ jobs:
run: |
cd libcrux-ml-kem
./hax.py extract
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
# 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

- name: 🏃 Extract the Kyber specification
run: |
Expand Down
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ members = [
"libcrux-ml-kem",
"libcrux-simd",
"libcrux-sha3",
"polynomials",
"polynomials-avx2",
"traits",
"polynomials-aarch64",
]

[workspace.package]
Expand Down Expand Up @@ -79,3 +83,8 @@ wasm = ["wasm-bindgen"]
log = ["dep:log"]
tests = [] # Expose functions for testing.
experimental = [] # Expose experimental APIs.

[profile.release]
lto = "fat"
codegen-units = 1
panic = "abort"
5 changes: 3 additions & 2 deletions libcrux-ml-kem/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ exclude = ["/tests", "/implementation_notes.pdf"]
rand_core = { version = "0.6" }
libcrux-platform = { version = "0.0.2-pre.2", path = "../sys/platform" }
libcrux-sha3 = { version = "0.0.2-pre.2", path = "../libcrux-sha3" }
libcrux-polynomials = { path = "../polynomials/" }

# This is only required for verification.
# The hax config is set by the hax toolchain.
Expand All @@ -21,8 +22,8 @@ hax-lib = { git = "https://github.com/hacspec/hax/" }

[features]
default = []
simd128 = ["libcrux-sha3/simd128"]
simd256 = ["libcrux-sha3/simd256"]
simd128 = ["libcrux-sha3/simd128", "libcrux-polynomials/simd128"]
simd256 = ["libcrux-sha3/simd256", "libcrux-polynomials/simd256"]

[dev-dependencies]
rand = { version = "0.8" }
Expand Down
15 changes: 13 additions & 2 deletions libcrux-ml-kem/hax.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,19 @@ def __call__(self, parser, args, values, option_string=None) -> None:
)

# Extract ml-kem
include_str = "-libcrux_platform::macos_arm::* +!libcrux_platform::platform::* -libcrux_ml_kem::types::index_impls::** -libcrux_ml_kem::intvec128::**"
interface_include = "+* -libcrux::kem::kyber::types +!libcrux_platform::** +!libcrux::digest::**"
includes = [
"-libcrux_platform::macos_arm::*",
"+!libcrux_platform::platform::*",
"-libcrux_ml_kem::types::index_impls::**",
]
include_str = " ".join(includes)
interfaces = [
"+*",
"-libcrux::kem::kyber::types",
"+!libcrux_platform::**",
"+!libcrux::digest::**",
]
interface_include = " ".join(interfaces)
cargo_hax_into = [
"cargo",
"hax",
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading
Loading