diff --git a/Cargo.toml b/Cargo.toml index cd55dfbf..4cf04e74 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,11 +16,11 @@ license = "MPL-2.0" minidom = "0.6.2" jid = { version = "0.3.1", features = ["minidom"] } base64 = "0.7.0" -digest = "0.6.0" -sha-1 = "0.4.0" -sha2 = "0.6.0" -sha3 = "0.6.0" -blake2 = "0.6.1" +digest = "0.7.1" +sha-1 = "0.7.0" +sha2 = "0.7.0" +sha3 = "0.7.0" +blake2 = "0.7.0" chrono = "0.4.0" try_from = "0.2.2" diff --git a/src/caps.rs b/src/caps.rs index 2b986795..27d511ca 100644 --- a/src/caps.rs +++ b/src/caps.rs @@ -16,7 +16,7 @@ use ns; use base64; use digest::Digest; -use sha_1::Sha1; +use sha1::Sha1; use sha2::{Sha256, Sha512}; use sha3::{Sha3_256, Sha3_512}; //use blake2::Blake2b; diff --git a/src/ecaps2.rs b/src/ecaps2.rs index 347d1dac..b4c407c2 100644 --- a/src/ecaps2.rs +++ b/src/ecaps2.rs @@ -15,11 +15,10 @@ use error::Error; use ns; use base64; -use digest::Digest; use sha2::{Sha256, Sha512}; use sha3::{Sha3_256, Sha3_512}; -//use blake2::Blake2b; -//use digest::{Digest, VariableOutput}; +use blake2::Blake2b; +use digest::{Digest, VariableOutput}; #[derive(Debug, Clone)] pub struct ECaps2 { @@ -144,9 +143,6 @@ pub fn hash_ecaps2(data: &[u8], algo: Algo) -> Result { let hash = hasher.result(); get_hash_vec(hash.as_slice()) }, - Algo::Blake2b_256 - | Algo::Blake2b_512 => panic!("See https://github.com/RustCrypto/hashes/issues/34"), - /* Algo::Blake2b_256 => { let mut hasher = Blake2b::default(); hasher.input(data); @@ -161,7 +157,6 @@ pub fn hash_ecaps2(data: &[u8], algo: Algo) -> Result { let hash = hasher.variable_result(&mut buf).unwrap(); get_hash_vec(hash) }, - */ Algo::Sha_1 => return Err(String::from("Disabled algorithm sha-1: unsafe.")), Algo::Unknown(algo) => return Err(format!("Unknown algorithm: {}.", algo)), }, @@ -452,7 +447,6 @@ mod tests { } #[test] - #[ignore] fn test_blake2b_512() { let hash = ecaps2::hash_ecaps2("abc".as_bytes(), Algo::Blake2b_512).unwrap(); let known_hash: Vec = vec!( diff --git a/src/lib.rs b/src/lib.rs index 4a40ae11..e5b5439c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -26,7 +26,7 @@ extern crate minidom; extern crate jid; extern crate base64; extern crate digest; -extern crate sha_1; +extern crate sha1; extern crate sha2; extern crate sha3; extern crate blake2;