Skip to content

Commit

Permalink
merged main
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikbhargavan committed Nov 1, 2024
2 parents f0bd4d2 + 13a5dea commit fb469cb
Show file tree
Hide file tree
Showing 145 changed files with 31,566 additions and 17,083 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

12 changes: 6 additions & 6 deletions .docker/c/ext-tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ set -v -e -x

source $HOME/.profile

curl -L https://github.com/AeneasVerif/charon/archive/28d543bfacc902ba9cc2a734b76baae9583892a4.zip \
curl -L https://github.com/AeneasVerif/charon/archive/45f5a34f336e35c6cc2253bc90cbdb8d812cefa9.zip \
--output charon.zip
unzip charon.zip
rm -rf charon.zip
mv charon-28d543bfacc902ba9cc2a734b76baae9583892a4/ charon
mv charon-45f5a34f336e35c6cc2253bc90cbdb8d812cefa9/ charon

curl -L https://github.com/FStarLang/karamel/archive/15d4bce74a2d43e34a64f48f8311b7d9bcb0e152.zip \
curl -L https://github.com/FStarLang/karamel/archive/8c3612018c25889288da6857771be3ad03b75bcd.zip \
--output karamel.zip
unzip karamel.zip
rm -rf karamel.zip
mv karamel-15d4bce74a2d43e34a64f48f8311b7d9bcb0e152/ karamel
mv karamel-8c3612018c25889288da6857771be3ad03b75bcd/ karamel

curl -L https://github.com/AeneasVerif/eurydice/archive/1a65dbf3758fe310833718c645a64266294a29ac.zip \
curl -L https://github.com/AeneasVerif/eurydice/archive/1fff1c51ae6e6c87eafd28ec9d5594f54bc91c0c.zip \
--output eurydice.zip
unzip eurydice.zip
rm -rf eurydice.zip
mv eurydice-1a65dbf3758fe310833718c645a64266294a29ac/ eurydice
mv eurydice-1fff1c51ae6e6c87eafd28ec9d5594f54bc91c0c/ eurydice

echo "export KRML_HOME=$HOME/karamel" >>$HOME/.profile
echo "export EURYDICE_HOME=$HOME/eurydice" >>$HOME/.profile
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/mldsa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,12 @@ jobs:
- name: 🏃🏻‍♀️ Test
run: |
cargo clean
cargo test --verbose $RUST_TARGET_FLAG
cargo test --verbose --features acvp $RUST_TARGET_FLAG
- name: 🏃🏻‍♀️ Test Release
run: |
cargo clean
cargo test --verbose --release $RUST_TARGET_FLAG
cargo test --verbose --release --features acvp $RUST_TARGET_FLAG
# Benchmarks
- name: 🔨 Build Benchmarks
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ fuzz/artifacts
__pycache__
kyber-crate/
*.llbc
.cargo/

# When using sed
*.bak
Expand Down
44 changes: 22 additions & 22 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 24 additions & 13 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ members = [
]

[workspace.package]
version = "0.0.2-alpha.3"
version = "0.0.2-beta.2"
authors = ["Cryspen"]
license = "Apache-2.0"
homepage = "https://github.com/cryspen/libcrux"
Expand Down Expand Up @@ -56,19 +56,19 @@ exclude = [

[lib]
crate-type = ["staticlib", "cdylib", "lib"]
bench = false # so libtest doesn't eat the arguments for criterion
bench = false # so libtest doesn't eat the arguments for criterion

[build-dependencies]
libcrux-platform = { version = "=0.0.2-alpha.3", path = "sys/platform" }
libcrux-platform = { version = "=0.0.2-beta.2", path = "sys/platform" }

[dependencies]
libcrux-hacl = { version = "=0.0.2-alpha.3", path = "sys/hacl" }
libcrux-platform = { version = "=0.0.2-alpha.3", path = "sys/platform" }
libcrux-hkdf = { version = "=0.0.2-alpha.3", path = "libcrux-hkdf" }
libcrux-hmac = { version = "=0.0.2-alpha.3", path = "libcrux-hmac" }
libcrux-ecdh = { version = "=0.0.2-alpha.3", path = "libcrux-ecdh" }
libcrux-ml-kem = { version = "=0.0.2-alpha.3", path = "libcrux-ml-kem" }
libcrux-kem = { version = "=0.0.2-alpha.3", path = "libcrux-kem" }
libcrux-hacl = { version = "=0.0.2-beta.2", path = "sys/hacl" }
libcrux-platform = { version = "=0.0.2-beta.2", path = "sys/platform" }
libcrux-hkdf = { version = "=0.0.2-beta.2", path = "libcrux-hkdf" }
libcrux-hmac = { version = "=0.0.2-beta.2", path = "libcrux-hmac" }
libcrux-ecdh = { version = "=0.0.2-beta.2", path = "libcrux-ecdh" }
libcrux-ml-kem = { version = "=0.0.2-beta.2", path = "libcrux-ml-kem" }
libcrux-kem = { version = "=0.0.2-beta.2", path = "libcrux-kem" }
rand = { version = "0.8" }
log = { version = "0.4", optional = true }
# WASM API
Expand Down Expand Up @@ -99,14 +99,25 @@ wasm-bindgen-test = "0.3"
getrandom = { version = "0.2", features = ["js"] }

[features]
hacspec = [] # TODO: #7 Use specs instead of efficient implementations
hacspec = [] # TODO: #7 Use specs instead of efficient implementations
rand = []
wasm = ["wasm-bindgen", "getrandom"]
log = ["dep:log"]
tests = [] # Expose functions for testing.
experimental = [] # Expose experimental APIs.
tests = [] # Expose functions for testing.
experimental = [] # Expose experimental APIs.

[profile.release]
lto = "fat"
codegen-units = 1
panic = "abort"

[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(hax)',
'cfg(eurydice)',
'cfg(doc_cfg)',
'cfg(libjade)',
'cfg(simd128)',
'cfg(simd256)',
'cfg(aes_ni)',
] }
2 changes: 1 addition & 1 deletion benchmarks/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pqcrypto-kyber = { version = "0.8.0" }
openssl = "0.10"

