Conversation
gnuykeat
reviewed
Mar 12, 2026
There was a problem hiding this comment.
Pull request overview
This PR refactors a CKKS homomorphic encryption library to support MSVC builds, adds secret key zeroization, introduces a custom random sampler interface (with sodium/blake3 examples), and creates preset template objects for Encryptor/Decryptor/KeyGenerator. The Context class is replaced with direct preset accessor functions and PresetTraits.
Changes:
- Replaced the
Contextshared-pointer indirection with directget_*()preset accessor functions and compile-timePresetTraits, removingContext.hppentirely. - Added
SecretKey::zeroize()for secure memory clearing with multiple backend options (libsodium, OpenSSL, native, fallback), and aRandomGeneratorabstraction with factory pattern for pluggable RNG. - Added MSVC 128-bit integer emulation (
u128/i128structs), float-precision message types (FMessage/FCoeffMessage), and Windows CI support.
Reviewed changes
Copilot reviewed 66 out of 66 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| include/deb/utils/Basic.hpp | MSVC u128/i128 emulation, subIfGEConst |
| include/deb/utils/Macro.hpp | deb_secure_zero inline function, platform detection |
| include/deb/utils/RandomGenerator.hpp | New abstract RNG interface and factory |
| include/deb/utils/AleaRandomGenerator.hpp | Alea-backed RNG implementation |
| include/deb/utils/PresetTraits.hpp | Compile-time preset traits with ModArith |
| include/deb/utils/OmpUtils.hpp | OMP utils moved to deb::utils namespace |
| include/deb/utils/FFT.hpp | Non-template FFT class with template methods |
| include/deb/utils/ModArith.hpp | Templatized ModArith on degree |
| include/deb/utils/Constant.hpp | Moved to deb::utils namespace |
| include/deb/Preset.hpp | New preset variant map and accessor functions |
| include/deb/CKKSTypes.hpp | Float message types, removed Context dependency, inline accessors |
| include/deb/Encryptor.hpp | Template class EncryptorT<P> |
| include/deb/Decryptor.hpp | Template class DecryptorT<P> |
| include/deb/Serialize.hpp | FMessage/FCoeffMessage serialization support |
| include/deb/SeedGenerator.hpp | Uses RandomGenerator instead of alea directly |
| include/deb/SecretKeyGenerator.hpp | Removed Context dependency |
| include/deb/Context.hpp | Deleted |
| include/deb/utils/Span.hpp | Deleted |
| src/*.cpp | Updated to use preset accessors, new RNG, zeroization |
| test/*.cpp | Updated tests for new APIs, added float and operation tests |
| examples/*.cpp | Updated for new API, added CustomRNG example |
| benchmark/*.cpp | Updated benchmarks, added blake3 RNG benchmark |
| CMakeLists.txt | MSVC support, secure zero options, version bump to 0.3.0 |
| CMakePresets.json | Added ci-win preset |
| .github/workflows/main.yml | Added Windows CI |
Comments suppressed due to low confidence (1)
include/deb/utils/Macro.hpp:180
- Spelling error: "seted" should be "set".
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
gnuykeat
approved these changes
Mar 12, 2026
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.
Newly supported features: