diff --git a/bazel/repositories.bzl b/bazel/repositories.bzl index 233e895b..7949ec41 100644 --- a/bazel/repositories.bzl +++ b/bazel/repositories.bzl @@ -38,6 +38,7 @@ def yacl_deps(): _com_github_google_cpu_features() _com_github_dltcollab_sse2neon() _com_github_msgpack_msgpack() + _com_github_greendow_hash_drbg() # crypto related _com_github_openssl_openssl() @@ -61,14 +62,6 @@ def yacl_deps(): remote = "{}/interconnection.git".format(SECRETFLOW_GIT), ) - maybe( - git_repository, - name = "com_github_greendow_hash_drbg", - build_file = "@yacl//bazel:hash_drbg.BUILD", - commit = "2411fa9d0de81c69dce2a48555c30298253db15d", - remote = "https://github.com/greendow/Hash-DRBG.git", - ) - # Add homebrew openmp for macOS, somehow..homebrew installs to different location on Apple Silcon/Intel macs.. so we need two rules here native.new_local_repository( name = "macos_omp_x64", @@ -331,6 +324,19 @@ def _com_github_msgpack_msgpack(): build_file = "@yacl//bazel:msgpack.BUILD", ) +def _com_github_greendow_hash_drbg(): + maybe( + http_archive, + name = "com_github_greendow_hash_drbg", + sha256 = "c03a3da5742d0f0c40232817d84f21d8eed4c4af498c4dff3a51b3bcadcb3787", + type = "tar.gz", + strip_prefix = "Hash-DRBG-2411fa9d0de81c69dce2a48555c30298253db15d", + urls = [ + "https://github.com/greendow/Hash-DRBG/archive/2411fa9d0de81c69dce2a48555c30298253db15d.tar.gz", + ], + build_file = "@yacl//bazel:hash_drbg.BUILD", + ) + def _com_github_herumi_mcl(): maybe( http_archive, diff --git a/yacl/utils/spi/argument/arg_kv.cc b/yacl/utils/spi/argument/arg_kv.cc index 4662c703..1075893c 100644 --- a/yacl/utils/spi/argument/arg_kv.cc +++ b/yacl/utils/spi/argument/arg_kv.cc @@ -20,12 +20,12 @@ const std::string& SpiArg::Key() const { return key_; } bool SpiArg::HasValue() const { return value_.has_value(); } -SpiArg SpiArg::operator=(const char* value) { +SpiArg& SpiArg::operator=(const char* value) { value_ = absl::AsciiStrToLower(std::string(value)); return *this; } -SpiArg SpiArg::operator=(const std::string& value) { +SpiArg& SpiArg::operator=(const std::string& value) { value_ = absl::AsciiStrToLower(value); return *this; } diff --git a/yacl/utils/spi/argument/arg_kv.h b/yacl/utils/spi/argument/arg_kv.h index 9939cfe3..9e3bc5a6 100644 --- a/yacl/utils/spi/argument/arg_kv.h +++ b/yacl/utils/spi/argument/arg_kv.h @@ -45,8 +45,8 @@ class SpiArg { } // Specialized functions of operator= - SpiArg operator=(const char *value); - SpiArg operator=(const std::string &value); + SpiArg &operator=(const char *value); + SpiArg &operator=(const std::string &value); const std::string &Key() const; bool HasValue() const;