Inferensys

Glossary

Galois Keys

Public evaluation keys enabling homomorphic rotation of the slots within a packed ciphertext, required for implementing convolution and matrix multiplication operations in the encrypted domain.
Operations room with a large monitor wall for system visibility and control.
HOMOMORPHIC ROTATION ENABLER

What is Galois Keys?

Galois keys are public evaluation keys in homomorphic encryption that enable the cyclic rotation of data slots within a packed ciphertext, a critical operation for implementing convolution and matrix multiplication on encrypted data.

Galois keys are a specialized type of key-switching key in schemes like BFV, BGV, and CKKS that enable homomorphic automorphisms—specifically, the cyclic rotation of the plaintext slots packed inside a single ciphertext. Without these keys, the evaluator can only perform element-wise addition and multiplication on the packed vector; Galois keys unlock the ability to shift elements left or right, which is essential for implementing the data movement patterns required by linear algebra operations in the encrypted domain.

Generated by the secret key owner and shared with the computation server, Galois keys enable operations like rotating a vector by k positions while consuming a portion of the noise budget. In practice, a separate key is required for each distinct rotation index needed by the circuit, and these keys are fundamental to evaluating convolutional neural network layers and matrix transpositions under encryption, where data must be systematically realigned to perform dot products between weights and inputs.

CRYPTOGRAPHIC PRIMITIVES

Key Properties of Galois Keys

Galois keys are public evaluation keys that enable homomorphic rotation of the slots within a packed ciphertext. They are the essential cryptographic mechanism for implementing convolutions, matrix transpositions, and data shuffling in the encrypted domain without decryption.

01

Slot Rotation Mechanics

Galois keys enable cyclic rotations of the plaintext slots encoded within a single RLWE ciphertext. A rotation by k positions shifts each slot value to slot i+k mod n.

  • Left Rotation: Shifts slots toward the most significant position
  • Right Rotation: Shifts slots toward the least significant position
  • Arbitrary Step Sizes: Any integer step k can be evaluated, provided the corresponding key has been generated

The operation applies a specific automorphism to the underlying ring element, mapping a(X) to a(X^k) modulo the cyclotomic polynomial. This preserves the encrypted state while rearranging the logical data layout.

O(n log n)
Computational Complexity
n/2
Max Distinct Keys
02

Convolution via Rotation

In encrypted neural networks, convolution operations are implemented using Galois rotations and element-wise multiplication. For a filter of size f, the process requires:

  • Rotate the input ciphertext by each offset position in the filter
  • Multiply each rotated ciphertext by the corresponding plaintext filter weight
  • Accumulate all resulting ciphertexts via homomorphic addition

This transforms a spatial convolution into a series of SIMD-friendly operations. The number of rotations scales linearly with the filter size, making Galois key selection a critical performance parameter for CNN inference under FHE.

f²
Rotations per Conv Layer
03

Matrix Multiplication Support

Galois keys enable efficient encrypted matrix multiplication by supporting row-major to column-major transformations and diagonal extraction patterns.

  • Row Rotation: Shifts entire rows within the packed matrix representation
  • Column Extraction: Uses specific rotation patterns to isolate columns for dot-product computation
  • Transposition: Achieved through a sequence of structured rotations and masking operations

This capability is fundamental for implementing fully connected layers and attention mechanisms in transformer architectures operating on encrypted data. The choice of encoding (row-packed vs. column-packed) determines the exact rotation schedule required.

04

Key Generation & Distribution

Galois keys are generated by the data owner using their secret key and published as part of the public evaluation key set. Each distinct rotation step k requires a separate key.

  • Key Material: A Galois key is a special key-switching key that transforms a ciphertext under s(X^k) back to s(X)
  • Storage Cost: Each key is approximately the size of a relinearization key, typically several megabytes
  • Security Property: Possession of Galois keys does not enable decryption; they only permit slot permutation

The set of required rotation indices must be determined before computation begins, as generating new keys requires access to the secret key.

~3-5 MB
Per Key Size
05

Relationship to Key Switching

Galois rotation is a specific instance of the key switching primitive. The operation transforms a ciphertext encrypted under the automorphed secret key s' = s(X^k) back to the original secret key s(X).

  • Underlying Mechanism: Identical to the key switching used in relinearization and modulus switching
  • Decomposition Base: The key switching decomposition base affects both noise growth and computational cost
  • Noise Addition: Each rotation adds a small, additive noise term proportional to the decomposition parameters

This shared mechanism means optimizations to key switching (such as hybrid key switching or GPU acceleration) directly benefit Galois rotation performance.

06

Performance Considerations

Galois rotations are among the most expensive operations in HE computation, typically dominating the runtime of encrypted CNN inference.

  • NTT Operations: Each rotation requires multiple Number Theoretic Transform passes
  • Key Count Trade-off: Generating more keys increases storage but reduces online computation by avoiding rotation decomposition
  • Decomposition Strategy: A rotation by k can be decomposed into a sequence of rotations by powers of two, trading key count for latency
  • Hardware Acceleration: Modern FHE libraries leverage GPU and FPGA acceleration specifically for the NTT-heavy rotation kernel

Optimal key selection is a storage-computation trade-off that must be tuned per model architecture.

60-80%
of FHE Inference Time
GALOIS KEYS EXPLAINED

Frequently Asked Questions

Clear answers to the most common technical questions about Galois keys, their role in homomorphic encryption, and how they enable critical operations like ciphertext rotation for encrypted computation.

Galois keys are a specific type of public evaluation key in Ring Learning With Errors (RLWE)-based homomorphic encryption schemes that enable the homomorphic rotation of the slots within a packed ciphertext. They are generated by the data owner during the key generation phase and shared with the computation server. Without Galois keys, the server can only perform addition and multiplication on ciphertexts; with them, the server gains the ability to cyclically shift the underlying plaintext vector elements. This rotation is essential for implementing matrix multiplication, convolution operations, and general data movement patterns required by neural network inference in the encrypted domain. Each distinct rotation step (e.g., rotate left by 1, rotate right by 3) typically requires its own corresponding Galois key, creating a trade-off between computational flexibility and the size of the public key material that must be transmitted and stored.

Prasad Kumkar

About the author

Prasad Kumkar

CEO & MD, Inference Systems

Prasad Kumkar is the CEO & MD of Inference Systems and writes about AI systems architecture, LLM infrastructure, model serving, evaluation, and production deployment. Over 5+ years, he has worked across computer vision models, L5 autonomous vehicle systems, and LLM research, with a focus on taking complex AI ideas into real-world engineering systems.

His work and writing cover AI systems, large language models, AI agents, multimodal systems, autonomous systems, inference optimization, RAG, evaluation, and production AI engineering.