Skip to content

Commit

Permalink
PQ code package update script
Browse files Browse the repository at this point in the history
  • Loading branch information
jschneider-bensch committed Jun 18, 2024
1 parent 52af832 commit 994d816
Show file tree
Hide file tree
Showing 4 changed files with 92 additions and 0 deletions.
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
45 changes: 45 additions & 0 deletions libcrux-ml-kem/pqcp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
[package]
name = "libcrux-ml-kem"
version = "0.0.2-pre.2"
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", "/implementation_notes.pdf"]

[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"]
simd128 = ["libcrux-sha3/simd128"]
simd256 = ["libcrux-sha3/simd256"]
tests = [] # Test utilities. DO NOT USE.
std = []

[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"
libcrux-ml-kem = { path = ".", features = ["tests"] }

[[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
33 changes: 33 additions & 0 deletions libcrux-ml-kem/update-pqcp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/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))"

0 comments on commit 994d816

Please sign in to comment.