Skip to content

Commit

Permalink
I noticed that we can shrink lvl0 modulus to 16-bit because of increa…
Browse files Browse the repository at this point in the history
…sed noise
  • Loading branch information
nindanaoto committed Mar 14, 2024
1 parent 4aa32d2 commit 5262998
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/gate.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace TFHEpp {
template <class brP, typename brP::targetP::T μ, class iksP, int casign,
int cbsign, typename brP::targetP::T offset>
int cbsign, std::make_signed_t<typename iksP::targetP::T> offset>
inline void HomGate(TLWE<typename iksP::targetP> &res,
const TLWE<typename brP::domainP> &ca,
const TLWE<typename brP::domainP> &cb, const EvalKey &ek)
Expand Down
2 changes: 1 addition & 1 deletion include/params/128bit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct lvl0param {
static constexpr ErrorDistribution errordist =
ErrorDistribution::ModularGaussian;
static const inline double α = 0.000'092'511'997'467'675'6; // fresh noise
using T = uint32_t; // Torus representation
using T = uint16_t; // Torus representation
static constexpr T μ = 1U << (std::numeric_limits<T>::digits - 3);
static constexpr uint32_t plain_modulus = 8;
static constexpr double Δ =
Expand Down
2 changes: 1 addition & 1 deletion include/params/concrete.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct lvl0param {
ErrorDistribution::ModularGaussian;
static constexpr inline double α =
0.000'092'511'997'467'675'6; // fresh noise, 2^{-13.4}
using T = uint32_t; // Torus representation
using T = uint16_t; // Torus representation
static constexpr T μ = 1U << (std::numeric_limits<T>::digits - 3);
static constexpr uint32_t plain_modulus = 8;
static constexpr double Δ =
Expand Down

0 comments on commit 5262998

Please sign in to comment.