Skip to content

lattigo: fix galois key generation for negative rotations - #3341

Open
AlexanderViand wants to merge 1 commit into
mainfrom
alex/negative-lattigo-rotations
Open

lattigo: fix galois key generation for negative rotations#3341
AlexanderViand wants to merge 1 commit into
mainfrom
alex/negative-lattigo-rotations

Conversation

@AlexanderViand

Copy link
Copy Markdown
Collaborator

Lattigo's ConfigureCryptoContext should use normalizeRotation on the rotation index first, otherwise negative rotations simply get galois element "1" since the loop was never entered.

Fixes #3337

The galois element loop in ConfigureCryptoContext only multiplied for
positive shifts, so negative rotation indices produced galoisElement = 1
and rotation failed at runtime. Reduce the shift mod 2N first, matching
lattigo's Parameters.GaloisElement.
@AlexanderViand

Copy link
Copy Markdown
Collaborator Author

@Someone117

@j2kun j2kun added the pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing label Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pull_ready Indicates whether a PR is ready to pull. The copybara worker will import for internal testing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lattigo Negative Rotation Key Failure

2 participants