[package]
name = "affinidi-tsp"
description = "Trust Spanning Protocol (TSP) implementation for the Affinidi TDK"
version = "0.1.10"
edition.workspace = true
authors.workspace = true
readme = "README.md"
homepage.workspace = true
license.workspace = true
keywords.workspace = true
repository.workspace = true
publish.workspace = true
rust-version.workspace = true

[features]
default = ["did-resolver"]
did-resolver = [
    "dep:affinidi-did-resolver-cache-sdk",
    "dep:affinidi-did-common",
    "dep:affinidi-encoding",
    "dep:tokio",
]
messaging-core = ["dep:affinidi-messaging-core", "dep:async-trait"]

[dependencies]
# Affinidi crates
affinidi-cesr = { path = "../../core/affinidi-cesr", version = "0.1" }
affinidi-messaging-core = { path = "../affinidi-messaging-core", version = "0.1", optional = true }

# Optional Affinidi crates (for DID-based VID resolution)
affinidi-did-resolver-cache-sdk = { path = "../../identity/affinidi-did-resolver-cache-sdk", version = "0.8", optional = true }
affinidi-did-common = { path = "../../identity/affinidi-did-common", version = "0.3", optional = true }
affinidi-encoding = { path = "../../core/affinidi-encoding", version = "0.1", optional = true }

# Crypto
ed25519-dalek = { version = "2", features = ["rand_core"] }
x25519-dalek = { version = "2", features = ["static_secrets"] }
hkdf = "0.12"
sha2 = "0.10"
## TSP mandates ChaCha20Poly1305 as the HPKE AEAD (spec Rev 2); see docs/tsp/interop.md.
chacha20poly1305 = "0.10"
rand_core = { version = "0.6", features = ["getrandom"] }
zeroize = { version = "1", features = ["derive"] }
blake2 = "0.10"

# Encoding / serialization
serde = { version = "1", features = ["derive"] }
serde_json = "1"
hex = "0.4"
url = { version = "2", features = ["serde"] }
thiserror = "2"

# Async (optional, for DID resolution and messaging-core)
tokio = { workspace = true, features = ["sync", "macros", "rt-multi-thread"], optional = true }
async-trait = { version = "0.1", optional = true }

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
hex = "0.4"

[lints]
workspace = true
