Parallel computing method based on GPU optimization for fully homomorphic encryption circuit bootstrapping
By adopting the GPU parallel computing optimization circuit bootstrap method in the TFHE solution, combining the steps under the same ciphertext level and reducing data transfer, the problem of inefficient circuit bootstrap is solved, and more efficient polynomial multiplication operation and data transfer reduction is achieved. , improves the bootloader performance of fully homomorphic encryption circuits.
Patent Information
- Application Number
- CN202210872222.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-20
- Publication Date
- 2024-11-01
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
There is a problem of inefficiency in the bootloader process of existing fully homomorphic encryption circuits, especially in the GPU optimization process, polynomial multiplication and linear combination operations take a long time and data transmission is frequent, so it is impossible to fully utilize the advantages of GPU parallel computing.
Using the parallel computing method based on GPU, the circuit bootstrap process in the TFHE scheme is optimized, and the number of data transfers between the CPU and the GPU is reduced by combining algorithm steps under the same ciphertext level, and the key preprocessing method is designed to initialize in advance. Parameters and vectors to support parallel execution and merge operations.
It improves the operation efficiency of the circuit bootstrap process, reduces the calculation complexity and data transfer times, makes full use of the advantages of GPU parallel computing, and improves the efficiency of polynomial multiplication.
Smart Images

