From 635cee114871bb340e4b469edd5968e32d70b398 Mon Sep 17 00:00:00 2001 From: SecAgg Team Date: Mon, 9 Feb 2026 00:21:30 -0800 Subject: [PATCH] No public description PiperOrigin-RevId: 867444815 --- shell_encryption/rns/rns_polynomial_hwy.cc | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/shell_encryption/rns/rns_polynomial_hwy.cc b/shell_encryption/rns/rns_polynomial_hwy.cc index a90ad3e..af14656 100644 --- a/shell_encryption/rns/rns_polynomial_hwy.cc +++ b/shell_encryption/rns/rns_polynomial_hwy.cc @@ -112,14 +112,7 @@ void BatchFusedMulAddMontgomeryRepHwy(absl::Span a, // Generate the masks on the even lanes, which correspond to the lower 64 bits // of BigInt64 (unsigned 128-bit int) values in the output vector. - uint8_t* mask_lo_bits = new uint8_t[(N + 7) / 8]; - for (int j = 0; j < (N + 7) / 8; ++j) { - mask_lo_bits[j] = 0; - for (int k = 0; k < 8; k += 2) { - mask_lo_bits[j] |= static_cast(1 << k); - } - } - auto mask_lo = hn::LoadMaskBits(d, mask_lo_bits); + auto mask_lo = hn::Eq(hn::And(hn::Iota(d, 0), hn::Set(d, 1)), hn::Zero(d)); // A highway vector whose odd lanes (higher 64 bits of the output vector) are // all 1's and even lanes are all 0's. auto ones = hn::Slide1Up(d, hn::IfThenElseZero(mask_lo, hn::Set(d, 1))); @@ -169,7 +162,6 @@ void BatchFusedMulAddMontgomeryRepHwy(absl::Span a, hn::Store(output0, d, output0_ptr); hn::Store(output1, d, output1_ptr); } - delete[] mask_lo_bits; // Handle the remaining elements in the input vectors. for (; i < num_coeffs; ++i) {