Skip to content

Commit 3236208

Browse files
authored
Merge pull request #1017 from openfheorg/dev
Update to v1.3.1
2 parents 02a8e9c + 94cef2e commit 3236208

33 files changed

Lines changed: 463 additions & 515 deletions

CMakeLists.txt

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ project (OpenFHE C CXX)
2727

2828
set(OPENFHE_VERSION_MAJOR 1)
2929
set(OPENFHE_VERSION_MINOR 3)
30-
set(OPENFHE_VERSION_PATCH 0)
30+
set(OPENFHE_VERSION_PATCH 1)
3131
set(OPENFHE_VERSION ${OPENFHE_VERSION_MAJOR}.${OPENFHE_VERSION_MINOR}.${OPENFHE_VERSION_PATCH})
3232

3333
set(CMAKE_CXX_STANDARD 17)
@@ -207,8 +207,14 @@ set(OpenFHE_PACKAGE_LIBS ${OpenFHE_STATIC_LIBS} ${OpenFHE_SHARED_LIBS})
207207
# Installation logic
208208
#--------------------------------------------------------------------
209209
### set up for install
210+
# include(GNUInstallDirs)
211+
210212
set(INSTALL_LIB_DIR lib CACHE PATH "Installation directory for libraries")
211213
set(INSTALL_INCLUDE_DIR include/openfhe CACHE PATH "Installation directory for headers")
214+
if(NOT IS_ABSOLUTE "${INSTALL_INCLUDE_DIR}")
215+
set(INSTALL_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}")
216+
endif()
217+
212218
if(WIN32 AND NOT CYGWIN)
213219
set(DEF_INSTALL_CMAKE_DIR CMake)
214220
else()
@@ -717,19 +723,16 @@ export(EXPORT OpenFHETargets FILE "${PROJECT_BINARY_DIR}/OpenFHETargets.cmake")
717723
export(PACKAGE OpenFHE)
718724

719725
# Create the OpenFHEConfig.cmake and OpenFHEConfigVersion files
720-
file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}"
721-
"${INSTALL_INCLUDE_DIR}")
726+
file(RELATIVE_PATH REL_INCLUDE_DIR "${INSTALL_CMAKE_DIR}" "${INSTALL_INCLUDE_DIR}")
722727
# ... for the build tree
723728
set(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}")
724-
configure_file(OpenFHEConfig.cmake.in
725-
"${PROJECT_BINARY_DIR}/OpenFHEConfig.cmake" @ONLY)
729+
configure_file(OpenFHEConfig.cmake.in "${PROJECT_BINARY_DIR}/OpenFHEConfig.cmake" @ONLY)
726730
# ... for the install tree
727731
set(CONF_INCLUDE_DIRS "\${OpenFHE_CMAKE_DIR}/${REL_INCLUDE_DIR}")
728-
configure_file(OpenFHEConfig.cmake.in
729-
"${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OpenFHEConfig.cmake" @ONLY)
732+
# set(CONF_INCLUDE_DIRS "\${OpenFHE_CMAKE_DIR}/../../include/openfhe") # supposed to be relocatable?
733+
configure_file(OpenFHEConfig.cmake.in "${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/OpenFHEConfig.cmake" @ONLY)
730734
# ... for both
731-
configure_file(OpenFHEConfigVersion.cmake.in
732-
"${PROJECT_BINARY_DIR}/OpenFHEConfigVersion.cmake" @ONLY)
735+
configure_file(OpenFHEConfigVersion.cmake.in "${PROJECT_BINARY_DIR}/OpenFHEConfigVersion.cmake" @ONLY)
733736

