Skip to content

Commit

Permalink
Repo sync (#762)
Browse files Browse the repository at this point in the history
  • Loading branch information
anakinxc committed Jul 11, 2024
1 parent 1e5aca1 commit 630297d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions libspu/mpc/ab_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ Value bitintl_b(SPUContext* ctx, const Value& x, size_t stride) {
idx--) {
auto K = hack_make_p(ctx, spu::detail::kBitIntlKeepMasks[idx], x.shape());
auto M = hack_make_p(ctx, spu::detail::kBitIntlSwapMasks[idx], x.shape());
int64_t S = 1 << idx;
int64_t S = static_cast<uint64_t>(1) << idx;
// out = (out & K) ^ ((out >> S) & M) ^ ((out & M) << S);
out = xor_bb(
ctx,
Expand Down Expand Up @@ -281,7 +281,7 @@ Value bitdeintl_b(SPUContext* ctx, const Value& x, size_t stride) {
for (int64_t idx = stride; idx + 1 < Log2Ceil(nbits); idx++) {
auto K = hack_make_p(ctx, spu::detail::kBitIntlKeepMasks[idx], x.shape());
auto M = hack_make_p(ctx, spu::detail::kBitIntlSwapMasks[idx], x.shape());
int64_t S = 1 << idx;
int64_t S = static_cast<uint64_t>(1) << idx;
// out = (out & K) ^ ((out >> S) & M) ^ ((out & M) << S);
out = xor_bb(
ctx,
Expand Down
2 changes: 1 addition & 1 deletion libspu/mpc/cheetah/arith/matmat_prot.cc
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ Shape3D MatMatProtocol::GetSubMatShape(const Meta& meta, int64_t poly_deg,
const double cpu_price = 1.0;
const double bandwidth_price = 1000.0;

Shape3D subshape;
Shape3D subshape = {0, 0, 0};
Shape3D blk;

const int64_t n = poly_deg;
Expand Down
4 changes: 2 additions & 2 deletions libspu/mpc/cheetah/rlwe/packlwes.cc
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ void PackingHelper::doPackingRLWEs(absl::Span<RLWECt> rlwes,
seal::Evaluator evaluator(context_);
const int64_t logn = absl::bit_width(gap_) - 1;
for (int64_t k = logn; k >= 1; --k) {
int64_t h = 1 << (k - 1);
int64_t h = static_cast<uint64_t>(1) << (k - 1);
yacl::parallel_for(0, h, [&](int64_t bgn, int64_t end) {
RLWECt dummy; // zero-padding with zero RLWE
for (int64_t i = bgn; i < end; ++i) {
Expand Down Expand Up @@ -188,7 +188,7 @@ void GenerateGaloisKeyForPacking(const seal::SEALContext &context,
size_t logN = absl::bit_width(N) - 1;
std::vector<uint32_t> galois_elt;
for (uint32_t i = 1; i <= logN; i++) {
galois_elt.push_back((1u << i) + 1);
galois_elt.push_back((static_cast<uint32_t>(1) << i) + 1);
}

seal::KeyGenerator keygen(context, key);
Expand Down

0 comments on commit 630297d

Please sign in to comment.