[package]
name = "tuta-sdk"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license-file.workspace = true
homepage.workspace = true

[lib]
name = "tutasdk"
crate-type = ["cdylib", "staticlib", "lib"]

[dependencies]
crypto-primitives = { workspace = true }
async-trait = "0.1.77"
thiserror = "2.0"
futures = "0.3.31"
serde_bytes = "0.11.15"
num_enum = "0.7.3"
minicbor = { version = "0.25", features = ["std", "alloc"] }
const-hex = { version = "1.12.0", features = ["serde"] }
lz4_flex = { version = "0.11.3", default-features = false, features = [
    "safe-encode",
    "safe-decode",
    "std",
] }
time = { version = "0.3.37", features = ["serde", "macros", "local-offset"] }
time-tz = { version = "2.0.0", features = ["db", "posix-tz"] }

aes = { version = "0.8.4", features = ["zeroize"] }
cbc = { version = "0.1.2", features = ["std", "zeroize"] }
sha2 = "0.10.8"
hmac = "0.12.1"
zeroize = { version = "1.8.1", features = ["zeroize_derive"] }
hkdf = "0.12.4"
argon2 = { version = "0.5.3", features = ["zeroize"] }
curve25519-dalek = "4.1.2"
pqcrypto-mlkem = { version = "0.1.0", default-features = false, features = [
    "std",
] }
pqcrypto-traits = "0.3.5"
rsa = "0.9.6"
sha3 = "0.10.8"
rand_core = { version = "0.6.4", features = ["getrandom"] }

log = { workspace = true }
base64 = { workspace = true }
tokio = { workspace = true, features = [
    "rt",
    "rt-multi-thread",
    "macros",
    "sync",
    "time",
] }
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
uniffi = { workspace = true }

# only used for the native rest client
hyper = { version = "1.5", features = ["client"], optional = true }
hyper-util = { version = "0.1.10", features = ["full"], optional = true }
http-body-util = { version = "0.1.2", optional = true }
hyper-rustls = { version = "0.27.5", features = [
    "ring",
    "http2",
], optional = true }
rustls = { version = "*", optional = true }
form_urlencoded = "1"

# allow initializing a simple_logger if the consuming application (or examples) want to do that.
simple_logger = { version = "5.0.0", optional = true }
regex = "1.11.1"

[target.'cfg(target_os = "android")'.dependencies]
android_log = "0.1.3"
[target.'cfg(target_os = "ios")'.dependencies]
oslog = "0.2.0"

[build-dependencies]
uniffi = { workspace = true, features = ["build"] }

[features]
net = [
    "dep:hyper",
    "dep:hyper-util",
    "dep:http-body-util",
    "dep:hyper-rustls",
    "dep:rustls",
]
# turns on the simple_logger logger when the sdk is initialized.
logging = ["dep:simple_logger"]
testing = ["logging"]
test-with-local-http-server = []

[dev-dependencies]
tokio = { workspace = true, features = ["macros", "rt-multi-thread"] }
tuta-sdk = { path = ".", features = ["net", "testing"] }
mockall = { version = "0.13.0" }
mockall_double = { version = "0.3.1" }
rand = { workspace = true }
crypto-primitives = { path = "../crypto-primitives", features = ["test_utils"] }

[lints]
workspace = true