Gadget sub-Gaussian sampling method, device, equipment and storage medium

By judging the conditions of the input parameter q, different methods are used to determine the gadget subgaussian sampling, which solves the problem of sampling complexity and low quality when the modulus q is less than bk in the prior art, and achieves higher quality subgaussian sampling, reducing The subgaussian parameters are smaller.

CN114065131BActive Publication Date: 2024-11-26TSINGHUA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111412525.2
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

Technical Problem

In the prior art, when the modulus q is less than bk, the implementation of the gadget subgaussian sampling method is complex and the sampling quality is low, requiring more random bits, resulting in larger subgaussian parameters.

Method used

By judging whether the input parameter q is equal to or less than the modulus threshold bk, the positive and negative nature of the last dimension of the output vector is determined by using subgaussian randomization, respectively, and the first k-1 dimension is determined based on this. Subgaussian sampling is implemented. When the conversion modulus q is not the power of b, the sampling is guaranteed to satisfy the subgaussian distribution.

Benefits of technology

Subgaussian sampling with higher quality is achieved when the modulus q is not powered by b, reducing subgaussian parameters and improving sampling efficiency and quality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114065131B_ABST
    Figure CN114065131B_ABST
Patent Text Reader

Abstract

The present application relates to a gadget sub-Gaussian sampling method, device, equipment and storage medium, wherein the method comprises: obtaining an input parameter q of the gadget sub-Gaussian sampling; judging whether the input parameter q satisfies a first preset condition or a second preset condition; when judging that the input parameter q satisfies the first preset condition, obtaining the sub-Gaussian sampling by using a sub-Gaussian randomized nearest plane algorithm; when judging that the input parameter q satisfies the second preset condition, determining the last dimension x of the output vector by a random operation k‑1 The positive and negative of the last dimension is determined, and the first k-1 dimensions of the output vector are determined based on the positive and negative of the last dimension, and the sub-Gaussian sampling is obtained using the first k-1 dimensions. Thus, the sampling when the modulus q is not a power of b is converted to the sampling when the modulus q is a power of b, and the output vector is guaranteed to satisfy the sub-Gaussian distribution, and a smaller sub-Gaussian parameter can be achieved, thereby achieving higher quality sampling.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of post-quantum cryptography technology, and in particular to a gadget sub-Gaussian sampling method, device, equipment and storage medium. Background Art

[0002] The rapid development of quantum computing has promoted the research of public key cryptography (i.e., post-quantum cryptography) that can resist quantum computing attacks. As an important type of post-quantum cryptography, lattice cryptography can not only realize efficient public key encryption and signature, but also realize powerful cryptographic methods such as homomorphic encryption and attribute-based encryption. In lattice cryptography, it is usually necessary to convert Z q The element u in is expressed as the inner product of vector g and vector z, that is, u =<g,z> mod q, where the vector g = (1, b, ..., b k-1 ) is called the gadget vector, where b k ≥q, the vector z is a short vector. There are three main methods to achieve this process: (1) b-ary decomposition. This method is a deterministic method, and the output vector z is the b-ary expansion coefficient of u; (2) gadget Gaussian sampling. This method is implemented by ⊥ (g t )={z∈Z k :<g,z> =0mod q}, and obtain a vector z that obeys the Gaussian distribution and satisfies u=<g,z> mod q; (3) gadget sub-Gaussian sampling. This method is similar to gadget Gaussian sampling, but the output vector z only needs to obey the sub-Gaussian distribution with specific parameters. Among the above three methods, gadget sub-Gaussian sampling has the advantages of the other two methods. On the one hand, it satisfies the "Pythagorean addition" property of Gaussian distribution. On the other hand, it has high sampling efficiency and requires fewer random bits for sampling. Therefore, gadget sub-Gaussian sampling is widely used in homomorphic encryption, attribute-based encryption and other methods.

