Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix bfv hps #422

Merged
merged 7 commits into from
Jun 14, 2023
Merged

fix bfv hps #422

merged 7 commits into from
Jun 14, 2023

Conversation

kimandrik
Copy link
Collaborator

fixes #280
fix bug in ScaleAndRound in dcrtpoly:

  • Previously double was converted to integer, but if double > 2^63 there was an overflow.

@yspolyakov yspolyakov added this to the Release 1.0.4 milestone Jun 2, 2023
@yspolyakov yspolyakov added the bug Something isn't working label Jun 2, 2023
@yspolyakov
Copy link
Contributor

@dsuponitskiy Please add a unit test based on bf-mult-bug.cpp. Move this example to extras (it can be useful in the future). I am done with the review of the logic.

@yspolyakov yspolyakov marked this pull request as ready for review June 6, 2023 20:05
@kimandrik
Copy link
Collaborator Author

@dsuponitskiy-duality can you please wait with this issue, I need to check again the logic. the code does not work every 10th time for level = 67 and every 2 time for level = 66

@yspolyakov
Copy link
Contributor

@kimandrik @dsuponitskiy-duality I just tried the unit tests in the dev branch (without the fix), and the unit tests work there, too. So the unit tests do not capture the bug.

@yspolyakov yspolyakov marked this pull request as draft June 6, 2023 23:53
@kimandrik kimandrik requested a review from yspolyakov June 10, 2023 08:06
@kimandrik
Copy link
Collaborator Author

Fixed another bug: in ScaleAndRound method, when alpha is calculated, it can be bigger than modulus, but previously it was added using ModAddFast method, instead of ModAdd method.

@kimandrik kimandrik marked this pull request as ready for review June 10, 2023 08:10
@yspolyakov yspolyakov force-pushed the 280-depth-limitations-hps-fix branch from 79133c9 to 690932c Compare June 13, 2023 16:57
Copy link
Collaborator

@dsuponitskiy dsuponitskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good now

@dsuponitskiy dsuponitskiy merged commit e4a7ce3 into dev Jun 14, 2023
dsuponitskiy pushed a commit that referenced this pull request Jun 14, 2023
* fix bfv hps

* Moved bfv-mult-bug.cpp to src/pke/extras

* Added unittests to check the multiplicative depth limit

* dcrtpoly bug fix with alpha

* some tests should not run for mathbackend 2

* updated unit tests for deep BFV setups

* fixed the overflow check for max double

---------

