Skip to content

Commit

Permalink
Fix Helper bootsSymEncrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
nindanaoto committed Oct 23, 2024
1 parent 260ec8d commit cef10bf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions include/tlwe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ typename P::T tlweSymIntDecrypt(const TLWE<P> &c, const Key<P> &key)
return tlweSymIntDecrypt<P, P::plain_modulus>(c, key);
}

template <class P, typename P::T μ>
template <class P, std::make_signed_t<typename P::T> μ>
std::vector<TLWE<P>> bootsSymEncrypt(const std::vector<uint8_t> &p,
const Key<P> &key)
{
Expand All @@ -127,7 +127,7 @@ template <class P>
std::vector<TLWE<P>> bootsSymEncrypt(const std::vector<uint8_t> &p,
const Key<P> &key)
{
return bootsSymEncrypt<P, typename P::T>(p, key);
return bootsSymEncrypt<P, P::μ>(p, key);
}

template <class P = lvl1param>
Expand All @@ -137,6 +137,13 @@ std::vector<TLWE<P>> bootsSymEncrypt(const std::vector<uint8_t> &p,
return bootsSymEncrypt<P>(p, sk.key.get<P>());
}

template <class P = lvl1param, std::make_signed_t<typename P::T> μ>
std::vector<TLWE<P>> bootsSymEncrypt(const std::vector<uint8_t> &p,
const SecretKey &sk)
{
return bootsSymEncrypt<P, μ>(p, sk.key.get<P>());
}

template <class P>
std::vector<uint8_t> bootsSymDecrypt(const std::vector<TLWE<P>> &c,
const Key<P> &key)
Expand Down

0 comments on commit cef10bf

Please sign in to comment.