mirror of
https://github.com/JHUAPL/openfhe-python-bindings.git
synced 2026-01-06 22:23:50 -05:00
remove mention of palisade
This commit is contained in:
@@ -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 {
|
||||
|
||||
|
||||
@@ -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 <complex>
|
||||
#include <vector>
|
||||
@@ -203,4 +203,4 @@ CKKSCiphertext operator*(const boost::python::numpy::ndarray &vals,
|
||||
|
||||
} // namespace pyOpenFHE_CKKS
|
||||
|
||||
#endif /* CKKS_PALISADE_PYTHON_CIPHERTEXT_H */
|
||||
#endif /* CKKS_OPENFHE_PYTHON_CIPHERTEXT_H */
|
||||
@@ -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 <boost/python.hpp>
|
||||
#include <boost/python/numpy.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 {
|
||||
|
||||
|
||||
@@ -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 <complex>
|
||||
#include <stdexcept>
|
||||
@@ -91,4 +91,4 @@ bool DeserializeFromFile_EvalAutomorphismKey_CryptoContext(
|
||||
|
||||
} // namespace pyOpenFHE_CKKS
|
||||
|
||||
#endif /* PALISADE_PYTHON_SERIALIZATION_H */
|
||||
#endif /* OPENFHE_PYTHON_SERIALIZATION_H */
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -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 <complex>
|
||||
#include <stdexcept>
|
||||
#include <vector>
|
||||
|
||||
// string formatting for exceptions
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <boost/python.hpp>
|
||||
@@ -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<ndarray>())
|
||||
.def(other<list>() * self)
|
||||
.def(other<ndarray>() * self)
|
||||
|
||||
// prevents weird numpy broadcasting
|
||||
.def("__array_ufunc__", &pyOpenFHE_CKKS::CKKSCiphertext::array_ufunc)
|
||||
|
||||
.def_pickle(CKKSCiphertext_pickle_suite())
|
||||
.attr("__module__") = "pyOpenFHE.CKKS";
|
||||
}
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// string formatting for exceptions
|
||||
#include <fmt/format.h>
|
||||
|
||||
#include <boost/python.hpp>
|
||||
@@ -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<std::string>(ufunc.attr("__name__"))();
|
||||
std::string op =boost::python::extract<std::string>(ufunc.attr("__name__"))();
|
||||
|
||||
if (op == "multiply") {
|
||||
return cipher * vals;
|
||||
@@ -221,8 +218,6 @@ CKKSCiphertext operator+=(CKKSCiphertext &ctxt, std::vector<double> 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;
|
||||
|
||||
@@ -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.
|
||||
*/
|
||||
|
||||
@@ -25,7 +25,6 @@ int shift_to_kernel_index(int shift, int ker_size) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
throw std::invalid_argument("test");
|
||||
}
|
||||
|
||||
// mask gen
|
||||
|
||||
Reference in New Issue
Block a user