[package]
name        = "quicproquo-core"
version     = "0.1.0"
edition     = "2021"
description = "Crypto primitives, MLS state machine, and hybrid post-quantum KEM for quicproquo."
license     = "MIT"

[features]
default = ["native"]
# The "native" feature enables MLS (openmls), OPAQUE, Cap'n Proto, tokio, and
# filesystem-backed key storage. Disable it (--no-default-features) to compile
# the pure-crypto subset to wasm32-unknown-unknown.
native = [
    "dep:openmls",
    "dep:openmls_rust_crypto",
    "dep:openmls_traits",
    "dep:tls_codec",
    "dep:opaque-ke",
    "dep:bincode",
    "dep:capnp",
    "dep:quicproquo-proto",
    "dep:tokio",
]

[dependencies]
# Crypto — classical (always available, WASM-safe)
x25519-dalek        = { workspace = true }
ed25519-dalek       = { workspace = true }
sha2                = { workspace = true }
hmac                = { workspace = true }
hkdf                = { workspace = true }
ciborium            = { workspace = true }
chacha20poly1305    = { workspace = true }
zeroize             = { workspace = true }
rand                = { workspace = true }
serde               = { workspace = true }
serde_json          = { workspace = true }
argon2              = { workspace = true }
thiserror           = { workspace = true }

# Crypto — post-quantum hybrid KEM (M7) — always available, WASM-safe
ml-kem              = { workspace = true }

# Crypto — OPAQUE password-authenticated key exchange (native only)
opaque-ke           = { workspace = true, optional = true }

# Crypto — MLS (M2) (native only)
openmls             = { workspace = true, optional = true }
openmls_rust_crypto = { workspace = true, optional = true }
openmls_traits      = { workspace = true, optional = true }
tls_codec           = { workspace = true, optional = true }
bincode             = { workspace = true, optional = true }

# Serialisation (native only)
capnp               = { workspace = true, optional = true }
quicproquo-proto    = { path = "../quicproquo-proto", optional = true }

# Async runtime (native only)
tokio               = { workspace = true, optional = true }

# WASM: provide getrandom with js backend
[target.'cfg(target_arch = "wasm32")'.dependencies]
getrandom           = { version = "0.2", features = ["js"] }

[lints]
workspace = true

[dev-dependencies]
tokio               = { workspace = true }
criterion           = { version = "0.5", features = ["html_reports"] }
prost               = "0.13"

[[bench]]
name = "serialization"
harness = false

[[bench]]
name = "mls_operations"
harness = false

[[bench]]
name = "hybrid_kem_bench"
harness = false

[[bench]]
name = "crypto_benchmarks"
harness = false
