Skip to content

Commit 50ec15e

Browse files
authored
Merge pull request #9 from cryptidtech/fix/deprecate-mceliece
fix/deprecate mceliece
2 parents 6ad9e99 + dc18173 commit 50ec15e

6 files changed

Lines changed: 96 additions & 41 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@ All notable changes to this project are documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
66
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
## [1.5.0] - 2026-09-14
11+
12+
### Deprecated
13+
14+
- All 36 Classic McEliece codec variants (`mceliece*` and `x25519-mceliece348864`) now carry `#[deprecated]` attributes. Key-recovery attacks now solve the TII McEliece challenges; see [tii-solved](https://github.com/mjosaarinen/tii-solved) for the recovered keys. Uses of these variants emit compiler warnings. The variants remain compiled, matchable, and decodable so stored multicodec-tagged data keeps working.
15+
16+
## [1.4.0] - 2026-09-03
17+
18+
### Added
19+
20+
- Three new codec entries for the proof-of-possession framework: `multiproof` (`0xd01330`, multiformat), `wacc-script-with-pop` (`0xd01331`, multiformat), and `xeddsa-msig` (`0xd01332`, multisig).
21+
- The `Codec` enum now has 885 variants (up from 882).
22+
23+
### Notes
24+
25+
- This is a minor version bump. The `Codec` enum is `#[non_exhaustive]`, so new variants are additive and do not break downstream match expressions.
26+
827
## [1.3.0] - 2026-09-01
928

1029
### Added

‎Cargo.toml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "multi-codec"
3-
version = "1.3.0"
3+
version = "1.5.0"
44
edition = "2024"
55
rust-version = "1.85"
66
authors = ["Benjamin Kampmann <ben@gnunicorn.org>", "Dave Grantham <dwg@linuxprogrammer.org>"]
@@ -48,7 +48,7 @@ name = "uvi"
4848
path = "examples/uvi.rs"
4949

5050
[build-dependencies]
51-
convert_case = "0.6"
51+
convert_case = "0.12"
5252
csv = "1.3"
5353
serde = { version = "1.0", features = ["serde_derive"] }
5454
serde_derive = "1.0"

‎build.rs‎

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,22 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
8989

9090
// Generate enum variant
9191
let variant_name = conv.convert(&rec.name);
92-
writeln!(f, "\t{} => ({}, \"{}\"),", code_str, variant_name, rec.name)?;
92+
// Classic McEliece key material is deprecated. Key-recovery attacks now
93+
// solve the TII McEliece challenges, so every McEliece variant carries a
94+
// deprecation attribute; uses emit a compiler warning. The variants stay
95+
// compiled and decodable so stored multicodec-tagged data keeps working.
96+
// See https://github.com/mjosaarinen/tii-solved for the recovered keys.
97+
// The attribute precedes the variant name inside the tuple so the
98+
// macro's `expr` fragment stays unambiguous.
99+
if rec.name.contains("mceliece") {
100+
writeln!(
101+
f,
102+
"\t{} => (#[deprecated(since = \"1.5.0\", note = \"Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved\")] {}, \"{}\"),",
103+
code_str, variant_name, rec.name
104+
)?;
105+
} else {
106+
writeln!(f, "\t{} => ({}, \"{}\"),", code_str, variant_name, rec.name)?;
107+
}
93108

94109
record_count += 1;
95110
}

