diff --git a/.licenserc.yaml b/.licenserc.yaml index e28f4228..f0025d22 100644 --- a/.licenserc.yaml +++ b/.licenserc.yaml @@ -36,6 +36,7 @@ header: # <1> - 'LICENSE' - 'NOTICE' - '.bazelversion' + - '.bazelignore' - '.clang-format' - '.gitattributes' - '.gitignore' diff --git a/heu/experimental/tfhe/src/BUILD.bazel b/heu/experimental/tfhe/src/BUILD.bazel index 9db267f9..7e43a9b5 100644 --- a/heu/experimental/tfhe/src/BUILD.bazel +++ b/heu/experimental/tfhe/src/BUILD.bazel @@ -12,10 +12,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@rules_cc//cc:defs.bzl", "cc_library") load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_static_library") load("//third_party/bazel_rust/cargo:crates.bzl", "all_crate_deps") load("//third_party/bazel_rust/cargo:rust_cxx_bridge.bzl", "rust_cxx_bridge") +load("@rules_cc//cc:defs.bzl", "cc_library") package(default_visibility = ["//visibility:public"]) diff --git a/heu/library/algorithms/paillier_zahlen/public_key.cc b/heu/library/algorithms/paillier_zahlen/public_key.cc index a50670eb..02b48079 100644 --- a/heu/library/algorithms/paillier_zahlen/public_key.cc +++ b/heu/library/algorithms/paillier_zahlen/public_key.cc @@ -45,5 +45,4 @@ std::string PublicKey::ToString() const { n_.ToHexString(), n_.BitCount(), h_s_.ToHexString(), PlaintextBound().ToHexString(), PlaintextBound().BitCount()); } - } // namespace heu::lib::algorithms::paillier_z diff --git a/heu/library/phe/base/serializable_types.cc b/heu/library/phe/base/serializable_types.cc index ef888044..151ac1f5 100644 --- a/heu/library/phe/base/serializable_types.cc +++ b/heu/library/phe/base/serializable_types.cc @@ -58,12 +58,13 @@ yacl::Buffer SerializableVariant::Serialize(bool with_meta) const { } } }); - uint8_t idx = GetAlignedIdx(); + size_t idx = GetAlignedIdx(); // Cast `idx` to `size_t` for compatibility + // with older versions // Append idx to the end of payload to reduce memory copying auto payload_sz = payload.size(); payload.resize(static_cast(payload_sz + sizeof(idx))); - *reinterpret_cast(payload.data() + payload_sz) = idx; + *reinterpret_cast(payload.data() + payload_sz) = idx; return payload; } @@ -111,12 +112,11 @@ void SerializableVariant::EmplaceInstance( template void SerializableVariant::Deserialize(yacl::ByteContainerView in) { - YACL_ENFORCE(in.size() > sizeof(uint8_t), "Illegal buffer size {}", - in.size()); + YACL_ENFORCE(in.size() > sizeof(size_t), "Illegal buffer size {}", in.size()); - uint8_t idx = *reinterpret_cast(in.data() + in.size() - - sizeof(uint8_t)); - yacl::ByteContainerView payload(in.data(), in.size() - sizeof(uint8_t)); + uint8_t idx = + *reinterpret_cast(in.data() + in.size() - sizeof(size_t)); + yacl::ByteContainerView payload(in.data(), in.size() - sizeof(size_t)); EmplaceInstance(idx); Visit([&](auto &clazz) { FOR_EACH_TYPE(clazz) clazz.Deserialize(payload); }); diff --git a/heu/library/phe/phe_test/ser_test.cc b/heu/library/phe/phe_test/ser_test.cc index 6a85fb8c..9afc8bee 100644 --- a/heu/library/phe/phe_test/ser_test.cc +++ b/heu/library/phe/phe_test/ser_test.cc @@ -82,7 +82,7 @@ TEST_P(SerTest, VarSerialize) { EXPECT_NE(ct0, Ciphertext()); EXPECT_NE(ct0, Ciphertext(he_kit_.GetSchemaType())); buffer = ct0.Serialize(); - EXPECT_GT(buffer.size(), sizeof(uint8_t)) << buffer; + EXPECT_GT(buffer.size(), sizeof(size_t)) << buffer; Ciphertext ct1; ct1.Deserialize(buffer); diff --git a/heu/pylib/numpy_binding/BUILD.bazel b/heu/pylib/numpy_binding/BUILD.bazel index 7505ded7..423b2429 100644 --- a/heu/pylib/numpy_binding/BUILD.bazel +++ b/heu/pylib/numpy_binding/BUILD.bazel @@ -12,8 +12,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -load("@pybind11_bazel//:build_defs.bzl", "pybind_extension", "pybind_library") load("@yacl//bazel:yacl.bzl", "yacl_cc_library", "yacl_cc_test") +load("@pybind11_bazel//:build_defs.bzl", "pybind_extension", "pybind_library") package(default_visibility = ["//visibility:public"]) diff --git a/heu/pylib/version.py b/heu/pylib/version.py index d9956c19..cf3c182c 100644 --- a/heu/pylib/version.py +++ b/heu/pylib/version.py @@ -13,4 +13,4 @@ # limitations under the License. -__version__ = "0.6.0.dev20241015" +__version__ = "0.6.0.dev20241106"