Repository navigation
Expand file tree
/
Copy pathCargo.toml
More file actions
272 lines (264 loc) · 10.4 KB
/
Copy pathCargo.toml
File metadata and controls
272 lines (264 loc) · 10.4 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
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
[package]
authors = ["Dave Grantham <dwg@linuxprogrammer.org>", "Michael Lodder <redmike7@gmail.com>"]
categories = ["cryptography", "encoding"]
description = "Multikey self-describing cryptographic key data"
documentation = "https://docs.rs/multi-key"
edition = "2024"
homepage = "https://crates.io/crates/multi-key"
keywords = ["multiformats", "multikey", "crypto", "post-quantum"]
license = "Apache-2.0"
name = "multi-key"
readme = "README.md"
repository = "https://github.com/cryptidtech/multi-key.git"
rust-version = "1.99"
version = "3.1.0"
[features]
# Each algorithm or curve is its own feature, so callers compile in only the
# key types they use. With `default-features = false` the crate exposes only
# the Multikey data type, its attributes, and the view traits; callers supply
# their own implementations through `ViewBuilder::with_local_codec`. Hybrid
# key types compile when every feature they combine is enabled, e.g.
# Ed25519-ML-DSA-65 needs both `curve25519` and `ml-dsa`.
#
# Shared AEAD layer (AES-GCM, ChaCha20-Poly1305, HKDF) used by every sealing
# (KEM/ECDH) key type. Enabled by the features that need it.
aead = ["dep:aes-gcm", "dep:chacha20poly1305", "dep:hkdf", "dep:sha2"]
# bcrypt-pbkdf key derivation.
bcrypt = ["dep:bcrypt-pbkdf"]
# BLS12-381 G1/G2 signing keys and their threshold shares.
bls12-381 = ["dep:blsful", "dep:elliptic-curve", "dep:vsss-rs", "multi-sig/bls12-381"]
# ChaCha20-Poly1305 symmetric cipher keys.
chacha20 = ["dep:chacha20", "dep:chacha20poly1305", "dep:poly1305", "multi-sig/chacha20"]
# Ed25519 signing, X25519 sealing, and XEdDSA.
curve25519 = [
"aead",
"dep:curve25519-dalek",
"dep:ed25519-dalek",
"dep:getrandom",
"dep:sha2",
"dep:x25519-dalek",
"ssh-key/ed25519",
]
default = [
"bcrypt",
"bls12-381",
"chacha20",
"curve25519",
"fn-dsa",
"frodokem",
"lamport",
"mayo",
"ml-dsa",
"ml-kem",
"p256",
"p384",
"p521",
"rsa",
"secp256k1",
"serde",
"slh-dsa",
"sntrup",
"threshold",
"xmss",
]
# Deprecated Classic McEliece KEM support. 2026 structural key-recovery attacks
# on binary Goppa codes led Germany's BSI to advise against it in new
# developments; see the README's Deprecated Algorithms section.
# Excluded from the default build; enable to keep the McEliece key views and
# their tests compiling.
deprecated = ["aead", "chacha20/rng", "dep:blake3", "dep:chacha20", "dep:pq-mceliece"]
# FN-DSA (Falcon) signing keys.
fn-dsa = ["dep:fn-dsa", "dep:rand_core_06"]
# FrodoKEM sealing keys.
frodokem = ["aead", "dep:blake3", "dep:frodo-kem-rs", "dep:getrandom"]
# Lamport and merkle-tree Lamport one-time signing keys.
lamport = [
"dep:blake2",
"dep:blake3",
"dep:lamport_signature_plus",
"dep:sha2",
"dep:sha3",
"dep:shake",
"multi-sig/lamport",
]
# Legacy bare-ChaCha20 fallback for keys encrypted before AEAD was added.
# When disabled (default), AEAD decryption failure is a hard error — never
# silently downgrade to unauthenticated ChaCha20. Enable only to migrate
# pre-AEAD keystores; a warning is emitted on every fallback.
legacy_chacha20_fallback = ["chacha20"]
# MAYO signing keys.
mayo = ["dep:pq-mayo", "dep:signature"]
# ML-DSA (FIPS 204) signing keys.
ml-dsa = ["dep:ml-dsa"]
# ML-KEM (FIPS 203) sealing keys.
ml-kem = ["aead", "dep:ml-kem"]
# NIST P-256 ECDSA signing keys.
p256 = [
"aead",
"dep:elliptic-curve",
"dep:p256",
"dep:sec1",
"dep:typenum",
"ssh-key/p256",
"ssh-key/rand_core",
]
# NIST P-384 ECDSA signing keys.
p384 = [
"aead",
"dep:elliptic-curve",
"dep:p384",
"dep:sec1",
"dep:typenum",
"ssh-key/p384",
"ssh-key/rand_core",
]
# NIST P-521 ECDSA signing keys.
p521 = [
"aead",
"dep:elliptic-curve",
"dep:p521",
"dep:sec1",
"dep:typenum",
"ssh-key/p521",
"ssh-key/rand_core",
]
# RSA signing keys.
rsa = ["aead", "dep:getrandom", "dep:pkcs1", "dep:sad-rsa", "dep:sha2"]
# secp256k1 ECDSA signing and ECDH sealing keys.
secp256k1 = ["aead", "dep:elliptic-curve", "dep:k256"]
serde = ["dep:serde", "multi-hash/serde", "multi-sig/serde"]
# SLH-DSA (FIPS 205) signing keys.
slh-dsa = ["dep:getrandom", "dep:slh-dsa"]
# Tests that take over 60 seconds in debug builds (SLH-DSA, Classic McEliece,
# XMSS). Excluded from the default `cargo test` run; enable with
# `cargo test --features slow-tests` to run the full suite.
slow-tests = []
# Streamlined NTRU Prime sealing keys.
sntrup = ["aead", "dep:blake3", "dep:sntrup"]
# Key splitting into verifiable shares and the threshold marker attributes.
threshold = ["dep:elliptic-curve", "dep:serde", "dep:serde_cbor_2", "dep:vsss-rs"]
wasm = ["dep:getrandom_02", "getrandom/wasm_js"]
# XMSS stateful signing keys.
xmss = ["dep:pq-xmss", "multi-sig/xmss"]
[dependencies]
aes-gcm = { version = "0.11", optional = true }
bcrypt-pbkdf = { version = "0.11", optional = true }
blake2 = { version = "0.11.0", optional = true }
blake3 = { version = "1.8", features = ["traits-preview", "zeroize"], optional = true }
# blsful configured per-target below (blst for native, rust for wasm)
chacha20 = { version = "0.10", optional = true }
chacha20poly1305 = { version = "0.11", optional = true }
curve25519-dalek = { version = "5.0.0", features = ["group"], optional = true }
ed25519-dalek = { version = "3.0", features = ["pkcs8", "rand_core", "alloc"], optional = true }
elliptic-curve = { version = "0.14", optional = true }
fn-dsa = { version = "0.4", optional = true }
frodo-kem-rs = { version = "0.9", default-features = false, features = ["frodo640aes", "frodo976aes", "frodo1344aes", "frodo640shake", "frodo976shake", "frodo1344shake"], optional = true }
getrandom = { version = "0.4", features = ["sys_rng"], optional = true }
hex = "0.4"
hkdf = { version = "0.13", optional = true }
k256 = { version = "0.14", features = ["ecdh"], optional = true }
lamport_signature_plus = { version = "0.5.0", optional = true }
ml-dsa = { version = "0.1.1", optional = true }
ml-kem = { version = "0.3", optional = true }
multi-base = { version = "1.0", default-features = false }
multi-codec = "2"
multi-hash = { version = "4", default-features = false }
multi-sig = { version = "3", default-features = false }
multi-trait = { version = "1.1", default-features = false }
multi-util = "2"
p256 = { version = "0.14", features = ["ecdsa", "ecdh"], optional = true }
p384 = { version = "0.14", features = ["ecdsa", "ecdh"], optional = true }
p521 = { version = "0.14", features = ["ecdsa", "ecdh"], optional = true }
# Compatibility pin. sad-rsa 0.2.3 (the newest release of its line) cannot
# compile against pkcs1 0.8.0-rc.5, which changed `RsaPrivateKey` and
# `RsaPublicKey` from lifetime parameters to generic parameters. sad-rsa
# permits `pkcs1 ^0.8.0-rc.4`, so a fresh resolve picks rc.5 and fails. Pin
# the exact rc.4 dependency to force it; remove this entry once sad-rsa
# publishes a rc.5-compatible release.
pkcs1 = { version = "=0.8.0-rc.4", optional = true }
poly1305 = { version = "0.9", optional = true }
pq-mayo = { version = "0.6.0", optional = true }
pq-mceliece = { version = "0.3", default-features = false, features = ["decapsulate", "encapsulate", "keygen", "mceliece348864"], optional = true }
pq-xmss = { version = "0.2.0", optional = true }
rand = "0.10"
rand_core = "0.10"
rand_core_06 = { package = "rand_core", version = "0.6", features = ["getrandom"], optional = true }
sad-rsa = { version = "0.2.3", features = ["sha2"], optional = true }
sec1 = { version = "0.8", optional = true }
serde = { version = "1.0", default-features = false, features = ["alloc", "derive"], optional = true }
serde_cbor_2 = { version = "0.13.0", optional = true }
sha2 = { version = "0.11", optional = true }
sha3 = { version = "0.12", optional = true }
shake = { version = "0.1", optional = true }
signature = { version = "3", optional = true }
slh-dsa = { version = "0.2.0-rc.5", optional = true }
sntrup = { version = "0.4.0", optional = true }
ssh-encoding = "0.3"
ssh-key = { version = "0.7.0-rc.11", default-features = false, features = ["alloc"] }
subtle = "2"
thiserror = { version = "2.0" }
typenum = { version = "1.20", optional = true }
unsigned-varint = { version = "0.8", features = ["std"] }
vsss-rs = { version = "6", optional = true }
x25519-dalek = { version = "3.0", features = ["static_secrets", "getrandom"], optional = true }
zeroize = { version = "1", features = ["derive"] }
[target.'cfg(target_arch = "wasm32")'.dependencies]
blsful = { version = "4.2.0", default-features = false, features = ["rust"], optional = true }
getrandom_02 = { package = "getrandom", version = "0.2", features = ["js"], optional = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
blsful = { version = "4.2.0", default-features = false, features = ["blst"], optional = true }
[dev-dependencies]
criterion = { version = "0.8", features = ["html_reports"] }
# the hash families the tests fingerprint keys with
multi-hash = { version = "4", default-features = false, features = ["blake2", "sha3"] }
proptest = "1.11"
serde_cbor_2 = "0.13.0"
serde_json = "1.0"
serde_test = "1.0"
[[bench]]
harness = false
name = "multikey_bench"
path = "benches/multikey_bench.rs"
required-features = ["curve25519"]
# Pedantic, nursery, and cargo lints are on. The allows suppress stylistic
# lints that would require large-scale churn for minimal security benefit.
[lints.clippy]
branches_sharing_code = "allow"
cargo = { level = "warn", priority = -1 }
cast_possible_truncation = "allow"
doc_markdown = "allow"
elidable_lifetime_names = "allow"
enum_glob_use = "allow"
explicit_iter_loop = "allow"
if_not_else = "allow"
items_after_statements = "allow"
large_stack_frames = "allow"
match_same_arms = "allow"
missing_const_for_fn = "allow"
missing_errors_doc = "allow"
missing_panics_doc = "allow"
multiple_crate_versions = { level = "allow", priority = 1 }
must_use_candidate = "allow"
needless_pass_by_value = "allow"
nursery = { level = "warn", priority = -1 }
option_if_let_else = "allow"
or_fun_call = "allow"
pedantic = { level = "warn", priority = -1 }
redundant_pub_crate = "allow"
return_self_not_must_use = "allow"
semicolon_if_nothing_returned = "allow"
similar_names = "allow"
single_char_pattern = "allow"
single_match_else = "allow"
too_long_first_doc_paragraph = "allow"
too_many_lines = "allow"
uninlined_format_args = "allow"
use_self = "allow"
useless_let_if_seq = "allow"
[lints.rust]
missing_docs = "warn"
trivial_casts = "deny"
trivial_numeric_casts = "deny"
unsafe_code = "deny"
unused_import_braces = "deny"
unused_qualifications = "deny"