Skip to content

Commit

Permalink
Update yacl (#181)
Browse files Browse the repository at this point in the history
* Update yacl

* format
  • Loading branch information
anakinxc authored Sep 13, 2024
1 parent 6a339a0 commit 00baa29
Show file tree
Hide file tree
Showing 13 changed files with 24 additions and 16 deletions.
6 changes: 3 additions & 3 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,10 @@ def _yacl():
http_archive,
name = "yacl",
urls = [
"https://github.com/secretflow/yacl/archive/refs/tags/0.4.5b4_nightly_20240731.tar.gz",
"https://github.com/secretflow/yacl/archive/refs/tags/0.4.5b5_nightly_20240913.tar.gz",
],
strip_prefix = "yacl-0.4.5b4_nightly_20240731",
sha256 = "952715bd56f6d9386984e9963426a1399bd2bd3702cf3efede9c82591cfab99b",
strip_prefix = "yacl-0.4.5b5_nightly_20240913",
sha256 = "04b332246e3ccb57b5dd612353ed2e84f894e5537a3e854c020c8172793c07d6",
)

def _bazel_platform():
Expand Down
1 change: 0 additions & 1 deletion bazel/seal.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ psi_cmake_external(
# "CpuFeatures_DIR": "$EXT_BUILD_DEPS/cpu_features/lib/cmake/CpuFeatures/",
# "EXT_BUILD_DEPS": "$EXT_BUILD_DEPS",
# "SEAL_USE_INTEL_HEXL": "ON",

},
lib_source = "@com_github_microsoft_seal//:all",
out_include_dir = "include/SEAL-4.1",
Expand Down
1 change: 1 addition & 0 deletions psi/apsi_wrapper/utils/csv_reader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "psi/apsi_wrapper/utils/csv_reader.h"

#include "fmt/format.h"
#include "fmt/ranges.h"

#include "psi/utils/multiplex_disk_cache.h"

Expand Down
6 changes: 4 additions & 2 deletions psi/legacy/bucket_psi_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -541,8 +541,10 @@ TEST(UnbalancedPsiTest, EcdhOprfUnbalanced) {
{
std::ofstream wf(ecdh_secret_key_path, std::ios::out | std::ios::binary);

std::string secret_key_binary = absl::HexStringToBytes(
"000102030405060708090a0b0c0d0e0ff0e0d0c0b0a090807060504030201000");
std::string secret_key_binary;
(void)absl::HexStringToBytes(
"000102030405060708090a0b0c0d0e0ff0e0d0c0b0a090807060504030201000",
&secret_key_binary);
wf.write(secret_key_binary.data(), secret_key_binary.length());
wf.close();
}
Expand Down
6 changes: 4 additions & 2 deletions psi/legacy/bucket_ub_psi_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ void WriteCsvFile(const std::string &file_name, const std::string &column_id,
void WriteSecretKey(const std::string &ecdh_secret_key_path) {
std::ofstream wf(ecdh_secret_key_path, std::ios::out | std::ios::binary);

std::string secret_key_binary = absl::HexStringToBytes(
"000102030405060708090a0b0c0d0e0ff0e0d0c0b0a090807060504030201000");
std::string secret_key_binary;
(void)absl::HexStringToBytes(
"000102030405060708090a0b0c0d0e0ff0e0d0c0b0a090807060504030201000",
&secret_key_binary);
wf.write(secret_key_binary.data(), secret_key_binary.length());
wf.close();
}
Expand Down
4 changes: 2 additions & 2 deletions psi/legacy/mini_psi/mini_psi.cc
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ struct MiniPsiSendCtx {
aes_ecb = std::make_shared<yacl::crypto::SymmetricCrypto>(
yacl::crypto::SymmetricCrypto::CryptoType::AES128_ECB, aes_key, 0);

prime256_str = absl::HexStringToBytes(kPrimeOver256bHexStr);
(void)absl::HexStringToBytes(kPrimeOver256bHexStr, &prime256_str);
}

void RecvPolynomialCoeff(
Expand Down Expand Up @@ -204,7 +204,7 @@ struct MiniPsiSendCtx {

struct MiniPsiRecvCtx {
MiniPsiRecvCtx() {
prime256_str = absl::HexStringToBytes(kPrimeOver256bHexStr);
(void)absl::HexStringToBytes(kPrimeOver256bHexStr, &prime256_str);
}

void GenerateSeeds(size_t data_size) {
Expand Down
4 changes: 3 additions & 1 deletion psi/legacy/mini_psi/polynomial_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ TEST_P(PolynomialBnTest, Works) {
yacl::crypto::Prg<uint64_t> prg1(rd());
yacl::crypto::Prg<uint64_t> prg2(rd());

std::string prime_data = absl::HexStringToBytes(kPrimeOver256bHexStr);
std::string prime_data;

(void)absl::HexStringToBytes(kPrimeOver256bHexStr, &prime_data);

for (uint64_t i = 0; i < polynomial_order; ++i) {
poly_x[i].resize(kBnByteSize);
Expand Down
2 changes: 1 addition & 1 deletion psi/rr22/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ psi_cc_library(
"@yacl//yacl/crypto/tools:ro",
"@yacl//yacl/kernel/algorithms:silent_vole",
"@yacl//yacl/link",
"@yacl//yacl/math/f2k",
"@yacl//yacl/math/galois_field:gf_intrinsic",
"@yacl//yacl/utils:parallel",
],
)
Expand Down
2 changes: 1 addition & 1 deletion psi/rr22/rr22_oprf.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "yacl/crypto/rand/rand.h"
#include "yacl/crypto/tools/prg.h"
#include "yacl/crypto/tools/ro.h"
#include "yacl/math/f2k/f2k.h"
#include "yacl/math/galois_field/gf_intrinsic.h"
#include "yacl/utils/parallel.h"

#include "psi/rr22/davis_meyer_hash.h"
Expand Down
3 changes: 1 addition & 2 deletions psi/rr22/rr22_psi_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@

#include "psi/rr22/rr22_psi.h"

#include <fmt/format.h>

#include <random>
#include <tuple>

#include "fmt/ranges.h"
#include "gtest/gtest.h"
#include "spdlog/spdlog.h"
#include "yacl/crypto/rand/rand.h"
Expand Down
3 changes: 2 additions & 1 deletion psi/utils/csv_checker.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@

#include "psi/utils/csv_checker.h"

#include <fmt/core.h>
#include <omp.h>

#include <cstddef>
Expand All @@ -32,6 +31,8 @@
#include "boost/uuid/uuid.hpp"
#include "boost/uuid/uuid_generators.hpp"
#include "boost/uuid/uuid_io.hpp"
#include "fmt/core.h"
#include "fmt/ranges.h"
#include "spdlog/spdlog.h"
#include "yacl/base/exception.h"
#include "yacl/crypto/hash/hash_utils.h"
Expand Down
1 change: 1 addition & 0 deletions psi/utils/csv_header_analyzer.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

#include "absl/strings/ascii.h"
#include "absl/strings/str_split.h"
#include "fmt/ranges.h"
#include "yacl/base/exception.h"

namespace psi {
Expand Down
1 change: 1 addition & 0 deletions psi/utils/key.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <omp.h>

#include "fmt/ranges.h"
#include "spdlog/spdlog.h"
#include "yacl/base/exception.h"

Expand Down

0 comments on commit 00baa29

Please sign in to comment.