Accurate fractional homomorphic calculation coding technology
By employing double polynomial encoding techniques and integer homomorphic scheme reconstruction under the RLWE hard problem, the problems of inflation and precision loss in fractional data processing of existing homomorphic encryption algorithms are solved, and high-fidelity results of accurate fractional calculations are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-23
- Publication Date
- 2026-03-27
AI Technical Summary
Existing homomorphic encryption algorithms suffer from message data inflation or precision loss when processing decimal data, making it impossible to achieve accurate decimal calculations.
By employing bipolynomial encoding technology and combining it with existing integer homomorphic schemes for the RLWE hard problem, a homomorphic encryption algorithm supporting precise decimal calculations is designed. This includes message front-end encoding, end-end decoding, dynamic management, reconstruction of bipolynomial homomorphic addition and multiplication stages, and optimization of multiplication operations in a multi-threaded environment.
It achieves high-fidelity calculation of decimal data types, ensuring that the ciphertext calculation result is error-free with the plaintext calculation after decryption, thus satisfying high fidelity and determinism.
Smart Images

Figure FT_1 
Figure BDA0005461628180000021 
Figure BDA0005461628180000022
Abstract
Description
Technical Field
[0001] This invention relates to the field of homomorphic encryption, and more particularly to homomorphic coding techniques for precise decimal calculations, as well as the design of homomorphic calculation methods for new coding techniques. Background Technology
[0002] Homomorphic encryption, as an advanced data protection technology, allows computation on encrypted data without decryption, providing secure computation and sharing capabilities for encrypted data in cloud computing. Homomorphic encryption enables data manipulation without decryption, thus ensuring data privacy in the cloud. Integrating homomorphic encryption into cloud computing platforms not only meets the growing demand for data security but also enables efficient data flow and innovative applications, providing a solid guarantee for the construction of modern industrial systems and the healthy development of the digital economy.
[0003] Since Genty proposed the first fully homomorphic encryption algorithm in 2009, the development of fully homomorphic encryption has entered a fast track, with different advancements in encoding schemes, encryption / decryption structures, noise control, and bootstrapping operations. Representative algorithms include BGV12 (Brakerski et al.), BFV12 (Fan et al.), GSW13 (Gentry et al.), FHEW16 (Ducas et al.), TFHE16 (Chillotti et al.), and CKKS17 (Cheon et al.). The BGV and BFV algorithms introduced message packing operations for the first time, greatly improving algorithm efficiency; the GSW algorithm focuses on binary number field operations, and its unique matrix encryption technology supports efficient evaluation of Boolean circuits. The FHEW and TFHE algorithms focus on fast evaluation of Boolean circuits, with significant improvements in bootstrapping performance. The CKKS algorithm supports approximate floating-point calculations from ciphertext, making it very suitable for handling real number operations.
[0004] Currently, homomorphic encryption algorithms for message data consisting of binary and integer data are becoming increasingly sophisticated, but research on homomorphic algorithms for message data consisting of decimal data is relatively limited. There are two main approaches to this problem. The first is to scale the decimal to an integer as input, thereby nesting existing integer homomorphic algorithms. This approach is relatively simple to implement, but it faces the problem of rapidly expanding message data. The second approach starts from the encoding stage, encoding the decimal data into the plaintext space supported by the homomorphic algorithm, thus expanding the number field. The most representative example is the CKKS algorithm. However, the CKKS algorithm performs approximate calculations on decimal data, resulting in precision loss during the calculation process and failing to obtain the exact result of decimal calculations. Summary of the Invention
[0005] To overcome the defects of the prior art, the present invention proposes a new precise decimal homomorphic computing coding technology - a dual polynomial coding technology for homomorphic encryption. This technology can combine the existing integer homomorphic algorithms under the RLWE difficult problem and expand it into a homomorphic encryption algorithm that supports precise decimal calculation, realizing high-fidelity calculation of decimal ciphertexts.
[0006] Let the extended integer homomorphic scheme be named ε, which includes 7 polynomial-time algorithms: key generation, message encoding, encryption, homomorphic addition, homomorphic multiplication, decryption, and message decoding, denoted as ε.KeyGen(), ε.Ecd(), ε.Enc(), ε.Add(), ε.Mul(), ε.Dec(), and ε.Dcd() respectively.
[0007] The technical solution of the present invention includes:
[0008] (1) Message front-end encoding: The message front-end encoding process is to encode the input decimal vector into a group of integer vectors. For a decimal message input, for the decimal vector Define the precision parameter Let the vector For all 0 ≤ i < n, it satisfies Define the dual polynomial front-end encoding process as ψ, then there is:
[0009] (2) Message end decoding: The end decoding process is to restore the group of integer vectors obtained after decoding to a decimal vector. Let the polynomial obtained by decryption and decoding be The current message precision parameter is
[0010] (3) Dynamic management of messages and plaintexts: After front-end encoding, the message is split from a single vector into two parallel vectors. The two vectors form a corresponding relationship but participate in each link of homomorphic encryption as independent individuals in homomorphic encryption. For the convenience of dynamic data management, this technology uses a set (which can also be called a group) to dynamically manage the above data, denoted as (,) set .
[0011] (4) Design of the dual polynomial homomorphic addition link: As the plaintext changes from a single variable to a binary tuple, this technical solution reconstructs the homomorphic addition link. Homomorphic addition needs to consider the situation where the scaling ratios are different when adding data with different digit precisions, and it is necessary to unify the digit precision in advance. Here, the homomorphic function Mul_Plain() is used, and its function is to implement the multiplication operation between the ciphertext and the plaintext.
[0012] The specific algorithm is shown in Algorithm 1.
[0013]
[0014] (5) Design of double polynomial homomorphic multiplication link: As the plaintext changes from a single variable to a binary tuple, the homomorphic multiplication link of this technical solution is reconstructed. The number of decimal digits in exact decimal multiplication will increase as the number of multiplication layers grows, and scaling needs to be introduced to achieve digit alignment operations. The specific algorithm is shown in Algorithm 2.
[0015]
[0016] (6) Optimization design of double polynomial homomorphic multiplication for multi-threading: In a multi-threaded operating environment, this technical solution proposes a multiplication optimization path. By analyzing the execution logic of the double polynomial multiplication in (5), in a system environment with 4 threads and above, the double polynomial multiplication can be divided into 4 layers for execution: The first layer is naive ciphertext multiplication, which is calculated in parallel and The second layer is ciphertext scalar multiplication, which is calculated in parallel and The third layer is ciphertext addition, calculating The fourth layer is ciphertext addition, calculating
[0017] The present invention can combine the existing integer homomorphic scheme under the RLWE hard problem and expand it into a decimal homomorphic scheme that supports exact calculation. The new scheme supports message input of decimal data types, and as the homomorphic calculation progresses, the result of the calculation under ciphertext has no error compared with the direct calculation of the plaintext after decryption, meeting the high fidelity and determinism of ciphertext calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] Figure 1 Shows the process of implementing the exact decimal homomorphic calculation coding technology, giving the transformation process between messages, plaintexts, and ciphertexts and the corresponding calculation links. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0019] The embodiments of the present invention include:
[0020] (1) Message front-end encoding: The message front-end encoding process is a process of encoding the input decimal vector into an integer vector group. For a decimal message input for the decimal vector Define the precision parameter Let the vector For all 0 ≤ i < n, satisfy Define the double polynomial front-end encoding process as ψ, then there is: Example: Suppose z = [3.14, 1.41, 2, 0.1], let Then we have:
[0021]
[0022] (2) End-of-Message Decoding: The end-of-message decoding process is the process of restoring the decoded integer vector group into a decimal vector. Let the polynomial obtained from decryption and decoding be... The current message precision parameter is
[0023] Example: Suppose h = [3, 1, 2, 0], l = [14, 41, 0, 10], let Then we have:
[0024]
[0025] (3) Dynamic Management of Messages and Plaintext: After front-end encoding, the message is split from a single vector into two parallel vectors. These two vectors form a corresponding relationship but participate in each stage of homomorphic encryption as independent entities. To facilitate dynamic data management, this technology uses a set (also known as a group) approach to dynamically manage the above data, denoted as (,). set .
[0026] (4) Design of the dual polynomial homomorphic addition stage: As the plaintext changes from a univariate variable to a binary tuple, this technical solution reconstructs the homomorphic addition stage. Homomorphic addition needs to consider the situation where the scaling ratio differs when adding data with different digit precisions, requiring the digit precision to be unified in advance. Here, the homomorphic function Mul_Plain() is used, which performs the multiplication operation between the ciphertext and plaintext. The specific algorithm is shown in Algorithm 1.
[0027] Example: C1=([1,2,3,4],[5,6,7,8]) set C2 = ([8,7,6,5],[4,3,2,1]) set Precision parameters
[0028] The steps for homomorphic addition are as follows:
[0029] 1. Adjust and standardize ciphertext precision:
[0030]
[0031] 2. Perform homomorphic addition:
[0032] C add =C′1+C2
[0033] =([1+8,2+7,3+6,4+5],[50+4,60+3,70+2,80+1]) set
[0034] =([9,9,9,9],[54,63,72,81]) set .
[0035] (5) Design of the double polynomial homomorphic multiplication stage: As the plaintext changes from a univariate variable to a binary tuple, this technical solution reconstructs the homomorphic multiplication stage. The number of decimal places in precise decimal multiplication will increase with the number of multiplication layers, requiring the introduction of scaling to achieve digit alignment. The specific algorithm is shown in Algorithm 2.
[0036] Example: Let C1 = ([1,2,3,4],[5,6,7,8]) set C2 = ([8,7,6,5],[4,3,2,1]) set Precision parameters
[0037] The steps for performing homomorphic multiplication are as follows:
[0038] 1. Calculate the ciphertext multiplication of the integer parts:
[0039] c mulh =[1,2,3,4]·[8,7,6,5]=[8,14,18,20];
[0040] 2. Calculate intermediate variables:
[0041] c temp1 =[1,2,3,4]·[4,3,2,1]·10=[40,60,60,40],
[0042] c temp2 =[5,6,7,8]·[8,7,6,5]·10 2 =[4000,4200,4200,4000],
[0043] c temp3 =[5,6,7,8]·[4,3,2,1]=[20,18,14,8].
[0044] 3. Encryption:
[0045] c mulh =c temp1 +c temp2 +c temp3 =[4060,4278,4274,4048]
[0046] 4. Return to the new ciphertext group:
[0047] C mul =([8,14,18,20],[4060,4278,4274,4048]) set .
[0048] (6) Optimization Design of Bipolynomial Homomorphic Multiplication for Multithreaded Systems: In a multithreaded operating environment, this technical solution proposes an optimization path for multiplication. By analyzing the execution logic of bipolynomial multiplication in (5), in a system environment with 4 threads or more, bipolynomial multiplication can be divided into 4 layers of execution: the first layer is naive ciphertext multiplication, which is computed in parallel. and The second layer involves encrypted scalar multiplication, computed in parallel. and The third layer is encrypted addition, calculating... The fourth layer is encrypted addition, calculating...
[0049] Example: Let C1 = ([1,2,3,4],[5,6,7,8]) set C2 = ([8,7,6,5],[4,3,2,1]) set Precision parameters
[0050] The steps for performing homomorphic multiplication are as follows:
[0051] 1. Perform the following naive ciphertext multiplications in parallel:
[0052] c 11 =[1,2,3,4]·[8,7,6,5]=[8,14,18,20],
[0053] c 12 =[1,2,3,4]·[4,3,2,1]=[4,6,6,4],
[0054] c 13 =[5,6,7,8]·[8,7,6,5]=[40,42,42,40],
[0055] c 14 =[5,6,7,8]·[4,3,2,1]=[20,18,14,8];
[0056] 2. Perform the following plaintext scalar multiplications in parallel:
[0057] c 21 =c 12 ·10=[4,6,6,4]·10=[40,60,60,40],
[0058] c 22 =c 13 ·10 2 =[40,42,42,40]·100=[4000,4200,4200,4000];
[0059] 3. Perform plaintext addition:
[0060] c 31 =c 21 +c 22 =[0,60,60,40]+[4000,4200,4200,4000]=[4040,4260,4260,4040];
[0061] 4. Perform plaintext addition:
[0062] c 41 =c 31 +c 14 =[4040,4260,4260,4040]+[20,18,14,8]=[4060,4278,4274,4048];
[0063] 5. Return to the new ciphertext group:
[0064] C mul =(c 11 ,c 41 ) set
[0065] =([8,14,18,20],[4060,4278,4274,4048]) set
[0066] This invention extends existing integer homomorphic schemes for the RLWE hard problem to support precise fractional homomorphic calculations. The new scheme supports fractional data type message input, and as homomorphic computation progresses, the result of the ciphertext calculation, after decryption, shows no error compared to the calculation performed directly on the plaintext, thus satisfying high fidelity and determinism in ciphertext computation.
[0067] Those skilled in the art will understand that all or part of the steps in the methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium. When executed, the program includes all the steps of the above-described methods. The storage medium can be ROM / RAM, magnetic disk, optical disk, memory card, etc. This invention provides a precise decimal homomorphic calculation encoding technology and its main implementation steps, without any limitations on the implementation medium or form. Any simple modifications, equivalent changes, and alterations made to the above-described methods based on the technical essence of this invention shall still fall within the protection scope of this invention.
Claims
1. A precise decimal homomorphic computation encoding method, characterized in that, The method includes: processing the input decimal vector Perform front-end encoding to generate two integer vectors. and in Given a precision parameter, homomorphic encryption is performed on vectors h and l respectively, resulting in two ciphertext vectors. In the encrypted state, addition and multiplication are calculated using a double polynomial method based on the precision parameter, and the precision is standardized by scaling the ciphertext to plaintext. The calculated ciphertext is then decrypted, and the final decoding function is used. The decimal vector result is recovered; the process ensures that the operation result after ciphertext decryption is consistent with the direct operation result of plaintext, and supports precise homomorphic computation of decimals.
2. The method according to claim 1, wherein the front-end encoding process is as follows: And h and l are integer vectors that satisfy:
3. The method according to claim 1, wherein the end decoding function The calculation method is as follows:
4. The method according to claim 1, wherein the homomorphic addition operation comprises: Determine the precision of the two ciphertext vectors involved in the addition. and Those with lower precision are scaled and multiplied by plaintext. Homomorphic addition is performed on the two ciphertext vectors respectively to obtain new ciphertext with uniform precision.
5. The method according to claim 1, wherein the homomorphic multiplication operation comprises: Perform homomorphic multiplication on the integer parts of the two ciphertexts; scale the results of multiplications of integers and decimals, and combinations of two decimal parts; The above products are combined using homomorphic addition to obtain a new ciphertext; and the new precision is set to...
6. The method according to claim 1, wherein the ciphertext data structure is a ciphertext pair, namely (ct1, ct2), which correspond to the integer and decimal encoding parts respectively.
7. The method according to claim 1, wherein, in order to support multi-threaded accelerated computation, the homomorphic multiplication process includes the following four layers of parallel operations: First layer: performing four types of ciphertext multiplication; Second layer: Perform ciphertext multiplication on part of the results; The third layer: performs addition on intermediate results in parallel; Fourth layer: Combine all product results and output the final ciphertext.
8. The method of claim 1, wherein the front-end encoding and the end-end decoding support precision parameters of arbitrary bit length. The system dynamically adjusts based on the number of calculation layers.
9. The method according to claim 1, wherein the supported underlying homomorphic encryption scheme is an integer homomorphic encryption algorithm ε based on the RLWE problem, including modules such as key generation, encryption / decryption, homomorphic addition / multiplication, encoding / decoding, etc.
10. A computing device for implementing the method of any one of claims 1 to 9, comprising: a memory for storing program instructions for executing the method; and a processor for running the program instructions and performing a precise decimal homomorphic calculation task.