From 9c8f13608f5f513728d345b6e5a3728365b1c7ae Mon Sep 17 00:00:00 2001 From: Martin von Zweigbergk Date: Thu, 24 Dec 2020 01:15:38 -0800 Subject: [PATCH] cargo: update blake2 For no reason other than to stay up to date. --- Cargo.lock | 52 ++++++++++++++++++++++++++++++------------ Cargo.toml | 2 +- lib/Cargo.toml | 2 +- lib/src/index.rs | 4 ++-- lib/src/local_store.rs | 8 +++---- 5 files changed, 46 insertions(+), 22 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e6f74590c..eede31d8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -61,14 +61,13 @@ checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" [[package]] name = "blake2" -version = "0.8.1" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94cb07b0da6a73955f8fb85d24c466778e70cda767a568229b104f0264089330" +checksum = "10a5720225ef5daecf08657f23791354e1685a8c91a4c60c7f3d3b2892f978f4" dependencies = [ - "byte-tools", "crypto-mac", - "digest", - "opaque-debug", + "digest 0.9.0", + "opaque-debug 0.3.0", ] [[package]] @@ -91,7 +90,7 @@ dependencies = [ "block-padding", "byte-tools", "byteorder", - "generic-array", + "generic-array 0.12.3", ] [[package]] @@ -298,11 +297,11 @@ dependencies = [ [[package]] name = "crypto-mac" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4434400df11d95d556bac068ddfedd482915eb18fe8bea89bc80b6e4b1c179e5" +checksum = "b584a330336237c1eecd3e94266efb216c56ed91225d634cb2991c5f3fd1aeab" dependencies = [ - "generic-array", + "generic-array 0.14.4", "subtle", ] @@ -340,7 +339,16 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array", + "generic-array 0.12.3", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array 0.14.4", ] [[package]] @@ -385,6 +393,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "generic-array" +version = "0.14.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.1.15" @@ -729,6 +747,12 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c" +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + [[package]] name = "openssl-probe" version = "0.1.2" @@ -1122,9 +1146,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" dependencies = [ "block-buffer", - "digest", + "digest 0.8.1", "fake-simd", - "opaque-debug", + "opaque-debug 0.2.3", ] [[package]] @@ -1141,9 +1165,9 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "subtle" -version = "1.0.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d67a5a62ba6e01cb2192ff309324cb4875d0c451d55fe2319433abe7a05a8ee" +checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" diff --git a/Cargo.toml b/Cargo.toml index 92c08ee4d..a3c7284a7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ edition = "2018" path = "lib" [dependencies] -blake2 = "0.8" +blake2 = "0.9.1" bytes = "0.5" chrono = "0.4" clap = "2.33" diff --git a/lib/Cargo.toml b/lib/Cargo.toml index d975d710c..350850fbb 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" protobuf-codegen-pure = "2.12" [dependencies] -blake2 = "0.8" +blake2 = "0.9.1" bytes = "0.5" byteorder = "1.3.4" chrono = "0.4" diff --git a/lib/src/index.rs b/lib/src/index.rs index 69f5f75bf..010641625 100644 --- a/lib/src/index.rs +++ b/lib/src/index.rs @@ -1004,8 +1004,8 @@ impl IndexFile { let buf = data.serialize(); let mut hasher = Blake2b::new(); - hasher.input(&buf); - let index_file_id_hex = hex::encode(&hasher.result()); + hasher.update(&buf); + let index_file_id_hex = hex::encode(&hasher.finalize()); let index_file_path = dir.join(&index_file_id_hex); let mut temp_file = NamedTempFile::new_in(&dir)?; diff --git a/lib/src/local_store.rs b/lib/src/local_store.rs index b5fe9c81c..c9cafdf9f 100644 --- a/lib/src/local_store.rs +++ b/lib/src/local_store.rs @@ -132,10 +132,10 @@ impl Store for LocalStore { break; } encoder.write_all(&buff)?; - hasher.input(&buff); + hasher.update(&buff); } encoder.finish()?; - let id = FileId(hasher.result().to_vec()); + let id = FileId(hasher.finalize().to_vec()); temp_file.persist(self.file_path(&id))?; Ok(id) @@ -153,8 +153,8 @@ impl Store for LocalStore { let mut temp_file = NamedTempFile::new_in(&self.path)?; temp_file.write_all(target.as_bytes()).unwrap(); let mut hasher = Blake2b::new(); - hasher.input(&target.as_bytes()); - let id = SymlinkId(hasher.result().to_vec()); + hasher.update(&target.as_bytes()); + let id = SymlinkId(hasher.finalize().to_vec()); temp_file.persist(self.symlink_path(&id))?; Ok(id)