Skip to content

Commit

Permalink
Merge pull request cosmos#101 from confio/bump-deps
Browse files Browse the repository at this point in the history
Bump `sha2` and `sha3` crates to 0.10.2 and replace deprecated crate `ripemd160` with `ripemd`
  • Loading branch information
romac authored Aug 8, 2022
2 parents d939c08 + d11df9a commit ae335de
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ prost = { version = "0.11", default-features = false, features = ["prost-derive"
bytes = { version = "1.0.1", default-features = false }
hex = { version = "0.4.3", default-features = false, features = [ "alloc" ] }
anyhow = { version = "1.0.40", default-features = false }
sha2 = { version = "0.9.3", optional = true }
sha3 = { version = "0.9.1", optional = true }
ripemd160 = { version = "0.9.1", optional = true }
sha2 = { version = "0.10.2", optional = true }
sha3 = { version = "0.10.2", optional = true }
ripemd = { version = "0.1.1", optional = true }

[dev-dependencies]
sha2 = { version = "0.9.3" }
sha3 = { version = "0.9.1" }
ripemd160 = { version = "0.9.1" }
sha2 = { version = "0.10.2" }
sha3 = { version = "0.10.2" }
ripemd = { version = "0.1.1" }
serde = { version = "1.0.125", features = ["derive"] }
serde_json = "1.0.64"

Expand All @@ -38,5 +38,5 @@ std = [
"anyhow/std",
"sha2",
"sha3",
"ripemd160",
"ripemd",
]
6 changes: 3 additions & 3 deletions rust/src/host_functions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ pub trait HostFunctionsProvider {
#[cfg(any(feature = "std", test))]
pub mod host_functions_impl {
use crate::host_functions::HostFunctionsProvider;
use ripemd160::Ripemd160;
use sha2::{Digest, Sha256, Sha512, Sha512Trunc256};
use ripemd::Ripemd160;
use sha2::{Digest, Sha256, Sha512, Sha512_256};
use sha3::Sha3_512;

pub struct HostFunctionsManager;
Expand All @@ -42,7 +42,7 @@ pub mod host_functions_impl {
}

fn sha2_512_truncated(message: &[u8]) -> [u8; 32] {
let digest = Sha512Trunc256::digest(message);
let digest = Sha512_256::digest(message);
let mut buf = [0u8; 32];
buf.copy_from_slice(&digest);
buf
Expand Down

0 comments on commit ae335de

Please sign in to comment.