diff --git a/yacl/crypto/primitives/ot/gywz_ote_test.cc b/yacl/crypto/primitives/ot/gywz_ote_test.cc index a310b58b..3e8f2510 100644 --- a/yacl/crypto/primitives/ot/gywz_ote_test.cc +++ b/yacl/crypto/primitives/ot/gywz_ote_test.cc @@ -165,7 +165,7 @@ TEST(GywzEdgeTest, Work) { auto index = RandInRange(n); auto lctxs = link::test::SetupWorld(2); uint128_t delta = SecureRandSeed(); - auto base_ot = MockCots(math::Log2Ceil(n), delta); // mock many base OTs + auto base_ot = MockCots(1, delta); // mock many base OTs std::vector send_out(n); std::vector recv_out(n); diff --git a/yacl/crypto/primitives/ot/sgrr_ote_test.cc b/yacl/crypto/primitives/ot/sgrr_ote_test.cc index 271cf185..576be7a6 100644 --- a/yacl/crypto/primitives/ot/sgrr_ote_test.cc +++ b/yacl/crypto/primitives/ot/sgrr_ote_test.cc @@ -195,7 +195,7 @@ TEST(SgrrEdgeTest, Work) { auto index = RandInRange(n); auto lctxs = link::test::SetupWorld(2); - auto base_ot = MockRots(math::Log2Ceil(n)); // mock many base OTs + auto base_ot = MockRots(1); // mock many base OTs std::vector send_out(n); std::vector recv_out(n); diff --git a/yacl/math/gadget.h b/yacl/math/gadget.h index 2e51186d..9dde74ae 100644 --- a/yacl/math/gadget.h +++ b/yacl/math/gadget.h @@ -29,7 +29,7 @@ inline uint64_t Log2Floor(uint64_t x) { inline uint64_t Log2Ceil(uint64_t x) { YACL_ENFORCE(x != 0, "log2(0) is undefined"); - return x == 1 ? 1 : Log2Floor(x - 1) + 1; + return x == 1 ? 0 : Log2Floor(x - 1) + 1; } constexpr uint64_t DivCeil(uint64_t x, uint64_t y) {