[0003] The gadget sub-Gaussian sampling method obtained in the related art is mainly implemented by performing sub-Gaussian randomization on the Babai nearest plane algorithm. k When the method is directly in the grid Λ ⊥ (g t ) is used to perform the nearest plane algorithm with sub-Gaussian randomization. The output vector has the sub-Gaussian parameter (b-1)√(2π) in the worst case, and the number of random bits required is log(q). When q k In order to improve efficiency, the method does not ⊥ (g t ​), but instead of sampling directly on a simple grid, the nearest plane algorithm is sampled with sub-Gaussian randomization, and then a linear transformation is performed to obtain the final output vector. The output vector has a sub-Gaussian parameter (b+1)√(2π) in the worst case, and the number of random bits required is klog(q). Compared with q=b k A dedicated method for q k The general method is complex to implement, requires more random bits and has low sampling quality (i.e., the corresponding sub-Gaussian parameters are larger).

[0004] Application Contents

[0005] The present application provides a gadget sub-Gaussian sampling method, device, equipment and storage medium. Thus, the sampling when the modulus q is not a power of b is converted to the sampling when the modulus q is a power of b, and the output vector is guaranteed to satisfy the sub-Gaussian distribution, and a smaller sub-Gaussian parameter can be achieved, thereby achieving higher quality sampling.

[0006] The first aspect of the present application provides a gadget sub-Gaussian sampling method, comprising the following steps:

[0007] Get the input parameter q of the gadget sub-Gaussian sampling;

[0008] Determining whether the input parameter q satisfies a first preset condition or a second preset condition;

[0009] When it is determined that the input parameter q satisfies the first preset condition, a sub-Gaussian randomized nearest plane algorithm is used to obtain sub-Gaussian sampling; and

[0010] When it is determined that the input parameter q satisfies the second preset condition, the last dimension x of the output vector is determined by a random operation. k-1 The positive or negative value of the last dimension is determined, and the first k-1 dimensions of the output vector are determined based on the positive or negative value of the last dimension, and the sub-Gaussian sampling is obtained using the first k-1 dimensions.

[0011] Optionally, the first preset condition is that the input parameter q is equal to the modulus threshold b k The second preset condition is that the input parameter q is less than the modulus threshold b k .

[0012] Optionally, the using the first k-1 dimensions to obtain the sub-Gaussian sampling includes:

[0013] The input parameter q is the modulus threshold b k In the case of, using the input parameters and corresponding parameters to obtain the output k-1 dimensional vector x';

[0014] ​Determine the last dimension x according to the vector x' k-1 The sub-Gaussian sampling is obtained by using the numerical value of .

[0015] Optionally, the calculation formula of the sub-Gaussian parameter is:

[0016] If the input parameter q satisfies the first preset condition, then the sub-Gaussian parameter = (b-1)√(2π);

[0017] If the input parameter q satisfies the second preset condition, then the sub-Gaussian parameter = √((b-1) 2 +α 2 )·√(2π);

[0018] Where b is a positive integer and α is (q / b k-1 )+1 after rounding.

[0019] A second aspect of the present application provides a gadget sub-Gaussian sampling device, including:

[0020] The first acquisition module is used to obtain the input parameter q of the gadget sub-Gaussian sampling;

[0021] A judging module, used to judge whether the input parameter q satisfies a first preset condition or a second preset condition;

[0022] A second acquisition module is used to obtain sub-Gaussian sampling by using a sub-Gaussian randomized nearest plane algorithm when it is determined that the input parameter q satisfies the first preset condition; and

[0023] The third acquisition module is used to determine the last dimension x of the output vector through a random operation when it is determined that the input parameter q meets the second preset condition. k-1 The positive or negative value of the last dimension is determined, and the first k-1 dimensions of the output vector are determined based on the positive or negative value of the last dimension, and the sub-Gaussian sampling is obtained using the first k-1 dimensions.

