dcrypt-algorithms 2.0.0

Cryptographic primitives for the dcrypt library
Documentation
[package]
name = "dcrypt-algorithms"
version.workspace = true
edition.workspace = true
authors.workspace = true
description = "Cryptographic primitives for the dcrypt library"
repository.workspace = true
license.workspace = true
publish = true

[features]
# Default features
default = ["std", "xof", "ec"]

# Standard library support - enables all features
std = [
    "alloc",
    "byteorder/std",
    "subtle/std",
    "hex/std",
    "rand/std",
    "getrandom/std",
    "serde_json",
    # Forward std to dependencies
    "dcrypt-api/std",
    "dcrypt-common/std",
    "dcrypt-internal/std",
    # Enable all algorithm features with std
    "hash", "xof", "aead", "block", "kdf", "mac", "stream", "ec"
]

# Allocator support - provides Vec, Box, String, etc.
alloc = [
    "dcrypt-api/alloc",
    "dcrypt-common/alloc",
]

# Algorithm feature groups
hash = []
xof = ["alloc"]
aead = ["alloc"]
block = []
kdf = ["alloc"]
mac = []
stream = []
ec = ["alloc", "groups", "pairings", "zeroize"]
groups = []
pairings = ["groups"]
experimental = []

# Optional features
serde_json = ["dep:serde_json", "dep:serde"]
zeroize = ["dep:zeroize"]

# Debug feature for pairing troubleshooting
pairing-debug = []

[dependencies]
# Internal dependencies
dcrypt-api = { path = "../api", version = "=2.0.0", default-features = false }
dcrypt-common = { path = "../common", version = "=2.0.0", default-features = false }
dcrypt-internal = { path = "../internal", version = "=2.0.0", default-features = false }
dcrypt-params = { path = "../params", version = "=2.0.0" }

# Core cryptographic dependencies
zeroize = { version = "1.5.7", features = ["zeroize_derive"], optional = true }
subtle = { version = "2.6.1", default-features = false }
byteorder = { version = "1.4.3", default-features = false }
chacha20poly1305 = { version = "0.10.1", default-features = false, features = ["alloc"] }

# Encoding/serialization
hex = { version = "0.4.3", default-features = false }
base64 = { version = "0.22.1", default-features = false, features = ["alloc"] }
faster-hex = { version = "0.6.1", optional = true }
serde = { version = "1.0.189", features = ["derive"], optional = true }
serde_json = { version = "1.0.107", optional = true }

# Random number generation
rand = { version = "0.8.6", default-features = false }
rand_core = { version = "0.6.4", default-features = false }
getrandom = { version = "0.2.15", default-features = false, optional = true, features = ["custom"] }

# Platform-specific dependencies
portable-atomic = { version = "1.6", default-features = false }

[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
rand_chacha = { version = "0.3.1", default-features = false }

[dev-dependencies]
criterion = { version = "0.5", features = ["html_reports"] }
serde = { version = "1.0.189", features = ["derive"] }
serde_json = "1.0.107"
rand = { version = "0.8.6", features = ["std", "std_rng"] }
rand_chacha = "0.3.1"

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

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

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

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

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

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

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

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

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

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

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

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

[package.metadata.docs.rs]
all-features = true
rustdoc-args = ["--cfg", "docsrs"]

[package.metadata.release]
publish = true