734737
# Install the OpenFHEConfig.cmake and OpenFHEConfigVersion.cmake
735738
install(FILES
@@ -738,5 +741,5 @@ install(FILES
738741
DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)
739742

740743
# Install the export set for use with the install-tree
741-
install(EXPORT OpenFHETargets DESTINATION
742-
"${INSTALL_CMAKE_DIR}" COMPONENT dev)
744+
install(EXPORT OpenFHETargets DESTINATION "${INSTALL_CMAKE_DIR}" COMPONENT dev)
745+
# install(EXPORT OpenFHETargets DESTINATION "${INSTALL_CMAKE_DIR}" NAMESPACE OpenFHE:: COMPONENT dev)

OpenFHEConfig.cmake.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ if(NOT OpenFHE_BINARY_DIR)
1010
endif()
1111

1212
# These are IMPORTED targets created by OpenFHETargets.cmake
13+
# set(OpenFHE_INCLUDE "${OpenFHE_CMAKE_DIR}/../../include/openfhe")
14+
# set(OpenFHE_LIBDIR "${OpenFHE_CMAKE_DIR}/../../lib")
1315
set(OpenFHE_INCLUDE "@INSTALL_INCLUDE_DIR@")
1416
set(OpenFHE_LIBDIR "@INSTALL_LIB_DIR@")
1517
set(OpenFHE_LIBRARIES @OpenFHE_PACKAGE_LIBS@ @THIRDPARTYLIBS@ @OpenMP_CXX_FLAGS@)

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@ To get familiar with the main API of OpenFHE, we recommend looking at the code o
7878
1. [Examples with Scheme Switching between CKKS and FHEW/TFHE](src/pke/examples/scheme-switching.cpp)
7979
1. Threshold FHE:
8080
1. [Code Example for BGV, BFV, and CKKS](src/pke/examples/threshold-fhe.cpp)
81-
1. [$2$-party Interactive Bootstrapping Examples](src/pke/examples/interactive-bootstrapping.cpp)
82-
1. [Simple $n$-party Interactive Bootstrapping Example](src/pke/examples/tckks-interactive-mp-bootstrapping.cpp)
83-
1. [$n$-party Interactive Bootstrapping after Chebyshev Approximation](src/pke/examples/tckks-interactive-mp-bootstrapping-Chebyshev.cpp)
81+
1. [2-party Interactive Bootstrapping Examples](src/pke/examples/interactive-bootstrapping.cpp)
82+
1. [Simple n-party Interactive Bootstrapping Example](src/pke/examples/tckks-interactive-mp-bootstrapping.cpp)
83+
1. [n-party Interactive Bootstrapping after Chebyshev Approximation](src/pke/examples/tckks-interactive-mp-bootstrapping-Chebyshev.cpp)
8484
1. [Code Example for BFV with 5 parties](src/pke/examples/threshold-fhe-5p.cpp)
8585

8686
## Main API

docs/sphinx_rsts/misc/contributors.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ We gratefully acknowledge intellectual and software contributions to the library
5555

5656
* Kevin King (Massachusetts Institute of Technology)
5757

58+
* Jeremy Kun (Google)
59+
5860
* Yongwoo Lee (Samsung Advanced Institute of Technology, Inha University)
5961

6062
* Thomas (Zeyu) Liu (Duality Technologies, Columbia University, Yale University)
@@ -109,6 +111,8 @@ We gratefully acknowledge intellectual and software contributions to the library
109111

110112
* Michael Walter (University of California San Diego)
111113

114+
* Hongren Zheng (Tsinghua University)
115+
112116
* Vincent Zucca (Universite de Perpignan Via Domitia, LIRMM, University of Montpellier, KU Leuven)
113117

114118
**Note.** We have attempted to make an as inclusive a list as possible to identify contributors, but we may of forgotten some important contributors. Any oversights are unintentional. If we neglected to identify your contribution, please let us know and we'll update our listing. If you are on the list of contributors and you'd prefer not to be, please let us know and we'll similarly update our list.

docs/static_docs/Release_Notes.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
07/11/2025: OpenFHE 1.3.1 (stable) is released
2+
3+
* Updates the noise estimation models for BGV and BFV, making them slightly more conservative (roughly 1 extra bit is added for each multiplicative level) (#1004)
4+
* Removes extra rotation indices in CKKS bootstrapping (#998)
5+
* Fixes a bug with CKKS bootstrapping for N=2^17 (#996)
6+
* Improves exception handling
7+
* Fixes several other bugs
8+
9+
The detailed list of changes is available at https://github.com/openfheorg/openfhe-development/issues?q=is%3Aissue+milestone%3A%22Release+1.3.1%22
10+
111
05/21/2025: OpenFHE 1.3.0 (development) is released
212

313
* Adds the composite scaling modes to CKKS based on https://eprint.iacr.org/2023/1462 (see https://github.com/openfheorg/openfhe-development/blob/main/src/pke/examples/COMPOSITE_SCALING.md for more details)

src/core/include/lattice/hal/default/dcrtpoly-impl.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1696,15 +1696,14 @@ void DCRTPolyImpl<VecType>::ScaleAndRoundPOverQ(const std::shared_ptr<Params>& p
16961696
const std::vector<NativeInteger>& pInvModq) {
16971697
m_params = paramsQ;
16981698

1699-
const uint32_t sizeQ = m_vectors.size() - 1;
1700-
const auto& q = m_params->GetParams();
1701-
const uint32_t ringDim = m_params->GetRingDimension();
1699+
const uint32_t sizeQ = m_vectors.size() - 1;
1700+
const auto& lastPoly = m_vectors.back();
17021701

17031702
#pragma omp parallel for num_threads(OpenFHEParallelControls.GetThreadLimit(sizeQ))
17041703
for (uint32_t i = 0; i < sizeQ; ++i) {
1705-
const auto& qi = q[i]->GetModulus();
1706-
for (uint32_t ri = 0; ri < ringDim; ++ri)
1707-
m_vectors[i][ri].ModSubEq(m_vectors[sizeQ][ri], qi);
1704+
auto tmp = lastPoly;
1705+
tmp.SwitchModulus(m_vectors[i].GetModulus(), m_vectors[i].GetRootOfUnity(), 0, 0);
1706+
m_vectors[i] -= tmp;
17081707
m_vectors[i] *= pInvModq[i];
17091708
}
17101709
m_vectors.resize(sizeQ);

src/core/include/utils/memory.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838

3939
#include <cstdint>
4040
#include <cstddef>
41+
#include <iterator>
4142
#include <utility>
4243
#include <vector>
4344

src/core/lib/math/discretegaussiangeneratorgeneric.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
#include "utils/exception.h"
4848
#include "utils/inttypes.h"
4949

50+
#include <algorithm>
5051
#include <cmath>
5152
#include <memory>
5253
#include <random>

src/core/lib/utils/demangle.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,9 @@
2929
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3030
//==================================================================================
3131
#include "utils/demangle.h"
32-
#include <memory>
32+
33+
#include <cstdlib>
34+
#include <string>
3335

3436
#if defined(__clang__) || defined(__GNUC__)
3537
#include <cxxabi.h>

src/core/lib/utils/get-call-stack.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@
3434
// clang-format off
3535
#include "utils/demangle.h"
3636

37-
#include <execinfo.h>
37+
#include <cstdlib>
3838
#include <cxxabi.h>
39+
#include <execinfo.h>
3940
#include <memory>
4041
// clang-format on
4142

0 commit comments

Comments
 (0)