summaryrefslogtreecommitdiffstats
path: root/Cargo.lock
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2021-11-04 15:58:03 +0100
committerJustus Winter <justus@sequoia-pgp.org>2021-11-04 16:23:48 +0100
commit17cd68fc56385a1db2bd0ddbb43cda5bd012e7c1 (patch)
tree057e17393ee2fd26447247c6818e7da0c595ea0e /Cargo.lock
parent62be3957d51efb2191b56c97c732583d02caf1ae (diff)
openpgp: Use XXH3 to hash packet bodies.
- When we stream packet bodies, we hash their contents so that we can compare them later on, even if we no longer have the data. Previously, we used the fasted hash from the SHA2 family, either SHA256 or SHA512 depending on the architecture. - That, however, turned out to be a major performance problem. When decrypting a non-compressed, binary file on amd64, we spent roughly a third of the time just to compute the hash. - Using the non-cryptographic hash function XXH3, we can greatly improve the performance. On my system, it is 30x as fast as SHA3, and reduces the overhead of computing the body hash considerably: % time ./sq-sha512 decrypt --recipient-key juliet.key.pgp 3g-for-juliet.binary.pgp >/dev/null 2>&1 13.931 total % time ./sq-xxh3 decrypt --recipient-key juliet.key.pgp 3g-for-juliet.binary.pgp >/dev/null 2>&1 9.264 total - See #771.
Diffstat (limited to 'Cargo.lock')
-rw-r--r--Cargo.lock7
1 files changed, 7 insertions, 0 deletions
diff --git a/Cargo.lock b/Cargo.lock
index d08a8d3f..3c66ff3f 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2875,6 +2875,7 @@ dependencies = [
"win-crypto-ng",
"winapi 0.3.9",
"x25519-dalek",
+ "xxhash-rust",
]
[[package]]
@@ -4007,6 +4008,12 @@ dependencies = [
]
[[package]]
+name = "xxhash-rust"
+version = "0.8.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "e575e15bedf6e57b5c2d763ffc6c3c760143466cbd09d762d539680ab5992ded"
+
+[[package]]
name = "yaml-rust"
version = "0.4.5"
source = "registry+https://github.com/rust-lang/crates.io-index"