From f061c8ea82d2be094fb5ff03625366bf0e6bc1f1 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2020 11:09:36 +0000 Subject: [PATCH 1/3] Bump sha2 from 0.8.2 to 0.9.0 Bumps [sha2](https://github.com/RustCrypto/hashes) from 0.8.2 to 0.9.0. - [Release notes](https://github.com/RustCrypto/hashes/releases) - [Commits](https://github.com/RustCrypto/hashes/compare/sha2-v0.8.2...sha2-v0.9.0) Signed-off-by: dependabot-preview[bot] --- Cargo.lock | 16 ++-------------- compiler/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3fa513cb86..4ad998187c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -518,7 +518,7 @@ dependencies = [ "log", "pest", "rand", - "sha2 0.8.2", + "sha2", "snarkos-curves", "snarkos-errors", "snarkos-gadgets", @@ -904,18 +904,6 @@ dependencies = [ "opaque-debug", ] -[[package]] -name = "sha2" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a256f46ea78a0c0d9ff00077504903ac881a1dafdc20da66545699e7776b3e69" -dependencies = [ - "block-buffer 0.7.3", - "digest 0.8.1", - "fake-simd", - "opaque-debug", -] - [[package]] name = "sha2" version = "0.9.0" @@ -954,7 +942,7 @@ dependencies = [ "rand", "rand_chacha", "rayon", - "sha2 0.9.0", + "sha2", "smallvec", "snarkos-errors", "snarkos-models", diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index cbf4c1d846..203acd60b0 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -18,7 +18,7 @@ hex = { version = "0.4.2" } log = { version = "0.4" } pest = { version = "2.0" } rand = { version = "0.7" } -sha2 = { version = "0.8" } +sha2 = { version = "0.9" } thiserror = { version = "1.0" } [dev-dependencies] From 18b965583a649cf4828189b3448d0843f3901037 Mon Sep 17 00:00:00 2001 From: "dependabot-preview[bot]" <27856297+dependabot-preview[bot]@users.noreply.github.com> Date: Mon, 29 Jun 2020 20:12:50 +0000 Subject: [PATCH 2/3] Bump rusty-hook from 0.11.1 to 0.11.2 Bumps [rusty-hook](https://github.com/swellaby/rusty-hook) from 0.11.1 to 0.11.2. - [Release notes](https://github.com/swellaby/rusty-hook/releases) - [Commits](https://github.com/swellaby/rusty-hook/commits) Signed-off-by: dependabot-preview[bot] --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 336d80bd3d..bba5287dac 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -903,9 +903,9 @@ checksum = "4c691c0e608126e00913e33f0ccf3727d5fc84573623b8d65b2df340b5201783" [[package]] name = "rusty-hook" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27138b73a8ce63ae918707a5e3b57f9b0c0842a57b82f0e43474cf4e3aaf0ff4" +checksum = "96cee9be61be7e1cbadd851e58ed7449c29c620f00b23df937cb9cbc04ac21a3" dependencies = [ "ci_info", "getopts", diff --git a/Cargo.toml b/Cargo.toml index c41f2fb8aa..13ca606fca 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ walkdir = { version = "2" } zip = { version = "0.5" } [dev-dependencies] -rusty-hook = { version = "0.11.1" } +rusty-hook = { version = "0.11.2" } [profile.release] opt-level = 3 From 9854c8c983cc235b0b6736aa60ee18283fdb76be Mon Sep 17 00:00:00 2001 From: collin Date: Mon, 29 Jun 2020 14:11:12 -0700 Subject: [PATCH 3/3] use updated sha2 functions --- compiler/src/compiler.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compiler/src/compiler.rs b/compiler/src/compiler.rs index 8391446535..49c2348bb1 100644 --- a/compiler/src/compiler.rs +++ b/compiler/src/compiler.rs @@ -66,8 +66,8 @@ impl> Compiler { // Hash the file contents let mut hasher = Sha256::new(); - hasher.input(unparsed_file.as_bytes()); - let hash = hasher.result(); + hasher.update(unparsed_file.as_bytes()); + let hash = hasher.finalize(); Ok(hex::encode(hash)) }