IP Library › Granted Patent US 12,425,183
Granted Patent B1
US 12,425,183 · App. 18/609,995 · Granted Sep 23, 2025

Reducing homomorphic encryption rotations when reshaping a ciphertext

Inventors: Nir Drucker (Zichron Yaakov, IL); Gilad Ezov (Binyamina, IL)
Assignee: International Business Machines Corporation
H04L9/008
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12,425,183
App. No.
18/609,995
Granted
Sep 23, 2025
Kind
B1
Abstract

Reducing homomorphic encryption (HE) rotations is provided. Input of a source tensor of HE ciphertexts is received and a mapping of elements from the source tensor to a target tensor. For each ciphertext, a vector of required rotations is computed according to the mapping plus a list of unique rotations. A first and second list of rotations are generated which have a combined number of rotations less than the list of unique rotations. For each rotation in the first list a ciphertext vector is computed that holds selected elements cyclically rotated by that rotation. For each rotation in the second list a subset of elements is selected from the ciphertext which is summed with ciphertext vectors generated according to the first list. A rotated ciphertext is generated from this sum rotated by the rotation in the second list. Rotated ciphertexts are summed, and the target tensor is output.

Claims (106)

1. A computer-implemented method for reducing homomorphic encryption (HE) rotations, the method comprising:

receiving input of a source tensor of HE ciphertexts and a mapping of source elements from the source tensor to a target tensor of HE ciphertexts;

for each source HE ciphertext, computing a rotation vector of required rotations to transform on the source tensor to the target tensor according to the mapping;

computing a list of unique rotations within each rotation vector;

for each rotation vector, generating a first list and second list of rotations from the list of unique rotations, wherein the rotations in the first list are applied before the rotations in the second list, and wherein the combined number of rotations in the first and second list is less than the list of unique rotations of the rotation vector;

for each rotation in the first list:

multiplying the source HE ciphertext by a first mask that selects a subset of source elements according to the mapping to generate a first masked vector;

computing a source ciphertext vector that holds the selected source elements of the first masked vector cyclically rotated by a number of slots specified by the rotation in the first list;

for each rotation in the second list:

multiplying the source HE ciphertext by a second mask that selects a subset of source elements according to the mapping to generate a second masked vector;

summing the second masked vector and any source ciphertext vector generated according to the first list requiring the same rotation in the second list;

computing a rotated HE ciphertext that holds the selected source elements of the second masked vector and source ciphertext vector rotated by a number of slots specified by the unique rotation in the second list;

summing the rotated HE ciphertexts generated according to the first and second lists; and

outputting the target tensor of HE ciphertexts.

2. The method of claim 1 , further comprising recursively applying the steps of claim 1 , wherein the second list of rotations is substituted for the list of unique rotations.

3. The method of claim 2 , wherein the recursion ends upon one of:

reaching a specified maximum multiplication depth;

a latency value of adding another iteration decreases below zero; or

when the list of unique rotations can no longer be split into two lists.

4. The method of claim 1 , wherein:

the first mask is:

approximately 1 in slot positions corresponding to source elements to be selected from the HE ciphertext for the rotation in the first list;

approximately 0 for all other source elements in the HE ciphertext; and

the second mask is:

approximately 1 in slots positions corresponding to source elements to be selected from the HE ciphertext for the rotation in the second list; and

approximately 0 for all other source elements in the HE ciphertext.

5. The method of claim 1 , wherein generating a first list and second list of rotations from the list of unique rotations further comprises:

selecting a number of rotation index values to apply to a ciphertext that modify the list of unique rotations for that ciphertext;

applying the rotation index values to a number of unique rotations that can be merged with target rotations in the list of unique rotations;

generating a dictionary of key values for the unique rotations in the rotation vector;

assigning respective first key values to the unique rotations to which the rotation index values are applied;

assigning a second key value to the target rotations, wherein the second key value indicates the target rotations are left unaltered; and

assigning a third key value to unique rotations in the rotation vector, wherein the third key value indicates that application of the rotation index value produces no net reduction in the number of rotations.

6. The method of claim 5 , wherein the rotation index values comprise the first list of rotations and the rotations assigned the second key value and third key value comprise the second list of rotations.

