mirror of
https://github.com/spacedriveapp/spacedrive
synced 2024-07-07 05:33:27 +00:00
355ac191b8
* rebase: `crates/crypto` into current `main` * refactor: remove `mnemonic` module * feat: disable secure erase temporarily * fix: tsc * fix: tsc due to unused import * fix: remove `cli` crypto info * deps: update * chore: remove dead comment * refactor: remove `bincode` feature * refactor: give `keyring` a dedicated feature so it's not reliant on `sys` as well * fix: remove `aes-gcm` as it's no longer supported * refactor: remove dead comment * fix: update `keyring` imports * refactor: change tests to `aes-256-gcm` * feat: make `Key` a `Box<>` internally to ensure it's heap allocated (and fix tests) * chore: clippy * fix: hashing tests now that `const` keys aren't available this will be cleaned up with test vectors and `include_bytes!()` * chore: clippy * refactor: remove dead code * test: bring back `encrypt_with_invalid_nonce` test * fix: secret service keyring * fix: `zbus` build issues * doc: update comment for clearer reasoning * fix: cargo fmt * fix: use bytes directly * deps: update lockfile * fix: secret service keyring * fix: comment out windows keyring for now * fix: use session keyring if no keyring backend * fix: completely remove keyring module if no keyring is available for that OS * fix: clippy * fix: move iimport to correct conditional compilation * fix: fmt
146 lines
3.4 KiB
TOML
146 lines
3.4 KiB
TOML
[package]
|
|
name = "sd-crypto"
|
|
rust-version = "1.72.0"
|
|
version = "0.0.0"
|
|
authors = ["Jake Robinson <jake@spacedrive.com>"]
|
|
description = """
|
|
A cryptographic library that provides safe and high-level
|
|
encryption, hashing, and encoding interfaces.
|
|
"""
|
|
readme = "README.md"
|
|
keywords = ["crypto"]
|
|
edition = { workspace = true }
|
|
license = { workspace = true }
|
|
repository = { workspace = true }
|
|
|
|
[features]
|
|
sys = []
|
|
serde = [
|
|
"dep:serde",
|
|
"dep:serde_json",
|
|
"dep:serde-big-array",
|
|
"dep:serdect",
|
|
"bincode/serde",
|
|
]
|
|
keyring = ["dep:linux-keyutils", "dep:security-framework"]
|
|
secret-service = [
|
|
"keyring",
|
|
"dep:secret-service",
|
|
"dep:zbus",
|
|
] # explicit enabling required as the secret service api requires `zbus` and is messy
|
|
experimental = []
|
|
|
|
[dependencies]
|
|
# rng
|
|
rand_core = "0.9.0-alpha.0"
|
|
rand = "0.9.0-alpha.0"
|
|
rand_chacha = "0.9.0-alpha.0"
|
|
|
|
# hashing
|
|
argon2 = { version = "0.6.0-pre.0", default_features = false, features = [
|
|
"alloc",
|
|
"zeroize",
|
|
] }
|
|
balloon-hash = { version = "0.5.0-pre.0", default_features = false, features = [
|
|
"alloc",
|
|
"zeroize",
|
|
] }
|
|
blake3 = { version = "1.5.0", features = ["traits-preview", "zeroize"] }
|
|
|
|
# constant time
|
|
cmov = "0.3.1"
|
|
|
|
# aeads
|
|
aes-gcm-siv = "0.11.1"
|
|
chacha20poly1305 = "0.10.1"
|
|
thiserror = "1.0.57"
|
|
aead = { version = "0.5.2", default-features = false, features = ["stream"] }
|
|
bincode = { version = "2.0.0-rc.3", features = ["derive", "alloc"] }
|
|
|
|
zeroize = { version = "1.7.0", features = ["derive", "aarch64"] }
|
|
|
|
serde = { version = "1.0.197", features = ["derive"], optional = true }
|
|
serde_json = { version = "1.0.114", optional = true }
|
|
serde-big-array = { version = "0.5.1", optional = true }
|
|
serdect = { version = "0.3.0-pre.0", optional = true }
|
|
|
|
specta = { workspace = true, optional = true }
|
|
|
|
# for asynchronous crypto
|
|
tokio = { workspace = true, features = [
|
|
"io-util",
|
|
"rt-multi-thread",
|
|
"macros",
|
|
"sync",
|
|
], optional = true }
|
|
|
|
redb = "1.5.0"
|
|
|
|
hex = "0.4.3"
|
|
|
|
uuid = { version = "1.7.0", features = ["v4"] }
|
|
|
|
# ed25519-dalek = { version = "2.1.1", feature = ["std", "zeroize"] }
|
|
# x25519-dalek = { version = "2.0.1", feature = [
|
|
# "std",
|
|
# "zeroize",
|
|
# ] } # ReusableSecrets feature may have to come out for X3DH
|
|
|
|
# linux OS keyring
|
|
[target.'cfg(target_os = "linux")'.dependencies]
|
|
linux-keyutils = { version = "0.2.4", features = ["std"], optional = true }
|
|
secret-service = { version = "3.0.1", features = [
|
|
"crypto-rust",
|
|
], optional = true }
|
|
|
|
# this needs to remain at versions < 4, as they made some changes and i can't get it
|
|
# to compile for the time being
|
|
zbus = { version = "3.15.2", default_features = false, features = [
|
|
"tokio",
|
|
"blocking",
|
|
], optional = true }
|
|
|
|
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
|
|
security-framework = { version = "2.9.2", optional = true }
|
|
|
|
[dev-dependencies]
|
|
criterion = "0.5.1"
|
|
paste = "1.0.14"
|
|
tempfile = "3.10.1"
|
|
|
|
[[bench]]
|
|
path = "benches/crypto/aes-256-gcm-siv.rs"
|
|
name = "aes-256-gcm-siv"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
path = "benches/crypto/xchacha20-poly1305.rs"
|
|
name = "xchacha20-poly1305"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
path = "benches/hashing/argon2id.rs"
|
|
name = "argon2id"
|
|
bench = false
|
|
harness = false
|
|
|
|
[[bench]]
|
|
path = "benches/hashing/blake3-balloon.rs"
|
|
name = "blake3-balloon"
|
|
bench = false
|
|
harness = false
|
|
|
|
[[bench]]
|
|
path = "benches/hashing/blake3.rs"
|
|
name = "blake3"
|
|
harness = false
|
|
|
|
[[bench]]
|
|
path = "benches/hashing/blake3-kdf.rs"
|
|
name = "blake3-kdf"
|
|
harness = false
|
|
|
|
[[example]]
|
|
path = "examples/file_encryption.rs"
|
|
name = "file_encryption"
|