# Bug Reports

**URL:** https://openfhe.discourse.group/c/bug-reports/22.md

[Latest](https://openfhe.discourse.group/latest.md) · [Categories](https://openfhe.discourse.group/categories.md) · [Tags](https://openfhe.discourse.group/tags.md)

---

## [About the Bug Reports category](https://openfhe.discourse.group/t/about-the-bug-reports-category/2368)

<div class="topic-metadata">

**Author:** [@ypolyakov](https://openfhe.discourse.group/u/ypolyakov)\
**Replies:** 0

</div>

---

## [\[Bug report\] CKKS \`COMPOSITESCALINGAUTO\` can generate a first composite modulus over 5 bits below \`firstModSize\`](https://openfhe.discourse.group/t/bug-report-ckks-compositescalingauto-can-generate-a-first-composite-modulus-over-5-bits-below-firstmodsize/2377)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [September 16, 2026, 4:47pm UTC](https://openfhe.discourse.group/t/bug-report-ckks-compositescalingauto-can-generate-a-first-composite-modulus-over-5-bits-below-firstmodsize/2377 "2026-09-16T16:47:53Z")

</div>

Hi OpenFHE team, I would like to report a CKKS parameter-generation correctness issue in the composite-scaling path. Summary At OpenFHE v1.5.1 commit 1306d14f8c26bb6150d3e6ad54f28dfe1007689e, a public GenCryptoContext(…

---

## [\[Bug report\] 128-bit CKKS plaintext encoding right-shifts by out-of-range counts for tiny inputs and misencodes results](https://openfhe.discourse.group/t/bug-report-128-bit-ckks-plaintext-encoding-right-shifts-by-out-of-range-counts-for-tiny-inputs-and-misencodes-results/2363)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 2\
**Last updated:** [September 15, 2026, 7:57pm UTC](https://openfhe.discourse.group/t/bug-report-128-bit-ckks-plaintext-encoding-right-shifts-by-out-of-range-counts-for-tiny-inputs-and-misencodes-results/2363 "2026-09-15T19:57:55Z")

</div>

Hi OpenFHE team, I would like to report a reproducible 128-bit CKKS plaintext-encoding bug for extremely small finite inputs. Summary In the NATIVEINT == 128 CKKS packed-encoding path, the real branch computes: int64\_…

---

## [Bug: Sparsely packed EvalBootstrap quietly destroys the message for certain levelBudget\[1\] values without any exception or warning](https://openfhe.discourse.group/t/bug-sparsely-packed-evalbootstrap-quietly-destroys-the-message-for-certain-levelbudget-1-values-without-any-exception-or-warning/2370)

<div class="topic-metadata">

**Author:** [@xelananv](https://openfhe.discourse.group/u/xelananv)\
**Replies:** 1\
**Last updated:** [September 15, 2026, 7:52pm UTC](https://openfhe.discourse.group/t/bug-sparsely-packed-evalbootstrap-quietly-destroys-the-message-for-certain-levelbudget-1-values-without-any-exception-or-warning/2370 "2026-09-15T19:52:35Z")

</div>

This bugreport is already up as issue 1264 on github, but this website seems like the more appropriate place for it, so ill duplicate it here. If I am wrong, apologies for the double report :wink: Version v1.5.1 release…

---

## [Unexpected result after CKKS-to-FHEW switching with multiplicativeDepth=1 and FIXEDAUTO](https://openfhe.discourse.group/t/unexpected-result-after-ckks-to-fhew-switching-with-multiplicativedepth-1-and-fixedauto/2380)

<div class="topic-metadata">

**Author:** [@takataka](https://openfhe.discourse.group/u/takataka)\
**Replies:** 0\
**Last updated:** [September 8, 2026, 3:55pm UTC](https://openfhe.discourse.group/t/unexpected-result-after-ckks-to-fhew-switching-with-multiplicativedepth-1-and-fixedauto/2380 "2026-09-08T15:55:41Z")

</div>

”Unexpected result after CKKS-to-FHEW switching with multiplicativeDepth=1 and FIXEDAUTO” Hello OpenFHE developers, I am testing CKKS-to-FHEW scheme switching with the following configuration: OpenFHE version/commit…

---

## [\[Bug report\] \`NativeIntegerT::MultiplyAndRound()\` can mis-round ordinary 60-bit inputs because it routes through \`double\`](https://openfhe.discourse.group/t/bug-report-nativeintegert-multiplyandround-can-mis-round-ordinary-60-bit-inputs-because-it-routes-through-double/2379)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 0\
**Last updated:** [September 8, 2026, 1:08pm UTC](https://openfhe.discourse.group/t/bug-report-nativeintegert-multiplyandround-can-mis-round-ordinary-60-bit-inputs-because-it-routes-through-double/2379 "2026-09-08T13:08:36Z")

</div>

Hi OpenFHE team, I would like to report a reproducible correctness issue in the public low-level integer helper. Summary NativeIntegerT::MultiplyAndRound() is implemented in ubintnat.h using floating-point arithmetic: …

---

## [\[Bug report\] CKKS scheme switching can round residues incorrectly because \`RoundqQAlter()\` uses \`double\`](https://openfhe.discourse.group/t/bug-report-ckks-scheme-switching-can-round-residues-incorrectly-because-roundqqalter-uses-double/2378)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 0\
**Last updated:** [September 8, 2026, 12:58pm UTC](https://openfhe.discourse.group/t/bug-report-ckks-scheme-switching-can-round-residues-incorrectly-because-roundqqalter-uses-double/2378 "2026-09-08T12:58:53Z")

</div>

Hi OpenFHE team, I would like to report a reproducible correctness issue in the CKKS-to-FHEW scheme-switching path. Summary OpenFHE v1.5.1 exposes the CKKS-to-FHEW switching path through the public CryptoContext wrappe…

---

## [\[Bug report\] OpenFHE 128-bit CKKS can silently wrap a scaled real plaintext coefficient modulo the active tower and decode near zero](https://openfhe.discourse.group/t/bug-report-openfhe-128-bit-ckks-can-silently-wrap-a-scaled-real-plaintext-coefficient-modulo-the-active-tower-and-decode-near-zero/2375)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 0\
**Last updated:** [September 4, 2026, 9:03am UTC](https://openfhe.discourse.group/t/bug-report-openfhe-128-bit-ckks-can-silently-wrap-a-scaled-real-plaintext-coefficient-modulo-the-active-tower-and-decode-near-zero/2375 "2026-09-04T09:03:11Z")

</div>

Hi OpenFHE team, I would like to report a reproducible CKKS correctness issue in the NATIVEINT == 128 COMPLEX encoding path. Summary With a public parameter set that OpenFHE accepts: multiplicative\_depth = 0 scaling\_…

---

## [\[Bug report\] \`PolyImpl\` signed-vector assignment negates signed minimum values and triggers UB](https://openfhe.discourse.group/t/bug-report-polyimpl-signed-vector-assignment-negates-signed-minimum-values-and-triggers-ub/2367)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 2\
**Last updated:** [August 28, 2026, 10:42am UTC](https://openfhe.discourse.group/t/bug-report-polyimpl-signed-vector-assignment-negates-signed-minimum-values-and-triggers-ub/2367 "2026-08-28T10:42:20Z")

</div>

Hi OpenFHE team, I would like to report a reproducible boundary-value bug in the public lattice assignment operators that accept signed integer vectors. Summary The public default-backend lattice types expose: Poly& o…

---

## [\[Bug report\] 128-bit CKKS scalar EvalAdd/EvalSub/EvalMult can shift by out-of-range counts for tiny operands, and EvalMult can produce wrong results](https://openfhe.discourse.group/t/bug-report-128-bit-ckks-scalar-evaladd-evalsub-evalmult-can-shift-by-out-of-range-counts-for-tiny-operands-and-evalmult-can-produce-wrong-results/2362)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [August 12, 2026, 8:17pm UTC](https://openfhe.discourse.group/t/bug-report-128-bit-ckks-scalar-evaladd-evalsub-evalmult-can-shift-by-out-of-range-counts-for-tiny-operands-and-evalmult-can-produce-wrong-results/2362 "2026-08-12T20:17:41Z")

</div>

Hi OpenFHE team, I would like to report a reproducible 128-bit CKKS scalar-processing bug for extremely small finite double operands. Summary In the NATIVEINT == 128 CKKS scalar paths, OpenFHE derives: int32\_t pRemain…

---

## [\[Bug report\] "Discrete Gaussian Generator Generic" shallow-copies owned SamplerCombiner pointers, causing use-after-free on destruction](https://openfhe.discourse.group/t/bug-report-discrete-gaussian-generator-generic-shallow-copies-owned-samplercombiner-pointers-causing-use-after-free-on-destruction/2365)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [August 12, 2026, 8:07pm UTC](https://openfhe.discourse.group/t/bug-report-discrete-gaussian-generator-generic-shallow-copies-owned-samplercombiner-pointers-causing-use-after-free-on-destruction/2365 "2026-08-12T20:07:15Z")

</div>

Hi OpenFHE team, I would like to report a reproducible C++ lifetime bug in the public DiscreteGaussianGeneratorGeneric class. Summary DiscreteGaussianGeneratorGeneric allocates SamplerCombiner objects with new, stores …

---

## [\[Bug report\] BFV/BGV \`EvalAtIndexKeyGen(INT\_MIN)\` can hang in automorphism-index computation](https://openfhe.discourse.group/t/bug-report-bfv-bgv-evalatindexkeygen-int-min-can-hang-in-automorphism-index-computation/2364)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [August 12, 2026, 7:59pm UTC](https://openfhe.discourse.group/t/bug-report-bfv-bgv-evalatindexkeygen-int-min-can-hang-in-automorphism-index-computation/2364 "2026-08-12T19:59:34Z")

</div>

Hi OpenFHE team, I would like to report a reproducible public-API availability bug in the BFV/BGV EvalAtIndex key-generation path. Summary For BFV and BGV, the public APIs: CryptoContextImpl::EvalAtIndexKeyGen(...) t…

---

## [\[Bug report\] Field2n(const Poly&) can flip the sign of positive centered coefficients above \`INT64\_MAX\`](https://openfhe.discourse.group/t/bug-report-field2n-const-poly-can-flip-the-sign-of-positive-centered-coefficients-above-int64-max/2361)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [August 12, 2026, 7:55pm UTC](https://openfhe.discourse.group/t/bug-report-field2n-const-poly-can-flip-the-sign-of-positive-centered-coefficients-above-int64-max/2361 "2026-08-12T19:55:46Z")

</div>

Hi OpenFHE team, I would like to report a reproducible correctness bug in the public Field2n(const Poly&) constructor. When a Poly uses a modulus larger than 2^64 and contains a coefficient on the positive side of the …

---

## [\[Bug report\] \`SamplerCombiner\` ignores its second sampler parameter and returns incorrect combined values for distinct samplers](https://openfhe.discourse.group/t/bug-report-samplercombiner-ignores-its-second-sampler-parameter-and-returns-incorrect-combined-values-for-distinct-samplers/2366)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [August 12, 2026, 7:50pm UTC](https://openfhe.discourse.group/t/bug-report-samplercombiner-ignores-its-second-sampler-parameter-and-returns-incorrect-combined-values-for-distinct-samplers/2366 "2026-08-12T19:50:29Z")

</div>

Hi OpenFHE team, I would like to report a reproducible correctness bug in the public SamplerCombiner class declared in src/core/include/math/discretegaussiangeneratorgeneric.h. Summary SamplerCombiner is documented and…

---

## [\[Bug report\] \`ConvertToInt32\` silently narrows centered values outside the int32\_t range](https://openfhe.discourse.group/t/bug-report-converttoint32-silently-narrows-centered-values-outside-the-int32-t-range/2360)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [August 11, 2026, 3:46pm UTC](https://openfhe.discourse.group/t/bug-report-converttoint32-silently-narrows-centered-values-outside-the-int32-t-range/2360 "2026-08-11T15:46:11Z")

</div>

Hi OpenFHE team, I would like to report a reproducible correctness bug in OpenFHE’s public matrix conversion API: Matrix\<int32\_t\> ConvertToInt32(const Matrix\<BigInteger\>& input, const Big…

---

## [\[Question / parser robustness report\] BFVrns ciphertext deserialization can reach impractical allocation requests from malformed ciphertext metadata](https://openfhe.discourse.group/t/question-parser-robustness-report-bfvrns-ciphertext-deserialization-can-reach-impractical-allocation-requests-from-malformed-ciphertext-metadata/2344)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 2\
**Last updated:** [August 11, 2026, 8:52am UTC](https://openfhe.discourse.group/t/question-parser-robustness-report-bfvrns-ciphertext-deserialization-can-reach-impractical-allocation-requests-from-malformed-ciphertext-metadata/2344 "2026-08-11T08:52:58Z")

</div>

Hi OpenFHE team, I would like to report a ciphertext deserialization robustness issue and ask whether the following behavior is expected. Summary In OpenFHE v1.5.1, a bounded corruption of an OpenFHE-generated BFVrns c…

---

## [\[Question / UB report\] BinFHE LMKCDEY SignedDigitDecompose performs signed left shifts with undefined behavior](https://openfhe.discourse.group/t/question-ub-report-binfhe-lmkcdey-signeddigitdecompose-performs-signed-left-shifts-with-undefined-behavior/2342)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 4\
**Last updated:** [August 5, 2026, 9:10pm UTC](https://openfhe.discourse.group/t/question-ub-report-binfhe-lmkcdey-signeddigitdecompose-performs-signed-left-shifts-with-undefined-behavior/2342 "2026-08-05T21:10:13Z")

</div>

Hi OpenFHE team, I would like to ask whether the following SignedDigitDecompose behavior is intentional and report an UndefinedBehaviorSanitizer (UBSan) finding from a normal BinFHE gate evaluation. Summary In OpenFHE …

---

## [\[Bug report\] BE2 bigintfxd unsigned reverse loops wrap and access out of bounds at the full-width boundary](https://openfhe.discourse.group/t/bug-report-be2-bigintfxd-unsigned-reverse-loops-wrap-and-access-out-of-bounds-at-the-full-width-boundary/2359)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 2\
**Last updated:** [August 5, 2026, 7:49am UTC](https://openfhe.discourse.group/t/bug-report-be2-bigintfxd-unsigned-reverse-loops-wrap-and-access-out-of-bounds-at-the-full-width-boundary/2359 "2026-08-05T07:49:13Z")

</div>

Hi OpenFHE team, I would like to report a memory-safety bug family in the optional BE2 fixed-width big-integer backend (MATHBACKEND=2 / WITH\_BE2). Summary The bigintfxd backend contains several reverse loops that use a…

---

## [\[Bug report\] 128-bit CKKS complex encoding uses a 64-bit shift in the imaginary branch and can misencode results](https://openfhe.discourse.group/t/bug-report-128-bit-ckks-complex-encoding-uses-a-64-bit-shift-in-the-imaginary-branch-and-can-misencode-results/2358)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [August 3, 2026, 7:32pm UTC](https://openfhe.discourse.group/t/bug-report-128-bit-ckks-complex-encoding-uses-a-64-bit-shift-in-the-imaginary-branch-and-can-misencode-results/2358 "2026-08-03T19:32:55Z")

</div>

Hi OpenFHE team, I would like to report a correctness bug in the NATIVEINT == 128 CKKS complex-encoding path. Summary In the 128-bit CKKS encoder, the real branch scales with a 128-bit constant: ((int128\_t)1) \<\< pRema…

---

## [\[Bug report\] BinFHE EvalBinGate(vector) lacks arity/null checks and crashes on malformed vectors](https://openfhe.discourse.group/t/bug-report-binfhe-evalbingate-vector-lacks-arity-null-checks-and-crashes-on-malformed-vectors/2356)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [August 3, 2026, 6:52pm UTC](https://openfhe.discourse.group/t/bug-report-binfhe-evalbingate-vector-lacks-arity-null-checks-and-crashes-on-malformed-vectors/2356 "2026-08-03T18:52:30Z")

</div>

Hi OpenFHE team, I would like to report an input-validation issue in the BinFHE multi-input gate API that can result in undefined behavior and process crashes. Summary BinFHEContext::EvalBinGate(BINGATE, const std::vec…

---

## [Bug report\] BinFHEContext::SwitchCTtoqn accepts malformed LWESwitchingKey tensors and crashes in KeySwitch](https://openfhe.discourse.group/t/bug-report-binfhecontext-switchcttoqn-accepts-malformed-lweswitchingkey-tensors-and-crashes-in-keyswitch/2355)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [August 3, 2026, 6:50pm UTC](https://openfhe.discourse.group/t/bug-report-binfhecontext-switchcttoqn-accepts-malformed-lweswitchingkey-tensors-and-crashes-in-keyswitch/2355 "2026-08-03T18:50:11Z")

</div>

Hi OpenFHE team, I would like to report an input-validation issue in the BinFHE key-switching path that can lead to unchecked out-of-bounds access in KeySwitch(), and ask whether malformed LWESwitchingKey shape is expec…

---

## [\[Bug report\] BinFHEContext::SwitchCTtoqn accepts malformed large-dimension ciphertexts when the modulus matches](https://openfhe.discourse.group/t/bug-report-binfhecontext-switchcttoqn-accepts-malformed-large-dimension-ciphertexts-when-the-modulus-matches/2354)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [August 3, 2026, 6:47pm UTC](https://openfhe.discourse.group/t/bug-report-binfhecontext-switchcttoqn-accepts-malformed-large-dimension-ciphertexts-when-the-modulus-matches/2354 "2026-08-03T18:47:33Z")

</div>

Hi OpenFHE team, I would like to report an input-validation issue in BinFHEContext::SwitchCTtoqn() that can lead to an out-of-bounds read inside KeySwitch(), and ask whether the current validation logic is intentional. …

---

## [BinFHEContext::Decrypt accepts undersized ciphertexts, leading to an out-of-bounds read](https://openfhe.discourse.group/t/binfhecontext-decrypt-accepts-undersized-ciphertexts-leading-to-an-out-of-bounds-read/2353)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [August 3, 2026, 6:44pm UTC](https://openfhe.discourse.group/t/binfhecontext-decrypt-accepts-undersized-ciphertexts-leading-to-an-out-of-bounds-read/2353 "2026-08-03T18:44:25Z")

</div>

Hi OpenFHE team, I would like to report an input-validation issue in the BinFHE decryption path that can lead to an out-of-bounds read, and ask whether malformed ciphertext length is supposed to be validated at this API…

---

## [Malformed BinFHEContext archive can trigger a heap-buffer-overflow in RingGSWCryptoParams::PreCompute](https://openfhe.discourse.group/t/malformed-binfhecontext-archive-can-trigger-a-heap-buffer-overflow-in-ringgswcryptoparams-precompute/2352)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [August 3, 2026, 6:43pm UTC](https://openfhe.discourse.group/t/malformed-binfhecontext-archive-can-trigger-a-heap-buffer-overflow-in-ringgswcryptoparams-precompute/2352 "2026-08-03T18:43:07Z")

</div>

Hi OpenFHE team, I would like to report a deserialization input-validation issue that can lead to an ASan-confirmed heap-buffer-overflow in RingGSWCryptoParams::PreCompute(). Summary A malformed but still-parseable ser…

---

## [\[Bug report\]OpenFHE vector ModExp and ModExpEq produce incorrect results when the exponent is greater than or equal to the vector modulus](https://openfhe.discourse.group/t/bug-report-openfhe-vector-modexp-and-modexpeq-produce-incorrect-results-when-the-exponent-is-greater-than-or-equal-to-the-vector-modulus/2341)

<div class="topic-metadata">

**Author:** [@CCYJ](https://openfhe.discourse.group/u/CCYJ)\
**Replies:** 1\
**Last updated:** [July 16, 2026, 4:52pm UTC](https://openfhe.discourse.group/t/bug-report-openfhe-vector-modexp-and-modexpeq-produce-incorrect-results-when-the-exponent-is-greater-than-or-equal-to-the-vector-modulus/2341 "2026-07-16T16:52:32Z")

</div>

Hi OpenFHE team, I would like to report a possible correctness issue in the vector modular-exponentiation APIs and ask for confirmation of the intended contract. Summary \`NativeVector::ModExp\` and \`NativeVector::ModExp…
