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

PQ code package update script #323

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 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
7 changes: 7 additions & 0 deletions libcrux-ml-kem/pqcp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-License-Identifier: Apache-2.0
# (TODO customize .gitignore for project)

.vscode
.idea
/target
Cargo.lock
48 changes: 48 additions & 0 deletions libcrux-ml-kem/pqcp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
[package]
name = "libcrux-ml-kem"
version = "0.0.2-pre.2"
jschneider-bensch marked this conversation as resolved.
Show resolved Hide resolved
authors = ["Cryspen"]
license = "Apache-2.0"
homepage = "https://github.com/cryspen/libcrux"
edition = "2021"
repository = "https://github.com/cryspen/libcrux"
readme = "Readme.md"
exclude = ["/tests"]
jschneider-bensch marked this conversation as resolved.
Show resolved Hide resolved

[dependencies]
rand_core = { version = "0.6" }
libcrux-platform = { git = "https://github.com/cryspen/libcrux", version = "0.0.2-pre.2", branch = "dev" }
libcrux-sha3 = { git = "https://github.com/cryspen/libcrux", version = "0.0.2-pre.2", branch = "dev" }
libcrux-intrinsics = { git = "https://github.com/cryspen/libcrux", version = "0.0.2-pre.2", branch = "dev" }

# This is only required for verification.
# The hax config is set by the hax toolchain.
[target.'cfg(hax)'.dependencies]
hax-lib = { git = "https://github.com/hacspec/hax/" }

[features]
default = ["std", "mlkem512", "mlkem768", "mlkem1024"]
simd128 = ["libcrux-sha3/simd128"]
simd256 = ["libcrux-sha3/simd256"]
mlkem512 = []
mlkem768 = []
mlkem1024 = []
std = []
kyber = []
pre-verification = []

[dev-dependencies]
rand = { version = "0.8" }
serde_json = { version = "1.0" }
serde = { version = "1.0", features = ["derive"] }
hex = { version = "0.4.3", features = ["serde"] }
criterion = "0.5"

[[bench]]
name = "ml-kem"
harness = false

[profile.release]
lto = "fat"
codegen-units = 1
panic = "abort"
7 changes: 7 additions & 0 deletions libcrux-ml-kem/pqcp/allowlist.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
build.rs
examples
src
tests
benches
pqcp/Cargo.toml
pqcp/.gitignore
31 changes: 31 additions & 0 deletions libcrux-ml-kem/update-pqcp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
#
# This script copies files to be included in the `mlkem-rust-libcrux`
# crate for the PQ code package. Files and directories to be copied
# are listed, one per line, in a file at `ALLOWLIST` and copied to
# `TARGET_DIR`, which should be the `mlkem-rust-libcrux` git
# repository. The copied files include custom Cargo.toml and
# .gitignore files for mlkem-rust-libcrux. On successful completion of
# `cargo test`, a signed-off commit is created in the target
# repository.

set -e
set -o pipefail

ALLOWLIST="pqcp/allowlist.txt"

if [[ -z "$TARGET_DIRECTORY" ]]; then
echo "Please set TARGET_DIRECTORY to the libcrux-ml-kem PQ code packages repository"
exit 1
fi

while read -r item; do
cp -r "$item" "$TARGET_DIRECTORY"
done < "$ALLOWLIST"

cd "$TARGET_DIRECTORY"
cargo test
cargo clean

git add .
git commit -sm "mlkem-rust-libcrux PQ code packages update ($(date))"
jschneider-bensch marked this conversation as resolved.
Show resolved Hide resolved
Loading