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

[lib]
crate-type = ["cdylib", "rlib"]

[features]
default = ["console_error_panic_hook"]
# Only enable this when compiling for testing. It provides some extra functions such as for compatibility tests,
test_utils = []

[dependencies]
tsify = { version = "0.4.5", features = ["js"] }
wasm-bindgen = "0.2.100"
serde = { workspace = true, features = ["derive"] }
serde_json = { workspace = true }
const-hex = { version = "1.12.0", features = ["serde"] }
serde-wasm-bindgen = "0.6.5"
serde-big-array = "0.5.1"

base64 = { workspace = true }
getrandom = { version = "0.2", features = [
    "js",
] } # needed for the js feature in rand_core
rand_core = { version = "0.6.4", features = ["getrandom"] }
ed25519-dalek = { version = "2.1.1", features = ["rand_core", "zeroize"] }
zeroize = { version = "1.8.1", features = ["zeroize_derive"] }
thiserror = "2.0"

# The `console_error_panic_hook` crate provides better debugging of panics by
# logging them with `console.error`. This is great for development, but requires
# all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
# code size when deploying.
console_error_panic_hook = { version = "0.1.7", optional = true }

[dev-dependencies]
# Allow enabling features for testing see: https://github.com/kartva/cargo-optional-features-for-testing-and-examples?tab=readme-ov-file
crypto-primitives = { path = ".", default-features = false, features = ["test_utils"] }
wasm-bindgen-test = "0.3.34"