|
@@ -540,23 +540,30 @@ std::unique_ptr<DecryptResult> CryptoContextDCRTPoly::DecryptByPrivateKeyAndCiph
|
|
const PrivateKeyDCRTPoly& privateKey, const CiphertextDCRTPoly& ciphertext,
|
|
const PrivateKeyDCRTPoly& privateKey, const CiphertextDCRTPoly& ciphertext,
|
|
Plaintext& plaintext) const
|
|
Plaintext& plaintext) const
|
|
{
|
|
{
|
|
- std::shared_ptr<PlaintextImpl> res;
|
|
|
|
- std::unique_ptr<DecryptResult> result = std::make_unique<DecryptResult>(
|
|
|
|
- m_cryptoContextImplSharedPtr->Decrypt(privateKey.GetInternal(), ciphertext.GetInternal(),
|
|
|
|
- &res));
|
|
|
|
- plaintext = res;
|
|
|
|
- return result;
|
|
|
|
|
|
+ std::shared_ptr<PlaintextImpl> p;
|
|
|
|
+ std::unique_ptr<DecryptResult> res = std::make_unique<DecryptResult>(
|
|
|
|
+ m_cryptoContextImplSharedPtr->Decrypt(privateKey.GetInternal(), ciphertext.GetInternal(), &p));
|
|
|
|
+ plaintext = p;
|
|
|
|
+ return res;
|
|
}
|
|
}
|
|
std::unique_ptr<DecryptResult> CryptoContextDCRTPoly::DecryptByCiphertextAndPrivateKey(
|
|
std::unique_ptr<DecryptResult> CryptoContextDCRTPoly::DecryptByCiphertextAndPrivateKey(
|
|
const CiphertextDCRTPoly& ciphertext, const PrivateKeyDCRTPoly& privateKey,
|
|
const CiphertextDCRTPoly& ciphertext, const PrivateKeyDCRTPoly& privateKey,
|
|
Plaintext& plaintext) const
|
|
Plaintext& plaintext) const
|
|
{
|
|
{
|
|
- std::shared_ptr<PlaintextImpl> res;
|
|
|
|
- std::unique_ptr<DecryptResult> result = std::make_unique<DecryptResult>(
|
|
|
|
- m_cryptoContextImplSharedPtr->Decrypt(ciphertext.GetInternal(), privateKey.GetInternal(),
|
|
|
|
- &res));
|
|
|
|
- plaintext = res;
|
|
|
|
- return result;
|
|
|
|
|
|
+ std::shared_ptr<PlaintextImpl> p;
|
|
|
|
+ std::unique_ptr<DecryptResult> res = std::make_unique<DecryptResult>(
|
|
|
|
+ m_cryptoContextImplSharedPtr->Decrypt(ciphertext.GetInternal(), privateKey.GetInternal(), &p));
|
|
|
|
+ plaintext = p;
|
|
|
|
+ return res;
|
|
|
|
+}
|
|
|
|
+std::unique_ptr<DecryptResult> CryptoContextDCRTPoly::MultipartyDecryptFusion(
|
|
|
|
+ const VectorOfCiphertexts& partialCiphertextVec, Plaintext& plaintext) const
|
|
|
|
+{
|
|
|
|
+ std::shared_ptr<PlaintextImpl> p;
|
|
|
|
+ std::unique_ptr<DecryptResult> res = std::make_unique<DecryptResult>(
|
|
|
|
+ m_cryptoContextImplSharedPtr->MultipartyDecryptFusion(partialCiphertextVec.GetInternal(), &p));
|
|
|
|
+ plaintext = p;
|
|
|
|
+ return res;
|
|
}
|
|
}
|
|
uint32_t CryptoContextDCRTPoly::GetRingDimension() const
|
|
uint32_t CryptoContextDCRTPoly::GetRingDimension() const
|
|
{
|
|
{
|