7. The method of claim 5 , wherein selecting the rotation index value comprises:

generating a number of forest representations of rotations in the list of unique rotations;

for each forest representation, selecting a number of rotations to remove;

for each group of rotations removed from each forest representation, determining a score; and

finding the rotation for each forest representation that minimizes the score.

8. The method of claim 7 , wherein the number of rotations selected for removal are removed one at the time.

9. The method of claim 7 , wherein the number of rotations selected for removal are removed all at once.

10. The method of claim 7 , wherein the score is determined by at least one of:

number of rotations;

forest depth;

level of parallelization;

memory utilization;

power consumption; or

minimizing the required number of rotation keys.

11. A system for reducing homomorphic encryption (HE) rotations, the system comprising:

a storage device that stores program instructions;

one or more processors operably connected to the storage device and configured to execute the program instructions to cause the system to:

receive input of a source tensor of HE ciphertexts and a mapping of source elements from the source tensor to a target tensor of HE ciphertexts;

for each source HE ciphertext, compute a rotation vector of required rotations to transform on the source tensor to the target tensor according to the mapping;

compute a list of unique rotations within each rotation vector;

for each rotation vector, generate a first list and second list of rotations from the list of unique rotations, wherein the rotations in the first list are applied before the rotations in the second list, and wherein the combined number of rotations in the first and second list is less than the list of unique rotations of the rotation vector;

for each rotation in the first list:

multiply the source HE ciphertext by a first mask that selects a subset of source elements according to the mapping to generate a first masked vector;

compute a source ciphertext vector that holds the selected source elements of the first masked vector cyclically rotated by a number of slots specified by the rotation in the first list;

for each rotation in the second list:

multiply the source HE ciphertext by a second mask that selects a subset of source elements according to the mapping to generate a second masked vector;

sum the second masked vector and any source ciphertext vector generated according to the first list requiring the same rotation in the second list;

compute a rotated HE ciphertext that holds the selected source elements of the second masked vector and source ciphertext vector rotated by a number of slots specified by the unique rotation in the second list;

sum the rotated HE ciphertexts generated according to the first and second lists; and

output the target tensor of HE ciphertexts.

12. The system of claim 11 , wherein the program instructions further cause the system to recursively apply the steps of claim 11 , wherein the second list of rotations is substituted for the list of unique rotations.

13. The system of claim 12 , wherein the recursion ends upon one of:

reaching a specified maximum multiplication depth;

a latency value of adding another iteration decreases below zero; or

when the list of unique rotations can no longer be split into two lists.

14. The system of claim 11 , wherein generating a first list and second list of rotations from the list of unique rotations further comprises:

selecting a number of rotation index values to apply to a ciphertext that modify the list of unique rotations for that ciphertext;

applying the rotation index values to a number of unique rotations that can be merged with target rotations in the list of unique rotations;

generating a dictionary of key values for the unique rotations in the rotation vector;

assigning respective first key values to the unique rotations to which the rotation index values are applied;

assigning a second key value to the target rotations, wherein the second key value indicates the target rotations are left unaltered; and

assigning a third key value to unique rotations in the rotation vector, wherein the third key value indicates that application of the rotation index value produces no net reduction in the number of rotations.

15. The system of claim 14 , wherein the rotation index values comprise the first list of rotations and the rotations assigned the second key value and third key value comprise the second list of rotations.

16. The system of claim 14 , wherein selecting the rotation index value comprises:

generating a number of forest representations of rotations in the list of unique rotations;

for each forest representation, selecting a number of rotations to remove;

for each group of rotations removed from each forest representation, determining a score; and

finding the rotation for each forest representation that minimizes the score.

17. The system of claim 16 , wherein the number of rotations selected for removal are removed one at the time.

18. The system of claim 16 , wherein the number of rotations selected for removal are removed all at once.

19. The system of claim 16 , wherein the score is determined by at least one of:

number of rotations;

forest depth;

level of parallelization;

memory utilization;

power consumption; or

minimizing the required number of rotation keys.

20. A computer program product for reducing homomorphic encryption (HE) rotations, the computer program product comprising:

