Use sha2 assembler optimization when possible

This commit is contained in:
Alexander Weiss 2023-04-18 22:22:56 +02:00
parent 23ae1e33e3
commit 34957af554
2 changed files with 15 additions and 1 deletions

10
Cargo.lock generated
View File

@ -2174,6 +2174,16 @@ dependencies = [
"cfg-if",
"cpufeatures",
"digest",
"sha2-asm",
]
[[package]]
name = "sha2-asm"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bf27176fb5d15398e3a479c652c20459d9dac830dedd1fa55b42a77dbcdbfcea"
dependencies = [
"cc",
]
[[package]]

View File

@ -35,7 +35,6 @@ crossbeam-channel = "0.5"
rayon = "1"
#crypto
aes256ctr_poly1305aes = "0.1"
sha2 = "0.10"
rand = "0.8"
scrypt = { version = "0.11", default-features = false }
# chunker / packer
@ -90,8 +89,13 @@ libc = "0.2"
rhai = {version = "1.13", features = ["sync", "serde", "no_optimize", "no_module", "no_custom_syntax", "only_i64"]}
[target.'cfg(not(windows))'.dependencies]
sha2 = { version = "0.10", features = ["asm"] }
users = "0.11"
[target.'cfg(windows)'.dependencies]
# unfortunately, the asm extensions do not build on MSVC, see https://github.com/RustCrypto/asm-hashes/issues/17
sha2 = "0.10"
[target.'cfg(not(any(windows, target_os="openbsd")))'.dependencies]
xattr = "1"