Bump sha2 from 0.8.2 to 0.9.2 (#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](https://github.com/RustCrypto/hashes/compare/sha2-v0.8.2...streebog-v0.9.2)

Signed-off-by: dependabot[bot] <support@github.com>

* Fix compilation error

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
This commit is contained in:
dependabot[bot]
2021-01-11 11:58:26 +00:00
committed by GitHub
parent 0c1a7447bf
commit 6b4cc36c60
3 changed files with 6 additions and 6 deletions
+4 -4
View File
@@ -77,7 +77,7 @@ pub fn blake2_64(data: &[u8]) -> [u8; 8] {
/// Do a XX 64-bit hash and place result in `dest`.
pub fn twox_64_into(data: &[u8], dest: &mut [u8; 8]) {
use ::core::hash::Hasher;
use core::hash::Hasher;
let mut h0 = twox_hash::XxHash::with_seed(0);
h0.write(data);
let r0 = h0.finish();
@@ -94,7 +94,7 @@ pub fn twox_64(data: &[u8]) -> [u8; 8] {
/// Do a XX 128-bit hash and place result in `dest`.
pub fn twox_128_into(data: &[u8], dest: &mut [u8; 16]) {
use ::core::hash::Hasher;
use core::hash::Hasher;
let mut h0 = twox_hash::XxHash::with_seed(0);
let mut h1 = twox_hash::XxHash::with_seed(1);
h0.write(data);
@@ -163,8 +163,8 @@ pub fn keccak_512(data: &[u8]) -> [u8; 64] {
/// Do a sha2 256-bit hash and return result.
pub fn sha2_256(data: &[u8]) -> [u8; 32] {
let mut hasher = Sha256::new();
hasher.input(data);
hasher.update(data);
let mut output = [0u8; 32];
output.copy_from_slice(&hasher.result());
output.copy_from_slice(&hasher.finalize());
output
}