Repository navigation
292 update the repository for v160 - #293
Open
dsuponitskiy wants to merge 8 commits into
Open
dsuponitskiy wants to merge 8 commits into
dsuponitskiy wants to merge 8 commits into
Conversation
dsuponitskiy
commented
Oct 9, 2026
Collaborator
- Port the PKE and BinFHE examples from openfhe-development to openfhe-python by converting them from C++ to Python.
- Add Python bindings for all APIs used in those examples that are not currently available in openfhe-python.
- Add Python bindings for additional APIs commonly used by openfhe-python users.
- Port the missing PKE and BinFHE examples and expose the APIs they need, including functional bootstrapping, BinFHE public-key support, and serialization. - Move the functional-bootstrapping bindings into fbt.cpp and extend the example tests to check the complete v1.6 inventory.
The binfhe examples keep their cryptocontexts and bootstrapping keys in module-level globals (1-2.5 GB each), so running all of them in one pytest process accumulates tens of GB and gets pytest killed on the runner. Running every example in its own interpreter returns the memory to the OS after each test.
The examples added for 1.6.0 hard-coded FLEXIBLEAUTO scaling, which 128-bit CKKS rejects. Pick FIXEDAUTO and matching modulus sizes when get_native_int() is 128, the same way the older examples do, and skip the composite scaling and functional bootstrapping examples on 128-bit builds since those techniques only exist for 64-bit.
…S class to Python
- Fix bind_eval_multinplace_scalar_overloads, which registered EvalAddInPlace instead of EvalMultInPlace. The scalar EvalAddInPlace overloads are bound elsewhere, so nothing is lost. - Bind PrivateKey(cryptoContext). RecoverSharedKey() dereferences sk->GetCryptoContext(), so a default-constructed key crashed it. - Add CryptoContext.GetElementParams(), needed to call GetPlaintextForDecrypt(). - Add the CryptoContext overloads of SerializeEvalSumKey and check is_open(), so an unusable path returns False instead of a cereal error. - Add tests/test_api_coverage.py, which checks decrypted values rather than method presence.
Bind missing BinFHE APIs, plus LWESwitchingKey which KeySwitchGen returns and SwitchCTtoqn consumes. - Drop the LWEPrivateKey default constructor. BinFHEContext only checks for a null key, so an empty one segfaulted BTKeyGen, PubKeyGen and KeySwitchGen. Keys come from KeyGen(), KeyGenN() or deserialization. - Move the integer conversions into integer_conversions.h, replacing the copies in bindings.cpp, binfhe_bindings.cpp and fbt.cpp. - Widen LWECiphertext.GetModulus(), which truncated for NATIVE_INT=128. - Add tests/test_binfhe_api_coverage.py.
- Add docstrings for the 79 bindings added by the two API-coverage commits, taken from the doxygen comments in openfhe-development. - Move the remaining docstrings out of the .cpp files into *_docs.h. fbt.cpp gets its own header, since these hold external-linkage globals. - Fix stale parameter names (keyId -> keyTag, i -> index and others), and add or drop the :param: and :return: entries that no longer matched. - Indent the 20 docstrings that were flush left.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.