Skip to content

Commit

Permalink
Update dependency com_google_absl to v20240722 (#371)
Browse files Browse the repository at this point in the history
* Update dependency com_google_absl to v20240722

* fix

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: anakinxc <[email protected]>
  • Loading branch information
renovate[bot] and anakinxc authored Aug 16, 2024
1 parent f6c6fa8 commit 014c642
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 12 deletions.
6 changes: 3 additions & 3 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
],
)

Expand Down
26 changes: 17 additions & 9 deletions yacl/crypto/hash/blake3_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t> hash = blake3.Update(vector_bytes).CumulativeHash();

Expand All @@ -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<uint8_t> hash = blake3.Update(vector_bytes).CumulativeHash();

Expand All @@ -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<uint8_t> hash = blake3.Update(vector1_bytes)
.Reset()
.Update(vector2_bytes)
Expand All @@ -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<uint8_t> result = blake3.Update(vector1_bytes).CumulativeHash();
EXPECT_EQ(absl::BytesToHexString(
Expand All @@ -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
Expand Down Expand Up @@ -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<size_t>(BLAKE3_OUT_LEN));

Expand Down

0 comments on commit 014c642

Please sign in to comment.