Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions examples/pke/threshold-fhe.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 13 additions & 2 deletions src/include/docstrings/cryptocontext_docs.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 6 additions & 1 deletion src/lib/bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,12 @@ void bind_crypto_context(py::module &m) {
py::overload_cast<const PublicKey<DCRTPoly>&, ConstPlaintext&>(&CryptoContextImpl<DCRTPoly>::Encrypt, py::const_),
py::arg("publicKey"),
py::arg("plaintext"),
py::doc(cc_Encrypt_docs))
py::doc(cc_EncryptPubkey_docs))
.def("Encrypt",
py::overload_cast<const PrivateKey<DCRTPoly>&, ConstPlaintext&>(&CryptoContextImpl<DCRTPoly>::Encrypt, py::const_),
py::arg("privateKey"),
py::arg("plaintext"),
py::doc(cc_EncryptPrivkey_docs))
.def("Decrypt",
[](CryptoContext<DCRTPoly>& self, const PrivateKey<DCRTPoly> privKey, ConstCiphertext<DCRTPoly> ct) {
Plaintext result;
Expand Down
Loading