[target.'cfg(all(not(target_os = "windows"), target_arch = "x86_64"))'.dev-dependencies]
libjade-sys = { version = "=0.0.2-alpha.3", path = "../sys/libjade" }
libjade-sys = { version = "=0.0.2-beta.2", path = "../sys/libjade" }

[[bench]]
name = "sha2"
Expand Down
47 changes: 30 additions & 17 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,27 @@
rev = "v3.10.3";
sha256 = "EBzwaHyDWF8h/z3Zfq4p/n5Vpz7Ozlc3eoWDKXWv2YY=";
};

tools-environment = {
CHARON_HOME = inputs.charon.packages.${system}.default;
EURYDICE_HOME = pkgs.runCommand "eurydice-home" { } ''
mkdir -p $out
cp -r ${inputs.eurydice.packages.${system}.default}/bin/eurydice $out
cp -r ${inputs.eurydice}/include $out
'';
FSTAR_HOME = inputs.fstar.packages.${system}.default;
KRML_HOME = inputs.karamel.packages.${system}.default.home;

CHARON_REV = inputs.charon.rev;
EURYDICE_REV = inputs.eurydice.rev;
KRML_REV = inputs.karamel.rev;
FSTAR_REV = inputs.fstar.rev;
};

craneLib = inputs.crane.mkLib pkgs;
src = ./.;
cargoArtifacts = craneLib.buildDepsOnly { inherit src; };
ml-kem = craneLib.buildPackage {
ml-kem = craneLib.buildPackage (tools-environment // {
name = "ml-kem";
inherit src cargoArtifacts;

Expand Down Expand Up @@ -80,26 +97,22 @@
cd ./..
cp -r . $out
'';

CHARON_HOME = inputs.charon.packages.${system}.default;
EURYDICE_HOME = pkgs.runCommand "eurydice-home" { } ''
mkdir -p $out
cp -r ${inputs.eurydice.packages.${system}.default}/bin/eurydice $out
cp -r ${inputs.eurydice}/include $out
'';
FSTAR_HOME = inputs.fstar.packages.${system}.default;
KRML_HOME = inputs.karamel.packages.${system}.default.home;

CHARON_REV = inputs.charon.rev;
EURYDICE_REV = inputs.eurydice.rev;
KRML_REV = inputs.karamel.rev;
FSTAR_REV = inputs.fstar.rev;
};
});
in
{
rec {
packages = {
inherit ml-kem;
};
devShells.default = pkgs.mkShell (tools-environment // {
packages = [
pkgs.clang
inputs.fstar.packages.${system}.default
];

inputsFrom = [
packages.ml-kem
];
});
}
);
}
2 changes: 1 addition & 1 deletion libcrux-ecdh/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ path = "src/ecdh.rs"

[dependencies]
rand = { version = "0.8" }
libcrux-hacl = { version = "=0.0.2-alpha.3", path = "../sys/hacl" }
libcrux-hacl = { version = "=0.0.2-beta.2", path = "../sys/hacl" }

[dev-dependencies]
rand_core = { version = "0.6" }
Expand Down
Loading

0 comments on commit fb469cb

Please sign in to comment.