Skip to content

Fix key and metadata state handling - #1348

Merged
pascoec merged 8 commits into
devfrom
1344-code-issues
Sep 25, 2026
Merged

pascoec merged 8 commits into
devfrom
1344-code-issues

Conversation

@dsuponitskiy

Copy link
Copy Markdown
Collaborator
  • preserve key tags through evaluation-key copy and move operations
  • add explicit move semantics to key base classes
  • initialize encryption and decryption result fields
  • preserve derived metadata when cloning by key
  • complete RingGSW parameter equality checks
  • correct the LWE switching-key serialized name
  • add regression coverage for the fixes

@dsuponitskiy dsuponitskiy added this to the Release 1.6.0 milestone Sep 24, 2026
@dsuponitskiy dsuponitskiy self-assigned this Sep 24, 2026
@dsuponitskiy dsuponitskiy added the cleanup Code cleanup label Sep 24, 2026
- preserve key tags through evaluation-key copy and move operations
- add explicit move semantics to key base classes
- initialize encryption and decryption result fields
- preserve derived metadata when cloning by key
- complete RingGSW parameter equality checks
- correct the LWE switching-key serialized name
- add regression coverage for the fixes
LWE ciphertexts did not serialize their plaintext modulus, so inputs
encrypted with p=6 or p=8 came back with the default of 4. Multi-input
gates took their output encoding from that tag, and OR3, AND4 and OR4
then decrypted wrongly after a round trip.

Serialize and compare the modulus, and take it from the gate rather
than from the first input, which also covers copies. Ciphertext
archives written before this change do not load.
- operator=(uint64_t) and operator=(const PolyType&) now set the
  element's format to match its towers
- CloneWithNoise samples the noise as coefficients and converts to the
  requested format, instead of ignoring it and labelling the samples
  with the element's current format
- SwitchModulusAtIndex updates a copy of the parameters rather than the
  object shared with other elements, which it also left stale
- AddILElementOne's error names EVALUATION, the format it requires
- document that the PolyType and PolyLargeType conversions need
  COEFFICIENT input
@pascoec
pascoec merged commit 1947bb4 into dev Sep 25, 2026
20 checks passed
@pascoec
pascoec deleted the 1344-code-issues branch September 25, 2026 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cleanup Code cleanup

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Potential code Issues that Claude found when adding doxygen comments

3 participants