a persistent storage medium having program instructions configured to cause one or more processors to:

receive input of a source tensor of HE ciphertexts and a mapping of source elements from the source tensor to a target tensor of HE ciphertexts;

for each source HE ciphertext, compute a rotation vector of required rotations to transform on the source tensor to the target tensor according to the mapping;

compute a list of unique rotations within each rotation vector;

for each rotation vector, generate a first list and second list of rotations from the list of unique rotations, wherein the rotations in the first list are applied before the rotations in the second list, and wherein the combined number of rotations in the first and second list is less than the list of unique rotations of the rotation vector;

for each rotation in the first list:

multiply the source HE ciphertext by a first mask that selects a subset of source elements according to the mapping to generate a first masked vector;

compute a source ciphertext vector that holds the selected source elements of the first masked vector cyclically rotated by a number of slots specified by the rotation in the first list;

for each rotation in the second list:

multiply the source HE ciphertext by a second mask that selects a subset of source elements according to the mapping to generate a second masked vector;

sum the second masked vector and any source ciphertext vector generated according to the first list requiring the same rotation in the second list;

compute a rotated HE ciphertext that holds the selected source elements of the second masked vector and source ciphertext vector rotated by a number of slots specified by the unique rotation in the second list;

sum the rotated HE ciphertexts generated according to the first and second lists; and

