From d09784a28d6459bcf7c961f598f94e5dcff2f7f0 Mon Sep 17 00:00:00 2001 From: Vikram Saraph Date: Sat, 22 Mar 2025 23:31:20 -0400 Subject: [PATCH] remove mention of palisade --- include/bgv/bindings.hpp | 4 ++-- include/ckks/CKKS_ciphertext_extension.hpp | 6 +++--- include/ckks/CKKS_key_operations.hpp | 4 ++-- include/ckks/bindings.hpp | 4 ++-- include/ckks/serialization.hpp | 6 +++--- src/bgv/BGV_serialization_bindings.cpp | 2 +- src/ckks/CKKS_bindings.cpp | 9 +-------- src/ckks/CKKS_ciphertext_extension.cpp | 7 +------ src/ckks/CKKS_serialization_bindings.cpp | 2 +- src/ckks/utils.cpp | 1 - 10 files changed, 16 insertions(+), 29 deletions(-) diff --git a/include/bgv/bindings.hpp b/include/bgv/bindings.hpp index 973f466..fa77502 100644 --- a/include/bgv/bindings.hpp +++ b/include/bgv/bindings.hpp @@ -1,7 +1,7 @@ // (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL). -#ifndef BGV_PALISADE_PYTHON_BINDINGS_H -#define BGV_PALISADE_PYTHON_BINDINGS_H +#ifndef BGV_OPENFHE_PYTHON_BINDINGS_H +#define BGV_OPENFHE_PYTHON_BINDINGS_H namespace pyOpenFHE_BGV { diff --git a/include/ckks/CKKS_ciphertext_extension.hpp b/include/ckks/CKKS_ciphertext_extension.hpp index 908e6fc..570d076 100644 --- a/include/ckks/CKKS_ciphertext_extension.hpp +++ b/include/ckks/CKKS_ciphertext_extension.hpp @@ -1,7 +1,7 @@ // (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL). -#ifndef CKKS_PALISADE_PYTHON_CIPHERTEXT_H -#define CKKS_PALISADE_PYTHON_CIPHERTEXT_H +#ifndef CKKS_OPENFHE_PYTHON_CIPHERTEXT_H +#define CKKS_OPENFHE_PYTHON_CIPHERTEXT_H #include #include @@ -203,4 +203,4 @@ CKKSCiphertext operator*(const boost::python::numpy::ndarray &vals, } // namespace pyOpenFHE_CKKS -#endif /* CKKS_PALISADE_PYTHON_CIPHERTEXT_H */ \ No newline at end of file +#endif /* CKKS_OPENFHE_PYTHON_CIPHERTEXT_H */ \ No newline at end of file diff --git a/include/ckks/CKKS_key_operations.hpp b/include/ckks/CKKS_key_operations.hpp index 8501e1a..f03bf80 100644 --- a/include/ckks/CKKS_key_operations.hpp +++ b/include/ckks/CKKS_key_operations.hpp @@ -2,8 +2,8 @@ // encrypt, decrypt, keygeneration, and the like -#ifndef CKKS_ENCRYPTION_PALISADE_PYTHON_BINDINGS_H -#define CKKS_ENCRYPTION_PALISADE_PYTHON_BINDINGS_H +#ifndef CKKS_ENCRYPTION_OPENFHE_PYTHON_BINDINGS_H +#define CKKS_ENCRYPTION_OPENFHE_PYTHON_BINDINGS_H #include #include diff --git a/include/ckks/bindings.hpp b/include/ckks/bindings.hpp index d76ec17..3d18251 100644 --- a/include/ckks/bindings.hpp +++ b/include/ckks/bindings.hpp @@ -1,7 +1,7 @@ // (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL). -#ifndef CKKS_PALISADE_PYTHON_BINDINGS_H -#define CKKS_PALISADE_PYTHON_BINDINGS_H +#ifndef CKKS_OPENFHE_PYTHON_BINDINGS_H +#define CKKS_OPENFHE_PYTHON_BINDINGS_H namespace pyOpenFHE_CKKS { diff --git a/include/ckks/serialization.hpp b/include/ckks/serialization.hpp index f2f374e..91a1d1c 100644 --- a/include/ckks/serialization.hpp +++ b/include/ckks/serialization.hpp @@ -1,7 +1,7 @@ // (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL). -#ifndef PALISADE_PYTHON_SERIALIZATION_H -#define PALISADE_PYTHON_SERIALIZATION_H +#ifndef OPENFHE_PYTHON_SERIALIZATION_H +#define OPENFHE_PYTHON_SERIALIZATION_H #include #include @@ -91,4 +91,4 @@ bool DeserializeFromFile_EvalAutomorphismKey_CryptoContext( } // namespace pyOpenFHE_CKKS -#endif /* PALISADE_PYTHON_SERIALIZATION_H */ \ No newline at end of file +#endif /* OPENFHE_PYTHON_SERIALIZATION_H */ \ No newline at end of file diff --git a/src/bgv/BGV_serialization_bindings.cpp b/src/bgv/BGV_serialization_bindings.cpp index eaabb7c..66398e0 100644 --- a/src/bgv/BGV_serialization_bindings.cpp +++ b/src/bgv/BGV_serialization_bindings.cpp @@ -41,7 +41,7 @@ void export_BGV_serialization_boost() { /* The difference is naming between these and the above functions is unfortunate, - but hard to avoid given how PALISADE works in C++. + but hard to avoid given how OpenFHE works in C++. Deserializing these keys requires being passed a CryptoContext object, while the above keys do not. */ diff --git a/src/ckks/CKKS_bindings.cpp b/src/ckks/CKKS_bindings.cpp index f2a131b..4696f2e 100644 --- a/src/ckks/CKKS_bindings.cpp +++ b/src/ckks/CKKS_bindings.cpp @@ -1,12 +1,11 @@ // (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL). -// python bindings for PALISADE's CKKS functionality +// python bindings for OpenFHE's implementation of CKKS #include #include #include -// string formatting for exceptions #include #include @@ -91,9 +90,6 @@ void export_CKKS_Ciphertext_boost() { .def(self -= double()) .def(self - double()) .def(double() - self) - // .def(self *= int()) - // .def(self * int()) - // .def(int() * self) .def(self *= double()) .def(self * double()) .def(double() * self) @@ -103,10 +99,7 @@ void export_CKKS_Ciphertext_boost() { .def(self * other()) .def(other() * self) .def(other() * self) - - // prevents weird numpy broadcasting .def("__array_ufunc__", &pyOpenFHE_CKKS::CKKSCiphertext::array_ufunc) - .def_pickle(CKKSCiphertext_pickle_suite()) .attr("__module__") = "pyOpenFHE.CKKS"; } diff --git a/src/ckks/CKKS_ciphertext_extension.cpp b/src/ckks/CKKS_ciphertext_extension.cpp index 383ef00..eb3290f 100644 --- a/src/ckks/CKKS_ciphertext_extension.cpp +++ b/src/ckks/CKKS_ciphertext_extension.cpp @@ -6,7 +6,6 @@ #include #include -// string formatting for exceptions #include #include @@ -32,9 +31,7 @@ CKKSCryptoContext CKKSCiphertext::getCryptoContext(void) const { CKKSCiphertext CKKSCiphertext::array_ufunc( const boost::python::object ufunc, const boost::python::str method, const boost::python::numpy::ndarray &vals, const CKKSCiphertext &cipher) { - // because this is defined, numpy will call into this instead of ufunc - std::string op = - boost::python::extract(ufunc.attr("__name__"))(); + std::string op =boost::python::extract(ufunc.attr("__name__"))(); if (op == "multiply") { return cipher * vals; @@ -221,8 +218,6 @@ CKKSCiphertext operator+=(CKKSCiphertext &ctxt, std::vector vals) { vals.size(), N); throw std::runtime_error(s); } - // size_t final_size = ctxt.cipher->GetCryptoContext()->GetRingDimension() / - // 2; tileVector(vals, final_size); auto ptxt = ctxt.cipher->GetCryptoContext()->MakeCKKSPackedPlaintext(vals); ctxt.cipher = ctxt.cipher->GetCryptoContext()->EvalAdd(ctxt.cipher, ptxt); return ctxt; diff --git a/src/ckks/CKKS_serialization_bindings.cpp b/src/ckks/CKKS_serialization_bindings.cpp index 7d069da..63df735 100644 --- a/src/ckks/CKKS_serialization_bindings.cpp +++ b/src/ckks/CKKS_serialization_bindings.cpp @@ -43,7 +43,7 @@ void export_CKKS_serialization_boost() { /* The difference is naming between these and the above functions is unfortunate, - but hard to avoid given how PALISADE works in C++. + but hard to avoid given how OpenFHE works in C++. Deserializing these keys requires being passed a CryptoContext object, while the above keys do not. */ diff --git a/src/ckks/utils.cpp b/src/ckks/utils.cpp index 2ca6a6f..b275390 100644 --- a/src/ckks/utils.cpp +++ b/src/ckks/utils.cpp @@ -25,7 +25,6 @@ int shift_to_kernel_index(int shift, int ker_size) { return i; } } - throw std::invalid_argument("test"); } // mask gen