-
Notifications
You must be signed in to change notification settings - Fork 316
Expand file tree
/
Copy pathCargo.toml
More file actions
254 lines (219 loc) · 7.1 KB
/
Cargo.toml
File metadata and controls
254 lines (219 loc) · 7.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
[package]
name = "tfhe"
version = "1.6.0"
edition = "2021"
readme = "../README.md"
keywords = ["fully", "homomorphic", "encryption", "fhe", "cryptography"]
homepage = "https://zama.org/"
documentation = "https://docs.zama.org/tfhe-rs"
repository = "https://github.com/zama-ai/tfhe-rs"
license = "BSD-3-Clause-Clear"
description = "TFHE-rs is a fully homomorphic encryption (FHE) library that implements Zama's variant of TFHE."
build = "build.rs"
exclude = [
"/docs/",
"/c_api_tests/",
"/CMakeLists.txt",
"/js_on_wasm_tests/",
"/web_wasm_parallel_tests/",
]
rust-version.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dev-dependencies]
rand = { workspace = true }
rand_distr = "0.4.3"
criterion = "0.5.1"
doc-comment = "0.3.3"
serde_json = "1.0.94"
num-bigint = "0.4.6"
# clap has to be pinned as its minimum supported rust version
# changes often between minor releases, which breaks our CI
clap = { version = "=4.5.30", features = ["derive"] }
# Used in user documentation
fs2 = { version = "0.4.3" }
statrs = "0.18"
# Begin regex-engine deps
test-case = "3.1.0"
combine = "4.6.6"
env_logger = "0.11"
log = "0.4.19"
hex = "0.4.3"
# End regex-engine deps
# Used in noise-measurements
csv = "1.3.0"
# Begin hpu-demo deps
# Enable to have hpu execution trace
tracing-subscriber = { version = "0.3.18", features = ["env-filter"] }
clap-num = { version = "1.1.1" }
# End hpu-demo deps
[build-dependencies]
cbindgen = { version = "0.28", optional = true }
[dependencies]
tfhe-csprng = { version = "0.9.0", path = "../tfhe-csprng", features = [
"parallel",
] }
serde = { workspace = true, features = ["default", "derive"] }
rayon = { workspace = true }
bincode = { workspace = true }
tfhe-fft = { version = "0.10.1", path = "../tfhe-fft", features = [
"serde",
"fft128",
] }
tfhe-ntt = { version = "0.7.0", path = "../tfhe-ntt" }
pulp = { workspace = true, features = ["default"] }
tfhe-cuda-backend = { version = "=0.14.0", path = "../backends/tfhe-cuda-backend", optional = true }
aligned-vec = { workspace = true, features = ["default", "serde"] }
dyn-stack = { workspace = true, features = ["default"] }
paste = { workspace = true }
fs2 = { version = "0.4.3", optional = true }
# Used for OPRF in shortint and rerand
sha3 = { version = "0.10", optional = true }
blake3 = { version = "1.8", optional = true }
itertools = { workspace = true }
rand_core = { version = "0.6.4", features = ["std"] }
strum = { version = "0.27", features = ["derive"], optional = true }
tfhe-zk-pok = { version = "0.8.1", path = "../tfhe-zk-pok", optional = true }
tfhe-versionable = { version = "0.7.0", path = "../utils/tfhe-versionable" }
# wasm deps
wasm-bindgen = { workspace = true, features = [
"serde-serialize",
], optional = true }
wasm-bindgen-rayon = { version = "1.3.0", optional = true }
js-sys = { workspace = true, optional = true }
console_error_panic_hook = { version = "0.1.7", optional = true }
serde-wasm-bindgen = { workspace = true, optional = true }
getrandom = { workspace = true, optional = true }
bytemuck = { workspace = true }
tfhe-hpu-backend = { version = "0.4", path = "../backends/tfhe-hpu-backend", optional = true }
[features]
default = ["avx512"]
boolean = []
shortint = ["dep:sha3", "dep:blake3"]
integer = ["shortint", "dep:strum"]
strings = ["integer"]
internal-keycache = ["dep:fs2"]
gpu = ["dep:tfhe-cuda-backend", "shortint"]
gpu-experimental-multi-arch = [
"gpu",
"tfhe-cuda-backend/experimental-multi-arch",
]
gpu-profile = ["gpu", "tfhe-cuda-backend/profile"]
gpu-debug = ["gpu", "tfhe-cuda-backend/debug"]
gpu-debug-fake-multi-gpu = ["gpu", "tfhe-cuda-backend/debug-fake-multi-gpu"]
zk-pok = ["dep:tfhe-zk-pok"]
# Start Fpga Hpu features
hpu = ["dep:tfhe-hpu-backend", "shortint", "integer"]
hpu-xrt = ["hpu", "tfhe-hpu-backend/hw-xrt"]
hpu-v80 = ["hpu", "tfhe-hpu-backend/hw-v80"]
hpu-debug = ["hpu", "tfhe-hpu-backend/io-dump"]
# End Fpga Hpu features
# Adds more FheUint/FheInt types to the HL
extended-types = []
pbs-stats = []
noise-asserts = []
# Experimental section
experimental = []
experimental-force_fft_algo_dif4 = []
# End experimental section
__c_api = ["dep:cbindgen"]
# Can be used in some situations to reduce build time with GPU
__force_skip_cbindgen = []
boolean-c-api = ["boolean", "__c_api"]
shortint-c-api = ["shortint", "__c_api"]
high-level-c-api = ["boolean-c-api", "shortint-c-api", "integer"]
__wasm_api = [
"dep:wasm-bindgen",
"dep:js-sys",
"dep:console_error_panic_hook",
"dep:serde-wasm-bindgen",
"dep:getrandom",
"getrandom/js",
]
boolean-client-js-wasm-api = ["boolean", "__wasm_api"]
shortint-client-js-wasm-api = ["shortint", "__wasm_api"]
integer-client-js-wasm-api = ["integer", "shortint-client-js-wasm-api"]
high-level-client-js-wasm-api = [
"boolean-client-js-wasm-api",
"integer-client-js-wasm-api",
]
parallel-wasm-api = ["dep:wasm-bindgen-rayon"]
avx512 = ["tfhe-fft/avx512", "tfhe-ntt/avx512", "pulp/x86-v4"]
# Kept for backward compatibility
nightly-avx512 = ["avx512"]
# Private features
__profiling = []
software-prng = ["tfhe-csprng/software-prng"]
[package.metadata.docs.rs]
# TODO: manage builds for docs.rs based on their documentation https://docs.rs/about
features = [
"boolean",
"shortint",
"integer",
"gpu",
"zk-pok",
"software-prng",
"strings",
"hpu",
"extended-types",
]
rustdoc-args = ["--html-in-header", "katex-header.html"]
# Examples used as tools
[[example]]
name = "generates_test_keys"
path = "examples/utilities/generates_test_keys.rs"
required-features = ["boolean", "shortint", "internal-keycache"]
[[example]]
name = "micro_bench_and"
path = "examples/utilities/micro_bench_and.rs"
required-features = ["boolean"]
[[example]]
name = "write_params_to_file"
path = "examples/utilities/params_to_file.rs"
required-features = ["boolean", "shortint", "internal-keycache", "hpu"]
[[example]]
name = "print_doc_bench_parameters"
path = "examples/utilities/print_doc_bench_parameters.rs"
required-features = ["shortint", "internal-keycache"]
# Real use-case examples
[[example]]
name = "manual_fft"
path = "examples/manual_fft.rs"
required-features = ["integer"]
[[example]]
name = "dark_market"
required-features = ["integer", "internal-keycache"]
[[example]]
name = "regex_engine"
required-features = ["integer"]
[[example]]
name = "sha256_bool"
required-features = ["boolean"]
[[example]]
name = "sha256"
required-features = ["integer"]
[[example]]
name = "pbs_count"
required-features = ["integer", "pbs-stats"]
# Start of Hpu related section
[[example]]
name = "hpu_hlapi"
path = "examples/hpu/hlapi.rs"
required-features = ["hpu"]
[[example]]
name = "hpu_matmul"
path = "examples/hpu/matmul.rs"
required-features = ["hpu"]
[[example]]
name = "hpu_bench"
path = "examples/hpu/bench.rs"
required-features = ["hpu"]
# End of Hpu related section
[lib]
crate-type = ["lib", "staticlib", "cdylib"]
[lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = [
'cfg(tarpaulin)',
'cfg(dylint_lib, values(any()))',
# This is a bug/unwanted behavior from wasm_bindgen macro, for now warn instead of erroring
'cfg(wasm_bindgen_unstable_test_coverage)',
] }