output the target tensor of HE ciphertexts.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 20, 2024
From: DRUCKER, NIR; EZOV, GILAD
To: INTERNATIONAL BUSINESS MACHINES CORPORATION
Reel/Frame 066834/0963 →
References Cited (32)
US 11177935B2 · Musuvathi et al. · 2021 [cited by applicant]
US 11477007B1 · Soceanu et al. · 2022 [cited by applicant]
US 11502820B2 · Ratha et al. · 2022 [cited by applicant]
US 20230053311A1 · Aharoni et al. · 2023 [cited by applicant]
US 20230188317A1 · Choi · 2023 [cited by examiner]
US 20240106803A1 · Race · 2024 [cited by examiner]
US 20240121076A1 · Lee · 2024 [cited by examiner]
US 20240214194A1 · Kapur · 2024 [cited by examiner]
US 20240259180A1 · Joye · 2024 [cited by examiner]
US 20240313945A1 · Choi · 2024 [cited by examiner]
Koo, Zahyun et al. Key Reduction in Multi-Key and Threshold Multi-Key Homomorphic Encryptions by Reusing Error. IEEE Access, vol. 1. https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=10129910 (Year: 2023). [cited by examiner]
Han, Kyoohyung et al. Improved Homomorphic Discrete Fourier Transforms and FHE Bootstrapping. IEEE Access, vol. 7. https://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=8701685 (Year: 2019). [cited by examiner]
Huang, Yun Fan et al. Design and Implementation of Big Data Analysis Algorithm in Ciphertext Domain Based on Homomorphic Encryption. 2021 3rd International Conference on Applied Machine Learning (ICAML). https://ieeexpl… [cited by examiner]
Aharoni et al., “Complex Encoded Tile Tensors: Accelerating Encrypted Analytics,” IEEE Security and Privacy, Sep.-Oct. 2022, pp. 35-43, vol. 20, No. 5, IEEE, accessed on [date], https://ieeexplore.ieee.org/document/9805… [cited by applicant]
Aharoni et al., “HeLayers: A Tile Tensors Framework for Large Neural Networks on Encrypted Data,” Proceedings on Privacy Enhancing Technologies, pp. 1-18, accessed on Feb. 12. 2024, https://arxiv.org/abs/2011.01805. [cited by applicant]
Aharoni et al., “Poster : Secure SqueezeNet inference in 4 minutes,” 43rd IEEE Symposium on Security and Privacy, 2 pages, accessed on Feb. 12, 2024, https://www.ieee-security.org/TC/SP2022/downloads/SP22-posters/sp22-p… [cited by applicant]
Anonymous, “Hyphen: A Hybrid Packing Method and Optimizations for Homomorphic Encryption Based Neural Network,” ICLR 2023, 19 pages, openreview.net, accessed Feb. 9, 2024, https://openreview.net/pdf?id=fyD8adDrXo. [cited by applicant]
Brakerski et al., “Fully Homomorphic Encryption without Bootstrapping,” ACM Transactions on Computation Theory, Jul. 2014, pp. 1-26, vol. 6, Issue 3, accessed Feb. 13, 2024, https://doi.org/10.1145/2633600. [cited by applicant]
Brakerski, “Fully Homomorphic Encryption without Modulus Switching from Classical GapSVP,” Advances in Cryptology—CRYPTO 2012, Lecture Notes in Computer Science, 2012, pp. 1-19, vol. 7417, Springer, Berlin, Germany, acc… [cited by applicant]
Brutzkus et al., “Low latency privacy preserving inference,” International Conference on Machine Learning, 2019, pp. 1-18, arxiv.org, accessed Feburary 14, 2024, https://arxiv.org/abs/1812.10659. [cited by applicant]
Buselli, “Secure AI workloades using full homomorphic encrypted data,” IBM Developer Blog, 2021, 6 pages, ibm.com, accessed on Feb. 16, 2024, https://developer.ibm.com/blogs/secure-ai-workloads-using-fully-homomorphic-e… [cited by applicant]
Cheon et al., “Faster Linear Transformations in HElib, Revisited,” IEEE Access, Apr. 15, 2019, pp. 50595-50604, vol. 7, IEEE, accessed Feb. 16, 2024, https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=8691744. [cited by applicant]
Cheon et al., “Homomorphic Encryption for Arithmetic of Approximate Numbers,” Proceedings of Advances in Cryptology, Nov. 30, 2017, pp. 1-23, Springer, accessed Feb. 14, 2024, https://link.springer.com/chapter/10.1007/9… [cited by applicant]
Crockett, “A low-depth homomorphic circuit for logistic regression model training,” Workshop on Applied Homomorphic Cryptography 2020, 2020, Cryptology ePrint Archive, accessed Feb. 14, 2024, https://eprint.iacr.org/202… [cited by applicant]
Dathathri et al., “CHET: an optimizing compiler for fully-homomorphic neural-network inferencing,” In Proceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation (PLDI 2019), 2019, p… [cited by applicant]
Fan et al., “Somewhat Practical Fully Homomorphic Encryption,” Proceedings of the 15th international conference on Practice and Theory in Public Key Cryptography , 2012, pp. 1-16, accessed Feb. 16, 2024, https://eprint.… [cited by applicant]
Gentry, et al., “Fully Homomorphic Encryption with Polylog Overhead,” Advances in Cryptology—EUROCRYPT 22012: Lecture Notes in Computer Science, 18 pages, vol. 7237, Springer, Berlin, Heidelberg, accessed Feb. 9, 2024, … [cited by applicant]
Halevi et al., “Faster Homomorphic Linear Transformations in HElib,” 2018 pp. 93-120, In: Shacham, H., Boldyreva, A. (eds) Advances in Cryptology—CRYPTO 2018. CRYPTO 2018. Lecture Notes in Computer Science(), vol. 10991… [cited by applicant]
Jiang et al., “Secure Outsourced Matrix Computation and Application to Neural Networks,” In Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security (CCS '18), 2018, pp. 1-23, Association fo… [cited by applicant]
Juvekar et al., “{Gazelle}: A low latency framework for secure neural network inference,” 27th USENIX Security Symposium (USENIX Security 18), 2018, pp. 1651-1668, usenix.org, accessed Feb. 16, 2024, https://www.usenix.… [cited by applicant]
Mihara, et al., “Neural Network Training with Homomorphic Encryption,” Dec. 29, 2020, 13 pages, arXiv.org, accessed Feb. 9, 2024, https://arxiv.org/pdf/2012.13552.pdf. [cited by applicant]
Xuanyuan, et al., “Efficient Privacy-Preserving Inference for Convolutional Neural Networks,” ICLR2022 PAIR(2) Struct Workshop, Aug. 26, 2022, arXiv.org, accessed Feb. 9, 2024, https://arxiv.org/pdf/2110.08321.pdf. [cited by applicant]