Skip to content

Commit

Permalink
Temporary use of ExtInt for backward comp
Browse files Browse the repository at this point in the history
  • Loading branch information
nindanaoto committed May 9, 2024
1 parent 905b692 commit c8f8009
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
1 change: 0 additions & 1 deletion include/params/compress.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ struct lvl31param {
static constexpr std::uint32_t t = 7; // number of addition in keyswitching
static constexpr std::uint32_t basebit =
2; // how many bit should be encrypted in keyswitching key
static const inline double α = lvl1param::α; // key noise
using domainP = lvl3param;
using targetP = lvl1param;
};
11 changes: 6 additions & 5 deletions include/raintt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,11 @@ constexpr uint wordbits = 27;
#else
constexpr uint wordbits = 31;
#endif
using Word = unsigned _BitInt(wordbits);
using SWord = signed _BitInt(wordbits);
using DoubleWord = unsigned _BitInt(2 * wordbits);
using DoubleSWord = signed _BitInt(2 * wordbits);
//_ExtInt is equivalent to _BitInt in C23
using Word = unsigned _ExtInt(wordbits);
using SWord = signed _ExtInt(wordbits);
using DoubleWord = unsigned _ExtInt(2 * wordbits);
using DoubleSWord = signed _ExtInt(2 * wordbits);
#else
constexpr uint wordbits = 32;
using Word = uint32_t;
Expand Down Expand Up @@ -394,7 +395,7 @@ inline void NTTradixButterfly(DoubleSWord *const res, const uint32_t size)
else if constexpr (radixbit == 2) {
NTTradixButterfly<radixbit - 1>(&res[0], size / 2);
NTTradixButterfly<radixbit - 1>(&res[size / 2], size / 2);
const uint32_t block = size >> radixbit;
// const uint32_t block = size >> radixbit;
for (uint index = 0; index < size / 4; index++) {
const SWord temp = res[index];
res[index] = AddMod(res[index], res[index + size / 2]);
Expand Down

0 comments on commit c8f8009

Please sign in to comment.