[0024] Optionally, the first preset condition is that the input parameter q is equal to the modulus threshold b k The second preset condition is that the input parameter q is less than the modulus threshold b k .

[0025] Optionally, the third acquisition module is specifically used to:

[0026] The input parameter q is the modulus threshold b k In the case of, using the input parameters and corresponding parameters to obtain the output k-1 dimensional vector x';

[0027] Determine the last dimension x according to the vector x' k-1The sub-Gaussian sampling is obtained by using the numerical value of .

[0028] Optionally, the calculation formula of the sub-Gaussian parameter is:

[0029] If the input parameter q satisfies the first preset condition, then the sub-Gaussian parameter = (b-1)√(2π);

[0030] If the input parameter q satisfies the second preset condition, then the sub-Gaussian parameter = √((b-1) 2 +α 2 )·√(2π);

[0031] Where b is a positive integer and α is (q / b k-1 )+1 after rounding.

[0032] 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 gadget sub-Gaussian sampling method as described in the above embodiment.

[0033] A fourth aspect 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 sub-Gaussian sampling method as described in the above embodiment.

[0034] Therefore, we can make the input parameter q equal to b k When the sub-Gaussian randomized nearest plane algorithm is used to obtain sub-Gaussian sampling; when the input parameter q is not equal to b k When , the last dimension x of the output vector is determined by a random operation k-1 The positive and negative of the last dimension is determined, and the first k-1 dimensions of the output vector are determined based on the positive and negative of the last dimension, and the sub-Gaussian sampling is obtained using the first k-1 dimensions. Thus, the sampling when the modulus q is not a power of b is converted to the sampling when the modulus q is a power of b, and the output vector is guaranteed to satisfy the sub-Gaussian distribution, and a smaller sub-Gaussian parameter can be achieved, thereby achieving higher quality sampling.

[0035] 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

[0036] 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:

[0037] Figure 1A flowchart of a gadget sub-Gaussian sampling method provided according to an embodiment of the present application;

[0038] Figure 2 According to one embodiment of the present application, q is equal to b k Flowchart of the Shiya Gaussian method;

[0039] Figure 3 According to one embodiment of the present application, q is not equal to b k Flowchart of the Shiya Gaussian method;

[0040] Figure 4 is an example diagram of a gadget sub-Gaussian sampling device according to an embodiment of the present application;

[0041] Figure 5 is an exemplary diagram of an electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0042] 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.

[0043] The following describes the gadget sub-Gaussian sampling method, device, equipment and storage medium of the embodiment of the present application with reference to the accompanying drawings. k The general method of implementing complex problems, this application provides a gadget sub-Gaussian sampling method, in which the input parameter q can be equal to b k When the sub-Gaussian randomized nearest plane algorithm is used to obtain sub-Gaussian sampling; when the input parameter q is not equal to b k When , the last dimension x of the output vector is determined by a random operation k-1 The positive and negative of the last dimension is determined, and the first k-1 dimensions of the output vector are determined based on the positive and negative of the last dimension, and the sub-Gaussian sampling is obtained using the first k-1 dimensions. Thus, the sampling when the modulus q is not a power of b is converted to the sampling when the modulus q is a power of b, and the output vector is guaranteed to satisfy the sub-Gaussian distribution, and a smaller sub-Gaussian parameter can be achieved, thereby achieving higher quality sampling.

[0044] Specifically, Figure 1 A flowchart of a gadget sub-Gaussian sampling method provided in an embodiment of the present application.

[0045] like Figure 1 As shown, the gadget sub-Gaussian sampling method includes the following steps: ​

[0046] In step S101, the input parameter q of the gadget sub-Gaussian sampling is obtained.

[0047] In step S102, it is determined whether the input parameter q satisfies the first preset condition or the second preset condition.

[0048] Optionally, in some embodiments, the first preset condition is that the input parameter q is equal to the modulus threshold b k The second preset condition is that the input parameter q is less than the modulus threshold b k .