Co-authored-by: Andrey Kim <andreykim@Andreys-MacBook-Pro.local>
Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>
@dsuponitskiy dsuponitskiy deleted the 280-depth-limitations-hps-fix branch June 19, 2023 10:27
@dsuponitskiy dsuponitskiy restored the 280-depth-limitations-hps-fix branch June 19, 2023 10:28
@dsuponitskiy dsuponitskiy deleted the 280-depth-limitations-hps-fix branch June 20, 2023 15:33
@dsuponitskiy dsuponitskiy restored the 280-depth-limitations-hps-fix branch June 20, 2023 15:34
@dsuponitskiy dsuponitskiy deleted the 280-depth-limitations-hps-fix branch June 20, 2023 15:34
@dsuponitskiy dsuponitskiy restored the 280-depth-limitations-hps-fix branch June 20, 2023 15:34
@dsuponitskiy dsuponitskiy deleted the 280-depth-limitations-hps-fix branch June 20, 2023 15:35
dsuponitskiy added a commit that referenced this pull request Jul 28, 2023
* PRE changes for noise flooding (#232)

* *removed TRAPDOOR_HRA from PRE options in constants
*change noise flooding to be done in base-pre.cpp instead of the noise in encryptzerocore
*include the statistical security and num of queries in computing noise flooding param in initializeflooding function in bgvrns-paramatersgeneration.cpp
*included parameters statisticalSecurity and numAdversarialQueries used for ckks noise flooding in cryptocontextparams into internal rlwe-parameters to reuse the same parameters for PRE noise flooding

* fixed review comments

* small correction in example link (#230)

* Manjaro is an installer of Arch Linux (#236)

Co-authored-by: yspolyakov <89226542+yspolyakov@users.noreply.github.com>

* Fhe aborts (#243)

* changes for aborts with threshold fhe

* Miscellaneous change

* modified return type of shareKeys from vector to map, added new testcases to UnitTestMultiParty for Aborts but have to debug some testdata issue

* added testcases to UnitTestMultiparty for aborts. the unittests pass but the parameters for ckks are not read in the correct order

* fixed UnitTestMultiparty after adding new testcases for aborts, all tests pass

* minor edit to aborts parameters

* fix evalmult after CI fail for 128 bits CLANG10 and gcc10

* parameter changes for ckksrns test aborts

* changes for aborts with threshold fhe

* Miscellaneous change

* modified return type of shareKeys from vector to map, added new testcases to UnitTestMultiParty for Aborts but have to debug some testdata issue

* added testcases to UnitTestMultiparty for aborts. the unittests pass but the parameters for ckks are not read in the correct order

* fixed UnitTestMultiparty after adding new testcases for aborts, all tests pass

* minor edit to aborts parameters

* fix evalmult after CI fail for 128 bits CLANG10 and gcc10

* parameter changes for ckksrns test aborts

* changed additive sharing map logic in cryptocontext.cpp

* Code corrections

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* autoconf is not required for a simple build anymore, corrections to the documentation (#252)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Emscripten support (#240)

* Support/guards for Emscripten

* Reduced the memory usage for UTGENERAL_MULTIPARTY unittests

* More changes for emscripten

* Corrections to the emscripten changes

* Enscripten change in CMakeLists.txt

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* BINFHE segfault fix (#241)

* Segfault fix

* Additional unit tests

* Fixed operator==() for RingGSWACCKeyImpl and RingGSWEvalKeyImpl

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Update windows.rst

Fixes #242

* updated BINFHE documentation

* Update binfhe.rst

Fixed the documentation

* updated the version to v1.0.1

* Additional support for the Emscripten compiler (#248)

* Additional Emscripten support

* Disabled UnitTestFHEWSerial with JSON

* Temporarily disabled some unit test for Emscripten as they throw std::bad_alloc if linked with Emscripten

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Disabled the i386 architecture (#259)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Removed not used variables (#269)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Set CMAKE_CXX_STANDARD to 17 for user projects (#268)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Switch mTilde related params to uint64_t (#260)

* Switch mTilde related params to uint64_t

* Enahncing readability and using in-place arithmetic operators

* More optimizations

* Migration guide (#274)

* Migration guide

* Format changes to z_migration_guide.rst

* Format changes to z_migration_guide.rst (2)

* update z_migration

* Format changes to z_migration_guide.rst (3)

* Format changes to z_migration_guide.rst (4)

* made some small formatting changes

* Small edits.

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
Co-authored-by: Ian Quah <iquah@dualitytech.com>
Co-authored-by: Saroja Erabelli <serabelli@dualitytech.com>

* Refactor unit tests: move test data to .csv files (#281)

* Moved test data to .csv file for UnitTestBGVrnsAutomorphism.cpp

* Added error handling

* Moved the implementation of Params(const std::vector<std::string>& vals) to .cpp

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

SquashMerge after 1 CI run, per DS.

* Fix for Issue 282 (#283)

* fixed code for issue #282

* fixed revew comment

* Use the CKKSRNS_SCHEME schemeId in CKKSPackedencoding constructors (#291)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Srv fix issue 273 (#290)

* changes to add threshold number of parties as cryptocontext params and adjust the cushion in findlevelstodrop for noise estimation

* changes to add threshold number of parties as cryptocontext params and adjust the cushion in findlevelstodrop for noise estimation

* cleaned up and added comment in findlevelstodrop

* typos and comments

* fixed review comments

* Use the CKKSRNS_SCHEME schemeId in CKKSPackedencoding constructors (#291)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* fixed thresholdparties *1 in two other lines

* changes to add threshold number of parties as cryptocontext params and adjust the cushion in findlevelstodrop for noise estimation

* cleaned up and added comment in findlevelstodrop

* typos and comments

* fixed review comments

* fixed thresholdparties *1 in two other lines

---------

Co-authored-by: dsuponitskiy <dmitriy.suponitskiy@gmail.com>
Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Edit readme for new example threshold-fhe-5p (#296)

* updated readme for new example threshold-fhe-5p

* fixed link in readme

* Fixed compiler errors in advanced-real-numbers.cpp (#299)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* added check for batch size to be a power of two (#300)

Co-authored-by: Andrey Kim <andreykim@Andreys-MacBook-Pro.local>

* Exception for oversized plaintext (#301)

* Throw an exception if the plaintext size exceeds its limit

* Set the scalingModSize default values for CKKS

* Added schemeId to error messages

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Added a call to PackedEncoding::SetParams() in CryptoContextFactory<Element>::GetContext (#303)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Srv fhew pke changes (#295)

* fixed 2020/086 reference

* code that compiles, need to debug segmentation fault

* running code but result fluctuates

* working code for boolean LWE pke

* fixed 2020/086 reference

* code that compiles, need to debug segmentation fault

* running code but result fluctuates

* working code for boolean LWE pke

* added more examples, benchmark and cleaned up code and comments. Still need to test new unittests added for lwe pke

* check input ciphertext to encryptn, removed unittests copy for pke to identify tests to add and some cleanup (this branch fixes issue #235)

* Edit readme for new example threshold-fhe-5p (#296)

* updated readme for new example threshold-fhe-5p

* fixed link in readme

* changes to pk generation in BTKeygen instead of generating a triple, encrypt function with pk that calls both encryptN and encryptn, added unittests

* added pubkeygen to binfhecontext, modified keygen benchmark to include btkeygen in ske

* modified keygen function in binfhe-benchmarks, cleaned up comments

* clean up

* correction to benchmark binfhe-ginx-pke

* Fixed compiler errors in advanced-real-numbers.cpp (#299)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* added check for batch size to be a power of two (#300)

Co-authored-by: Andrey Kim <andreykim@Andreys-MacBook-Pro.local>

* fixed yuriy review comments

* fixed 2020/086 reference

* code that compiles, need to debug segmentation fault

* running code but result fluctuates

* working code for boolean LWE pke

* code that compiles, need to debug segmentation fault

* running code but result fluctuates

* working code for boolean LWE pke

* added more examples, benchmark and cleaned up code and comments. Still need to test new unittests added for lwe pke

* check input ciphertext to encryptn, removed unittests copy for pke to identify tests to add and some cleanup (this branch fixes issue #235)

* changes to pk generation in BTKeygen instead of generating a triple, encrypt function with pk that calls both encryptN and encryptn, added unittests

* added pubkeygen to binfhecontext, modified keygen benchmark to include btkeygen in ske

* modified keygen function in binfhe-benchmarks, cleaned up comments

* clean up

* correction to benchmark binfhe-ginx-pke

* fixed yuriy review comments

* fixed some typos and comments

* fixed review comments

* small edits to binfhe/examples/readme and docs/sphinx_rsts/modules/binfhe.rst

---------

Co-authored-by: dsuponitskiy <dmitriy.suponitskiy@gmail.com>
Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
Co-authored-by: Andrey Kim <kimandr.kz@gmail.com>
Co-authored-by: Andrey Kim <andreykim@Andreys-MacBook-Pro.local>

* Correction on the serialization page (#309)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Changed Hamming weight from 16 to 64 for SPARSE_TERNARY (#312)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Return original ciphertext in bootstrapping if we already start with enough towers. (#314)

* Return original ciphertext if we already start with enough towers.

* Add comment to explain changes.

* Fixed vectorization bug (#322)

* fixed vectorization in pubkeygen for xor performance difference in ske vs pke

* fixed noise issue with pke with native size 32 - modaddeq for every addition instead of using +operator, fixed review comment for changing variable name size and its type

* MATHBACKEND cleanup (#327)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* minor bug fix for throwing exception when vector of values is empty in packedencoding (#330)

* fixed the input ranges for function-evaluation.cpp (#335)

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* fixes documentation issue #272

* fixes documentation issue #262

* updated to v1.0.2

* Update publications.rst

* added changes (#287)

Calabacitas merge now.

* updated to v1.0.3

* Added MATHBACKEND to config_core.in (#345)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* PS parameters (#342)

* PS parameters

* cleanup

* update name

* Update FUNCTION_EVALUATION.md

* fix issue 355 - should not delete elements of DCRTPoly with one element (#379)

* fix issue 355 - should not elements of DCRTPoly with one element

* fix format

* more exception to a lower level function

* Hybrid Key Switching Optimization (#377)

* optimization from https://eprint.iacr.org/2018/117 Section 3.3

* sw optimizations

* Replaced usint with size_t and deleted redundant code for KeySwitchGen()

---------

Co-authored-by: Andrey Kim <andreykim>
Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* add check to prevent negative moduli (#386)

* Fix eval-decomp example returning wrong output (#357)

* removed final bootstrapping in evaldecomp function and changed p=8 in decrypt for last digit

* change to example to compute modulus for last digit instead of hardcoding, change to unittest to check all the digits

* replaced pow with bitwise operation

* replace log2 with getMSB in digitdecomp example and unittest

* change to example to compute modulus for last digit instead of hardcoding, change to unittest to check all the digits

* replaced pow with bitwise operation

* Modified Native Transform (#384)

* initial set of native transform modifications

* reduced set of native transform modifications; only includes transforms used in SwitchFormat()

* modified implementation after gcc benchmarking

* add in inner product example (#391)

* add in inner product example

* added in tests

* done

* Added a missing argument (ExecutionMode) to calls to Decode() (#394)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* comment out for now (#397)

* Check if std::map<>::find() returns a valid iterator (#395)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Fixed code to disallow out-of-bounds vector access (#398)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Verify that ring dimension for cryptocontext params is always power of 2 (#401)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Added a check for nullptr to GetParamsPK() to fix crashes (#399)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Do not request Git to be installed if GIT_SUBMOD_AUTO=OFF (#405)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Code improvements (#406)

* Design changes in class templates v1

* Design changes in class templates 2

* Design changes in class templates 3

* Added unittest/utils/*.h to be installed and fixed a bug in UnitTestGenerateContext()

* Assign a default slot size if slots == 0

* Do not catch and hide exceptions for cryptocontext serialization; removed unused m_autoIdxLis

* Cleanup

* Fixed clang errors

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Modified lattice (#365)

* initial setup for modifications to Lattice and Math Layers

* modifications to Lattice and Math Layers; Poly into HAL; optimization of poly/dcrtpoly rootines; speedup builds; workaround for include *.cpp files

* remove remaining HEXL-specific code

* modifications of other files to accommodate Lattice/Math Layer changes

* fixes after running unittests

* fix for compilation issue on mac

* bug fix for BE6 builds

* bug fix for BUILD_EXTRAS=ON

* fix for compilation issue with MING64 + Windows 10 (g++ 12.2.0)

* Small documentation fixes (#417)

* small comment typo in example

* Removed a text left over from Palisade

---------

Co-authored-by: Rener Oliveira <53785783+reneroliveira@users.noreply.github.com>
Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Conversion functions for crypto parameters' enums (#420)

* Added functions converting uint32_t to enum for crypto parameters

* Additional conversion functions

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* fixed the bug with large CKKS plaintexts (#424)

* fixed the bug with large CKKS plaintexts

* fix for 128-bit CKKS unit tests

* fixed the word size in MakeAuxPlaintext

---------

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* cyclotomic order instead of ring dimension (#427)

* gcc13 compiler errors (#430)

* Disabled -Werror=dangling-reference for the cereal library as gcc-13 throws an error

* Fixed gcc-13 errors: added <cstdint> and removed a call to std::move

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Port of PR#415 - Fix some undefined behavior (#429)

* Fix UB in CKKSPackedEncoding

Avoid casting a potentially-infinite floating point value to int32_t.

* Fix UB in FHECKKSRNS::MakeAuxPlaintext

Avoid casting a potentially-infinite floating point value to int32_t.

* Restore std:: prefix for abs in ckkspackedencoding.cpp

* Fix for segmentation fault in MakeCKKSPackedPlaintext() (#403)

* Limited the upper value of the level to encode the plaintext at

* Addressed comments

* Addressed comments about the error condition

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Issue 382 - Fix BFV security check (#432)

* fixed a bug with BFV parameter generation

* updated documentation

* Added a test for ring dimension failure on security requirement

---------

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>
Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* fixed bugs with addition and multiplication of large doubles in CKKS (#436)

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* fix bfv hps (#422)

* fix bfv hps

* Moved bfv-mult-bug.cpp to src/pke/extras

* Added unittests to check the multiplicative depth limit

* dcrtpoly bug fix with alpha

* some tests should not run for mathbackend 2

* updated unit tests for deep BFV setups

* fixed the overflow check for max double

---------

Co-authored-by: Andrey Kim <andreykim@Andreys-MacBook-Pro.local>
Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* Updated standard security tables (#439)

* updated stdlatticeparms for ternary, error secret distribution with 2^16 ring dimension for classic 128, 192, 256 security and parameter sets for 128, 192, 256 quantum security levels upto 2^15 ring dimension

* removed the hard-coding of the maximum ring dimension

---------

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* Correct max value for implicit conversion from int64 to double (#441)

* Corrected the max value of double that can be converted to int64_t

* Replaced the number with an expression in Max64BitValue()

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* updated version to v1.0.4

* Uncommented unittests and an example for innerproduct (#452)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Added functions to check enabled features in the cryptocontext and called them in all cryptocontext interfaces (#451)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Small correction to the migration guide (from Palisade to OpenFHE) (#453)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* New FHEW bootstrapping method LMKCDEY (ia.cr/2022/198) (#352)

* stubs

* Key generation added

* fix syntax errors

* code finished, seg. fault occurs

* try to round-to-odd

* test passed

* lmkcdey finished (replicated Yongwoo Lee's commit 1ea84c7)

* bench added, revise rgsw-acc-lmk+

* openmp for auto key gen. m_logGen to PreCompute

* error fix: add precomputation  RingGSWCryptoParams

* binfhe support Gaussian secrets

* Add STD128_LMKCDEY to binfhe-constants-impl.cpp.

* modified fhew unittest, removing repeated functions and looping through the different bootstrapping techniques instead

* fixed UnitTestFHEW after adding LMKCDEY

* Refactored unittests in UnitTestFHEW.cpp

* code cleanup in binfhe: reuse the PreCompute code

* unittest serialize for lmkcdey

---------

Co-authored-by: Yongwoo Lee <yongwool@snu.ac.kr>
Co-authored-by: randomcryptoguy <yw0803.lee@samsung.com>
Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
Co-authored-by: sararv22 <saraswathy@dualitytech.com>
Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* fix for issue #402 (#442)

* fix for issue #402

* additional edits

* added description for PolyImpl::TimesNoCheck()

* New function to estimate the levels consumed in bootstrapping (#459)

* Rename the private function GetBootstrapDepth() and made g_coefficients static

* Added a function to estimate the levels consumed in bootstrapping

* minor fixes in bootstrapping examples

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* Corrected CMakeLists.User.txt and documentation for custom build location and updated docs with other OSs where OpenFHE has been sucessfully linked (#460)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Update CMakeLists.txt (#462)

Co-authored-by: Hunter Richards <36270862+harichards@users.noreply.github.com>

* Replaced uint with size_t (#465)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Problem with two coexisting CKKS crypto contexts with different ring dimensions (#463)

* Created a static map of precomputed values with ringDim as the key to handle multiple cryptocontexts

* Added a unittest to verify that ringDim for the first cryptocontext is not overriden by creation of another cryptocontext.

* Inlined FFTSpecialInvLazy() as it was called in one place only

* Added a benchmark for DiscreteFourierTransform::FFTSpecial and FFTSpecialInv

* Moved the benchmark for DiscreteFourierTransform::FFTSpecial and FFTSpecialInv to fft-ckks-encoding.cpp

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Changes to improve readability (mostly cosmetic) (#467)

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Add numAutoKeys to RingGSWCryptoParams (#466)

* add numAutoKeys to RingGSWCryptoParams

* numAutoKeys arg to end; throw if numAutoKeys==0

* Added m_numAutoKeys to save()/load() for RingGSWCryptoParams

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* added support for Compress to BFV for HPS* modes (#472)

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* Modified math (#476)

* initial setup for modifications to Lattice and Math Layers

* modifications to Lattice and Math Layers; Poly into HAL; optimization of poly/dcrtpoly rootines; speedup builds; workaround for include *.cpp files

* checkpoint after modified SwitchModulus

* remove unused variable

* checkpoint before adding operator*=(NativeInteger) to DCRTPoly

* added a few NativeInteger operations DCRTPoly

* decouple and add guards for BE2/4/6; bug fix for index check

* updated Native/BE4 Vector/Integer routines; updated IntegerMath benchmark; use of uint64_t as BigInteger for BE4

* updates after unit tests and benchmarking

* optimizations to distribution generators

* optimizations to binfhe

* updated CMake file

* a few binfhe optimizations

* DCRTPoly passed by const& instead of value in keyswitch

* fix for failed workflow

* fix for BE6

* remove noexcept from default ctor (#485)

* Code for multi-input gates (#488)

* new branch to transfer changes from srv_multi_input_gates branch because that branch has many conflicts after carlo's PR was merged into dev

* small change for compatibility with paramsgen script

* confirmed changes to not conflict with carlo's pr

* fixed doxygen comments

* hardening and optimizations of CKKS bootstrapping for sparse secrets (#489)

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* implemented approximate gadget decomposition (#487)

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* Added noise flag for parameter estimator script (#492)

* added noise flag for parameter estimator script

* sorted the variable names in config_core.h

---------

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* Scheme switching (#367) (#486)

* initial switch CKKS->FHEW

* initial switch FHEW->CKKS

* sign evaluation via scheme switching

* initial min/max

* some code cleanup

* 3 scaletechs and argminAlt

* secure CKKS->FHEW switching

* all scaling modes

* unit tests

* examples and documentation

* extra and code clean-up

* 128-bit and cleanup

* finalized rebase + renamed constants

* params for inner binfhe cc and comments

* addressed all comments except circular dependency + reused code

* addressed all comments except fwd headers

* constants file in core

* rebased again to resolve conflicts

* 454 fix comments in binfhe documentation (#496)

* updated descriptions in binfhe header files

* updated README

* more README and comments updates

* FIxed CKKS precision unit tests (#499)

* fixed CKKS precision unit tests

* additional fix

---------

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* trimmed unit tests for scheme switching (#501)

* trimmed unit tests for scheme switching

* more trimming of scheme switching unit tests

* Issue 495 optimized fhew parameters (#503)

* simplified named parameter sets for binfhe

* optimized STD128* datasets

* added more optimized parameters for FHEW

---------

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* Ckks int mp boot tmp (#502)

* Initial commit - driver app stub

* trial one

* stub is ready - adding intmpboot adjust scale

* cleaner version of stub

* Adding generateCRP

* Adding IntMPBootDecrypt

* Adding IntMPBootAdd

* Adding IntMPBootEncrypt

* first working implementation - tckks

* evaluating Chebyshev series example

* supporting 4 mode of scaling

* fix scale issue in flexible* modes

* Added unit tests for interactive bootstrapping, fixed some code

* issue in passing compression level parameter from user level params to rns params

* working implementation after moving compression level

* small fix

* Added interactiveBootCompressionLevel to params used for cryptocontext generation

* small updates to improve examples output

* improving comments and adding serialization logic for new parameter: compression level

* Reduced scalingModSize to 50 in unittests

* Changed the epsilon value used for results comparison in unittests

* Added skipTest() to BaseTestCase.h to skip some unittests

* Ran pre-commit on all changed files and removed tabs

* fixed error messages and DropLastElement -> DropLastElements

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Pke documentation + optimized parameters for LMKCDEY FHEW (#507)

* beginning of documentation changes

* documentation changes

* more updates in the parameter sets

* many documentation changes in cryptocontext.h and some other small changes

* more FHEW parameter changes

* optimized FHEW parameter sets

---------

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* Unittests fail on mingw (#506)

* Fixed unittest failures on MinGW

* Disabled an OMP pragma that caused a crash on MinGW

* Completely disabled that pragma as it should be revised

* int32_t and std::abs

* Corrected the CryptoContext static data members

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
Co-authored-by: Andreea Alexandru <aalexandru@dualitytech.com>

* 483 implement compiler specific optimizations for ntt and ringmult (#508)

* limited omp performance tuning

* tunning of ModAdd/ModMul for g++-10/WITH_NATIVEOPT=OFF/OMP_NUM_THREADS=1; Implementation of NoCheck functions

* change >= to > in ModAddFastEq for performance

* initial tunning of ntt for g++-10/WITH_NATIVEOPT=OFF/OMP_NUM_THREADS=1

* tunning of ntt/intt for g++-10/WITH_NATIVEOPT=OFF/WITH_OPENMP=OFF

* Issue 434 (#450)

* Fix unnecesary copy

* Additional code corrections

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

* Reduced runtime of pke unit tests (#510)

* optimized many unit tests

* reduce time scheme switching unit tests

---------

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* Documentation changes (#514)

* some documentation changes

* fixed README

* more documentation changes

* more documentation changes

* more rst changes

* more documentation changes

---------

Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>

* Compiler errors on macos (#515)

* Removed constexpr for some utility functions

* Moved ToNativePoly() from poly-impl.h to poly.h

---------

Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>

---------

Co-authored-by: sararv22 <100254654+sararv22@users.noreply.github.com>
Co-authored-by: Rener Oliveira <53785783+reneroliveira@users.noreply.github.com>
Co-authored-by: Bastiaan Quast <bquast@gmail.com>
Co-authored-by: yspolyakov <89226542+yspolyakov@users.noreply.github.com>
Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>
Co-authored-by: Jack Bates <101598183+jbates-duality@users.noreply.github.com>
Co-authored-by: caesar <caesar.etos@gmail.com>
Co-authored-by: Ian Quah <iquah@dualitytech.com>
Co-authored-by: Saroja Erabelli <serabelli@dualitytech.com>
Co-authored-by: Andrey Kim <kimandr.kz@gmail.com>
Co-authored-by: Andrey Kim <andreykim@Andreys-MacBook-Pro.local>
Co-authored-by: sarojaduality <95240483+sarojaduality@users.noreply.github.com>
Co-authored-by: iquah1 <97902382+iquah1@users.noreply.github.com>
Co-authored-by: andreea-alexandru <31080521+andreea-alexandru@users.noreply.github.com>
Co-authored-by: pascoec <123595534+pascoec@users.noreply.github.com>
Co-authored-by: Eric Astor <epastor@google.com>
Co-authored-by: Yongwoo Lee <yongwool@snu.ac.kr>
Co-authored-by: randomcryptoguy <yw0803.lee@samsung.com>
Co-authored-by: sararv22 <saraswathy@dualitytech.com>
Co-authored-by: Hunter Richards <36270862+harichards@users.noreply.github.com>
Co-authored-by: Andreea Alexandru <aalexandru@dualitytech.com>
Co-authored-by: Saman <100295082+enum-class@users.noreply.github.com>
gong-cr pushed a commit to gong-cr/openfhe-development that referenced this pull request Mar 6, 2024
* fix bfv hps

* Moved bfv-mult-bug.cpp to src/pke/extras

* Added unittests to check the multiplicative depth limit

* dcrtpoly bug fix with alpha

* some tests should not run for mathbackend 2

* updated unit tests for deep BFV setups

* fixed the overflow check for max double

---------

Co-authored-by: Andrey Kim <andreykim@Andreys-MacBook-Pro.local>
Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>
gong-cr pushed a commit to gong-cr/openfhe-development that referenced this pull request Mar 6, 2024
* fix bfv hps

* Moved bfv-mult-bug.cpp to src/pke/extras

* Added unittests to check the multiplicative depth limit

* dcrtpoly bug fix with alpha

* some tests should not run for mathbackend 2

* updated unit tests for deep BFV setups

* fixed the overflow check for max double

---------

Co-authored-by: Andrey Kim <andreykim@Andreys-MacBook-Pro.local>
Co-authored-by: Dmitriy Suponitskiy <dsuponitskiy@dualitytech.com>
Co-authored-by: Yuriy Polyakov <ypolyakod@dualitytech.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Multiplicative depth limitation for HPS, HPSPOVERQ and HPSOVERQLEVELED modes of BFV
4 participants