Skip to content

Commit 714720f

Browse files
authored
Merge pull request #245 from openfheorg/dev
Update to v1.4.0.0
2 parents c679b5a + f88a631 commit 714720f

File tree

12 files changed

+1068
-1225
lines changed

12 files changed

+1068
-1225
lines changed

CMakeLists.txt

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
cmake_minimum_required (VERSION 3.5.1)
1+
cmake_minimum_required (VERSION 3.16.3)
22

33
project (OpenFHE-Python)
44

55
set(OPENFHE_PYTHON_VERSION_MAJOR 1)
6-
set(OPENFHE_PYTHON_VERSION_MINOR 3)
7-
set(OPENFHE_PYTHON_VERSION_PATCH 1)
6+
set(OPENFHE_PYTHON_VERSION_MINOR 4)
7+
set(OPENFHE_PYTHON_VERSION_PATCH 0)
88
set(OPENFHE_PYTHON_VERSION_TWEAK 0)
99
set(OPENFHE_PYTHON_VERSION ${OPENFHE_PYTHON_VERSION_MAJOR}.${OPENFHE_PYTHON_VERSION_MINOR}.${OPENFHE_PYTHON_VERSION_PATCH}.${OPENFHE_PYTHON_VERSION_TWEAK})
1010

11-
# OpenFHE version can be specified externally (-DOPENFHE_REQUIRED_VERSION=1.3.1)
11+
# OpenFHE version can be specified externally (-DOPENFHE_REQUIRED_VERSION=1.4.0)
1212
if(NOT DEFINED OPENFHE_REQUIRED_VERSION)
13-
set(OPENFHE_REQUIRED_VERSION "1.3.1" CACHE STRING "Required OpenFHE version")
13+
set(OPENFHE_REQUIRED_VERSION "1.4.0" CACHE STRING "Required OpenFHE version")
1414
else()
1515
# User provided OPENFHE_REQUIRED_VERSION via -D
1616
message(STATUS "Using user-specified OpenFHE version: ${OPENFHE_REQUIRED_VERSION}")
@@ -71,8 +71,11 @@ pybind11_add_module(openfhe
7171
src/lib/binfhe_bindings.cpp
7272
src/lib/binfhe/binfhecontext_wrapper.cpp
7373
src/lib/pke/serialization.cpp
74-
src/lib/pke/cryptocontext_wrapper.cpp
7574
)
75+
# The next line ensures that the installed openfhe module can find its shared library dependencies
76+
# in the 'lib/' subdirectory relative to itself without requiring LD_LIBRARY_PATH.
77+
target_link_options(openfhe PRIVATE "-Wl,-rpath=$ORIGIN/lib" "-Wl,--disable-new-dtags")
78+
7679
### Python installation
7780
# Allow the user to specify the path to Python executable (if not provided, find it)
7881
option(PYTHON_EXECUTABLE_PATH "Path to Python executable" "")
@@ -104,5 +107,5 @@ else()
104107
endif()
105108
message("***** INSTALL IS AT ${Python_Install_Location}; to change, run cmake with -DCMAKE_INSTALL_PREFIX=/your/path")
106109
install(TARGETS openfhe LIBRARY DESTINATION ${Python_Install_Location})
107-
install(FILES ${CMAKE_SOURCE_DIR}/__init__.py DESTINATION ${Python_Install_Location})
110+
install(FILES ${CMAKE_SOURCE_DIR}/src/__init__.py DESTINATION ${Python_Install_Location})
108111

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Please see [Instructions for the Docker setup](docker/README.md)
3535

3636
Before building, make sure you have the following dependencies installed:
3737

38-
- [OpenFHE 1.3.1+](https://github.com/openfheorg/openfhe-development) by following the instructions in [OpenFHE Documentation](https://openfhe-development.readthedocs.io/en/latest/sphinx_rsts/intro/installation/installation.html)
38+
- [OpenFHE 1.4.0+](https://github.com/openfheorg/openfhe-development) by following the instructions in [OpenFHE Documentation](https://openfhe-development.readthedocs.io/en/latest/sphinx_rsts/intro/installation/installation.html)
3939
- [Python 3.6+](https://www.python.org/)
4040
- [pybind11](https://pybind11.readthedocs.io/en/stable/installing.html)
4141

__init__.py

Lines changed: 0 additions & 48 deletions
This file was deleted.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
# The short X.Y version
2727
version = ''
2828
# The full version, including alpha/beta/rc tags
29-
release = '0.8.0'
29+
release = 'v1.3.1.0'
3030

3131

3232
# -- General configuration ---------------------------------------------------

src/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
from .openfhe import *

src/include/binfhe/binfhecontext_wrapper.h

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -31,43 +31,14 @@
3131
#ifndef __BINFHECONTEXT_WRAPPER_H__
3232
#define __BINFHECONTEXT_WRAPPER_H__
3333

34-
#include <pybind11/pybind11.h>
35-
#include <pybind11/stl.h>
36-
#include "openfhe.h"
3734
#include "binfhecontext.h"
38-
#include <functional>
35+
36+
#include <pybind11/pybind11.h>
3937
#include <pybind11/functional.h>
4038

4139
namespace py = pybind11;
4240
using namespace lbcrypto;
43-
LWECiphertext binfhe_EncryptWrapper(BinFHEContext &self,
44-
ConstLWEPrivateKey sk,
45-
const LWEPlaintext &m,
46-
BINFHE_OUTPUT output,
47-
LWEPlaintextModulus p,
48-
uint64_t mod);
49-
LWEPlaintext binfhe_DecryptWrapper(BinFHEContext &self,
50-
ConstLWEPrivateKey sk,
51-
ConstLWECiphertext ct,
52-
LWEPlaintextModulus p);
53-
54-
uint32_t GetnWrapper(BinFHEContext &self);
55-
56-
const uint64_t GetqWrapper(BinFHEContext &self) ;
57-
58-
const uint64_t GetMaxPlaintextSpaceWrapper(BinFHEContext &self);
59-
60-
const uint64_t GetBetaWrapper(BinFHEContext &self);
61-
62-
const uint64_t GetLWECiphertextModulusWrapper(LWECiphertext &self);
6341

6442
std::vector<uint64_t> GenerateLUTviaFunctionWrapper(BinFHEContext &self, py::function f, uint64_t p);
6543

66-
NativeInteger StaticFunction(NativeInteger m, NativeInteger p);
67-
68-
// Define static variables to hold the state
69-
// extern py::function static_f;
70-
71-
LWECiphertext EvalFuncWrapper(BinFHEContext &self, ConstLWECiphertext &ct, const std::vector<uint64_t> &LUT);
72-
7344
#endif // __BINFHECONTEXT_WRAPPER_H__

src/include/docstrings/cryptocontext_docs.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,13 @@ const char* cc_MakeCoefPackedPlaintext_docs = R"pbdoc(
153153
154154
:param value: vector of signed integers mod t
155155
:type value: List[int]
156-
:param noiseScaleDeg : is degree of the scaling factor to encode the plaintext at
157-
:type noiseScaleDeg : int
156+
:param noiseScaleDeg: is degree of the scaling factor to encode the plaintext at
157+
:type noiseScaleDeg: int
158158
:param level: is the level to encode the plaintext at
159159
:type level: int
160160
:return: plaintext
161161
:rtype: Plaintext
162+
162163
)pbdoc";
163164

164165
const char* cc_MakeCKKSPackedPlaintextComplex_docs = R"pbdoc(
@@ -1179,9 +1180,10 @@ const char* cc_InsertEvalAutomorphismKey_docs = R"pbdoc(
11791180
Add the given map of keys to the map, replacing the existing map if there is one
11801181
11811182
:param evalKeyMap: map of keys to be inserted
1182-
:type EvalKeyMap
1183+
:type evalKeyMap: EvalKeyMap
11831184
:param keyTag: key identifier for the given key map
11841185
:type keyTag: str
1186+
11851187
)pbdoc";
11861188

11871189
const char* cc_EvalSum_docs = R"pbdoc(
@@ -1376,10 +1378,11 @@ const char* cc_EvalFHEWtoCKKSSetup_docs = R"pbdoc(
13761378
13771379
:param ccLWE: Source FHEW crypto context.
13781380
:type ccLWE: BinFHEContext
1379-
:param numSlotsCKKS Number of slots in resulting CKKS ciphertext.
1381+
:param numSlotsCKKS: Number of slots in resulting CKKS ciphertext.
13801382
:type numSlotsCKKS: int
1381-
:param logQ: Ciphertext modulus size in FHEW (for high precision).
1383+
:param logQ: Ciphertext modulus size in FHEW (for high precision).
13821384
:type logQ: int
1385+
13831386
)pbdoc";
13841387

13851388
const char* cc_EvalFHEWtoCKKSKeyGen_docs = R"pbdoc(

src/include/pke/cryptocontext_wrapper.h

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)