[0049] That is, if the input parameter q of the gadget sub-Gaussian sampling is equal to the modulus threshold b k , it means that the input parameter q meets the first preset condition. If the input parameter q of the gadget sub-Gaussian sampling is less than the modulus threshold b k , it means that the input parameter q meets the second preset condition.

[0050] In step S103, when it is determined that the input parameter q satisfies the first preset condition, a sub-Gaussian randomized nearest plane algorithm is used to obtain sub-Gaussian sampling.

[0051] Optionally, in some embodiments, the calculation formula of the sub-Gaussian parameter is: if the input parameter q satisfies the first preset condition, then the sub-Gaussian parameter = (b-1)√(2π);

[0052] Where b is a positive integer and α is (q / b k-1 )+1 is rounded down directly, discarding the decimal part.

[0053] Specifically, the gadget sub-Gaussian sampling method SubGaussian(b,k,q,u) takes as input positive integers b,k,q,u, such that q≤b k And u∈Z q , here Z q ={-q / 2,…,q / 2-1}, the output is the lattice coset Λ u ⊥ (g t ) on the sub-Gaussian vector x∈Z k , when q=b k When x has a sub-Gaussian parameter of (b-1)√(2π), when q k When x has a sub-Gaussian parameter of √((b-1) 2 +α 2 )·√(2π), where α is equal to (q / b k-1 )+1. The rounding mentioned here and later is to round down directly, that is, to discard the decimal part directly. Figure 2 The integer is recorded as the symbol​ For the output vector x∈Z k , let each component of x be x i , i ranges from 0 to k-1; corresponding to g = (1, b, ..., b k-1 ), let g'=(1,b,…,b k-2 ).

[0054] Specifically, if Figure 2 As shown, when judging that the input parameter q satisfies the first preset condition, that is, q=b k When the sub-Gaussian randomized nearest plane algorithm is used to obtain sub-Gaussian sampling (i.e., q is equal to b k The sub-Gaussian method) comprises the following steps:

[0055] S201, start.

[0056] S202, input b, k, q = b k 、u.

[0057] S203, i=0

[0058] S204, determine whether i<k holds, if so, execute step S205, otherwise, execute step S214.

[0059] S205, y=u mod b.

[0060] S206, determine whether y=0 is true, if so, execute step S207, otherwise, execute step S208.

[0061] S207,x i =0, and jump to step S212.

[0062] S208, get a random number r∈[0,b).

[0063] S209, determine whether r<y is established, if so, execute step S210, otherwise, execute step S211.

[0064] S210,x i =yb, and jump to execute step S212.

[0065] S211,x i =y.

[0066] S212,u=(ux i ) / b.

[0067] S213, i=i+1, and jump to execute step S204.

[0068] S214, output vector x.

[0069] S215, end.

[0070] That is, if q equals b k , then calculate the components x of x from i=0 to k-1 in sequence i , let y = u mod b, if y is equal to 0, then the current x i equal to 0; if y is not equal to 0, take x with probability y / b i Equal to yb, otherwise take x i Equal to y, recalculate u=(ux i ) / b, until x i Calculated to x k-1 , then output x and the method ends.

[0071] In step S104, when it is determined that the input parameter q satisfies the second preset condition, the last dimension x of the output vector is determined by a random operation. k-1 The positive and negative nature of the last dimension is determined, and the first k-1 dimensions of the output vector are determined based on the positive and negative nature of the last dimension, and the sub-Gaussian sampling is obtained using the first k-1 dimensions.

[0072] Optionally, in some embodiments, the calculation formula of the sub-Gaussian parameter is: if the input parameter q satisfies the second preset condition, then the sub-Gaussian parameter = √((b-1) 2 +α 2 )·√(2π);

[0073] Where b is a positive integer and α is (q / b k-1 )+1 after rounding.

