open-standards/smart-byte/smart-byte-rs/crates/smart-byte-mdl/Cargo.toml
Transaction Science 7968cce275 smart-byte: unbreak the build — 47k LOC that had never been compiled
The identity pillar did not build. Not "was untested" — `cargo check` failed
at dependency resolution, before a single line was compiled. That went
unnoticed because no CI has ever built this workspace and no target/ tree
existed locally. 9 of 22 crates compiled; 13 did not, including the whole
credentials core: vc, bbs, pq, mdl, acdc, keri-witness, oidc4vc, didcomm,
zk, edv.

Every failure was a dependency declaration that had drifted ahead of the
code. Nothing was wrong with the cryptography.

Root cause, and it is one line: rand = "0.10" against code written for 0.8.
The crypto stack here — ed25519-dalek 2, curve25519-dalek 4, bls12_381 0.8,
bulletproofs 5 — all pin rand_core 0.6, which pairs with rand 0.8. rand 0.9
removed OsRng's infallible RngCore impl; 0.10 removed RngCore from the root
and replaced OsRng with SysRng. Reverting the pin recovered eight crates on
its own and let the original source stand unmodified. Two edits made while
chasing the 0.9 API were reverted once the correct pin proved them
unnecessary.

The rest:
  - rand_core `alloc` (zk) and cbc `std` (nostr): features that do not exist
    in those crates. These blocked *resolution*, so nothing could build.
  - rand_chacha 0.10 -> 0.3 (bbs, zk): dev-dependencies drifted independently
    of normal ones. The library compiled while test targets did not — caught
    only by --all-targets.
  - smart-byte-mdl pinned its own rand = "0.10" and had been partly migrated
    to the 0.9 API. Realigned to the workspace pin, reverted to 0.8 idiom.
  - hmac 0.13 moved new_from_slice from Mac to KeyInit (edv, nostr).
  - reqwest query() is behind the "query" feature (atproto).
  - aes 0.9/cbc 0.2 pull cipher 0.5; code uses the cipher 0.4 API. Aligned
    to aes 0.8 / cbc 0.1.
  - secp256k1 0.31 takes from_byte_array by value, bundles its own rand.

Seven lines of source changed, all mechanical call-site adjustments. The
remainder is manifests.

Result: `cargo check --workspace --all-targets` clean, `cargo test
--workspace` green — 616 passing across 90 test binaries. BBS+, the only
unlinkable credential primitive in the tree, compiles and passes its vectors
for the first time in this repository's history.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-08-24 23:41:24 -04:00

27 lines
803 B
TOML

[package]
name = "smart-byte-mdl"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
description = "ISO/IEC 18013-5 + 18013-7 mobile driving licence (mDL / mDOC) ingestion for Smart Byte."
[dependencies]
smart-byte-core = { workspace = true }
smart-byte-vc = { workspace = true }
serde = { workspace = true }
serde_cbor = { workspace = true }
ciborium = "0.2"
coset = "0.4"
chrono = { workspace = true }
p256 = { version = "0.14.0-rc.9", default-features = false, features = ["ecdsa", "alloc", "pem"] }
ecdsa = { version = "0.17.0-rc.18", features = ["der"] }
ed25519-dalek = { workspace = true }
rand = { workspace = true }
sha2 = "0.11"
base64 = "0.22"
thiserror = { workspace = true }
[dev-dependencies]
hex = "0.4"