[package]
authors.workspace      = true
categories.workspace   = true
description            = "Miden Cryptographic primitives"
documentation          = "https://docs.rs/miden-crypto/0.18.0"
edition.workspace      = true
keywords.workspace     = true
license.workspace      = true
name                   = "miden-crypto"
readme                 = "../README.md"
repository.workspace   = true
rust-version.workspace = true
version.workspace      = true

[[bin]]
bench             = false
doctest           = false
name              = "miden-crypto"
path              = "src/main.rs"
required-features = ["executable"]

[[bench]]
harness           = false
name              = "encryption"
required-features = ["std"]

[[bench]]
harness           = false
name              = "hash"
required-features = ["std"]

[[bench]]
harness           = false
name              = "smt"
required-features = ["internal"]

[[bench]]
harness           = false
name              = "merkle"
required-features = ["std"]

[[bench]]
harness           = false
name              = "partial_mt"
required-features = ["std"]

[[bench]]
harness           = false
name              = "large-smt"
required-features = ["rocksdb"]

[[bench]]
harness           = false
name              = "store"
required-features = ["std"]

[[bench]]
harness           = false
name              = "dsa"
required-features = ["std"]

[[bench]]
harness           = false
name              = "word"
required-features = ["std"]

[[bench]]
harness           = false
name              = "rand"
required-features = ["std"]

[features]
concurrent = [
  "dep:rayon",
  "hashbrown?/rayon",
  "p3-maybe-rayon/parallel",
  "p3-miden-prover/parallel",
  "p3-util/parallel",
  "std",
]
default = ["concurrent", "std"]
executable = ["concurrent", "dep:clap", "dep:rand-utils"]
fuzzing = []
hashmaps = ["dep:hashbrown"]
internal = ["concurrent"]
rocksdb = ["concurrent", "dep:rocksdb"]
serde = ["dep:serde", "serde?/alloc"]
std = ["blake3/std", "dep:cc", "miden-serde-utils/std", "rand/std", "rand/thread_rng"]
testing = ["dep:proptest"]

[dependencies]
blake3                        = { default-features = false, version = "1.8" }
chacha20poly1305              = { features = ["alloc", "stream"], version = "0.10" }
clap                          = { features = ["derive"], optional = true, version = "4.5" }
curve25519-dalek              = { default-features = false, version = "4" }
ed25519-dalek                 = { features = ["zeroize"], version = "2" }
flume                         = { version = "0.11.1" }
hashbrown                     = { features = ["serde"], optional = true, version = "0.16" }
hkdf                          = { default-features = false, version = "0.12" }
k256                          = { features = ["ecdh", "ecdsa"], version = "0.13" }
miden-crypto-derive.workspace = true
miden-serde-utils.workspace   = true
num                           = { default-features = false, features = ["alloc", "libm"], version = "0.4" }
num-complex                   = { default-features = false, version = "0.4" }
proptest                      = { default-features = false, features = ["alloc"], optional = true, version = "1.7" }
rand                          = { default-features = false, version = "0.9" }
rand-utils                    = { optional = true, package = "winter-rand-utils", version = "0.13" }
rand_chacha                   = { default-features = false, version = "0.9" }
rand_core                     = { default-features = false, version = "0.9" }
rand_hc                       = { version = "0.3" }
rayon                         = { optional = true, version = "1.10" }
rocksdb                       = { default-features = false, features = ["bindgen-runtime", "lz4"], optional = true, version = "0.24" }
serde                         = { default-features = false, features = ["derive"], optional = true, version = "1.0" }
sha2                          = { default-features = false, version = "0.10" }
sha3                          = { default-features = false, version = "0.10" }
subtle                        = { default-features = false, version = "2.6" }
thiserror                     = { default-features = false, version = "2.0" }
x25519-dalek                  = { default-features = false, features = ["static_secrets"], version = "2.0" }

# Upstream Plonky3 dependencies
p3-air         = { default-features = false, version = "0.4.2" }
p3-blake3      = { default-features = false, version = "0.4.2" }
p3-challenger  = { default-features = false, version = "0.4.2" }
p3-commit      = { default-features = false, version = "0.4.2" }
p3-dft         = { default-features = false, version = "0.4.2" }
p3-field       = { default-features = false, version = "0.4.2" }
p3-goldilocks  = { default-features = false, version = "0.4.2" }
p3-keccak      = { default-features = false, version = "0.4.2" }
p3-matrix      = { default-features = false, version = "0.4.2" }
p3-maybe-rayon = { default-features = false, version = "0.4.2" }
p3-merkle-tree = { default-features = false, version = "0.4.2" }
p3-symmetric   = { default-features = false, version = "0.4.2" }
p3-util        = { default-features = false, version = "0.4.2" }

# Miden-specific Plonky3 crates
p3-miden-air    = { default-features = false, version = "0.4.2" }
p3-miden-fri    = { default-features = false, version = "0.4.2" }
p3-miden-prover = { default-features = false, version = "0.4.2" }

[dev-dependencies]
assert_matches = { default-features = false, version = "1.5" }
criterion      = { features = ["html_reports"], version = "0.7" }
hex            = { default-features = false, features = ["alloc"], version = "0.4" }
itertools      = { version = "0.14" }
proptest       = { default-features = false, features = ["alloc"], version = "1.7" }
rand-utils     = { package = "winter-rand-utils", version = "0.13" }
rstest         = { version = "0.26" }
seq-macro      = { version = "0.3" }
tempfile       = { version = "3.20" }

[build-dependencies]
cc   = { features = ["parallel"], optional = true, version = "1.2" }
glob = "0.3"

[lints]
workspace = true

[package.metadata.cargo-machete]
ignored = ["getrandom", "rand-utils"]

[[test]]
name              = "rocksdb_large_smt"
required-features = ["concurrent", "rocksdb"]