[0074] Optionally, in some embodiments, using the first k-1 dimensions to obtain sub-Gaussian sampling includes: when the input parameter q is the modulus threshold b k In the case of , the input parameters and corresponding parameters are used to obtain the output k-1-dimensional vector x'; according to the vector x', the last dimension x is determined k-1 The value of is used to obtain sub-Gaussian sampling.

[0075] Specifically, q is not equal to b k The Gaussian method process is as follows Figure 3 As shown, the following steps are included:

[0076] S301, start.

[0077] S302, input b, k, q, u.

[0078] S303, u0=u mod b k-1 ; u1=(uq)mod b k-1 ;

[0079] S304, get a random number r∈[0,1].

[0080] S305, judgment Is it true? If so, execute step S306; otherwise, execute step S310.

[0081] S306, with parameters (b, k-1, b k-1 , u0) calling method (i.e. the above Figure 2 method) to obtain a k-1 dimensional vector x'.

[0082] S307, judgment<x′,g′> =u0 is true, if so, execute step S308, otherwise, execute step S309.

[0083] S308, output the k-dimensional vector x=(x′, a0), and jump to execute step S314.

[0084] S309, output the k-dimensional vector x=(x′, a0+1), and jump to execute step S314.

[0085] S310, with parameters (b, k-1, b k-1 , u1) calling method (i.e. the above Figure 2 method) to obtain a k-1 dimensional vector x'.

[0086] S311, judgment<x′,g′> =u1 is true, if so, execute step S312, otherwise, execute step S313.

[0087] S312, output the k-dimensional vector x=(x′, a1), and jump to execute step S314.

[0088] S313, output the k-dimensional vector x=(x′, a1+1), and jump to execute step S314.

[0089] S314, end.