‎src/codec.rs‎

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,20 @@ use core::{
3131
use multi_trait::{EncodeInto, Null, TryDecodeFrom};
3232

3333
macro_rules! build_codec_enum {
34-
{$( $val:expr => ($i:ident, $s:expr), )*} => {
34+
{$( $val:expr => ( $(#[$vattr:meta])* $i:ident, $s:expr), )*} => {
3535

3636
/// Codecs from the multicodec table
3737
#[allow(non_camel_case_types)]
3838
#[derive(Clone, Copy, Default, Eq, Ord, PartialEq, PartialOrd)]
3939
#[non_exhaustive]
4040
pub enum Codec {
4141
#[default]
42-
$( $i, )*
42+
$( $(#[$vattr])* $i, )*
4343
}
4444

4545
/// Convert from the canonical string name of the multicodec to the
4646
/// associated enum/value.
47+
#[allow(deprecated)]
4748
impl TryFrom<&str> for Codec {
4849
type Error = Error;
4950

@@ -56,6 +57,7 @@ macro_rules! build_codec_enum {
5657
}
5758

5859
/// Convert a Codec into a type that implements `AsRef<str>`
60+
#[allow(deprecated)]
5961
impl From<Codec> for &str {
6062
fn from(codec: Codec) -> &'static str {
6163
match codec {
@@ -65,6 +67,7 @@ macro_rules! build_codec_enum {
6567
}
6668

6769
/// Convert from the value of the multicodec to the associated enum/value.
70+
#[allow(deprecated)]
6871
impl TryFrom<u64> for Codec {
6972
type Error = Error;
7073

@@ -77,6 +80,7 @@ macro_rules! build_codec_enum {
7780
}
7881

7982
/// Convert a Codec into a u64
83+
#[allow(deprecated)]
8084
impl From<Codec> for u64 {
8185
fn from(codec: Codec) -> u64 {
8286
match codec {
@@ -285,6 +289,17 @@ mod tests {
285289
assert_eq!("ed25519-pub", Codec::Ed25519Pub.as_str());
286290
}
287291

292+
#[test]
293+
#[allow(deprecated)]
294+
fn test_mceliece_roundtrip() {
295+
// The McEliece variants are deprecated but stay compiled and decodable
296+
// so stored multicodec-tagged data keeps working.
297+
let codec = Codec::try_from(0x1220).unwrap();
298+
assert_eq!(Codec::Mceliece348864Pub, codec);
299+
assert_eq!("mceliece348864-pub", codec.as_str());
300+
assert_eq!(0x1220_u64, codec.code());
301+
}
302+
288303
#[test]
289304
fn test_from_str() {
290305
assert_eq!(Codec::Ed25519Pub, Codec::try_from("ed25519-pub").unwrap());

‎src/table_gen.rs‎

Lines changed: 39 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -190,23 +190,23 @@ build_codec_enum! {
190190
0x121d => (SlhDsaShake256FPub, "slh-dsa-shake256f-pub"),
191191
0x121e => (SlhDsaShake256SPub, "slh-dsa-shake256s-pub"),
192192
0x121f => (Sntrup761Pub, "sntrup761-pub"),
193-
0x1220 => (Mceliece348864Pub, "mceliece348864-pub"),
194-
0x1221 => (Mceliece460896Pub, "mceliece460896-pub"),
195-
0x1250 => (Mceliece460896FPub, "mceliece460896f-pub"),
196-
0x1251 => (Mceliece460896PcPub, "mceliece460896pc-pub"),
197-
0x1252 => (Mceliece460896PcfPub, "mceliece460896pcf-pub"),
198-
0x1253 => (Mceliece6688128Pub, "mceliece6688128-pub"),
199-
0x1254 => (Mceliece6688128FPub, "mceliece6688128f-pub"),
200-
0x1255 => (Mceliece6688128PcPub, "mceliece6688128pc-pub"),
201-
0x1256 => (Mceliece6688128PcfPub, "mceliece6688128pcf-pub"),
202-
0x1257 => (Mceliece6960119Pub, "mceliece6960119-pub"),
203-
0x1258 => (Mceliece6960119FPub, "mceliece6960119f-pub"),
204-
0x1259 => (Mceliece6960119PcPub, "mceliece6960119pc-pub"),
205-
0x125a => (Mceliece6960119PcfPub, "mceliece6960119pcf-pub"),
206-
0x125b => (Mceliece8192128Pub, "mceliece8192128-pub"),
207-
0x125c => (Mceliece8192128FPub, "mceliece8192128f-pub"),
208-
0x125d => (Mceliece8192128PcPub, "mceliece8192128pc-pub"),
209-
0x125e => (Mceliece8192128PcfPub, "mceliece8192128pcf-pub"),
193+
0x1220 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece348864Pub, "mceliece348864-pub"),
194+
0x1221 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece460896Pub, "mceliece460896-pub"),
195+
0x1250 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece460896FPub, "mceliece460896f-pub"),
196+
0x1251 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece460896PcPub, "mceliece460896pc-pub"),
197+
0x1252 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece460896PcfPub, "mceliece460896pcf-pub"),
198+
0x1253 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6688128Pub, "mceliece6688128-pub"),
199+
0x1254 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6688128FPub, "mceliece6688128f-pub"),
200+
0x1255 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6688128PcPub, "mceliece6688128pc-pub"),
201+
0x1256 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6688128PcfPub, "mceliece6688128pcf-pub"),
202+
0x1257 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6960119Pub, "mceliece6960119-pub"),
203+
0x1258 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6960119FPub, "mceliece6960119f-pub"),
204+
0x1259 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6960119PcPub, "mceliece6960119pc-pub"),
205+
0x125a => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6960119PcfPub, "mceliece6960119pcf-pub"),
206+
0x125b => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece8192128Pub, "mceliece8192128-pub"),
207+
0x125c => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece8192128FPub, "mceliece8192128f-pub"),
208+
0x125d => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece8192128PcPub, "mceliece8192128pc-pub"),
209+
0x125e => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece8192128PcfPub, "mceliece8192128pcf-pub"),
210210
0x1222 => (Rsa2048Pub, "rsa-2048-pub"),
211211
0x1223 => (Rsa3072Pub, "rsa-3072-pub"),
212212
0x1224 => (Rsa4096Pub, "rsa-4096-pub"),
@@ -221,7 +221,7 @@ build_codec_enum! {
221221
0x1230 => (X25519Sntrup761Pub, "x25519-sntrup761-pub"),
222222
0x1243 => (X25519Frodokem640AesPub, "x25519-frodokem640aes-pub"),
223223
0x1244 => (X25519Frodokem640ShakePub, "x25519-frodokem640shake-pub"),
224-
0x1245 => (X25519Mceliece348864Pub, "x25519-mceliece348864-pub"),
224+
0x1245 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] X25519Mceliece348864Pub, "x25519-mceliece348864-pub"),
225225
0x1246 => (Bls12381G1Mldsa65Pub, "bls12381-g1-mldsa65-pub"),
226226
0x1247 => (Bls12381G1Fndsa512Pub, "bls12381-g1-fndsa512-pub"),
227227
0x1248 => (Bls12381G1Mayo1Pub, "bls12381-g1-mayo1-pub"),
@@ -283,23 +283,23 @@ build_codec_enum! {
283283
0x1326 => (SlhDsaShake256FPriv, "slh-dsa-shake256f-priv"),
284284
0x1327 => (SlhDsaShake256SPriv, "slh-dsa-shake256s-priv"),
285285
0x1328 => (Sntrup761Priv, "sntrup761-priv"),
286-
0x1329 => (Mceliece348864Priv, "mceliece348864-priv"),
287-
0x132a => (Mceliece460896Priv, "mceliece460896-priv"),
288-
0x135d => (Mceliece460896FPriv, "mceliece460896f-priv"),
289-
0x135e => (Mceliece460896PcPriv, "mceliece460896pc-priv"),
290-
0x135f => (Mceliece460896PcfPriv, "mceliece460896pcf-priv"),
291-
0x1360 => (Mceliece6688128Priv, "mceliece6688128-priv"),
292-
0x1361 => (Mceliece6688128FPriv, "mceliece6688128f-priv"),
293-
0x1362 => (Mceliece6688128PcPriv, "mceliece6688128pc-priv"),
294-
0x1363 => (Mceliece6688128PcfPriv, "mceliece6688128pcf-priv"),
295-
0x1364 => (Mceliece6960119Priv, "mceliece6960119-priv"),
296-
0x1365 => (Mceliece6960119FPriv, "mceliece6960119f-priv"),
297-
0x1366 => (Mceliece6960119PcPriv, "mceliece6960119pc-priv"),
298-
0x1367 => (Mceliece6960119PcfPriv, "mceliece6960119pcf-priv"),
299-
0x1368 => (Mceliece8192128Priv, "mceliece8192128-priv"),
300-
0x1369 => (Mceliece8192128FPriv, "mceliece8192128f-priv"),
301-
0x136a => (Mceliece8192128PcPriv, "mceliece8192128pc-priv"),
302-
0x136b => (Mceliece8192128PcfPriv, "mceliece8192128pcf-priv"),
286+
0x1329 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece348864Priv, "mceliece348864-priv"),
287+
0x132a => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece460896Priv, "mceliece460896-priv"),
288+
0x135d => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece460896FPriv, "mceliece460896f-priv"),
289+
0x135e => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece460896PcPriv, "mceliece460896pc-priv"),
290+
0x135f => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece460896PcfPriv, "mceliece460896pcf-priv"),
291+
0x1360 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6688128Priv, "mceliece6688128-priv"),
292+
0x1361 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6688128FPriv, "mceliece6688128f-priv"),
293+
0x1362 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6688128PcPriv, "mceliece6688128pc-priv"),
294+
0x1363 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6688128PcfPriv, "mceliece6688128pcf-priv"),
295+
0x1364 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6960119Priv, "mceliece6960119-priv"),
296+
0x1365 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6960119FPriv, "mceliece6960119f-priv"),
297+
0x1366 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6960119PcPriv, "mceliece6960119pc-priv"),
298+
0x1367 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece6960119PcfPriv, "mceliece6960119pcf-priv"),
299+
0x1368 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece8192128Priv, "mceliece8192128-priv"),
300+
0x1369 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece8192128FPriv, "mceliece8192128f-priv"),
301+
0x136a => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece8192128PcPriv, "mceliece8192128pc-priv"),
302+
0x136b => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] Mceliece8192128PcfPriv, "mceliece8192128pcf-priv"),
303303
0x132b => (Rsa2048Priv, "rsa-2048-priv"),
304304
0x132c => (Rsa3072Priv, "rsa-3072-priv"),
305305
0x132d => (Rsa4096Priv, "rsa-4096-priv"),
@@ -314,7 +314,7 @@ build_codec_enum! {
314314
0x1340 => (X25519Sntrup761Priv, "x25519-sntrup761-priv"),
315315
0x1350 => (X25519Frodokem640AesPriv, "x25519-frodokem640aes-priv"),
316316
0x1351 => (X25519Frodokem640ShakePriv, "x25519-frodokem640shake-priv"),
317-
0x1352 => (X25519Mceliece348864Priv, "x25519-mceliece348864-priv"),
317+
0x1352 => (#[deprecated(since = "1.5.0", note = "Classic McEliece key recovery attacks: see https://github.com/mjosaarinen/tii-solved")] X25519Mceliece348864Priv, "x25519-mceliece348864-priv"),
318318
0x1353 => (Bls12381G1Mldsa65Priv, "bls12381-g1-mldsa65-priv"),
319319
0x1354 => (Bls12381G1Fndsa512Priv, "bls12381-g1-fndsa512-priv"),
320320
0x1355 => (Bls12381G1Mayo1Priv, "bls12381-g1-mayo1-priv"),
@@ -866,6 +866,9 @@ build_codec_enum! {
866866
0xd0132d => (XmssSha216256Msig, "xmss-sha2-16-256-msig"),
867867
0xd0132e => (XmssSha220256Msig, "xmss-sha2-20-256-msig"),
868868
0xd0132f => (Ed448Msig, "ed448-msig"),
869+
0xd01332 => (XeddsaMsig, "xeddsa-msig"),
870+
0xd01330 => (Multiproof, "multiproof"),
871+
0xd01331 => (WaccScriptWithPop, "wacc-script-with-pop"),
869872
0xd01400 => (BsMessage, "bs-message"),
870873
0xd02000 => (Scion, "scion"),
871874
0xd03000 => (Ed25519ThreshPrivShare, "ed25519-thresh-priv-share"),

‎table.csv‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,9 @@ xmss-sha2-10-256-msig, multisig, 0xd0132c, draft, XMSS
866866
xmss-sha2-16-256-msig, multisig, 0xd0132d, draft, XMSS-SHA2_16_256 signature as Multisig; RFC 8391
867867
xmss-sha2-20-256-msig, multisig, 0xd0132e, draft, XMSS-SHA2_20_256 signature as Multisig; RFC 8391
868868
ed448-msig, multisig, 0xd0132f, draft, Ed448 (EdDSA) signature as Multisig; RFC 8032
869+
xeddsa-msig, multisig, 0xd01332, draft, XEdDSA signature over an X25519 key
870+
multiproof, multiformat, 0xd01330, draft, Multiproof proof-of-possession object
871+
wacc-script-with-pop, multiformat, 0xd01331, draft, WACC script with proof-of-possession envelope
869872
bs-message, multiformat, 0xd01400, draft, BetterSign signed+encrypted message multiformat
870873
scion, multiaddr, 0xd02000, draft, SCION Internet architecture
871874
ed25519-thresh-priv-share, key, 0xd03000, draft, Ed25519 FROST DKG threshold private key share

0 commit comments

Comments
 (0)