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"
4
8
authors = [" Cryspen" ]
5
9
license = " Apache-2.0"
6
- homepage = " https://github.com/cryspen/ libcrux"
10
+ homepage = " https://github.com/pq-code-package/mlkem-rust- libcrux"
7
11
edition = " 2021"
8
- repository = " https://github.com/cryspen/ libcrux"
12
+ repository = " https://github.com/pq-code-package/mlkem-rust- libcrux"
9
13
readme = " Readme.md"
10
- exclude = [" /tests" ]
11
14
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
14
37
15
38
[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 " }
20
43
21
44
# This is only required for verification.
22
45
# The hax config is set by the hax toolchain.
23
46
[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/" }
25
48
26
49
[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
30
60
mlkem512 = []
31
61
mlkem768 = []
32
62
mlkem1024 = []
33
- std = []
63
+
64
+ # Enable Round 3 Kyber in addition to ML-KEM
34
65
kyber = []
66
+
67
+ # Code that is not yet verified
35
68
pre-verification = []
36
69
70
+ # APIs that sample their own randomness
71
+ rand = [" dep:rand" ]
72
+
73
+ # std support
74
+ std = []
75
+
37
76
[dev-dependencies ]
38
77
rand = { version = " 0.8" }
39
78
serde_json = { version = " 1.0" }
@@ -45,7 +84,25 @@ criterion = "0.5"
45
84
name = " ml-kem"
46
85
harness = false
47
86
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
+ ] }
0 commit comments