[0090] That is, if q is not equal to b k , then calculate u0=u mod b k-1 ,u1=(uq)mod b k-1 , calculate a0 equal to (u / b k-1 ) is rounded, a1 is equal to ((uq) / b k-1 ) rounds up, picks a random number r between 0 and 1, if r<(qu) / q, calls the method SubGaussian(b,k-1,b k-1,(u0) obtain a (k - 1)-dimensional vector x'. Let the first k - 1 dimensions of the vector x be x'. If the inner product <g', x'> = u0, then the k-th dimension is a0; if the inner product <g', x'> = u0 - b k-1 , the k-th dimension is a0 + 1. Output x, and the method ends; if r ≥ (q - u) / q, call the method SubGaussian(b, k - 1, b k-1 ,(u1) obtain a (k - 1)-dimensional vector x'. Let the first k - 1 dimensions of the vector x be x'. If the inner product <g', x'> = u1, then the k-th dimension is a1; if the inner product <g', x'> = u1 - b k-1 , the k-th dimension is a1 + 1. Output x, and the method ends.

[0091] In summary, when the input parameter q satisfies q equals b k , the embodiment of the present application can directly use the Sub-Gaussian randomized nearest plane algorithm to obtain the output (i.e., Figure 2 in S203 - S214). If the input parameter q does not satisfy q equals b k (i.e., q < b k ), first, determine the sign of the last dimension x k-1 of the output vector x through a random operation, and then determine the first k - 1 dimensions of the output vector x according to the different signs obtained. At this time, when determining the first k - 1 dimensions, sampling can be performed modulo b k-1 , that is, the method can be directly called with parameters (b, k - 1, q = b k-1 , u0) or (b, k - 1, q = b k-1 , u1). The method called at this time will directly obtain the output (k - 1)-dimensional vector x' from Figure 2 in S203, and then determine the specific value of the last dimension x k-1 of x according to the difference of x'.

[0092] According to the gadget Sub-Gaussian sampling method proposed by the embodiment of the present application, when the input parameter q equals b k , Sub-Gaussian sampling can be obtained by using the Sub-Gaussian randomized nearest plane algorithm; when the input parameter q is not equal to b k , determine the sign of the last dimension x k-1 of the output vector through a random operation, and determine the first k - 1 dimensions of the output vector based on the sign of the last dimension, and obtain Sub-Gaussian sampling using the first k - 1 dimensions. Thus, the sampling in the case where the modulus q is not a power of b is transformed into the sampling in the case where the modulus q is a power of b, and it is ensured that the output vector satisfies the Sub-Gaussian distribution, and a smaller Sub-Gaussian parameter can be achieved, thereby realizing higher-quality sampling.

[0093] Next, the gadget sub-Gaussian sampling device proposed according to the embodiment of the present application is described with reference to the accompanying drawings.

[0094] Figure 4 is a block diagram of a gadget sub-Gaussian sampling device according to an embodiment of the present application.

[0095] like Figure 4 As shown, the gadget sub-Gaussian sampling device 10 includes: a first acquisition module 100 , a judgment module 200 , a second acquisition module 300 and a third acquisition module 400 .

[0096] The first acquisition module 100 is used to obtain the input parameter q of the gadget sub-Gaussian sampling;

[0097] The judging module 200 is used to judge whether the input parameter q satisfies the first preset condition or the second preset condition;

[0098] The second acquisition module 300 is used to obtain sub-Gaussian sampling by using a sub-Gaussian randomized nearest plane algorithm when it is determined that the input parameter q meets the first preset condition; and

[0099] The third acquisition module 400 is used to determine the last dimension x of the output vector through a random operation when it is determined that the input parameter q meets the second preset condition. k-1 The positive and negative nature of the last dimension is determined, and the first k-1 dimensions of the output vector are determined based on the positive and negative nature of the last dimension, and the sub-Gaussian sampling is obtained using the first k-1 dimensions.

[0100] Optionally, the first preset condition is that the input parameter q is equal to the modulus threshold b k The second preset condition is that the input parameter q is less than the modulus threshold b k .

[0101] Optionally, the third acquisition module 400 is specifically used for:

[0102] The input parameter q is the modulus threshold b k In the case of, use the input parameters and corresponding parameters to obtain the output k-1 dimensional vector x';

[0103] Determine the last dimension x from the vector x' k-1 The value of is used to obtain sub-Gaussian sampling.

[0104] Optionally, the calculation formula of the sub-Gaussian parameter is:

[0105] If the input parameter q satisfies the first preset condition, then the sub-Gaussian parameter = (b-1)√(2π);

[0106] If the input parameter q satisfies the second preset condition, then the sub-Gaussian parameter = √((b-1) 2 +α2 )·√(2π);

[0107] Where b is a positive integer and α is (q / b k-1 )+1 after rounding.

[0108] It should be noted that the aforementioned explanation of the gadget sub-Gaussian sampling method embodiment is also applicable to the gadget sub-Gaussian sampling device of this embodiment, and will not be repeated here.

[0109] According to the gadget sub-Gaussian sampling device proposed in the embodiment of the present application, the input parameter q can be equal to b k When the sub-Gaussian randomized nearest plane algorithm is used to obtain sub-Gaussian sampling; when the input parameter q is not equal to b k When , the last dimension x of the output vector is determined by a random operation k-1 The positive and negative of the last dimension is used to determine the first k-1 dimensions of the output vector, and the first k-1 dimensions are used to obtain sub-Gaussian sampling. In this way, the sampling when the modulus q is not a power of b is converted to the sampling when the modulus q is a power of b, and the output vector is guaranteed to satisfy the sub-Gaussian distribution, which can achieve a smaller sub-Gaussian parameter and thus achieve higher quality sampling.

[0110] 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:

[0111] A memory 501 , a processor 502 , and a computer program stored in the memory 501 and executable on the processor 502 .

[0112] When the processor 502 executes the program, the gadget sub-Gaussian sampling method provided in the above embodiment is implemented.

[0113] Furthermore, the electronic device further comprises:

[0114] The communication interface 503 is used for communication between the memory 501 and the processor 502 .

[0115] The memory 501 is used to store computer programs that can be executed on the processor 502 .

[0116] 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.

[0117] 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.

[0118] 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.

[0119] 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.

[0120] This embodiment also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, the above-mentioned gadget sub-Gaussian sampling method is implemented.

[0121] 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.

[0122] 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.

[0123] 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.

[0124] 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.

[0125] 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.

[0126] 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.

[0127] 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.

[0128] 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 gadget sub-Gaussian sampling method, characterized in that: The following steps are involved: Get the input parameter q of the gadget sub-Gaussian sampling; Determining whether the input parameter q satisfies a first preset condition or a second preset condition; When it is determined that the input parameter q satisfies the first preset condition, a sub-Gaussian randomized nearest plane algorithm is used to obtain sub-Gaussian sampling; as well as When it is determined that the input parameter q satisfies the second preset condition, the last dimension x of the output vector is determined by a random operation. k-1 The positive and negative of the last dimension is determined based on the positive and negative of the last dimension, and the first k-1 dimensions of the output vector are determined, and the sub-Gaussian sampling is obtained by using the first k-1 dimensions; Wherein, the calculation formula of the sub-Gaussian sampling is: If the input parameter q satisfies the first preset condition, then the sub-Gaussian sampling = (b-1)√(2π); If the input parameter q satisfies the second preset condition, then the sub-Gaussian sampling = √((b-1) 2 +α 2 )·√(2π); Where b is a positive integer and α is (q / b k-1 )+1 after rounding.

2. The method according to claim 1, characterized in that: The first preset condition is that the input parameter q is equal to the modulus threshold b k The second preset condition is that the input parameter q is less than the modulus threshold b k .

3. The method according to claim 2, characterized in that The using the first k-1 dimensions to obtain the sub-Gaussian sampling includes: The input parameter q is the modulus threshold b k In the case of, using the input parameters and corresponding parameters to obtain the output k-1 dimensional vector x'; Determine the last dimension x according to the vector x' k-1 The sub-Gaussian sampling is obtained by using the numerical value of .

4. A gadget sub-Gaussian sampling device, characterized in that: include: The first acquisition module is used to obtain the input parameter q of the gadget sub-Gaussian sampling; A judging module, used to judge whether the input parameter q satisfies a first preset condition or a second preset condition; A second acquisition module is used to obtain sub-Gaussian sampling by using a sub-Gaussian randomized nearest plane algorithm when it is determined that the input parameter q meets the first preset condition; as well as The third acquisition module is used to determine the last dimension x of the output vector through a random operation when it is determined that the input parameter q meets the second preset condition. k-1 The positive and negative of the last dimension is determined based on the positive and negative of the last dimension, and the first k-1 dimensions of the output vector are determined, and the sub-Gaussian sampling is obtained by using the first k-1 dimensions; Wherein, the calculation formula of the sub-Gaussian sampling is: If the input parameter q satisfies the first preset condition, then the sub-Gaussian sampling = (b-1)√(2π); If the input parameter q satisfies the second preset condition, then the sub-Gaussian sampling = √((b-1) 2 +α 2 )·√(2π); Where b is a positive integer and α is (q / b k-1 )+1 after rounding.

5. The device according to claim 4, characterized in that The first preset condition is that the input parameter q is equal to the modulus threshold b k The second preset condition is that the input parameter q is less than the modulus threshold b k .

6. The device according to claim 5, characterized in that The third acquisition module is specifically used for: The input parameter q is the modulus threshold b k In the case of, using the input parameters and corresponding parameters to obtain the output k-1 dimensional vector x'; Determine the last dimension x according to the vector x' k-1 The sub-Gaussian sampling is obtained by using the numerical value of .

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 gadget sub-Gaussian sampling method according to 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 gadget sub-Gaussian sampling method as described in any one of claims 1 to 3.