Skip to content
89 changes: 60 additions & 29 deletions heu/library/algorithms/paillier_dl/cgbn_wrapper/cgbn_wrapper.cu.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#include <random>
#include <climits>
#include <gmp.h>
#include "cgbn/cgbn.h"
#include "heu/library/algorithms/paillier_dl/cgbn_wrapper/cgbn_wrapper.h"
#include "heu/library/algorithms/paillier_dl/cgbn_wrapper/gpu_support.h"
Expand Down Expand Up @@ -43,7 +46,7 @@ static void buf_cal_used(mp_digit *buf, int size, int *used) {
*used = count;
}

static void store2dev(dev_mem_t<BITS> *address, MPInt &z) {
static void store2dev(dev_mem_t<BITS> *address, const MPInt &z) {
auto buffer = z.ToMagBytes(Endian::little);
if (buffer.size() > sizeof(address->_limbs)) {
printf("%s:%d No enough memory, need: %d, real: %d\n", __FILE__, __LINE__, buffer.size(), sizeof(address->_limbs));
Expand All @@ -62,7 +65,7 @@ static void store2dev(void *address, SecretKey *sk) {
CUDA_CHECK(cudaMemcpy(address, sk, sizeof(SecretKey), cudaMemcpyHostToDevice));
}

static void store2host(MPInt &z, dev_mem_t<BITS> *address) {
static void store2host(MPInt *z, dev_mem_t<BITS> *address) {
int32_t z_size = sizeof(address->_limbs);

yacl::Buffer buffer(z_size);
Expand All @@ -74,7 +77,7 @@ static void store2host(MPInt &z, dev_mem_t<BITS> *address) {

buffer.resize(used * sizeof(mp_digit));
Endian endian = Endian::little;
z.FromMagBytes(buffer, endian);
(*z).FromMagBytes(buffer, endian);
}

__device__ __forceinline__ void powmod(env_t &bn_env, env_t::cgbn_t &r, env_t::cgbn_t &a, env_t::cgbn_t &b, env_t::cgbn_t &c) {
Expand Down Expand Up @@ -259,10 +262,10 @@ __global__ __noinline__ void raw_encrypt(PublicKey *pub_key, cgbn_error_report_t
#endif
}

void CGBNWrapper::Encrypt(const std::vector<Plaintext>& pts, const PublicKey& pk, std::vector<MPInt>& rns, std::vector<Ciphertext>& cts) {
void CGBNWrapper::Encrypt(const std::vector<Plaintext>& pts, const PublicKey& pk, std::vector<Ciphertext>* cts) {
int32_t TPB=128;
int32_t IPB=TPB/TPI;
int count = pts.size();
int32_t count = pts.size();

cgbn_error_report_t *report;
cgbn_mem_t<BITS> *dev_plains;
Expand All @@ -280,11 +283,15 @@ void CGBNWrapper::Encrypt(const std::vector<Plaintext>& pts, const PublicKey& pk

CUDA_CHECK(cgbn_error_report_alloc(&report));

raw_encrypt<<<(count+IPB-1)/IPB, TPB>>>(pk.dev_pk_, report, dev_plains, dev_ciphers, count, 12345);
std::random_device rd;
std::default_random_engine engine{rd()};
std::uniform_int_distribution<int> gen_data{0, INT_MAX};
int32_t rnd_number = gen_data(engine);
raw_encrypt<<<(count+IPB-1)/IPB, TPB>>>(pk.dev_pk_, report, dev_plains, dev_ciphers, count, rnd_number);
CUDA_CHECK(cudaDeviceSynchronize());

for (int i=0; i<count; i++) {
store2host(cts[i].c_, (dev_mem_t<BITS> *)(dev_ciphers + i));
store2host(&(*cts)[i].c_, (dev_mem_t<BITS> *)(dev_ciphers + i));
}

CGBN_CHECK(report);
Expand Down Expand Up @@ -348,7 +355,7 @@ __global__ void raw_decrypt(SecretKey *priv_key, dev_mem_t<BITS> *pk_n, cgbn_err
#endif
}

void CGBNWrapper::Decrypt(const std::vector<Ciphertext>& cts, const SecretKey& sk, const PublicKey& pk, std::vector<Plaintext>& pts) {
void CGBNWrapper::Decrypt(const std::vector<Ciphertext>& cts, const SecretKey& sk, const PublicKey& pk, std::vector<Plaintext>* pts) {
int32_t TPB=128;
int32_t IPB=TPB/TPI;
int count = cts.size();
Expand All @@ -375,7 +382,7 @@ void CGBNWrapper::Decrypt(const std::vector<Ciphertext>& cts, const SecretKey& s
CGBN_CHECK(report);

for (int i=0; i<count; i++) {
store2host(pts[i], (dev_mem_t<BITS> *)(dev_plains + i));
store2host(&(*pts)[i], (dev_mem_t<BITS> *)(dev_plains + i));
}

CUDA_CHECK(cgbn_error_report_free(report));
Expand Down Expand Up @@ -417,7 +424,7 @@ cgbn_mont2bn(bn_env, r, r, nsquare, np0);
#endif
}

void CGBNWrapper::Add(const PublicKey& pk, const std::vector<Ciphertext>& as, const std::vector<Ciphertext>& bs, std::vector<Ciphertext>& cs) {
void CGBNWrapper::Add(const PublicKey& pk, const std::vector<Ciphertext>& as, const std::vector<Ciphertext>& bs, std::vector<Ciphertext>* cs) {
int32_t TPB=128;
int32_t IPB=TPB/TPI;
int count = as.size();
Expand Down Expand Up @@ -447,7 +454,7 @@ void CGBNWrapper::Add(const PublicKey& pk, const std::vector<Ciphertext>& as, co
CGBN_CHECK(report);

for (int i=0; i<count; i++) {
store2host(cs[i].c_, (dev_mem_t<BITS> *)(dev_cs + i));
store2host(&(*cs)[i].c_, (dev_mem_t<BITS> *)(dev_cs + i));
}

CUDA_CHECK(cgbn_error_report_free(report));
Expand All @@ -456,7 +463,7 @@ void CGBNWrapper::Add(const PublicKey& pk, const std::vector<Ciphertext>& as, co
CUDA_CHECK(cudaFree(dev_cs));
}

void CGBNWrapper::Add(const PublicKey& pk, const std::vector<Ciphertext>& as, const std::vector<Plaintext>& bs, std::vector<Ciphertext>& cs) {
void CGBNWrapper::Add(const PublicKey& pk, const std::vector<Ciphertext>& as, const std::vector<Plaintext>& bs, std::vector<Ciphertext>* cs) {
int32_t TPB=128;
int32_t IPB=TPB/TPI;
int count = as.size();
Expand All @@ -483,13 +490,18 @@ void CGBNWrapper::Add(const PublicKey& pk, const std::vector<Ciphertext>& as, co
}

CUDA_CHECK(cgbn_error_report_alloc(&report));
raw_encrypt<<<(count+IPB-1)/IPB, TPB>>>(pk.dev_pk_, report, dev_bs, dev_ctbs, count, 12345);

std::random_device rd;
std::default_random_engine engine{rd()};
std::uniform_int_distribution<int> gen_data{0, INT_MAX};
int32_t rnd_number = gen_data(engine);
raw_encrypt<<<(count+IPB-1)/IPB, TPB>>>(pk.dev_pk_, report, dev_bs, dev_ctbs, count, rnd_number);
raw_add<<<(count+IPB-1)/IPB, TPB>>>(pk.dev_nsquare_, report, dev_cs, dev_as, dev_ctbs, count);
CUDA_CHECK(cudaDeviceSynchronize());
CGBN_CHECK(report);

for (int i=0; i<count; i++) {
store2host(cs[i].c_, (dev_mem_t<BITS> *)(dev_cs + i));
store2host(&(*cs)[i].c_, (dev_mem_t<BITS> *)(dev_cs + i));
}

CUDA_CHECK(cgbn_error_report_free(report));
Expand Down Expand Up @@ -535,7 +547,7 @@ __global__ void raw_mul(dev_mem_t<BITS> *pk_n, dev_mem_t<BITS> *pk_max_int, dev_
#endif
}

void CGBNWrapper::Mul(const PublicKey& pk, const std::vector<Ciphertext>& as, const std::vector<Plaintext>& bs, std::vector<Ciphertext>& cs) {
void CGBNWrapper::Mul(const PublicKey& pk, const std::vector<Ciphertext>& as, const std::vector<Plaintext>& bs, std::vector<Ciphertext>* cs) {
int32_t TPB=128;
int32_t IPB=TPB/TPI;
int count = as.size();
Expand Down Expand Up @@ -565,7 +577,7 @@ void CGBNWrapper::Mul(const PublicKey& pk, const std::vector<Ciphertext>& as, co
CGBN_CHECK(report);

for (int i=0; i<count; i++) {
store2host(cs[i].c_, (dev_mem_t<BITS> *)(dev_cs + i));
store2host(&(*cs)[i].c_, (dev_mem_t<BITS> *)(dev_cs + i));
}

CUDA_CHECK(cgbn_error_report_free(report));
Expand Down Expand Up @@ -595,7 +607,7 @@ __global__ void raw_negate(dev_mem_t<BITS> *pk_nsquare, cgbn_error_report_t *re
#endif
}

void CGBNWrapper::Negate(const PublicKey& pk, const std::vector<Ciphertext>& as, std::vector<Ciphertext>& cs) {
void CGBNWrapper::Negate(const PublicKey& pk, const std::vector<Ciphertext>& as, std::vector<Ciphertext>* cs) {

int32_t TPB=128;
int32_t IPB=TPB/TPI;
Expand All @@ -622,7 +634,7 @@ void CGBNWrapper::Negate(const PublicKey& pk, const std::vector<Ciphertext>& as,
CGBN_CHECK(report);

for (int i=0; i<count; i++) {
store2host(cs[i].c_, (dev_mem_t<BITS> *)(dev_cs + i));
store2host(&(*cs)[i].c_, (dev_mem_t<BITS> *)(dev_cs + i));
}

CUDA_CHECK(cgbn_error_report_free(report));
Expand All @@ -639,7 +651,7 @@ void CGBNWrapper::DevMalloc(PublicKey *pk) {
}

void CGBNWrapper::DevFree(PublicKey *pk) {
ifpk->dev_pk_{
if (pk->dev_pk_) {
CUDA_CHECK(cudaFree(pk->dev_g_));
CUDA_CHECK(cudaFree(pk->dev_n_));
CUDA_CHECK(cudaFree(pk->dev_nsquare_));
Expand All @@ -648,6 +660,14 @@ void CGBNWrapper::DevFree(PublicKey *pk) {
}
}

void CGBNWrapper::DevCopy(PublicKey *dst_pk, const PublicKey &pk) {
CUDA_CHECK(cudaMemcpy(dst_pk->dev_g_, pk.dev_g_, sizeof(cgbn_mem_t<BITS>), cudaMemcpyDeviceToDevice));
CUDA_CHECK(cudaMemcpy(dst_pk->dev_n_, pk.dev_n_, sizeof(cgbn_mem_t<BITS>), cudaMemcpyDeviceToDevice));
CUDA_CHECK(cudaMemcpy(dst_pk->dev_nsquare_, pk.dev_nsquare_, sizeof(cgbn_mem_t<BITS>), cudaMemcpyDeviceToDevice));
CUDA_CHECK(cudaMemcpy(dst_pk->dev_max_int_, pk.dev_max_int_, sizeof(cgbn_mem_t<BITS>), cudaMemcpyDeviceToDevice));
CUDA_CHECK(cudaMemcpy(dst_pk->dev_pk_, dst_pk, sizeof(PublicKey), cudaMemcpyHostToDevice));
}

void CGBNWrapper::DevMalloc(SecretKey *sk) {
CUDA_CHECK(cudaMalloc((void **)&sk->dev_g_, sizeof(cgbn_mem_t<BITS>)));
CUDA_CHECK(cudaMalloc((void **)&sk->dev_p_, sizeof(cgbn_mem_t<BITS>)));
Expand All @@ -661,7 +681,7 @@ void CGBNWrapper::DevMalloc(SecretKey *sk) {
}

void CGBNWrapper::DevFree(SecretKey *sk) {
ifsk->dev_sk_{
if (sk->dev_sk_) {
CUDA_CHECK(cudaFree(sk->dev_g_));
CUDA_CHECK(cudaFree(sk->dev_p_));
CUDA_CHECK(cudaFree(sk->dev_q_));
Expand All @@ -674,6 +694,17 @@ void CGBNWrapper::DevFree(SecretKey *sk) {
}
}

void CGBNWrapper::DevCopy(SecretKey *dst_sk, const SecretKey &sk) {
CUDA_CHECK(cudaMemcpy(dst_sk->dev_g_, sk.dev_g_, sizeof(cgbn_mem_t<BITS>), cudaMemcpyDeviceToDevice));
CUDA_CHECK(cudaMemcpy(dst_sk->dev_p_, sk.dev_p_, sizeof(cgbn_mem_t<BITS>), cudaMemcpyDeviceToDevice));
CUDA_CHECK(cudaMemcpy(dst_sk->dev_q_, sk.dev_q_, sizeof(cgbn_mem_t<BITS>), cudaMemcpyDeviceToDevice));
CUDA_CHECK(cudaMemcpy(dst_sk->dev_psquare_, sk.dev_psquare_, sizeof(cgbn_mem_t<BITS>), cudaMemcpyDeviceToDevice));
CUDA_CHECK(cudaMemcpy(dst_sk->dev_qsquare_, sk.dev_qsquare_, sizeof(cgbn_mem_t<BITS>), cudaMemcpyDeviceToDevice));
CUDA_CHECK(cudaMemcpy(dst_sk->dev_q_inverse_, sk.dev_q_inverse_, sizeof(cgbn_mem_t<BITS>), cudaMemcpyDeviceToDevice));
CUDA_CHECK(cudaMemcpy(dst_sk->dev_hp_, sk.dev_hp_, sizeof(cgbn_mem_t<BITS>), cudaMemcpyDeviceToDevice));
CUDA_CHECK(cudaMemcpy(dst_sk->dev_hq_, sk.dev_hq_, sizeof(cgbn_mem_t<BITS>), cudaMemcpyDeviceToDevice));
CUDA_CHECK(cudaMemcpy(dst_sk->dev_sk_, dst_sk, sizeof(SecretKey), cudaMemcpyHostToDevice));
}

void CGBNWrapper::StoreToDev(PublicKey *pk) {
store2dev(pk->dev_n_, pk->n_);
Expand All @@ -688,17 +719,17 @@ void CGBNWrapper::StoreToDev(SecretKey *sk) {
}

void CGBNWrapper::StoreToHost(PublicKey *pk) {
store2host(pk->g_, pk->dev_g_);
store2host(pk->nsquare_, pk->dev_nsquare_);
store2host(pk->max_int_, pk->dev_max_int_);
store2host(&pk->g_, pk->dev_g_);
store2host(&pk->nsquare_, pk->dev_nsquare_);
store2host(&pk->max_int_, pk->dev_max_int_);
}

void CGBNWrapper::StoreToHost(SecretKey *sk) {
store2host(sk->psquare_, sk->dev_psquare_);
store2host(sk->qsquare_, sk->dev_qsquare_);
store2host(sk->q_inverse_, sk->dev_q_inverse_);
store2host(sk->hp_, sk->dev_hp_);
store2host(sk->hq_, sk->dev_hq_);
store2host(&sk->psquare_, sk->dev_psquare_);
store2host(&sk->qsquare_, sk->dev_qsquare_);
store2host(&sk->q_inverse_, sk->dev_q_inverse_);
store2host(&sk->hp_, sk->dev_hp_);
store2host(&sk->hq_, sk->dev_hq_);
}

} // namespace heu::lib::algorithms::paillier_dl
} // namespace heu::lib::algorithms::paillier_dl
14 changes: 8 additions & 6 deletions heu/library/algorithms/paillier_dl/cgbn_wrapper/cgbn_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,18 @@ class CGBNWrapper {
public:
static void InitSK(SecretKey *sk);
static void InitPK(PublicKey *pk);
static void Encrypt(const std::vector<Plaintext>& pts, const PublicKey& pk, std::vector<MPInt>& rns, std::vector<Ciphertext>& cts);
static void Decrypt(const std::vector<Ciphertext>& cts, const SecretKey& sk, const PublicKey& pk, std::vector<Plaintext>& pts);
static void Add(const PublicKey& pk, const std::vector<Ciphertext>& as, const std::vector<Ciphertext>& bs, std::vector<Ciphertext>& cs);
static void Add(const PublicKey& pk, const std::vector<Ciphertext>& as, const std::vector<Plaintext>& bs, std::vector<Ciphertext>& cs);
static void Mul(const PublicKey& pk, const std::vector<Ciphertext>& as, const std::vector<Plaintext>& bs, std::vector<Ciphertext>& cs);
static void Negate(const PublicKey& pk, const std::vector<Ciphertext>& as, std::vector<Ciphertext>& cs);
static void Encrypt(const std::vector<Plaintext>& pts, const PublicKey& pk, std::vector<Ciphertext>* cts);
static void Decrypt(const std::vector<Ciphertext>& cts, const SecretKey& sk, const PublicKey& pk, std::vector<Plaintext>* pts);
static void Add(const PublicKey& pk, const std::vector<Ciphertext>& as, const std::vector<Ciphertext>& bs, std::vector<Ciphertext>* cs);
static void Add(const PublicKey& pk, const std::vector<Ciphertext>& as, const std::vector<Plaintext>& bs, std::vector<Ciphertext>* cs);
static void Mul(const PublicKey& pk, const std::vector<Ciphertext>& as, const std::vector<Plaintext>& bs, std::vector<Ciphertext>* cs);
static void Negate(const PublicKey& pk, const std::vector<Ciphertext>& as, std::vector<Ciphertext>* cs);
static void DevMalloc(PublicKey *pk);
static void DevMalloc(SecretKey *sk);
static void DevFree(PublicKey *pk);
static void DevFree(SecretKey *sk);
static void DevCopy(PublicKey *dst_pk, const PublicKey& pk);
static void DevCopy(SecretKey *dst_sk, const SecretKey& sk);
static void StoreToDev(PublicKey *pk);
static void StoreToDev(SecretKey *sk);
static void StoreToHost(PublicKey *pk);
Expand Down
2 changes: 1 addition & 1 deletion heu/library/algorithms/paillier_dl/decryptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace heu::lib::algorithms::paillier_dl {

std::vector<Plaintext> Decryptor::DecryptImplVector(const std::vector<Ciphertext>& in_cts) const {
std::vector<Plaintext> out_pts(in_cts.size());
CGBNWrapper::Decrypt(in_cts, sk_, pk_, out_pts);
CGBNWrapper::Decrypt(in_cts, sk_, pk_, &out_pts);
for (int i=0; i<out_pts.size(); ++i) {
if (out_pts[i] >= pk_.half_n_) {
out_pts[i] -= pk_.n_;
Expand Down
2 changes: 1 addition & 1 deletion heu/library/algorithms/paillier_dl/decryptor.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ namespace heu::lib::algorithms::paillier_dl {
class Decryptor {
public:
explicit Decryptor(PublicKey pk, SecretKey sk)
: pk_(std::move(pk)), sk_(std::move(sk)) {}
: pk_(pk), sk_(sk) {}

void Decrypt(ConstSpan<Ciphertext> in_cts, Span<Plaintext> out_pts) const;
std::vector<Plaintext> Decrypt(ConstSpan<Ciphertext> in_cts) const;
Expand Down
6 changes: 2 additions & 4 deletions heu/library/algorithms/paillier_dl/encryptor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

namespace heu::lib::algorithms::paillier_dl {

Encryptor::Encryptor(PublicKey pk) : pk_(std::move(pk)) {}
Encryptor::Encryptor(PublicKey pk) : pk_(pk) {}
Encryptor::Encryptor(const Encryptor &from) : Encryptor(from.pk_) {}

template <bool audit>
Expand All @@ -29,7 +29,6 @@ std::vector<Ciphertext> Encryptor::EncryptImplVector(ConstSpan<Plaintext> pts,
// YACL_ENFORCE(m.CompareAbs(pk_.PlaintextBound()) < 0,
// "message number out of range, message={}, max (abs)={}",
// m.ToHexString(), pk_.PlaintextBound());
std::vector<MPInt> rns;
std::vector<Ciphertext> cts;
std::vector<Plaintext> handled_pts;
for (int i=0; i<pts.size(); i++) {
Expand All @@ -43,9 +42,8 @@ std::vector<Ciphertext> Encryptor::EncryptImplVector(ConstSpan<Plaintext> pts,
Ciphertext ct;
MPInt rn;
cts.push_back(ct);
rns.push_back(rn);
}
CGBNWrapper::Encrypt(handled_pts, pk_, rns, cts);
CGBNWrapper::Encrypt(handled_pts, pk_, &cts);


// if constexpr (audit) {
Expand Down
12 changes: 6 additions & 6 deletions heu/library/algorithms/paillier_dl/evaluator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ std::vector<Ciphertext> Evaluator::Add(ConstSpan<Ciphertext> as, ConstSpan<Ciphe
}
std::vector<Ciphertext> outs_vec(as_vec.size());

CGBNWrapper::Add(pk_, as_vec, bs_vec, outs_vec);
CGBNWrapper::Add(pk_, as_vec, bs_vec, &outs_vec);

return outs_vec;
}
Expand All @@ -42,7 +42,7 @@ void Evaluator::AddInplace(Span<Ciphertext> as, ConstSpan<Ciphertext> bs) const
}
std::vector<Ciphertext> outs_vec(as_vec.size());

CGBNWrapper::Add(pk_, as_vec, bs_vec, as_vec);
CGBNWrapper::Add(pk_, as_vec, bs_vec, &as_vec);
for (int i=0; i<as.size(); ++i) {
*as[i] = as_vec[i];
}
Expand All @@ -58,7 +58,7 @@ std::vector<Ciphertext> Evaluator::Add(ConstSpan<Ciphertext> as, ConstSpan<Plain
std::vector<Plaintext> handled_bs_vec = HandleNeg(bs_vec);
std::vector<Ciphertext> outs_vec(as_vec.size());

CGBNWrapper::Add(pk_, as_vec, handled_bs_vec, outs_vec);
CGBNWrapper::Add(pk_, as_vec, handled_bs_vec, &outs_vec);

return outs_vec;
}
Expand All @@ -73,7 +73,7 @@ void Evaluator::AddInplace(Span<Ciphertext> as, ConstSpan<Plaintext> bs) const {
std::vector<Plaintext> handled_bs_vec = HandleNeg(bs_vec);
std::vector<Ciphertext> outs_vec(as_vec.size());

CGBNWrapper::Add(pk_, as_vec, handled_bs_vec, as_vec);
CGBNWrapper::Add(pk_, as_vec, handled_bs_vec, &as_vec);
for (int i=0; i<as.size(); ++i) {
*as[i] = as_vec[i];
}
Expand Down Expand Up @@ -136,7 +136,7 @@ std::vector<Ciphertext> Evaluator::Mul(ConstSpan<Ciphertext> as, ConstSpan<Plain
std::vector<Plaintext> handled_bs_vec = HandleNeg(bs_vec);
std::vector<Ciphertext> outs_vec(as_vec.size());

CGBNWrapper::Mul(pk_, as_vec, handled_bs_vec, outs_vec);
CGBNWrapper::Mul(pk_, as_vec, handled_bs_vec, &outs_vec);

return outs_vec;
}
Expand All @@ -151,7 +151,7 @@ void Evaluator::MulInplace(Span<Ciphertext> as, ConstSpan<Plaintext> bs) const {
std::vector<Plaintext> handled_bs_vec = HandleNeg(bs_vec);
std::vector<Ciphertext> outs_vec(as_vec.size());

CGBNWrapper::Mul(pk_, as_vec, handled_bs_vec, as_vec);
CGBNWrapper::Mul(pk_, as_vec, handled_bs_vec, &as_vec);
for (int i=0; i<as.size(); ++i) {
*as[i] = as_vec[i];
}
Expand Down
3 changes: 2 additions & 1 deletion heu/library/algorithms/paillier_dl/paillier_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class DLPaillierTest : public ::testing::Test {
std::shared_ptr<Encryptor> encryptor_;
std::shared_ptr<Evaluator> evaluator_;
std::shared_ptr<Decryptor> decryptor_;

};

TEST_F(DLPaillierTest, VectorEncryptDecrypt) {
Expand Down Expand Up @@ -217,4 +218,4 @@ TEST_F(DLPaillierTest, VectorEvaluateCiphertextNeg) {
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
return RUN_ALL_TESTS();
}
}
Loading