Figure QLYQS_1 
Figure QLYQS_6 
Figure QLYQS_7
Abstract
Description
Technical Field
[0001] The present invention relates to the field of GPU-accelerated homomorphic encryption technology, and in particular to a parallel computing method based on GPU-optimized fully homomorphic encryption circuit bootstrapping, which is applied to parallel computing of fully homomorphic encryption circuit bootstrapping process. Background Art
[0002] The first fully homomorphic encryption (FHE) scheme was proposed by Gentry in 2009. This encryption scheme supports performing arbitrary operations on ciphertext (including addition and multiplication). The result of the ciphertext operation is the same as the result of performing the same operation on the unencrypted data, thereby protecting the privacy of user data. In order to ensure the security of the ciphertext, noise generally needs to be introduced in the FHE scheme. As the number of ciphertext operations increases, the noise of the ciphertext also increases, resulting in incorrect decryption of the ciphertext. In order to overcome this defect and enable the FHE scheme to support an unlimited number of homomorphic operations, the FHE scheme introduces the bootstrapping process. After the ciphertext undergoes several homomorphic operations, it is determined whether the noise level of the ciphertext reaches the threshold that supports correct decryption. If it reaches the threshold, the ciphertext with noise is bootstrapped to obtain a new ciphertext to reset the noise.
[0003] In 2020, Chillotti et al. proposed a fully homomorphic encryption method called TFHE in the paper “TFHE: fast fully homomorphic encryption over the torus. J. Cryptol. 33(1), 34–91(2020)”. This scheme combines the FHE scheme based on the problem of learning with errors (LWE) and implements it on a torus, so that the original LWE ciphertext becomes TLWE ciphertext, RLWE ciphertext becomes TRLWE ciphertext, and GSW ciphertext becomes TRGSW ciphertext. In the TFHE scheme, the TLWE ciphertext is expressed in the form of a polynomial. The TLWE ciphertext is extended to the polynomial torus to obtain the TRLWE ciphertext, and the GSW ciphertext, which is originally expressed in the form of a matrix, is extended to the polynomial torus to obtain the TRGSW ciphertext. At the same time, the TFHE scheme contains all the contents of the two working aspects of the FHE scheme and the hierarchical fully homomorphic scheme (LHE). The work content of the LHE scheme includes the proposal and optimization of efficient LHE algorithms such as finite automata (det-WFA) and homomorphic counters (TBSR). However, the input and output of these efficient LHE algorithms are different ciphertext types and cannot be combined. Therefore, a special ciphertext bootstrapping method is proposed - circuit bootstrapping. The goal of circuit bootstrapping is to convert the TLWE ciphertext with large message noise in the binary space into the TRGSW ciphertext with small noise, so that the efficient LHE algorithms of these arithmetic operations can be combined, which improves the operation efficiency of the LHE algorithm. However, there are many polynomial multiplication operations and linear combination operations in the circuit bootstrapping process, which will consume a lot of time. And because the circuit bootstrapping process involves many steps, the parallelization of each step on the GPU will generate a large number of intermediate data transfer processes, which cannot give full play to the advantages of GPU parallel computing. Summary of the invention
[0004] In order to improve the efficiency of the circuit bootstrapping algorithm in the TFHE scheme in the LHE scheme and avoid the large amount of data transfer work required in the GPU optimization process, the present invention provides a method for implementing the circuit bootstrapping process in the TFHE scheme using GPU parallel computing and applicable to improve the operating efficiency of the polynomial multiplication in the circuit bootstrapping process in the TFHE scheme. Based on the original TFHE circuit bootstrapping scheme, the method uses the advantages of GPU parallel computing to parallelize the polynomial multiplication in the TFHE circuit bootstrapping. At the same time, in order to accelerate this process faster, the method reduces the steps in the circuit bootstrapping and reduces the number of data transfers between the CPU and the GPU. The method merges the algorithm steps running at the same ciphertext level according to the ciphertext level of the circuit bootstrapping process in TFHE, reducing the computational complexity of the algorithm. A method for preprocessing the keys required in the scheme steps in advance is designed to support the merging of its steps and reduce the number of data transfers between the GPU and the CPU.
[0005] The technical solution adopted by the present invention to solve the technical problem is:
[0006] A parallel computing method based on GPU optimization of fully homomorphic encryption circuit bootstrapping, comprising the following steps:
[0007] Step 1: According to the message space μ∈β={0,1} to which the message μ belongs, use Construct ciphertext level n 1 The initial TLWE ciphertext has the polynomial form of Where a and b are both 32-bit integers. Initialize and generate the parameters and various keys preKS, BK, BKFFT and privKS required for each step on the CPU, and pass them to the GPU.
[0008] Step 2: Use the preKS key to convert the ciphertext s 1 From 1 The level is changed to level n 0 The ciphertext The initial value of a is all 0, and b is the same as the ciphertext s 1 In the same way, the corresponding message μ∈β is obtained when s 0 When ciphering, each item is converted to integer form at the same time:
[0009] Step 3: Initialize ACC ciphertext sample:
[0010] Generate basic vector parameters and Here c is a 64-bit integer;
[0011] According to the parameter EL 1Generate vector value M = unit(1) < < (64-(w+1) × Bg 1 ), where 0≤w<EL 1 , Bg 1 is the TRGSW ciphertext at ciphertext level n 1 The order of magnitude of the noise, EL 1 Indicates level n 1 The number of TRLWE ciphertexts contained in the TRGSW ciphertext; for each TRLWE ciphertext, a w and M will be generated, resulting in a total of EL 1 M, for each M there will be a set of VEC and a set of ACC:
[0012]
[0013] For the ciphertext s generated above 0 The nth 0 For item b, if b <n 2 , then VEC 2 The initialization is:
[0014]
[0015] If b≥n 2 , then VEC 2 The initialization is:
[0016]
[0017] The ACC is initialized to a 64-bit TRLWE ciphertext sample of size n 2 , expressed in matrix form as:
[0018]
[0019] The first K-1 rows of the matrix are initialized to 0, and the value of the Kth row is ACC(c Ki )=VEC 2 (c i ),0≤i<n 2 ;
[0020] Initialize ACC before the circuit boot process and pass the value to the GPU;
[0021] Step 4: Bootstrap the circuit and use ACC to 0 Transformed into n 2 TLWE ciphertext in the form of a 64-bit integer of level 2 ;
[0022] Step 5: Utilize s 2 Get level n 1The 32-bit TRGSW ciphertext.
[0023] Furthermore, in step 1, the parameters required for each step and various keys preKS, BK, BKFFT and privKS are expressed as follows:
[0024] preKS=(n 1 ,KSL 1-0 ,B 1-0 ,n 0 )
[0025] preKS represents a size of n 1 ×KSL 1-0 ×B 1-0 The key, KSL 1-0 Indicates that the ciphertext is from level n 1 To level n 0 When the key operates on the ciphertext, the number of valid digits, where the data is generated by the random function n 1 After level shaping data, the ciphertext level n 0 The relevant parameters B for generating the preKS key are generated by encrypting 1-0 =1<<KSB 1-0 , KSB 1-0 Indicates that the ciphertext is from level n 1 To level n 0 When the noise level is affected, each element in the preKS key is regarded as an n 0 TLWE ciphertext of 32 bits of level size;
[0026] BK=(n 0 ,EL 2 ,n 2 )
[0027] BK represents a level n 0 The key, where the data is generated by a random function 0 After level shaping data, the ciphertext level n 2 It is generated by encrypting it, and each element is n 2 The scale of the level is EL 2 ×n 2 The TRGSW ciphertext of a 64-bit integer, where EL 2 Indicates level n 2 The number of TRLWE ciphertexts contained in the TRGSW ciphertext;
[0028] BKFFT=(EL 2 ,n 2 )
[0029] BKFFT is expressed as a scale of EL 2 ×n 2 TRGSW ciphertext in integer form, where the data is the data generated using the BK key at ciphertext level n 2 It is generated by encrypting it below;
[0030] privKS=(K,n 2 +1,KSL 2-1 ,KSB 2-1 ,n 1 )
[0031] privKS is represented by a K×(n 2 +1)×KSL 2-1 ×KSB 2-1 The key, K represents the number of TLWE ciphertexts contained in the TRLWE ciphertext in the entire TFHE scheme, KSL 2-1 Indicates the number of effective bits of the key used to operate the ciphertext when the ciphertext changes from level n2 to level n1, KSB 2-1 It indicates the number of levels affected by noise when the ciphertext changes from level n2 to level n1. The data is generated by using a random function to generate integer data of level n2 and then encrypting it at ciphertext level n1. Each element is a TRLWE ciphertext of a 32-bit integer at level n1.
[0032] Furthermore, in step 2, for the ciphertext s 1 Each item a i , where 0≤i<n 1 -1, the formula is as follows:
[0033] x ij =((a i + offset)>>(32-(j+1)×KSB 1-0 ))&(B 1-0 -1)
[0034] Where 0≤j<KSL 1-0 , x ij Represents the ciphertext s 1 The form of the ciphertext after obtaining the effective precision is: offset = 1 < < (32-(1 + KSB 1-0 ×KSL 1-0 )), offset represents the ciphertext s 1 Each sub-item a in i The precision of the ciphertext after compression is obtained according to the parameters specified by the key preKS, and then ij To allocate threads on the GPU, a total of n 0 threads, for the ciphertext s0 Each of a k , where k is the thread number, 0≤k<n 0 ,have
[0035]
[0036] The above process is executed j times in total. Indicates the i×j×xth ij n 0 Get the kth value from the TLWE ciphertext of size; According to the above formula, we get s 0 Each of a k , thus obtaining the complete ciphertext s 0 ;
[0037] After that in n 0 The following formula is executed in the same thread:
[0038] a k =((uint 64(a k )<<32)+(uint 64(1)<<63 / (n 2 ×2))) / (uint 64(1)<<63 / n 2 )
[0039] uint64(a) means converting a to a 64-bit unsigned integer. The ciphertext result is 0 The ciphertext as an integer at the level.
[0040] Further, in step 4, ACC is used to convert s 0 Transformed into n 2 The process of obtaining the TLWE ciphertext in the form of a 64-bit integer at the level is:
[0041] Step 4.1: ACC 1 and ACC 2 Initialization:
[0042] Get ACC from ACC 1 The initial value is ACC 1 =ACC, for ciphertext s 0 Each item a i , let x = a i , where 0≤i<n 0 , if x<n 2 , then for ACC 2 The data in
[0043]
[0044] If x≥n 2, then
[0045]
[0046] The above ACC 1 and ACC 2 The size is consistent with ACC;
[0047] Step 4.2: ACC 2 Decrypt and use the decrypted result to perform FFT transformation to obtain the final ACC result:
[0048] The result of step 4.1 is ACC 2 Decrypted and then stored in the vector dem = (K × EL 2 ,n 2 ), whose size is K×EL 2 , the elements are in the form of n 2 The size is an integer:
[0049] Generate the initial intermediate parameter decoffset = 0, and then perform n 2 The following operations are performed to obtain the final result:
[0050] decoffset=decoffset|(unit(1)<<(63-i×Bg 2 ))
[0051] Where | is an OR operation, uint(1) represents an unsigned integer 1, 0≤i≤n 2 , Bg 2 is the TRGSW ciphertext at ciphertext level n 2 The order of magnitude of the noise is 2 Each row k in is a TLWE ciphertext. Each TLWE ciphertext is expanded into an unsigned 64-bit integer as follows:
[0052] c i ' k =c ik +decoffset
[0053] Then the result of dem is
[0054] dem lk (a i )=(c i ' k >>(64-(l+1)×Bg 2 ))&(unit(1)<<Bg 2 -1)-Bg 2 / 2
[0055] Parameter l satisfies 0≤l<EL 2 , parameter k satisfies 0≤k<K, parameter i satisfies 0≤i<n 2 ,dem lk (a i ) represents the value of the i-th bit in the l×k-th a in dem;
[0056] For the value in dem, use BKFFT to perform polynomial multiplication and store the result in ACC 1 middle:
[0057] ACC 1 (c ik )=dem l (a ik )×BKFFT l (a i )
[0058] dem l (a ik ) represents the value of a of the i-th item of the k-th TLWE ciphertext contained in the l-th TRLWE ciphertext in dem, BKFFT l (a i ) represents the value of a of the i-th item in the l-th TRLWE ciphertext in the BKFFT key;
[0059] Leverage ACC 1 The final ACC of each group is as follows:
[0060] ACC(c ik )=ACC(c ik )+ACC 1 (c ik )
[0061] Step 4.3: Get level n 2 The 64-bit TLWE ciphertext is:
[0062] Setting the value of K to 2 changes ACC to the following form:
[0063]
[0064] Save the result in ciphertext In, 2 The size of sub-item a in the ciphertext is n 2 ; where s 2 (a 0 )=ACC(c 11 ), establish n 2 -1 thread, get a on the GPU j , the formula is as follows:
[0065]
[0066] s 2 (b) = ACC (c 21 )+M / 2, thus obtaining the complete ciphertext s 2 .
[0067] Furthermore, in step 5, using s 2 The ciphertext is obtained at level K n 1 The K 32-bit TRLWE ciphertexts are then combined into a complete TRGSW ciphertext.
[0068] Furthermore, in step 4, EL 1 The bootstrap of EL 1 s 2 The ciphertext is the same as n 1 The 32-bit TRLWE ciphertexts at the level are combined in the resulting thread to form a complete 1 The 32-bit TRGSW ciphertext at the level.
[0069] Furthermore, for each s 2 , use the privKS key and use the following process to make it available in n 1 The 32-bit TRLWE ciphertext at the level is expressed as follows:
[0070]
[0071] The ciphertext initialization value is all 0. 2 Each item a in the ciphertext j , with coffset = a j +unit(1)<<(64-(1+KSB 2-1 ×KSL 2-1 )), coffset is used to compress the ciphertext into 32-bit ciphertext based on the original 64-bit ciphertext to obtain the accuracy of the effective information contained in the ciphertext. The ciphertext s is obtained using the following formula 1 ':
[0072]
[0073] Here 0≤k<K, 0≤i<n 1 , 0≤j<n 2 , 0≤l<KSL 2-1 , Indicates getting the kth n in privKS(k,j,l,x)1 The i-th item of the ciphertext of size, privKS(k,j,l,x) represents the value of the data at the (k,j,l,x) position in the privKS key, where the value of x is:
[0074] x=(coffset>>(64-(l+1)×KSB 2-1 ))&(1<<KSB 2-1 -1)
[0075] According to k and i, establish K thread blocks and allocate n in each thread block. 1 The number of threads, parallel to obtain the ciphertext s' 1 , the process executes KSL 2-1 Second-rate.
[0076] Beneficial Effects
[0077] In view of the problem of low efficiency of the circuit bootstrapping technology in the current TFHE scheme, the present invention proposes a method for optimizing the circuit bootstrapping process based on GPU parallel computing. The method utilizes the levels of various ciphertexts existing in the circuit bootstrapping process, merges the steps performed at the same ciphertext level in the actual steps of the circuit bootstrapping, and allocates the same number of threads so that they can be executed in parallel on the GPU. At the same time, the method initializes the parameters and various vectors required in the scheme in advance to support this merger, reduces the number of data transfers between the CPU and the GPU, and improves the operating efficiency of the circuit bootstrapping.
[0078] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. DETAILED DESCRIPTION
[0079] The present invention provides a method for implementing the circuit bootstrap process in the TFHE scheme using GPU parallel computing. Based on the original TFHE circuit bootstrap scheme, the advantages of GPU parallel computing are used to parallelize the polynomial multiplication in the TFHE circuit bootstrap. At the same time, in order to accelerate this process faster, the method reduces the steps in the circuit bootstrap and reduces the number of data transfers between the CPU and the GPU. The method merges the algorithm steps running at the same ciphertext level according to the ciphertext level of the circuit bootstrap process in TFHE, reducing the computational complexity of the algorithm. A method for preprocessing the keys required in the scheme steps in advance is designed to support the merging of its steps and reduce the number of data transfers between the GPU and the CPU. The specific steps are as follows:
[0080] Step 1: Initialization:
[0081] The ciphertext level involved in the present invention includes n0 , n 1 , n 2 There are three levels. These three ciphertext levels represent the size of the ciphertext, and also determine the size of the noise contained in the ciphertext and the speed of arithmetic operations. 0 Level means that the ciphertext size is small, and the corresponding noise is very large. Generally speaking, in n 0 When the parameters are very small, arithmetic operations are almost instantaneous, but only a very limited amount of linear operations is allowed. 1 Level means that the ciphertext size is moderate, the corresponding noise is medium-sized ciphertext, and the ciphertext uses relatively medium-sized parameters, which allows relatively fast operations (such as hierarchical homomorphic (LHE) evaluation of a relatively large automaton). 2 Level indicates that the ciphertext is large in size, corresponding to the ciphertext with very small noise. 2 The parameters used to construct the ciphertext at this level are larger, allowing more arithmetic operations to be performed on the ciphertext, but it will take longer due to the limitation of parameter size.
[0082] According to the message space μ∈β={0,1} to which the message μ belongs, use Construct ciphertext level n 1 The initial TLWE ciphertext is expressed in polynomial form as Where a and b are both 32-bit integers.
[0083] Initialize the parameters required for each step and various keys preKS, BK, BKFFT and privKS, which are expressed as follows:
[0084] preKS=(n 1 ,KSL 1-0 ,B 1-0 ,n 0 )
[0085] preKS is represented by a size of n 1 ×KSL 1-0 ×B 1-0 The key, KSL 1-0 Indicates that the ciphertext is from level n 1 To level n 0 When the key operates on the ciphertext, the number of valid digits, where the data is generated by the random function n 1 After level shaping data, the ciphertext level n 0 The relevant parameters B for generating the preKS key are generated by encrypting 1-0 =1<<KSB 1-0 , KSB 1-0 Indicates that the ciphertext is from level n 1To level n 0 When the noise level is affected, each element in the preKS key is regarded as an n 0 The level size is 32 bits of TLWE ciphertext.
[0086] BK=(n 0 ,EL 2 ,n 2 )
[0087] BK represents a level n 0 The key, where the data is generated by a random function 0 After the integer data of the level size, at the ciphertext level n 2 It is generated by encrypting it, and each element is n 2 The scale of the level is EL 2 ×n 2 The TRGSW ciphertext of a 64-bit integer, where EL 2 Indicates level n 2 The number of TRLWE ciphertexts contained in the TRGSW ciphertext.
[0088] BKFFT=(EL 2 ,n 2 )
[0089] BKFFT is expressed as a scale of EL 2 ×n 2 TRGSW ciphertext in integer form, where the data is the data generated using the BK key at ciphertext level n 2 It is generated by encrypting it.
[0090] privKS=(K,n 2 +1,KSL 2-1 ,KSB 2-1 ,n 1 )
[0091] privKS is represented by a K×(n 2 +1)×KSL 2-1 ×KSB 2-1 The key, K represents the number of TLWE ciphertexts contained in the TRLWE ciphertext in the entire TFHE scheme, KSL 2-1 Indicates the number of effective bits of the key used to operate the ciphertext when the ciphertext changes from level n2 to level n1, KSB 2-1It indicates the number of levels affected by noise when the ciphertext changes from level n2 to level n1. The data is generated by using a random function to generate integer data of level n2 and then encrypting it at ciphertext level n1. Each element is a TRLWE ciphertext of a 32-bit integer at level n1.
[0092] The parameters of this step are passed to the GPU after being initialized on the CPU.
[0093] Step 2: Use the preKS key to convert the ciphertext s 1 From the noisy n 1 The level is transformed to the level with smaller key n 0 The ciphertext The initial value of a is all 0, and b is the same as the ciphertext s 1 In the same way, the corresponding message μ∈β is obtained when s 0 When ciphering, each item is converted into integer form at the same time, that is, the modular exchange process of TLWE ciphertext is realized, so that the final s 0 The ciphertext form of is an integer:
[0094] For the ciphertext s 1 Each item a i , where 0≤i<n 1 -1, the formula is as follows:
[0095] x ij =((a i + offset)>>(32-(j+1)×KSB 1-0 ))&(B 1-0 -1)
[0096] Where 0≤j<KSL 1-0 , x ij Represents the ciphertext s 1 The form of the ciphertext after obtaining the effective precision is: offset = 1 < < (32-(1 + KSB 1-0 ×KSL 1-0 )), offset represents the ciphertext s 1 Each sub-item a in i The precision of the ciphertext after compression is obtained according to the parameters specified by the key preKS, and then ij To allocate threads on the GPU, a total of n 0 threads, for the ciphertext s 0 Each of a k , where k is the thread number, 0≤k<n 0 ,have
[0097]
[0098] The above process is executed j times in total. Indicates that from n 0 Get the kth value from a of size a, here is to get the i×j×xth value from the preKS key ij n 0 The kth value is obtained from the TLWE ciphertext of size s. 0 Each of a k , thus obtaining the complete ciphertext s 0 .
[0099] After that, in the above mentioned n 0 The following formula is executed in the same thread:
[0100] a k =((uint 64(a k )<<32)+(uint 64(1)<<63 / (n 2 ×2))) / (uint 64(1)<<63 / n 2 )
[0101] uint64(a) means converting a to a 64-bit unsigned integer. The ciphertext result is 0 The ciphertext as an integer at the level.
[0102] Step 3: Initialize ACC ciphertext sample:
[0103] Generate basic vector parameters and Here c is a 64-bit integer. The function of this vector is to facilitate the initialization of ACC ciphertext samples.
[0104] According to the parameter EL 1 Generate vector value M = unit(1) < < (64-(w+1) × Bg 1 ), where 0≤w<EL 1 , Bg 1 is the TRGSW ciphertext at ciphertext level n 1 The order of magnitude of the noise, EL 1 Indicates level n 1 The number of TRLWE ciphertexts contained in the TRGSW ciphertext; for each TRLWE ciphertext, a w and M will be generated, and a total of EL 1 There are M, and for each M there will be a set of VECs and a set of ACCs.
[0105]
[0106] For the ciphertext s generated above 0 The nth 0For item b, if b <n 2 , there are the following formulas:
[0107]
[0108] If b≥n 2 , then VEC 2 The initialization is:
[0109]
[0110] The ACC is initialized to a 64-bit TRLWE ciphertext sample of size n 2 , expressed in matrix form as:
[0111]
[0112] The first K-1 rows of the matrix are initialized to 0, and the value of the Kth row is ACC(c Ki )=VEC 2 (c i ),0≤i<n 2 , because of the initialization value of ACC, the parameters M and ciphertext s used 0 The b in is known, so the initialization of ACC can be performed in advance before the circuit bootstrap process, and then its value is passed to the GPU together with all the initial parameters used in the scheme, thereby omitting the value transfer in the subsequent circuit bootstrap process.
[0113] Step 4: Bootstrap the circuit and use ACC to 0 Transformed into n 2 The TLWE ciphertext in the form of a 64-bit integer of level:
[0114] Step 4.1: ACC 1 and ACC 2 Initialization:
[0115] Get ACC from ACC 1 The initial value is ACC 1 =ACC, for ciphertext s 0 Each item a i , let x = a i , where 0≤i<n 0 , if x<n 2 , then for ACC 2 The data in
[0116]
[0117] If x≥n 2 , then
[0118]
[0119] The above ACC 1 and ACC 2 The size is consistent with ACC. For the ciphertext s 0 For example, the encrypted message information has been saved to ACC 2 In, about to 0 In n 0 The integer ciphertext at level n is transformed into 2 The TRLWE ciphertext at the level as a 64-bit integer.
[0120] Step 4.2: ACC 2 Decrypt and use the decrypted result to perform FFT transformation to obtain the final ACC result:
[0121] The results of the entire procedure described in step 4.1 are ACC 2 Decrypted and then stored in the vector dem = (K × EL 2 ,n 2 ), whose size is K×EL 2 , the elements are in the form of n 2 The size is an integer:
[0122] In order to decrypt the ciphertext, corresponding to the previous steps, the initial intermediate parameter decoffset = 0 is first generated. This variable mainly includes the shift operation for obtaining the valid bits of the decryption result, and then decoffset is shifted by n. 2 The following operations are performed to obtain the final result:
[0123] decoffset=decoffset|(unit(1)<<(63-i×Bg 2 ))
[0124] Where | is an OR operation, uint(1) represents an unsigned integer 1, 0≤i≤n 2 , Bg 2 is the TRGSW ciphertext at ciphertext level n 2 The order of magnitude of the noise is 2 Each row k in is a TLWE ciphertext. Each TLWE ciphertext is expanded into an unsigned 64-bit integer as follows:
[0125] c' ik =c ik +decoffset
[0126] Then, the result of dem is
[0127] demlk (a i )=(c i ' k >>(64-(l+1)×Bg 2 ))&(unit(1)<<Bg 2 -1)-Bg 2 / 2
[0128] The parameter l here satisfies 0≤l<EL 2 , parameter k satisfies 0≤k<K, parameter i satisfies 0≤i<n 2 ,dem lk (a i ) represents the value of the i-th bit in the l×k-th a in dem. This operation corresponds to the encryption process, including the operation and the shift process. For the above decryption process, according to n 2 The value of n 2 The number of threads parallelizes the process, thereby obtaining each a required in dem i ,,Total EL 2 * K times.
[0129] For the value in dem, use BKFFT to perform polynomial multiplication and store the result in ACC 1 In the formula, the following operation is performed:
[0130] ACC 1 (c ik )=dem l (a ik )×BKFFT l (a i )
[0131] The parameters i and k here are consistent with those described above. l (a ik ) represents the value of a of the i-th item of the k-th TLWE ciphertext contained in the l-th TRLWE ciphertext in dem, BKFFT l (a i ) represents the value of a in the i-th item in the l-th TRLWE ciphertext in the BKFFT key. The steps here correspond to those in step 3, and a total of EL 2 ACC 1 , where 0≤l<EL 2 .
[0132] Leverage ACC 1 The final ACC of each group is as follows:
[0133] ACC(c ik )=ACC(c ik )+ACC1 (c ik )
[0134] Step 4.3: Get level n 2 The 64-bit TLWE ciphertext is:
[0135] In the general process above, in order to conveniently obtain the 64-bit TLWE ciphertext in ACC (64-bit TRLWE ciphertext), we generally set the value of K to 2, that is, ACC becomes the following form:
[0136]
[0137] Save the result in the ciphertext s 2 =(a 0 ,a 1 ,a 2 ,....,a n2 -1,b), s 2 The size of sub-item a in the ciphertext is n 2 , b is the same size as the previous b. 2 (a 0 )=ACC(c 11 ), establish n 2 -1 thread, get a on the GPU j , the formula is as follows:
[0138]
[0139] s 2 (b) = ACC (c 21 )+M / 2, thus obtaining the complete ciphertext s 2 .
[0140] Step 5: Utilize s 2 Get level n 1 The 32-bit TRGSW ciphertext is:
[0141] Since the TRGSW ciphertext is composed of several TRLWE ciphertexts, in this step, we use s 2 The ciphertext is obtained at level K n 1 The K 32-bit TRLWE ciphertexts are then combined into a complete TRGSW ciphertext.
[0142] For step 4 above, a total of EL 1 The bootstrap of EL 1 with s 2 Ciphertexts with the same ciphertext:
[0143] For each s 2, use the privKS key and use the following procedure to make it available in n 1 The 32-bit TRLWE ciphertext at the level is expressed as follows:
[0144]
[0145] The ciphertext initialization value is all 0. 2 Each item a in the ciphertext j , with coffset = a j +unit(1)<<(64-(1+KSB 2-1 ×KSL 2-1 )), coffset is used to compress the ciphertext into 32-bit ciphertext based on the original 64-bit ciphertext to obtain the accuracy of the effective information contained in the ciphertext. The ciphertext s is obtained using the following formula 1 ':
[0146]
[0147] Here 0≤k<K, 0≤i<n 1 , 0≤j<n 2 , 0≤l<KSL 2-1 , Indicates getting the kth n in a 1 The i-th item of the ciphertext of size, privKS(k,j,l,x) represents the value of the data at (k,j,l,x) in the privKS key, where the value of x is as follows. The main function is to use the privKS key according to coffset to obtain the ciphertext level size n 2 s 2 Change to level size n 1 s 1 The accuracy of the valid information after.
[0148]
[0149] According to k and i, establish K thread blocks and allocate n in each thread block. 1 The number of threads, parallel to obtain the ciphertext s 1 ', the process executes KSL 2-1 times. Since EL is performed on step 4 1 The number of 32-bit TRLWE ciphertexts that can be obtained is EL 1 , these TRLWE ciphertexts are merged in the resulting thread, which is a complete 1 The 32-bit TRGSW ciphertext at the level.
[0150] Embodiments of the present invention are described in detail below. The embodiments are exemplary and intended to be used to explain the present invention, but should not be construed as limiting the present invention.
[0151] Step 1: Initialization:
[0152] Initialization parameter n 0 =500, n 1 =1024,n 2 = 2048, according to the message space μ∈β={0,1} to which the message μ belongs, using Construct ciphertext level n 1 The polynomial form of the initial TLWE ciphertext is expressed as s 1 =(a 0 ,a 1 ,a 2 ,....,a 1023 ,b), where a and b are both 32-bit integers.
[0153] Initialize the parameters required for each step and various keys preKS, BK, BKFFT and privKS, which are expressed as follows:
[0154] preKS=(n 1 ,KSL 1-0 ,B 1-0 ,n 0 )
[0155] KSL 1-0 =6, B 1-0 =4, KSB 1-0 =2, where the data is generated by random function n 1 The integer data of level size is followed by the ciphertext level n 0 The encryption is generated under the following conditions, and each element is regarded as an n 0 The level size is 32 bits of TLWE ciphertext.
[0156] BK=(n 0 ,EL 2 ,n 2 )
[0157] The data is generated by random function 0 The integer data of level size is followed by the ciphertext level n 2 Encrypted under, each element is n 2 The scale of the level is EL 2 ×n 2 The TRGSW ciphertext of a 64-bit integer, where EL 2 =4.
[0158] BKFFT=(EL2 ,n 2 )
[0159] BKFFT is expressed as a scale of EL 2 ×n 2 TRGSW ciphertext in integer form, data is the data generated by BK key at ciphertext level n 2 Encryption is performed below.
[0160] privKS=(K,n 2 +1,KSL 2-1 ,KSB 2-1 ,n 1 )
[0161] Here K = 2, KSL 2-1 =10, KSB 2-1 =3, data is generated by random function n 2 The integer data of level size is followed by the ciphertext level n 1 Encrypted under, each element is n 1 A 32-bit integer representing the TRLWE ciphertext level.
[0162] The parameters of this step are passed to the GPU after being initialized on the CPU.
[0163] Step 2: Use the preKS key to convert the ciphertext s 1 From the noisy n 1 The level is transformed to the level with smaller key n 0 The ciphertext 0 =(a 0 ,a 1 ,a 2 ,....,a 499 ,b), where the initial value of a is all 0, and b is the same as the ciphertext s 1 In the same way, the corresponding message μ∈β={0,1}, when obtaining s 0 When ciphering, each item is converted into integer form at the same time, that is, the modular exchange process of TLWE ciphertext is realized, so that the final s 0 The ciphertext form of is an integer:
[0164] For the ciphertext s 1 Each item a i , where 0≤i<1023, the following formula is given:
[0165] x ij =((a i +offset)>>(32-(j+1)×2))&3
[0166] Where 0≤j<6, offset=1<<19=219 , x ij Represents the ciphertext s 1 The form of the ciphertext after obtaining effective precision, offset represents the ciphertext s 1 Each sub-item a in i The precision of the ciphertext after compression is obtained according to the parameters specified by the key preKS, and then ij Thread allocation on GPU requires 500 threads in total. 0 Each of a k , where k is the thread number, 0≤k<500, there is
[0167]
[0168] The above process is performed 6 times in total. Indicates that from n 0 Get the kth value from a of size a, here is to get the i×j×xth value from the preKS key ij n 0 The kth value is obtained from the TLWE ciphertext of size s. 0 Each of a k , thus obtaining the complete ciphertext s 0 . Then, the following formula is executed in the 500 identical threads mentioned above:
[0169] a k =((uint 64(a k )<<32)+(uint 64(1)<<63 / 4096)) / (uint 64(1)<<63 / 2048)
[0170] uint64(a) means converting a to a 64-bit unsigned integer. The ciphertext result is 0 The ciphertext at the level as an integer.
[0171] Step 3: Initialize ACC ciphertext sample:
[0172] Generate basic vector parameters VEC 1 =(c 0 ,c 1 ,c 2 ,....,c 2047 ) and VEC 2 =(c 0 ,c 1 ,c 2 ,....,c 2047 ), where c is a 64-bit integer. The function of this vector is to facilitate the initialization of the ACC ciphertext sample. 1=2 Generate vector value M = uint(1) << (64-(w+1)×8), where 0≤w<2, EL 1 Indicates level n 1 The number of TRLWE ciphertexts contained in the TRGSW ciphertext. For each TRLWE ciphertext, a w and M will be generated, and a total of 2 M will be generated here. For each M, there will be a group of VEC and a group of ACC, a total of two groups.
[0173]
[0174] For the ciphertext s generated above 0 The nth 0 For item b, if b<2048, we have the following formula:
[0175]
[0176] If b ≥ 2048, then VEC 2 The initialization is:
[0177]
[0178] ACC is initialized to a 64-bit TRLWE ciphertext sample with a size of 2048, which is expressed in the form of a matrix as follows, where K = 2:
[0179]
[0180] The first row of the matrix is initialized to 0, and the second row is initialized to ACC(c 2i )=VEC 2 (c i ), 0≤i<2048, because of the initialization value of ACC, the parameters M and ciphertext s used 0 The b in is known, so the initialization of ACC can be performed in advance before the circuit bootstrap process, and then its value is passed to the GPU together with all the initial parameters used in the scheme, thereby omitting the value transfer in the subsequent circuit bootstrap process.
[0181] Step 4: Bootstrap the circuit and use ACC to 0 Transformed into n 2 The TLWE ciphertext in the form of a 64-bit integer of level:
[0182] 4.1: ACC 1 and ACC 2 Initialization:
[0183] Get ACC from ACC 1 The initial value is ACC 1 =ACC, for ciphertext s0 Each item a i , let x = a i , where 0≤i<500, if x<2048, then for ACC 2 The data in
[0184]
[0185] If x ≥ 2048, then
[0186]
[0187] The above ACC 1 and ACC 2 The size is consistent with ACC. For the ciphertext s 0 For example, the encrypted message information has been saved to ACC 2 In, about to 0 In n 0 The integer ciphertext at level n is transformed into 2 The TRLWE ciphertext at the level as a 64-bit integer.
[0188] 4.2: ACC 2 Decrypt and use the decrypted result to perform FFT transformation to obtain the final ACC result:
[0189] The results of the entire step described in 4.1 are applied to ACC 2 Decrypted and then stored in the vector dem = (8, 2048), the elements are in the form of n 2 =2048 integer. To decrypt the ciphertext, corresponding to the above steps, the initial intermediate parameter decoffset=0 is generated. This variable mainly includes the shift operation to obtain the valid bits of the decryption result, and then the following operation is performed 2048 times to obtain the final result:
[0190] decoffset=decoffset|(uint(1)<<(63-i×9))
[0191] Where | is an OR operation, 0≤i≤2048, for ACC 2 Each row k in is a TLWE ciphertext. Each TLWE ciphertext is expanded into an unsigned 64-bit integer as follows:
[0192] c' ik =c ik +decoffset
[0193] Then, the result of dem is
[0194] dem lk (a i )=(a' ik >>(64-(l+1)×9))&(uint(1)<<8)-4
[0195] Here, the parameter l satisfies 0≤l<4, the parameter k satisfies 0≤k<2, and the parameter i satisfies 0≤i<2048. For the above decryption process, according to n 2 The value of specifies 2048 threads to execute the process in parallel, thereby obtaining each a required in dem i , and execute this process on the GPU 2*4 times in total.
[0196] For the value in dem, use BKFFT to perform polynomial multiplication and store the result in ACC 1 In the formula, the following operation is performed:
[0197] ACC 1 (a ik )=dem(a ik )×BKFFT(a ik )
[0198] The parameters i and k here are consistent with those described above. l (a ik ) represents the value of a of the i-th item of the k-th TLWE ciphertext contained in the l-th TRLWE ciphertext in dem, BKFFT l (a i ) represents the value of a in the i-th item in the l-th TRLWE ciphertext in the BKFFT key. The steps here correspond to those in step 3, and a total of 4 ACCs are generated. 1 .
[0199] Leverage ACC 1 The final ACC of each group is as follows:
[0200] ACC(c ik )=ACC(c ik )+ACC 1 (c ik )
[0201] 4.3: Get level n 2 The 64-bit TLWE ciphertext is:
[0202] We save the corresponding result of ACC in the ciphertext s 2 =(a 0 ,a 1 ,a 2 ,....,a 2047 ,b), where s2 (a 0 )=ACC(a 11 ), create 2047 threads, and obtain a on the GPU j , the formula is as follows:
[0203] s 2 (a j )=-ACC(a 1(2047-j) )
[0204] s 2 (b) = ACC (a 21 )+M / 2, thus obtaining the complete ciphertext s 2 .
[0205] Step 5: Utilize s 2 Get level n 1 The 32-bit TRGSW ciphertext is:
[0206] Since the TRGSW ciphertext is composed of several TRLWE ciphertexts, in this step, we use s 2 Ciphertext gets 2 levels of n 1 The 32-bit TRLWE ciphertext is then combined to form a complete TRGSW ciphertext. For step 4 above, two bootstraps are performed, that is, two ciphertexts with the same s are obtained. 2 The same ciphertext, for each s 2 , use the privKS key and use the following procedure to make it available in n 1 The 32-bit TRLWE ciphertext at the level is expressed as follows:
[0207]
[0208] The ciphertext initialization value is all 0. 2 Each item a in the ciphertext j , with coffset = a j +uint(1)<<33, coffset is used to compress the ciphertext into 32-bit ciphertext based on the original 64-bit ciphertext to obtain the accuracy of the effective information contained in the ciphertext. The ciphertext s is obtained using the following formula 1 ':
[0209] s' 1 (a ki )=s' 1 (a ki )-get k→2,i→1024 (privKS(k,j,l,x))
[0210] Here 0≤k<2, 0≤i<1024, 0≤j<2048, 0≤l<10, Indicates getting the kth n in a 1 The i-th item of the ciphertext of size, privKS(k, j, l, x) represents the value of the data at (k, j, l, x) in the privKS key, where the value of x is as follows. The main function is to use the privKS key according to coffset to obtain the ciphertext level s with a size of 2048. 2 Change to s with a level size of 1024 1 The accuracy of the valid information after.
[0211] x=(coffset>>(64-(l+1)×3))&5
[0212] According to k and i, two thread blocks are established, 1024 threads are allocated in each thread block, and the ciphertext s is obtained in parallel. 1 ', the process is performed 10 times in total. Since step 4 is bootstrapped twice, two 32-bit TRLWE ciphertexts can be obtained. The two TRLWE ciphertexts are merged in the resulting thread to form a complete ciphertext in n 1 The 32-bit TRGSW ciphertext at the level.
[0213] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations on the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention without departing from the principles and intent of the present invention.
Claims
1. A parallel computing method based on GPU optimization of fully homomorphic encryption circuit bootstrapping, characterized by: It includes the following steps: Step 1: According to the message space μ∈β={0,1} to which the message μ belongs, use Construct the initial TLWE ciphertext with ciphertext level n1, whose polynomial form is Where a and b are both 32-bit integers. Initialize and generate the parameters and various keys preKS, BK, BKFFT and privKS required for each step on the CPU, and pass them to the GPU. Step 2: Use the preKS key to transform the ciphertext s1 from level n1 to level n0 The initial value of a is all 0, b is equal to that in the ciphertext s1, and the corresponding message μ∈β, when obtaining the ciphertext s0, convert each item into integer form at the same time: Step 3: Initialize the ACC ciphertext sample: Generate basic vector parameters and Here c is a 64-bit integer; Generate the vector value M = unit(1) << (64 - (w + 1)×Bg1) according to the parameter EL1, where 0 ≤ w < EL1, Bg1 is the order of magnitude of the noise in the TRGSW ciphertext at the ciphertext level n1, and EL1 represents the number of TRLWE ciphertexts included in the TRGSW ciphertext of level n1; for each TRLWE ciphertext, a w and an M will be generated, and a total of EL1 Ms will be generated. For each M, there will be a group of VEC and a group of ACC: For the n0th item b of the ciphertext s0 generated above, if b < n2, the initialization of VEC2 is: If b ≥ n2, the initialization of VEC2 is: And ACC is initialized as a 64-bit TRLWE ciphertext sample with a size of n2, and its matrix form is: The first K-1 rows of the matrix are initialized to 0, and the value of the Kth row is ACC(c Ki )=VEC2(c i ),0≤i<n2; The initialization of ACC is carried out in advance before the circuit bootstrapping process, and the value is passed to the GPU together; Step 4: Circuit bootstrapping, use ACC to transform s0 into a 64-bit integer form TLWE ciphertext s2 of level n2; Step 5: Use s2 to obtain a 32-bit TRGSW ciphertext of level n1.
2. According to claim 1, a parallel computing method based on GPU optimization of fully homomorphic encryption circuit bootstrapping is characterized in that: In Step 1, the parameter requirements for each step and the forms of various keys preKS, BK, BKFFT, and privKS are as follows: preKS=(n1,KSL 1-0 ,B 1-0 ,n0) preKS represents a KSL with a size of n1×KSL 1-0 ×B 1-0 The key, KSL 1-0 Indicates the number of effective bits of the key used to operate on the ciphertext when the ciphertext level is changed from n1 to n0. The data is generated by using a random function to generate n1-level integer data and then encrypting it at ciphertext level n0. The relevant parameters B for generating the preKS key 1-0 =1<<KSB 1-0 , KSB 1-0 It indicates the number of levels affected by noise when the ciphertext changes from level n1 to level n0. Each element in the preKS key is regarded as a 32-bit TLWE ciphertext of level n0. BK = (n0, EL2, n2) BK is represented as a key of level n0, where the data is generated by encrypting the integer data of level n0 generated by a random function at the ciphertext level n2. Each element is a 64-bit integer TRGSW ciphertext of size EL2×n2 at level n2, where EL2 represents the number of TRLWE ciphertexts included in the TRGSW ciphertext of level n2; BKFFT = (EL2, n2) BKFFT is represented as an integer form TRGSW ciphertext of size EL2×n2, where the data is generated by encrypting the data generated by the BK key at the ciphertext level n2; privKS=(K,n2+1,KSL 2-1 ,KSB 2-1 ,n1) privKS is represented by a K×(n2+1)×KSL 2-1 ×KSB 2-1 The key, K represents the number of TLWE ciphertexts contained in the TRLWE ciphertext in the entire TFHE scheme, KSL 2-1 Indicates the number of effective bits of the key used to operate the ciphertext when the ciphertext changes from level n2 to level n1, KSB 2-1 It indicates the number of levels affected by noise when the ciphertext changes from level n2 to level n1. The data is generated by using a random function to generate integer data of level n2 and then encrypting it at ciphertext level n1. Each element is a TRLWE ciphertext of a 32-bit integer at level n1.
3. According to claim 2, a parallel computing method based on GPU optimization of fully homomorphic encryption circuit bootstrapping is characterized in that: In step 2, for each item a in the ciphertext s1 i , where 0≤i<n1-1, the formula is as follows: x ij =((a i +offset)>>(32-(j+1)×KSB 1-0 ))&(B 1-0 -1) Where 0≤j<KSL 1-0 , x ij Indicates the form of the ciphertext after obtaining the effective precision of the ciphertext s1, offset = 1 < < (32-(1 + KSB 1-0 ×KSL 1-0 )), offset represents each sub-item a in the ciphertext s1 i The precision of the ciphertext after compression is obtained according to the parameters specified by the key preKS, and then ij Thread allocation on the GPU requires n0 threads in total. For each a in the ciphertext s0 k , where k is the thread number, 0≤k<n0, there is The above process is executed j times in total. Indicates the i×j×xth ij The kth value is obtained from the TLWE ciphertext of size n0; According to the above formula, each a in s0 is obtained k , thus obtaining the complete ciphertext s0; Then, the following formula is executed in n0 identical threads: Well k =((uint 64(a k )<#32)+(uint 64(1)##63 / (n2×2))) / (uint 64(1)##63 / n2) Where uint64(a) represents converting a to a 64-bit unsigned integer, and the ciphertext result is a ciphertext in integer form at level n0.
4. According to claim 3, a parallel computing method based on GPU optimization of fully homomorphic encryption circuit bootstrapping is characterized in that: In Step 4, the process of using ACC to transform s0 into a 64-bit integer form TLWE ciphertext of level n2 is: Step 4.1: Initialization of ACC1 and ACC2: According to ACC, the initial value of ACC1 is ACC1 = ACC. For each item a in the ciphertext s0, i , let x = a i , where 0≤i<n0, if x<n2, then for the data in ACC2 If x ≥ n2, then The sizes of the above ACC1 and ACC2 are the same as that of ACC; Step 4.2: Decrypt ACC2 and use the decryption result to perform an FFT transformation to obtain the final ACC result: Decrypt the result ACC2 in Step 4.1 and then save it in the vector dem = (K×EL2, n2), whose size is K×EL2, and the form of the elements is an integer form with a size of n2: Generate the initial intermediate parameter decoffset = 0, and then perform the following operation on decoffset n2 times to obtain its final result: decoffset=decoffset|(unit(1)<<(63-i×Bg2)) Where | is an OR operation, uint(1) represents an unsigned integer 1, 0≤i≤n2, Bg2 is the order of magnitude of the noise of the TRGSW ciphertext at the ciphertext level n2, and for each row k in ACC2, it is a TLWE ciphertext. Each TLWE ciphertext is expanded to an unsigned 64-bit integer as follows: c i ' k =c ik +decoffset Then the result of dem is dem lk (a i )=(c i ' k >>(64-(l+1)×Bg2))&(unit(1)<<Bg2-1)-Bg2 / 2 Parameter l satisfies 0≤l<EL2, parameter k satisfies 0≤k<K, parameter i satisfies 0≤i<n2, dem lk (a i ) represents the value of the i-th bit in the l×k-th a in dem; For the value in dem, use BKFFT to perform polynomial multiplication and store the result in ACC1: ACC1(c ik )=dem l (a ik )×BKFFT l (a i ) dem l (a ik ) represents the value of a of the i-th item of the k-th TLWE ciphertext contained in the l-th TRLWE ciphertext in dem, BKFFT l (a i ) represents the value of a of the i-th item in the l-th TRLWE ciphertext in the BKFFT key; Using ACC1, the final ACCs of each group are as follows: ACC(c ik )=ACC(c ik )+ACC1(c ik ) Step 4.3: Get the 64-bit TLWE ciphertext of level n2: Setting the value of K to 2 changes ACC to the following form: Save the result in ciphertext In the ciphertext s2, the size of sub-item a is n2; s2(a0)=ACC(c 11 ), create n2-1 threads, and obtain a on the GPU j , the formula is as follows: s2(b)=ACC(c 21 )+M / 2, thus obtaining the complete ciphertext s2.
5. According to claim 4, a parallel computing method based on GPU optimization of fully homomorphic encryption circuit bootstrapping is characterized in that: In step 5, the s2 ciphertext is used to obtain K 32-bit TRLWE ciphertexts of level n1, and then these K TRLWE ciphertexts are combined together to form a complete TRGSW ciphertext.
6. According to claim 5, a parallel computing method based on GPU optimization of fully homomorphic encryption circuit bootstrapping is characterized in that: In step 4, a total of EL1 bootstrappings are performed to obtain EL1 32-bit TRLWE ciphertexts at the n1 level that are the same as the s2 ciphertext. These TRLWE ciphertexts are merged in the resulting thread to obtain a complete 32-bit TRGSW ciphertext at the n1 level.
7. According to claim 6, a parallel computing method based on GPU optimization of fully homomorphic encryption circuit bootstrapping is characterized in that: For each s2, use the privKS key and use the following process to make it a 32-bit TRLWE ciphertext at the n1 level. The TRLWE ciphertext is as follows: The ciphertext initialization value is all 0. For each item a in the ciphertext of s2 j , with coffset = a j +unit(1)<<(64-(1+KSB 2-1 ×KSL 2-1 )), coffset is used to compress the ciphertext into 32-bit ciphertext based on the original 64-bit ciphertext to obtain the accuracy of the effective information contained in the ciphertext. The ciphertext s1' is obtained using the following formula: Here 0≤k<K, 0≤i<n1, 0≤j<n2, 0≤l<KSL 2-1 , Indicates obtaining the i-th item of the k-th ciphertext of size n1 in privKS(k,j,l,x), where privKS(k,j,l,x) represents the value of the data at the (k,j,l,x) position in the privKS key, where the value of x is: x=(coffset>>(64-(l+1)×KSB 2-1 ))&(1<<KSB 2-1 -1) According to k and i, K thread blocks are established, and n1 threads are allocated to each thread block to obtain the ciphertext s1' in parallel. This process executes KSL 2-1 Second-rate.
