diff --git a/examples/pke/threshold-fhe.py b/examples/pke/threshold-fhe.py index e85cad9..23e3c7b 100644 --- a/examples/pke/threshold-fhe.py +++ b/examples/pke/threshold-fhe.py @@ -17,6 +17,7 @@ def main(): def RunBGVrnsAdditive(): parameters = CCParamsBGVRNS() parameters.SetPlaintextModulus(65537) + parameters.SetRingDim(32768) # NOISE_FLOODING_MULTIPARTY adds extra noise to the ciphertext before decrypting # and is most secure mode of threshold FHE for BFV and BGV. diff --git a/src/include/docstrings/cryptocontext_docs.h b/src/include/docstrings/cryptocontext_docs.h index 4738c2f..f9fa759 100644 --- a/src/include/docstrings/cryptocontext_docs.h +++ b/src/include/docstrings/cryptocontext_docs.h @@ -306,17 +306,28 @@ const char* cc_EvalAtIndexKeyGen_docs = R"pbdoc( :return: None )pbdoc"; -const char* cc_Encrypt_docs = R"doc( +const char* cc_EncryptPubkey_docs = R"doc( Encrypt a plaintext using a given public key :param plaintext: plaintext - :type plaintext: Plaintext + :type plaintext: ConstPlaintext :param publicKey: public key :type publicKey: PublicKey :return: ciphertext (or null on failure) :rtype: Ciphertext )doc"; +const char* cc_EncryptPrivkey_docs = R"doc( + Encrypt a plaintext using a given private key + + :param plaintext: plaintext + :type plaintext: ConstPlaintext + :param privateKey: private key + :type privateKey: PrivateKey + :return: ciphertext (or null on failure) + :rtype: Ciphertext +)doc"; + const char* cc_Decrypt_docs = R"pbdoc( Decrypt a single ciphertext into the appropriate plaintext diff --git a/src/lib/bindings.cpp b/src/lib/bindings.cpp index 89805f9..051bff4 100644 --- a/src/lib/bindings.cpp +++ b/src/lib/bindings.cpp @@ -613,7 +613,12 @@ void bind_crypto_context(py::module &m) { py::overload_cast&, ConstPlaintext&>(&CryptoContextImpl::Encrypt, py::const_), py::arg("publicKey"), py::arg("plaintext"), - py::doc(cc_Encrypt_docs)) + py::doc(cc_EncryptPubkey_docs)) + .def("Encrypt", + py::overload_cast&, ConstPlaintext&>(&CryptoContextImpl::Encrypt, py::const_), + py::arg("privateKey"), + py::arg("plaintext"), + py::doc(cc_EncryptPrivkey_docs)) .def("Decrypt", [](CryptoContext& self, const PrivateKey privKey, ConstCiphertext ct) { Plaintext result;