Gaussian sampling method, device and equipment for removing floating point operation gadget
By decomposing the covariance matrix into integers and utilizing the convolution theorem of Gaussian distribution, Gaussian sampling of gadgets was implemented, solving the problem of floating-point operation dependence in existing technologies, improving sampling efficiency and ensuring accuracy.
Patent Information
- Application Number
- CN202111412517.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-25
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-11-25
AI Technical Summary
Existing Gaussian sampling methods on gadget lattices rely on high-precision floating-point operations, resulting in high complexity and unsuitability for lightweight devices. Furthermore, they do not fully utilize the algebraic structure of the gadget lattice, leading to low sampling efficiency.
By decomposing the covariance matrix into integers and utilizing the convolution theorem of Gaussian distribution, Gaussian sampling of integer operations is achieved using gadgets, avoiding high-precision floating-point operations and supporting parallel computing.
It achieves improved sampling efficiency and ensures sampling accuracy without relying on high-precision floating-point operations.
Smart Images

Figure CN114065130B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of post-quantum cryptography technology, and in particular to a Gaussian sampling method, device and equipment for removing floating-point operations. Background Art
[0002] With the development of quantum computing, the existing mainstream public key cryptography system has been impacted, and the research on public key cryptography that can resist quantum computing attacks (i.e., post-quantum cryptography) has become an important topic in academia and industry. Lattice cryptography is an important type of post-quantum cryptography. Based on the lattice, not only can practical and efficient encryption and signature schemes be designed, but also various powerful cryptographic methods can be implemented. The construction of many advanced lattice cryptographic systems is based on the lattice trapdoor method. The use of trapdoors can effectively sample grid points on the lattice that obey the Gaussian distribution (this process is called trapdoor sampling), thereby realizing signatures, identity / attribute-based encryption and other methods. The most advanced lattice trapdoor scheme currently divides trapdoor sampling into two stages, online and offline. Most of the complex calculations can be completed in the offline stage, while the online stage only requires a special lattice Λ ⊥ (g t )={z∈Z k :<g,z> =0 mod q}, where the vector g = (1, b, …, b k-1 ) is called the gadget vector, where b k ≥q,Λ ⊥ (g t ) is called the gadget grid, and the vector (z0,z1,…,z k-1 ),<g,z> represents the inner product of vector g and vector z, that is, 〈g,z〉=1·z0+b·z1+…+b k-1 ·z k-1 Therefore, the efficiency of Gaussian sampling on the gadget lattice directly affects the overall efficiency of the Micciancio-Peikert trapdoor scheme.
[0003] The Gaussian sampling method on the gadget grid studied in the related art is for q=b k This method is essentially based on the grid Λ ⊥ (g t ) performs the Klein Gaussian sampling method. Since q = b k Time ⊥ (g t ) has a set of short lattice bases with good algebraic structure, so the upsampling method has a complexity of O(k), which is simple to implement and does not rely on high-precision algebraic operations. k The complexity required for this method is O(k 2 ). The related art also proposes a method for q k The complexity of the gadget lattice is O(k). Unlike the previous method, it uses the Peikert Gaussian sampling method instead of the Klein Gaussian sampling method. By decomposing the gadget lattice short lattice basis into the product of a double diagonal matrix and an upper triangular matrix, the complexity of O(k) can be achieved by combining the Peikert Gaussian sampling method.
[0004] However, the Peikert Gaussian sampling method needs to calculate the Cholesky decomposition of the covariance matrix, which relies on floating-point operations, making the implementation of the method complex and unsuitable for lightweight devices. In order to solve the dependence of Gaussian sampling on lattice on floating-point operations, a class of Gaussian sampling methods without floating-point operations is proposed in the related art, but the technology is relatively complex and does not fully consider the algebraic structure of the gadget lattice basis, which will greatly reduce the sampling efficiency.
[0005] Application Contents
[0006] The present application provides a method, device and equipment for gadget Gaussian sampling without floating-point operations, which does not require high-precision floating-point operations, only requires integer data operations, and can achieve parallel operations to improve efficiency while ensuring sampling accuracy.
[0007] The first aspect of the present application provides a Gaussian sampling method for removing floating-point operations, comprising the following steps:
[0008] Get the input parameter q of the gadget Gaussian sampling;
[0009] Determine whether the input parameter q satisfies a preset condition; and
[0010] When it is determined that the input parameter q satisfies the preset condition, the Gaussian sampling is obtained based on integer decomposition of the covariance matrix and the convolution theorem of Gaussian distribution.
[0011] Optionally, the preset condition is that the input parameter q is less than the modulus threshold b k .
[0012] Optionally, the step of performing integer decomposition on the covariance matrix includes:
[0013] The integer grid Z where the Gaussian distribution of the k+2-dimensional vector y is obtained by sampling k+2 , the covariance matrix J is a diagonal matrix, where the values of the first k+1 dimensions on the main diagonal of the covariance matrix J are l 2 r 2 b, the value of the k+2th dimension is l 2 r 2 ;
[0014] The k+2-dimensional vector y is multiplied by the matrix A on the left, and then divided by the integer l to obtain the k-dimensional vector p;
[0015] Where k is a positive integer and l is not less than A positive integer, r is not less than the smoothing parameter η ∈ (Z k ) of real numbers, the matrix
[0016] Optionally, the grid where the Gaussian distribution satisfied by the k-dimensional vector p is Z k / l, the covariance matrix is Σ=AJA t =r 2 ((b+1) 2 I k -TT t ), A t represents the transpose of the matrix A, T t represents the transpose of the matrix T;
[0017] Among them, Z k is a k-dimensional integer space, l is not less than A positive integer, I k is a k×k identity matrix, b is a positive integer, and the matrix
[0018] Optionally, the obtaining the Gaussian sampling by using the convolution theorem of Gaussian distribution includes:
[0019] The sampling covariance on the grid L(H) is r 2 I k , the center is c = T -1 (pu) Gaussian distribution, we get vector z, where the lattice basis B q as follows:
[0020]
[0021] Calculate the output vector x = Tz, then x obeys the grid Λ ⊥ (g t ) with a Gaussian distribution with covariance s 2 I k , where s is the standard deviation and the center of distribution is -u.
[0022] The second aspect of the present application provides a Gaussian sampling device for removing floating-point operations, including:
[0023] The first acquisition module is used to obtain the input parameter q of the gadget Gaussian sampling;
[0024] A judging module, used to judge whether the input parameter q satisfies a preset condition; and
[0025] The second acquisition module is used to obtain the Gaussian sampling based on integer decomposition of the covariance matrix and the convolution theorem of Gaussian distribution when it is determined that the input parameter q meets the preset condition.
[0026] Optionally, the preset condition is that the input parameter q is less than the modulus threshold b k .
[0027] Optionally, the second acquisition module is specifically used to:
[0028] The integer grid Z where the Gaussian distribution of the k+2-dimensional vector y is obtained by sampling k+2 , the covariance matrix J is a diagonal matrix, where the values of the first k+1 dimensions on the main diagonal of the covariance matrix J are l 2 r 2 b, the value of the k+2th dimension is l 2 r 2 ;
[0029] The k+2-dimensional vector y is multiplied by the matrix A on the left, and then divided by the integer l to obtain the k-dimensional vector p;
[0030] Where k is a positive integer and l is not less than A positive integer, r is not less than the smoothing parameter η ∈ (Z k ) of real numbers, the matrix
[0031] Optionally, the grid where the Gaussian distribution satisfied by the k-dimensional vector p is Z k / l, the covariance matrix is Σ=AJA t =r 2 ((b+1) 2 I k -TT t ), A t represents the transpose of the matrix A, T t represents the transpose of the matrix T;
[0032] Among them, Z k is a k-dimensional integer space, l is not less than A positive integer, I k is a k×k identity matrix, b is a positive integer, and the matrix
[0033] Optionally, the second acquisition module is specifically used to:
[0034] The sampling covariance on the grid L(H) is r 2 I k , the center is c = T -1(pu) Gaussian distribution, we get vector z, where the lattice basis B q as follows:
[0035]
[0036] Calculate the output vector x = Tz, then x obeys the grid Λ ⊥ (g t ) with a Gaussian distribution with covariance s 2 I k , where s is the standard deviation and the center of distribution is -u.
[0037] A third aspect of the present application provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the Gaussian sampling method for removing floating-point operations as described in the above embodiment.
[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute the gadget Gaussian sampling method for removing floating-point operations as described in the above embodiments.
[0039] Thus, the input parameter q of the gadget Gaussian sampling can be obtained, and when the input parameter q meets the preset conditions, the covariance matrix is integer decomposed and the Gaussian sampling is obtained by using the convolution theorem of Gaussian distribution. Therefore, high-precision floating-point operations are not required, only integer data operations are required, and parallel operations can be used to improve efficiency while ensuring sampling accuracy.
[0040] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0042] Figure 1 A flowchart of a Gaussian sampling method for removing floating-point operations provided by an embodiment of the present application;
[0043] Figure 2 is a flow chart of a disturbance sampling method according to an embodiment of the present application;
[0044] Figure 3 is a flowchart of a Gaussian sampling method according to an embodiment of the present application;
[0045] Figure 4 This is an example diagram of a Gaussian sampling device for removing floating-point operations according to an embodiment of the present application;
[0046] Figure 5 1 is a block diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION
[0047] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0048] The following describes the Gaussian sampling method, device and equipment for removing floating-point operations of the gadget of the embodiment of the present application with reference to the accompanying drawings. In view of the problem that the sampling mentioned in the above background technology center requires high-precision floating-point operations, the present application provides a Gaussian sampling method for removing floating-point operations of the gadget, in which the input parameter q of the gadget Gaussian sampling can be obtained, and when the input parameter q meets the preset conditions, the Gaussian sampling is obtained based on the integer decomposition of the covariance matrix and the convolution theorem of the Gaussian distribution. As a result, high-precision floating-point operations are not required, only integer data operations are required, and parallel operations can be achieved to improve efficiency while ensuring the accuracy of sampling.
[0049] Specifically, Figure 1 A flowchart of a Gaussian sampling method for removing floating-point operations provided in an embodiment of the present application is provided.
[0050] like Figure 1 As shown, the Gaussian sampling method for removing floating-point operations includes the following steps:
[0051] In step S101, the input parameter q of the gadget Gaussian sampling is obtained.
[0052] In step S102, it is determined whether the input parameter q meets a preset condition.
[0053] Optionally, in some embodiments, the preset condition is that the input parameter q is less than the modulus threshold b k .
[0054] That is, if the input parameter q of the gadget Gaussian sampling is less than the modulus threshold b k , it means that the input parameter q meets the preset conditions.
[0055] In step S103, when it is determined that the input parameter q meets the preset condition, Gaussian sampling is obtained based on integer decomposition of the covariance matrix and the convolution theorem of Gaussian distribution.
[0056] Optionally, in some embodiments, based on integer decomposition of the covariance matrix, the method includes: sampling to obtain an integer grid Z where the Gaussian distribution of the k+2-dimensional vector y satisfies k+2 , the covariance matrix J is a diagonal matrix, where the value of the first k+1 dimensions on the main diagonal of the covariance matrix J is l 2 r 2 b, the value of the k+2th dimension is l 2 r 2 ; Multiply the k+2-dimensional vector y by the matrix A on the left and divide by the integer l to obtain the k-dimensional vector p;
[0057] Where k is a positive integer and l is not less than A positive integer, r is not less than the smoothing parameter η ∈ (Z k ) of real numbers, the matrix
[0058] In some embodiments, the grid where the Gaussian distribution satisfied by the k-dimensional vector p is Z k / l, the covariance matrix is Σ=AJA t =r 2 ((b+1) 2 I k -TT t ), A t represents the transpose of matrix A, T t represents the transpose of the matrix T;
[0059] Among them, Z k is a k-dimensional integer space, l is not less than A positive integer, I k is a k×k identity matrix, b is a positive integer, and the matrix
[0060] Optionally, in some embodiments, Gaussian sampling is obtained using the convolution theorem of Gaussian distribution, including: sampling on the grid L(H) with a covariance of r 2 I k , the center is c = T -1 (pu) Gaussian distribution, we get vector z, where the lattice basis B q as follows:
[0061]
[0062] Calculate the output vector x = Tz, then x obeys the grid Λ ⊥ (g t) with a Gaussian distribution with covariance s 2 I k , where s is the standard deviation and the center of distribution is -u.
[0063] Specifically, the input of the Gaussian sampling method for removing floating-point operations in the embodiment of the present application is integers b, k, q, l, standard deviation s and vector u∈Z q k , here Z q ={-q / 2,…,q / 2-1}, the output is vector x satisfying Gaussian distribution The symbol D represents Gaussian distribution. The first subscript of D represents the set in which the distribution belongs, that is, the output vector x belongs to the grid Λ ⊥ (g t ); the second subscript represents the covariance matrix of the Gaussian distribution. If the covariance matrix is s 2 I k It is simplified to s, where I k is the k×k identity matrix; the third subscript is the center of the Gaussian distribution and is omitted if the center is 0. ⊥ (g t ), Geki B q ∈Z k×k There is decomposition:
[0064]
[0065] The first matrix of the decomposition is T∈Z k×k , the second matrix is H∈Z k×k ; Among them B q The last column (q0,…,q k-1 ) is the decomposition of q under component b, and when b=2, it is bit decomposition. The embodiment of the present application uses the existing Gaussian sampling on one-dimensional integers and the Gaussian sampling method in the related art as basic elements, and defines the matrix A∈Z k×(k+2) for:
[0066]
[0067] Specifically, Figure 2 As shown, the perturbation sampling method includes the following steps:
[0068] S201, start.
[0069] S202, Gaussian sampling is performed k+1 times on the integer Z with a standard deviation of lr√b to obtain a k+1-dimensional vector y'.
[0070] S203, Gaussian sampling is performed once on the integer Z with standard deviation lr to obtain y k+2 , and concatenate the vector y' to get the vector y.
[0071] S204, calculate and obtain a k-dimensional disturbance vector p=Ay / l.
[0072] S205, end.
[0073] like Figure 3 As shown, the Gaussian sampling method includes the following steps:
[0074] S301, sampling a disturbance vector p according to integer decomposition of the matrix ∑.
[0075] S302, calculate the center vector of Gaussian sampling (ie, the k-dimensional center vector) c=T -1 (pu), T -1 is the inverse matrix of matrix T.
[0076] S303 , taking c as the Gaussian sampling center and r as the standard deviation, Klein Gaussian sampling is performed on the grid spanned by the matrix H to obtain a k-dimensional vector z.
[0077] S304, return the k-dimensional vector x=Tz.
[0078] S305, end.
[0079] In summary, steps S202 to S203 are to obtain the Gaussian distribution of the k+2-dimensional vector y, where the grid is the integer grid Z. k+2 , the covariance matrix J is a diagonal matrix, and the values of the first k+1 dimensions on the main diagonal of J are l 2 r 2 b, the value of the k+2th dimension is l 2 r 2 In step S204, the k+2-dimensional vector y is multiplied by the matrix A on the left and then divided by the integer l to obtain the k-dimensional vector p. The grid where the Gaussian distribution satisfied by p is Z k / l, the covariance matrix is Σ:=AJA t =r 2 ((b+1) 2 I k -TT t ), A t represents the transpose of matrix A, T t Represents the transpose of the matrix T. Steps S202 to S204 are the key steps of this application, because the integer decomposition of the covariance matrix Σ is proposed, so that the present application no longer requires floating point operations compared to the related art. In steps S301 to S305, according to the convolution theorem of Gaussian distribution, the k-dimensional vector x satisfies the grid Λ ⊥ (g t ) with a Gaussian distribution with covariance s 2 I k , the distribution center is -u.
[0080] Thus, an integer decomposition AJA of the covariance matrix Σ is given by t Satisfies A∈Z k×(k+2) This allows the overall sampling method to be implemented with integers and no longer rely on high-precision floating-point operations. At the same time, because the decomposed matrix A has only k+2 columns, it can maintain practical efficiency.
[0081] According to the Gaussian sampling method for removing floating-point operations proposed in the embodiment of the present application, the input parameter q of the Gadget Gaussian sampling can be obtained, and when the input parameter q meets the preset conditions, the Gaussian sampling is obtained based on integer decomposition of the covariance matrix and the convolution theorem of the Gaussian distribution. Therefore, high-precision floating-point operations are not required, only integer data operations are required, and parallel operations can be achieved to improve efficiency while ensuring the accuracy of sampling.
[0082] Next, a Gaussian sampling device for removing floating-point operations gadgets proposed in an embodiment of the present application will be described with reference to the accompanying drawings.
[0083] Figure 4 It is a block diagram of a Gaussian sampling device for removing floating-point operations according to an embodiment of the present application.
[0084] like Figure 4 As shown, the floating point operation gadget Gaussian sampling device 10 includes: a first acquisition module 100, a judgment module 200 and a second acquisition module 300.
[0085] The first acquisition module 100 is used to obtain the input parameter q of the gadget Gaussian sampling;
[0086] The judging module 200 is used to judge whether the input parameter q satisfies a preset condition; and
[0087] The second acquisition module 300 is used to obtain Gaussian sampling based on integer decomposition of the covariance matrix and the convolution theorem of Gaussian distribution when it is determined that the input parameter q meets the preset condition.
[0088] Optionally, the preset condition is that the input parameter q is less than the modulus threshold b k .
[0089] Optionally, the second acquisition module 200 is specifically used for:
[0090] The integer grid Z where the Gaussian distribution of the k+2-dimensional vector y is obtained by sampling k+2 , the covariance matrix J is a diagonal matrix, where the value of the first k+1 dimensions on the main diagonal of the covariance matrix J is l 2 r 2 b, the value of the k+2th dimension is l 2r 2 ;
[0091] Multiply the k+2-dimensional vector y by the matrix A on the left and divide by the integer l to get the k-dimensional vector p;
[0092] Where k is a positive integer and l is not less than A positive integer, r is not less than the smoothing parameter η ∈ (Z k ) of real numbers, the matrix
[0093] Optionally, the grid where the Gaussian distribution of the k-dimensional vector p is located is Z k / l, the covariance matrix is Σ=AJA t =r 2 ((b+1) 2 I k -TT t ), A t represents the transpose of matrix A, T t represents the transpose of the matrix T;
[0094] Among them, Z k is a k-dimensional integer space, l is not less than A positive integer, I k is a k×k identity matrix, b is a positive integer, and the matrix
[0095] Optionally, the second acquisition module 200 is specifically used for:
[0096] The sampling covariance on the grid L(H) is r 2 I k , the center is c = T -1 (pu) Gaussian distribution, we get vector z, where the lattice basis B q as follows:
[0097]
[0098] Calculate the output vector x = Tz, then x obeys the grid Λ ⊥ (g t ) with a Gaussian distribution with covariance s 2 I k , where s is the standard deviation and the distribution center is -u. It should be noted that the above explanation of the Gaussian sampling method for removing floating-point operations is also applicable to the Gaussian sampling device for removing floating-point operations in this embodiment, and will not be repeated here.
[0099] According to the gadget Gaussian sampling device for removing floating-point operations proposed in the embodiment of the present application, the input parameter q of the gadget Gaussian sampling can be obtained, and when the input parameter q meets the preset conditions, the covariance matrix is integer decomposed and the Gaussian sampling is obtained by using the convolution theorem of the Gaussian distribution. Therefore, high-precision floating-point operations are not required, only integer data operations are required, and parallel operations can be achieved to improve efficiency while ensuring the accuracy of sampling.
[0100] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. The electronic device may include:
[0101] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .
[0102] When the processor 502 executes the program, the Gaussian sampling method for removing the floating-point operation gadget provided in the above embodiment is implemented.
[0103] Furthermore, the electronic device further comprises:
[0104] The communication interface 503 is used for communication between the memory 501 and the processor 502 .
[0105] The memory 501 is used to store computer programs that can be executed on the processor 502 .
[0106] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0107] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0108] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.
[0109] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application.
[0110] This embodiment further provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned Gaussian sampling method for removing floating-point operations is implemented.
[0111] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or N embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0112] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of the features. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0113] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0114] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or N wirings (electronic devices), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0115] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiment, the N steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0116] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0117] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0118] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. A Gaussian sampling method for removing floating-point operations, characterized in that: The following steps are involved: Get the input parameter q of the gadget Gaussian sampling; Determine whether the input parameter q meets a preset condition; as well as When it is determined that the input parameter q satisfies the preset condition, the Gaussian sampling is obtained based on integer decomposition of the covariance matrix and the convolution theorem of Gaussian distribution; The preset condition is that the input parameter q is less than the modulus threshold b. k ; The method is based on integer decomposition of the covariance matrix, including: sampling to obtain the integer grid Z where the Gaussian distribution of the k+2-dimensional vector y satisfies k+2 , the covariance matrix J is a diagonal matrix, where the values of the first k+1 dimensions on the main diagonal of the covariance matrix J are l 2 r 2 b, the value of the k+2th dimension is l 2 r 2 ; After the k+2-dimensional vector y is multiplied by the matrix A on the left, the k-dimensional vector p is obtained by dividing the integer l; where k is a positive integer and l is not less than A positive integer, r is not less than the smoothing parameter η ∈ (Z k ) of real numbers, the matrix 2. The method according to claim 1, characterized in that The grid where the Gaussian distribution satisfied by the k-dimensional vector p is Z k / l, the covariance matrix is Σ=AJA t =r 2 ((b+1) 2 I k -TT t ), A t represents the transpose of the matrix A, T t represents the transpose of the matrix T; Among them, Z k is a k-dimensional integer space, l is not less than A positive integer, I k is a k×k identity matrix, b is a positive integer, and the matrix 3. The method according to claim 2, characterized in that The Gaussian sampling is obtained by using the convolution theorem of Gaussian distribution, including: The sampling covariance on the grid L(H) is r 2 I k , the center is c = T -1 (pu) Gaussian distribution, we get vector z, where the lattice basis B q as follows: Calculate the output vector x = Tz, then x obeys the grid Λ ⊥ (g t ) with a Gaussian distribution with covariance s 2 I k , where s is the standard deviation and the center of distribution is -u.
4. A Gaussian sampling device for removing floating point operations, characterized in that: include: The first acquisition module is used to obtain the input parameter q of the gadget Gaussian sampling; A judgment module, used to judge whether the input parameter q meets a preset condition; as well as A second acquisition module is used for obtaining the Gaussian sampling based on integer decomposition of the covariance matrix and the convolution theorem of Gaussian distribution when it is determined that the input parameter q meets the preset condition; The preset condition is that the input parameter q is less than the modulus threshold b. k ; The second acquisition module is specifically used to: sample and obtain the integer grid Z where the Gaussian distribution of the k+2-dimensional vector y satisfies k +2 , the covariance matrix J is a diagonal matrix, where the values of the first k+1 dimensions on the main diagonal of the covariance matrix J are l 2 r 2 b, the value of the k+2th dimension is l 2 r 2 ; After the k+2-dimensional vector y is multiplied by the matrix A on the left, the k-dimensional vector p is obtained by dividing the integer l; where k is a positive integer and l is not less than A positive integer, r is not less than the smoothing parameter η ∈ (Z k ) of real numbers, the matrix 5. The device according to claim 4, characterized in that The grid where the Gaussian distribution satisfied by the k-dimensional vector p is Z k / l, the covariance matrix is Σ=AJA t =r 2 ((b+1) 2 I k -TT t ), A t represents the transpose of the matrix A, T t represents the transpose of the matrix T; Among them, Z k is a k-dimensional integer space, l is not less than A positive integer, I k is a k×k identity matrix, b is a positive integer, and the matrix 6. The device according to claim 5, characterized in that The second acquisition module is specifically used for: The sampling covariance on the grid L(H) is r 2 I k , the center is c = T -1 (pu) Gaussian distribution, we get vector z, where the lattice basis B q as follows: Calculate the output vector x = Tz, then x obeys the grid Λ ⊥ (g t ) with a Gaussian distribution with covariance s 2 I k , where s is the standard deviation and the center of distribution is -u.
7. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the Gaussian sampling method for removing floating-point operations as described in any one of claims 1 to 3.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that: The program is executed by a processor to implement the Gaussian sampling method for removing floating-point operations as described in any one of claims 1 to 3.
