Skip to content

Commit

Permalink
parallelize bootsSym by OpenMP
Browse files Browse the repository at this point in the history
  • Loading branch information
nindanaoto committed Mar 20, 2024
1 parent 76223d1 commit 74564ee
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/tlwe.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ std::vector<TLWE<P>> bootsSymEncrypt(const std::vector<uint8_t> &p,
const Key<P> &key)
{
vector<TLWE<P>> c(p.size());
#pragma omp parallel for
for (int i = 0; i < p.size(); i++)
c[i] = tlweSymEncrypt<P>(p[i] ? P::μ : -P::μ, key);
return c;
Expand All @@ -120,6 +121,7 @@ std::vector<uint8_t> bootsSymDecrypt(const std::vector<TLWE<P>> &c,
const Key<P> &key)
{
vector<uint8_t> p(c.size());
#pragma omp parallel for
for (int i = 0; i < c.size(); i++) p[i] = tlweSymDecrypt<P>(c[i], key);
return p;
}
Expand Down

0 comments on commit 74564ee

Please sign in to comment.