Skip to content

Commit db37b2b

Browse files
code update
Signed-off-by: Franziskus Kiefer <[email protected]>
1 parent f83fd49 commit db37b2b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+7270
-2764
lines changed

CODE_OF_CONDUCT.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2024 Cryspen Sarl <[email protected]>
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
SPDX-License-Identifier: MIT
6+
-->
7+
18
[//]: # (SPDX-License-Identifier: CC-BY-4.0)
29
[//]: # (TODO Add code of conduct)
310

CONTRIBUTING.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2024 Cryspen Sarl <[email protected]>
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
SPDX-License-Identifier: MIT
6+
-->
7+
18
[//]: # (SPDX-License-Identifier: CC-BY-4.0)
29
[//]: # (TODO Add contributing guide)
310

Cargo.toml

+78-21
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,78 @@
1-
[package]
2-
name = "libcrux-ml-kem"
3-
version = "0.0.2-alpha.1"
1+
# SPDX-FileCopyrightText: 2024 Cryspen Sarl <[email protected]>
2+
#
3+
# SPDX-License-Identifier: Apache-2.0
4+
# SPDX-License-Identifier: MIT
5+
6+
[workspace.package]
7+
version = "0.0.2-alpha.3"
48
authors = ["Cryspen"]
59
license = "Apache-2.0"
6-
homepage = "https://github.com/cryspen/libcrux"
10+
homepage = "https://github.com/pq-code-package/mlkem-rust-libcrux"
711
edition = "2021"
8-
repository = "https://github.com/cryspen/libcrux"
12+
repository = "https://github.com/pq-code-package/mlkem-rust-libcrux"
913
readme = "Readme.md"
10-
exclude = ["/tests"]
1114

12-
[workspace]
13-
member = ["."]
15+
[package]
16+
name = "libcrux-ml-kem"
17+
version.workspace = true
18+
authors.workspace = true
19+
license.workspace = true
20+
homepage.workspace = true
21+
edition.workspace = true
22+
repository.workspace = true
23+
readme = "README.md"
24+
description = "Libcrux ML-KEM & Kyber implementations"
25+
exclude = [
26+
"/tests",
27+
"/implementation_notes.pdf",
28+
"/c",
29+
"/proofs",
30+
"/c.sh",
31+
"/c.yaml",
32+
"/hax.py",
33+
]
34+
35+
[lib]
36+
bench = false # so libtest doesn't eat the arguments to criterion
1437

1538
[dependencies]
16-
rand_core = { version = "0.6" }
17-
libcrux-platform = { version = "0.0.2-alpha.1" }
18-
libcrux-sha3 = { version = "0.0.2-alpha.1" }
19-
libcrux-intrinsics = { version = "0.0.2-alpha.1" }
39+
rand = { version = "0.8", optional = true }
40+
libcrux-platform = { version = "0.0.2-beta.2" }
41+
libcrux-sha3 = { version = "0.0.2-beta.2" }
42+
libcrux-intrinsics = { version = "0.0.2-beta.2" }
2043

2144
# This is only required for verification.
2245
# The hax config is set by the hax toolchain.
2346
[target.'cfg(hax)'.dependencies]
24-
hax-lib = { git = "https://github.com/hacspec/hax/" }
47+
hax-lib = { version = "0.1.0-alpha.1", git = "https://github.com/hacspec/hax/" }
2548

2649
[features]
27-
default = ["std", "mlkem512", "mlkem768", "mlkem1024"]
28-
simd128 = ["libcrux-sha3/simd128"]
29-
simd256 = ["libcrux-sha3/simd256"]
50+
# By default all variants and std are enabled.
51+
default = ["std", "mlkem512", "mlkem768", "mlkem1024", "rand"]
52+
53+
# Hardware features can be force enabled.
54+
# It is not recommended to use these. This crate performs CPU feature detection
55+
# and enables the features when they are available.
56+
simd128 = ["libcrux-sha3/simd128", "libcrux-intrinsics/simd128"]
57+
simd256 = ["libcrux-sha3/simd256", "libcrux-intrinsics/simd256"]
58+
59+
# Features for the different key sizes of ML-KEM
3060
mlkem512 = []
3161
mlkem768 = []
3262
mlkem1024 = []
33-
std = []
63+
64+
# Enable Round 3 Kyber in addition to ML-KEM
3465
kyber = []
66+
67+
# Code that is not yet verified
3568
pre-verification = []
3669

70+
# APIs that sample their own randomness
71+
rand = ["dep:rand"]
72+
73+
# std support
74+
std = []
75+
3776
[dev-dependencies]
3877
rand = { version = "0.8" }
3978
serde_json = { version = "1.0" }
@@ -45,7 +84,25 @@ criterion = "0.5"
4584
name = "ml-kem"
4685
harness = false
4786

48-
[profile.release]
49-
lto = "fat"
50-
codegen-units = 1
51-
panic = "abort"
87+
[[example]]
88+
name = "encapsulate"
89+
required-features = ["mlkem768"]
90+
91+
[[example]]
92+
name = "decapsulate"
93+
required-features = ["mlkem768"]
94+
95+
[[example]]
96+
name = "keygen"
97+
required-features = ["mlkem768"]
98+
99+
[package.metadata."docs.rs"]
100+
features = ["pre-verification", "kyber"]
101+
rustdoc-args = ["--cfg", "doc_cfg"]
102+
103+
[lints.rust]
104+
unexpected_cfgs = { level = "warn", check-cfg = [
105+
'cfg(hax)',
106+
'cfg(eurydice)',
107+
'cfg(doc_cfg)',
108+
] }

GOVERNANCE.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2024 Cryspen Sarl <[email protected]>
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
SPDX-License-Identifier: MIT
6+
-->
7+
18
[//]: # (SPDX-License-Identifier: CC-BY-4.0)
29
[//]: # (TODO Define governance)
310

MAINTAINERS.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2024 Cryspen Sarl <[email protected]>
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
SPDX-License-Identifier: MIT
6+
-->
7+
18
[//]: # (SPDX-License-Identifier: CC-BY-4.0)
29
[//]: # (TODO Update list of maintainers)
310

README.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2024 Cryspen Sarl <[email protected]>
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
SPDX-License-Identifier: MIT
6+
-->
7+
18
[//]: # (SPDX-License-Identifier: CC-BY-4.0)
29
[//]: # (TODO Customize project readme)
310

SECURITY.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2024 Cryspen Sarl <[email protected]>
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
SPDX-License-Identifier: MIT
6+
-->
7+
18
[//]: # (SPDX-License-Identifier: CC-BY-4.0)
29
[//]: # (TODO Add Security Policy)
310

SUPPORT.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2024 Cryspen Sarl <[email protected]>
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
SPDX-License-Identifier: MIT
6+
-->
7+
18
[//]: # (SPDX-License-Identifier: CC-BY-4.0)
29
[//]: # (TODO add support information)
310

antitrust.md

+7
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
<!--
2+
SPDX-FileCopyrightText: 2024 Cryspen Sarl <[email protected]>
3+
4+
SPDX-License-Identifier: Apache-2.0
5+
SPDX-License-Identifier: MIT
6+
-->
7+
18
[//]: # (SPDX-License-Identifier: CC-BY-4.0)
29

310
# Antitrust Policy Notice

0 commit comments

Comments
 (0)