[package]
name = "askar-crypto"
version = "0.2.1"
authors = ["Hyperledger Aries Contributors <aries@lists.hyperledger.org>"]
edition = "2018"
description = "Hyperledger Aries Askar cryptography"
license = "MIT OR Apache-2.0"
readme = "README.md"
repository = "https://github.com/hyperledger/aries-askar/"
categories = ["cryptography", "no-std"]
keywords = ["hyperledger", "aries", "didcomm", "ssi"]

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

[features]
default = ["alloc", "any_key", "all_keys", "crypto_box"]
alloc = []
std = ["alloc", "serde/std", "serde-json-core/std"]
all_keys = ["aes", "bls", "chacha", "ec_curves", "ed25519"]
any_key = ["alloc"]
aes = ["aes-core", "aes-gcm", "block-modes", "hmac"]
bls = ["bls12_381", "hkdf"]
chacha = ["chacha20poly1305"]
crypto_box = ["alloc", "crypto_box_rs", "ed25519", "getrandom"]
ec_curves = ["k256", "p256"]
ed25519 = ["curve25519-dalek", "ed25519-dalek", "x25519-dalek"]
getrandom = ["rand/getrandom"]

[dev-dependencies]
base64 = { version = "0.13", default-features = false, features = ["alloc"] }
criterion = "0.3"
hex-literal = "0.3"
serde_cbor = "0.11"
serde-json-core = { version = "0.4", default-features = false, features = ["std"] }

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

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

[dependencies]
aead = "0.3"
aes-core = { package = "aes", version = "0.6", default-features = false, optional = true }
aes-gcm = { version = "0.8", default-features = false, features = ["aes"], optional = true }
arbitrary = { version = "1.0", optional = true, features = ["derive"] }
argon2 = { version = "0.1", default-features = false, features = ["password-hash"], optional = true }
base64 = { version = "0.13", default-features = false }
blake2 = { version = "0.9", default-features = false }
block-modes = { version = "0.7", default-features = false, optional = true }
bls12_381 = { version = "0.4", default-features = false, features = ["groups"], optional = true }
chacha20 = { version = "0.6" }  # should match chacha20poly1305
chacha20poly1305 = { version = "0.7", default-features = false, features = ["chacha20", "xchacha20poly1305"], optional = true }
crypto_box_rs = { package = "crypto_box", version = "0.5", default-features = false, features = ["u64_backend"], optional = true }
curve25519-dalek = { version = "3.1", default-features = false, features = ["u64_backend"], optional = true }
ed25519-dalek = { version = "1.0", default-features = false, features = ["u64_backend"], optional = true }
digest = "0.9"
group = "0.9"
hkdf = { version = "0.11", optional = true }
hmac = { version = "0.11", optional = true }
k256 = { version = "0.9", default-features = false, features = ["arithmetic", "ecdsa", "ecdh", "sha256", "zeroize"], optional = true }
p256 = { version = "0.9", default-features = false, features = ["arithmetic", "ecdsa", "ecdh", "zeroize"], optional = true }
rand = { version = "0.8", default-features = false }
serde = { version = "1.0", default-features = false, features = ["derive"] }
serde-json-core = { version = "0.4", default-features = false }
subtle = "2.4"
sha2 = { version = "0.9", default-features = false }
x25519-dalek = { version = "1.1", default-features = false, features = ["u64_backend"], optional = true }
zeroize = { version = "1.4", features = ["zeroize_derive"] }
