remove mention of palisade

This commit is contained in:
Vikram Saraph
2025-03-22 23:31:20 -04:00
parent 18e6cbdef9
commit d09784a28d
10 changed files with 16 additions and 29 deletions

View File

@@ -1,7 +1,7 @@
// (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL). // (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL).
#ifndef BGV_PALISADE_PYTHON_BINDINGS_H #ifndef BGV_OPENFHE_PYTHON_BINDINGS_H
#define BGV_PALISADE_PYTHON_BINDINGS_H #define BGV_OPENFHE_PYTHON_BINDINGS_H
namespace pyOpenFHE_BGV { namespace pyOpenFHE_BGV {

View File

@@ -1,7 +1,7 @@
// (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL). // (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL).
#ifndef CKKS_PALISADE_PYTHON_CIPHERTEXT_H #ifndef CKKS_OPENFHE_PYTHON_CIPHERTEXT_H
#define CKKS_PALISADE_PYTHON_CIPHERTEXT_H #define CKKS_OPENFHE_PYTHON_CIPHERTEXT_H
#include <complex> #include <complex>
#include <vector> #include <vector>
@@ -203,4 +203,4 @@ CKKSCiphertext operator*(const boost::python::numpy::ndarray &vals,
} // namespace pyOpenFHE_CKKS } // namespace pyOpenFHE_CKKS
#endif /* CKKS_PALISADE_PYTHON_CIPHERTEXT_H */ #endif /* CKKS_OPENFHE_PYTHON_CIPHERTEXT_H */

View File

@@ -2,8 +2,8 @@
// encrypt, decrypt, keygeneration, and the like // encrypt, decrypt, keygeneration, and the like
#ifndef CKKS_ENCRYPTION_PALISADE_PYTHON_BINDINGS_H #ifndef CKKS_ENCRYPTION_OPENFHE_PYTHON_BINDINGS_H
#define CKKS_ENCRYPTION_PALISADE_PYTHON_BINDINGS_H #define CKKS_ENCRYPTION_OPENFHE_PYTHON_BINDINGS_H
#include <boost/python.hpp> #include <boost/python.hpp>
#include <boost/python/numpy.hpp> #include <boost/python/numpy.hpp>

View File

@@ -1,7 +1,7 @@
// (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL). // (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL).
#ifndef CKKS_PALISADE_PYTHON_BINDINGS_H #ifndef CKKS_OPENFHE_PYTHON_BINDINGS_H
#define CKKS_PALISADE_PYTHON_BINDINGS_H #define CKKS_OPENFHE_PYTHON_BINDINGS_H
namespace pyOpenFHE_CKKS { namespace pyOpenFHE_CKKS {

View File

@@ -1,7 +1,7 @@
// (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL). // (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL).
#ifndef PALISADE_PYTHON_SERIALIZATION_H #ifndef OPENFHE_PYTHON_SERIALIZATION_H
#define PALISADE_PYTHON_SERIALIZATION_H #define OPENFHE_PYTHON_SERIALIZATION_H
#include <complex> #include <complex>
#include <stdexcept> #include <stdexcept>
@@ -91,4 +91,4 @@ bool DeserializeFromFile_EvalAutomorphismKey_CryptoContext(
} // namespace pyOpenFHE_CKKS } // namespace pyOpenFHE_CKKS
#endif /* PALISADE_PYTHON_SERIALIZATION_H */ #endif /* OPENFHE_PYTHON_SERIALIZATION_H */

View File

@@ -41,7 +41,7 @@ void export_BGV_serialization_boost() {
/* /*
The difference is naming between these and the above functions is unfortunate, 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, Deserializing these keys requires being passed a CryptoContext object,
while the above keys do not. while the above keys do not.
*/ */

View File

@@ -1,12 +1,11 @@
// (c) 2021-2024 The Johns Hopkins University Applied Physics Laboratory LLC (JHU/APL). // (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 <complex> #include <complex>
#include <stdexcept> #include <stdexcept>
#include <vector> #include <vector>
// string formatting for exceptions
#include <fmt/format.h> #include <fmt/format.h>
#include <boost/python.hpp> #include <boost/python.hpp>
@@ -91,9 +90,6 @@ void export_CKKS_Ciphertext_boost() {
.def(self -= double()) .def(self -= double())
.def(self - double()) .def(self - double())
.def(double() - self) .def(double() - self)
// .def(self *= int())
// .def(self * int())
// .def(int() * self)
.def(self *= double()) .def(self *= double())
.def(self * double()) .def(self * double())
.def(double() * self) .def(double() * self)
@@ -103,10 +99,7 @@ void export_CKKS_Ciphertext_boost() {
.def(self * other<ndarray>()) .def(self * other<ndarray>())
.def(other<list>() * self) .def(other<list>() * self)
.def(other<ndarray>() * self) .def(other<ndarray>() * self)
// prevents weird numpy broadcasting
.def("__array_ufunc__", &pyOpenFHE_CKKS::CKKSCiphertext::array_ufunc) .def("__array_ufunc__", &pyOpenFHE_CKKS::CKKSCiphertext::array_ufunc)
.def_pickle(CKKSCiphertext_pickle_suite()) .def_pickle(CKKSCiphertext_pickle_suite())
.attr("__module__") = "pyOpenFHE.CKKS"; .attr("__module__") = "pyOpenFHE.CKKS";
} }

View File

@@ -6,7 +6,6 @@
#include <string> #include <string>
#include <vector> #include <vector>
// string formatting for exceptions
#include <fmt/format.h> #include <fmt/format.h>
#include <boost/python.hpp> #include <boost/python.hpp>
@@ -32,9 +31,7 @@ CKKSCryptoContext CKKSCiphertext::getCryptoContext(void) const {
CKKSCiphertext CKKSCiphertext::array_ufunc( CKKSCiphertext CKKSCiphertext::array_ufunc(
const boost::python::object ufunc, const boost::python::str method, const boost::python::object ufunc, const boost::python::str method,
const boost::python::numpy::ndarray &vals, const CKKSCiphertext &cipher) { 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<std::string>(ufunc.attr("__name__"))();
std::string op =
boost::python::extract<std::string>(ufunc.attr("__name__"))();
if (op == "multiply") { if (op == "multiply") {
return cipher * vals; return cipher * vals;
@@ -221,8 +218,6 @@ CKKSCiphertext operator+=(CKKSCiphertext &ctxt, std::vector<double> vals) {
vals.size(), N); vals.size(), N);
throw std::runtime_error(s); 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); auto ptxt = ctxt.cipher->GetCryptoContext()->MakeCKKSPackedPlaintext(vals);
ctxt.cipher = ctxt.cipher->GetCryptoContext()->EvalAdd(ctxt.cipher, ptxt); ctxt.cipher = ctxt.cipher->GetCryptoContext()->EvalAdd(ctxt.cipher, ptxt);
return ctxt; return ctxt;

View File

@@ -43,7 +43,7 @@ void export_CKKS_serialization_boost() {
/* /*
The difference is naming between these and the above functions is unfortunate, 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, Deserializing these keys requires being passed a CryptoContext object,
while the above keys do not. while the above keys do not.
*/ */

View File

@@ -25,7 +25,6 @@ int shift_to_kernel_index(int shift, int ker_size) {
return i; return i;
} }
} }
throw std::invalid_argument("test");
} }
// mask gen // mask gen