Skip to content
This repository was archived by the owner on Feb 21, 2024. It is now read-only.

Commit 8b3e4c8

Browse files
Bump sha2 from 0.8.2 to 0.9.2 (paritytech#7643)
* Bump sha2 from 0.8.2 to 0.9.2 Bumps [sha2](https://github.com/RustCrypto/hashes) from 0.8.2 to 0.9.2. - [Release notes](https://github.com/RustCrypto/hashes/releases) - [Commits](RustCrypto/hashes@sha2-v0.8.2...streebog-v0.9.2) Signed-off-by: dependabot[bot] <[email protected]> * Fix compilation error Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bastian Köcher <[email protected]>
1 parent f6ca02d commit 8b3e4c8

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

primitives/core/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ ed25519-dalek = { version = "1.0.1", default-features = false, features = ["u64_
4646
blake2-rfc = { version = "0.2.18", default-features = false, optional = true }
4747
tiny-keccak = { version = "2.0.1", features = ["keccak"], optional = true }
4848
schnorrkel = { version = "0.9.1", features = ["preaudit_deprecated", "u64_backend"], default-features = false, optional = true }
49-
sha2 = { version = "0.8.0", default-features = false, optional = true }
49+
sha2 = { version = "0.9.2", default-features = false, optional = true }
5050
hex = { version = "0.4", default-features = false, optional = true }
5151
twox-hash = { version = "1.5.0", default-features = false, optional = true }
5252
libsecp256k1 = { version = "0.3.2", default-features = false, features = ["hmac"], optional = true }

primitives/core/src/hashing.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ pub fn blake2_64(data: &[u8]) -> [u8; 8] {
7777

7878
/// Do a XX 64-bit hash and place result in `dest`.
7979
pub fn twox_64_into(data: &[u8], dest: &mut [u8; 8]) {
80-
use ::core::hash::Hasher;
80+
use core::hash::Hasher;
8181
let mut h0 = twox_hash::XxHash::with_seed(0);
8282
h0.write(data);
8383
let r0 = h0.finish();
@@ -94,7 +94,7 @@ pub fn twox_64(data: &[u8]) -> [u8; 8] {
9494

9595
/// Do a XX 128-bit hash and place result in `dest`.
9696
pub fn twox_128_into(data: &[u8], dest: &mut [u8; 16]) {
97-
use ::core::hash::Hasher;
97+
use core::hash::Hasher;
9898
let mut h0 = twox_hash::XxHash::with_seed(0);
9999
let mut h1 = twox_hash::XxHash::with_seed(1);
100100
h0.write(data);
@@ -163,8 +163,8 @@ pub fn keccak_512(data: &[u8]) -> [u8; 64] {
163163
/// Do a sha2 256-bit hash and return result.
164164
pub fn sha2_256(data: &[u8]) -> [u8; 32] {
165165
let mut hasher = Sha256::new();
166-
hasher.input(data);
166+
hasher.update(data);
167167
let mut output = [0u8; 32];
168-
output.copy_from_slice(&hasher.result());
168+
output.copy_from_slice(&hasher.finalize());
169169
output
170170
}

0 commit comments

Comments
 (0)