Skip to content

Apache DataFusion SQL Query Engine

update md-5, sha2, blake2 (#1647)

xudong.w9c5ccae240ce
diff --git a/datafusion/Cargo.toml b/datafusion/Cargo.toml
index 6897780941..317ac2e130 100644
--- a/datafusion/Cargo.toml
+++ b/datafusion/Cargo.toml
@@ -64,9 +64,9 @@ pin-project-lite= "^0.2.7"
tokio = { version = "1.0", features = ["macros", "rt", "rt-multi-thread", "sync", "fs"] }
tokio-stream = "0.1"
log = "^0.4"
-md-5 = { version = "^0.9.1", optional = true }
-sha2 = { version = "^0.9.1", optional = true }
-blake2 = { version = "^0.9.2", optional = true }
+md-5 = { version = "^0.10.0", optional = true }
+sha2 = { version = "^0.10.1", optional = true }
+blake2 = { version = "^0.10.2", optional = true }
blake3 = { version = "1.0", optional = true }
ordered-float = "2.0"
unicode-segmentation = { version = "^1.7.1", optional = true }
diff --git a/datafusion/src/physical_plan/crypto_expressions.rs b/datafusion/src/physical_plan/crypto_expressions.rs
index 4ad3087753..2507a8d192 100644
--- a/datafusion/src/physical_plan/crypto_expressions.rs
+++ b/datafusion/src/physical_plan/crypto_expressions.rs
@@ -28,7 +28,7 @@ use arrow::{
},
datatypes::DataType,
};
-use blake2::{Blake2b, Blake2s, Digest};
+use blake2::{Blake2b512, Blake2s256, Digest};
use blake3::Hasher as Blake3;
use md5::Md5;
use sha2::{Sha224, Sha256, Sha384, Sha512};
@@ -115,8 +115,8 @@ impl DigestAlgorithm {
Self::Sha256 => digest_to_scalar!(Sha256, value),
Self::Sha384 => digest_to_scalar!(Sha384, value),
Self::Sha512 => digest_to_scalar!(Sha512, value),
- Self::Blake2b => digest_to_scalar!(Blake2b, value),
- Self::Blake2s => digest_to_scalar!(Blake2s, value),
+ Self::Blake2b => digest_to_scalar!(Blake2b512, value),
+ Self::Blake2s => digest_to_scalar!(Blake2s256, value),
Self::Blake3 => ScalarValue::Binary(value.as_ref().map(|v| {
let mut digest = Blake3::default();
digest.update(v.as_bytes());
@@ -145,8 +145,8 @@ impl DigestAlgorithm {
Self::Sha256 => digest_to_array!(Sha256, input_value),
Self::Sha384 => digest_to_array!(Sha384, input_value),
Self::Sha512 => digest_to_array!(Sha512, input_value),
- Self::Blake2b => digest_to_array!(Blake2b, input_value),
- Self::Blake2s => digest_to_array!(Blake2s, input_value),
+ Self::Blake2b => digest_to_array!(Blake2b512, input_value),
+ Self::Blake2s => digest_to_array!(Blake2s256, input_value),
Self::Blake3 => {
let binary_array: BinaryArray = input_value
.iter()