[package]
name = "mftp"
version = "0.2.2"
edition = "2021"
description = "High-throughput file transfer over high-latency internet links"
license = "MIT"
repository = "https://github.com/OmarHermannsson/mftp"
homepage = "https://github.com/OmarHermannsson/mftp"
documentation = "https://github.com/OmarHermannsson/mftp#readme"
keywords = ["file-transfer", "quic", "network", "ssh", "transfer"]
categories = ["command-line-utilities", "network-programming"]
exclude = ["tests/results/", "*.data", "*.data.old", ".claudeignore", "CLAUDE.md"]

[[bin]]
name = "mftp"
path = "src/main.rs"

[lib]
name = "mftp"
path = "src/lib.rs"

[dependencies]
# QUIC transport
# default-features = false drops aws-lc-rs (a C library) from both rustls and
# tokio-rustls; we only use the pure-Rust ring provider.
quinn = { version = "0.11", default-features = false, features = ["rustls-ring", "runtime-tokio"] }
rustls = { version = "0.23", default-features = false, features = ["ring", "std", "logging", "tls12"] }
tokio-rustls = { version = "0.26", default-features = false, features = ["ring"] }
rcgen = "0.13"
socket2 = { version = "0.5", features = ["all"] }

# Async runtime
tokio = { version = "1", features = ["full"] }
tokio-util = { version = "0.7", features = ["io"] }

# CLI
clap = { version = "4", features = ["derive"] }

# Serialization (protocol messages + SSH handshake)
serde = { version = "1", features = ["derive"] }
serde_json = "1"
bincode = "1"

# Compression
zstd = "0.13"

# Hashing / integrity
blake3 = "1"
sha2 = "0.10"   # kept for TLS cert fingerprints and SSH key display
hex = "0.4"

# Forward error correction
reed-solomon-erasure = "6"

# Progress reporting
indicatif = "0.17"
console = "0.15"

# Error handling
anyhow = "1"

# Logging
tracing = "0.1"
tracing-subscriber = { version = "0.3", features = ["env-filter"] }

# HTTP client (GitHub release binary download)
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }

# SSH / SFTP (for the SFTP fallback transport)
ssh2 = "0.9"
base64 = "0.22"
# HMAC-SHA1 for hashed known_hosts verification
hmac = "0.12"
sha1 = "0.10"

# Config file (~/.config/mftp/config.toml)
toml = "0.8"
dirs = "5"

# Misc
async-channel = "2"
bytes = "1"
futures = "0.3"
libc = "0.2"
walkdir = "2"

openssl = { version = "0.10.77", features = ["vendored"] }
mimalloc = "0.1"

[dev-dependencies]
tempfile = "3"
tokio-test = "0.4"
criterion = "0.5"

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

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

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

# On Windows, libssh2-sys can't find a system OpenSSL — vendor it from source.
[target.'cfg(windows)'.dependencies]
openssl = { version = "0.10", features = ["vendored"] }

[profile.release]
opt-level = 3
lto = "fat"
codegen-units = 1
strip = true
# Trap on integer overflow rather than silently wrapping.  This is a transfer
# tool parsing attacker-influenced sizes/counts off the wire; a panic on a
# wrapped length is far safer than a wraparound feeding an undersized buffer.
# The arithmetic cost is negligible next to the network and crypto work.
overflow-checks = true
