From 014c642b7328f3cc5b18b51fe64f29b56e9c05ea Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 16 Aug 2024 13:23:44 +0800 Subject: [PATCH] Update dependency com_google_absl to v20240722 (#371) * Update dependency com_google_absl to v20240722 * fix --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: anakinxc --- bazel/repositories.bzl | 6 +++--- yacl/crypto/hash/blake3_test.cc | 26 +++++++++++++++++--------- 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index d9507ef6..25b6599b 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -156,11 +156,11 @@ def _com_google_absl(): maybe( http_archive, name = "com_google_absl", - sha256 = "733726b8c3a6d39a4120d7e45ea8b41a434cdacde401cba500f14236c49b39dc", + sha256 = "f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3", type = "tar.gz", - strip_prefix = "abseil-cpp-20240116.2", + strip_prefix = "abseil-cpp-20240722.0", urls = [ - "https://github.com/abseil/abseil-cpp/archive/refs/tags/20240116.2.tar.gz", + "https://github.com/abseil/abseil-cpp/archive/refs/tags/20240722.0.tar.gz", ], ) diff --git a/yacl/crypto/hash/blake3_test.cc b/yacl/crypto/hash/blake3_test.cc index 64f170ba..f9f89dc0 100644 --- a/yacl/crypto/hash/blake3_test.cc +++ b/yacl/crypto/hash/blake3_test.cc @@ -53,7 +53,9 @@ TestData test_data_blake3 = { TEST(Blake3HashTest, TestVector1) { Blake3Hash blake3; - std::string vector_bytes = absl::HexStringToBytes(test_data_blake3.vector1); + std::string vector_bytes; + + ASSERT_TRUE(absl::HexStringToBytes(test_data_blake3.vector1, &vector_bytes)); std::vector hash = blake3.Update(vector_bytes).CumulativeHash(); @@ -64,7 +66,8 @@ TEST(Blake3HashTest, TestVector1) { TEST(Blake3HashTest, TestVector2) { Blake3Hash blake3; - std::string vector_bytes = absl::HexStringToBytes(test_data_blake3.vector2); + std::string vector_bytes; + ASSERT_TRUE(absl::HexStringToBytes(test_data_blake3.vector2, &vector_bytes)); std::vector hash = blake3.Update(vector_bytes).CumulativeHash(); @@ -77,8 +80,10 @@ TEST(Blake3HashTest, TestVector2) { // a clean state, allowing a new hash operation to take place. TEST(Blake3HashTest, ResetBetweenUpdates) { Blake3Hash blake3; - std::string vector1_bytes = absl::HexStringToBytes(test_data_blake3.vector1); - std::string vector2_bytes = absl::HexStringToBytes(test_data_blake3.vector2); + std::string vector1_bytes; + ASSERT_TRUE(absl::HexStringToBytes(test_data_blake3.vector1, &vector1_bytes)); + std::string vector2_bytes; + ASSERT_TRUE(absl::HexStringToBytes(test_data_blake3.vector2, &vector2_bytes)); std::vector hash = blake3.Update(vector1_bytes) .Reset() .Update(vector2_bytes) @@ -92,8 +97,10 @@ TEST(Blake3HashTest, ResetBetweenUpdates) { // calls to Update. TEST(Blake3HashTest, MultipleUpdates) { Blake3Hash blake3; - std::string vector1_bytes = absl::HexStringToBytes(test_data_blake3.vector1); - std::string suffix_bytes = absl::HexStringToBytes(test_data_blake3.suffix); + std::string vector1_bytes; + ASSERT_TRUE(absl::HexStringToBytes(test_data_blake3.vector1, &vector1_bytes)); + std::string suffix_bytes; + ASSERT_TRUE(absl::HexStringToBytes(test_data_blake3.suffix, &suffix_bytes)); std::vector result = blake3.Update(vector1_bytes).CumulativeHash(); EXPECT_EQ(absl::BytesToHexString( @@ -115,8 +122,8 @@ TEST(Blake3HashTest, CustomOutLength) { for (size_t i = 0; i <= (8 * BLAKE3_OUT_LEN); i++) { Blake3Hash blake3(i); - std::string vector1_bytes = - absl::HexStringToBytes(test_data_blake3.vector1); + std::string vector1_bytes; + ASSERT_TRUE(absl::HexStringToBytes(test_data_blake3.vector1, &vector1_bytes)); // Shorter outputs are prefixes of longer ones. // reference @@ -145,7 +152,8 @@ TEST(Blake3HashTest, MaximumLength) { Blake3Hash blake3(max_size); - std::string vector1_bytes = absl::HexStringToBytes(test_data_blake3.vector1); + std::string vector1_bytes; + ASSERT_TRUE(absl::HexStringToBytes(test_data_blake3.vector1, &vector1_bytes)); auto len = std::min(max_size, static_cast(BLAKE3_OUT_LEN));