Randomness testing method and system for quantum random numbers
Patent Information
- Application Number
- CN202211440149.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-17
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-11-17
AI Technical Summary
[0003]目前现有的量子随机数的随机性检验方法有抽样检测、实时在线检测等方法,其中抽样检测通过从产生的随机数中提取部分数据进行随机性检验,其虽然能够检验提取的部分数据的随机性质量,但难以实时监测整个运行周期内产生的所有随机数的随机性质量
[0033] The present invention discloses a method and system for testing the randomness of quantum random numbers. It employs the principle of random computation to amplify and demonstrate the randomness of random numbers. Specifically, it uses quantum random numbers as factors, converting them into random numbers suitable for random computation. After multiple random computations, the final result is converted back into binary numbers. The difference between this binary number and the expected value corresponding to the default value can be used as a standard for measuring randomness. This method does not require a large amount of computing resources and has good performance in testing randomness, enabling high-speed online detection, thus providing an objective basis for testing the randomness of quantum random numbers.
Smart Images

Figure CN115756390B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of quantum random number testing technology, and in particular to a method and system for testing the randomness of quantum random numbers. Background Technology
[0002] The randomness of the random numbers generated by a quantum random number generator indicates the quality of the quantum random number generator service. Therefore, the methods for verifying the randomness of random numbers generated by a quantum random number generator are particularly important.
[0003] Current methods for verifying the randomness of quantum random numbers include sampling detection and real-time online detection. Sampling detection extracts a subset of data from the generated random numbers for randomness verification. While it can verify the randomness quality of the extracted data, it struggles to monitor the randomness quality of all random numbers generated throughout the entire runtime cycle in real time. Furthermore, existing real-time online detection methods either employ simple randomness detection techniques to reduce circuit complexity, resulting in poor performance, or they utilize overly complex methods that consume significant computational resources.
[0004] Therefore, there is an urgent need to propose a method for testing the randomness of quantum random numbers to overcome the aforementioned technical deficiencies in existing technologies. Summary of the Invention
[0005] Therefore, the technical problem to be solved by the present invention is to overcome the technical defects existing in the prior art, and to propose a method and system for testing the randomness of quantum random numbers. This method does not require a large amount of computing resources, has good performance in testing randomness, and can achieve high-speed online detection, thereby providing an objective basis for testing the randomness of quantum random numbers.
[0006] To address the aforementioned technical problems, this invention provides a method for testing the randomness of quantum random numbers, comprising the following steps:
[0007] S1: Obtain quantum random numbers generated by the quantum random number generator;
[0008] S2: Extract n random arrays of length m from the obtained quantum random numbers, compare the size of the n random arrays of length m with the preset n default values, and generate a binary number with randomness related to S for each array.
[0009] S3: Repeat step S2 twice. m Next, all the generated binary numbers are combined into a random computation binary bit stream for random calculation. The size of the random computation binary bit stream is related to a default value, the randomness of the binary bit stream is related to the obtained quantum random number, and the length of the binary bit stream is 2. m ;
[0010] S4: Perform operations on the aforementioned random computation binary bitstream as the operand in random computation to obtain a set of length 2. m Random computation of binary bit streams;
[0011] S5: Transform a length of 2 m The random computation binary bit stream is converted into a binary number M of length m;
[0012] S6: Generate an expected value C based on n sets of default values and m values, and verify the randomness of the quantum random number based on the expected value C and the value M.
[0013] In one embodiment of the present invention, in S2, the n sets of default values are different in size.
[0014] In one embodiment of the present invention, in S4, the random computation binary bit stream is used as the operand in random computation to obtain a set of lengths of 2. m Methods for randomly calculating binary bit streams include:
[0015] The random computation binary bit stream is used as an operand in a random computation and added together. The remaining part of the random computation binary bit stream is also used as an operand in a random computation and added together. The result of the two random computation additions is then multiplied together again to obtain a set of length 2. m Random computation of binary bit streams.
[0016] In one embodiment of the present invention, in S5, the length is 2 m The random binary bit stream is converted into a binary number M of length m by a counter.
[0017] In one embodiment of the present invention, in S6, the method for verifying the randomness of a quantum random number based on the expected value C and the value M includes:
[0018] Using |MC| / (2) m As a standard for measuring the randomness of the tested quantum random number, when the value approaches 0, it indicates good randomness, and vice versa.
[0019] Furthermore, the present invention also provides a randomness testing system for quantum random numbers, comprising:
[0020] A quantum random number acquisition module, wherein the quantum random number acquisition module is used to acquire quantum random numbers generated by a quantum random number generator;
[0021] A binary number generation module is used to extract n random arrays of length m from the acquired quantum random numbers, compare the size of the n random arrays of length m with the size of the n preset default values, and generate a binary number with randomness related to S respectively.
[0022] A binary bit stream composition module is used to repeatedly perform the steps of generating binary numbers 2. m Next, all the generated binary numbers are combined into a random computation binary bit stream for random calculation. The size of the random computation binary bit stream is related to a default value, the randomness of the binary bit stream is related to the obtained quantum random number, and the length of the binary bit stream is 2. m ;
[0023] The binary bitstream arithmetic module is used to perform operations on the random computation binary bitstream as the operand in random computation, resulting in a set of bits of length 2. m Random computation of binary bit streams;
[0024] A binary bitstream conversion module, wherein the binary bitstream conversion module is used to convert a binary bitstream of length 2 m The random computation binary bit stream is converted into a binary number M of length m;
[0025] A randomness testing module is used to generate an expected value C based on n sets of default values and m values, and to test the randomness of quantum random numbers using the expected value C and the value M.
[0026] In one embodiment of the present invention, the binary bitstream arithmetic module uses the randomly calculated binary bitstream as the operand in random computation to perform operations, resulting in a set of bits of length 2. m Methods for randomly calculating binary bit streams include:
[0027] The random computation binary bit stream is used as an operand in a random computation and added together. The remaining part of the random computation binary bit stream is also used as an operand in a random computation and added together. The result of the two random computation additions is then multiplied together again to obtain a set of length 2. m Random computation of binary bit streams.
[0028] In one embodiment of the present invention, the length is 2. m The random binary bit stream is converted into a binary number M of length m by a counter.
[0029] In one embodiment of the present invention, the method by which the randomness testing module tests the randomness of a quantum random number based on the expected value C and the value M includes:
[0030] Using |MC| / (2) m As a standard for measuring the randomness of the tested quantum random number, when the value approaches 0, it indicates good randomness, and vice versa.
[0031] Furthermore, the present invention also provides an FPGA that implements the steps of the above-described method for verifying the randomness of quantum random numbers.
[0032] The technical solution of the present invention has the following advantages compared with the prior art:
[0033] The present invention discloses a method and system for testing the randomness of quantum random numbers. It employs the principle of random computation to amplify and demonstrate the randomness of random numbers. Specifically, it uses quantum random numbers as factors, converting them into random numbers suitable for random computation. After multiple random computations, the final result is converted back into binary numbers. The difference between this binary number and the expected value corresponding to the default value can be used as a standard for measuring randomness. This method does not require a large amount of computing resources and has good performance in testing randomness, enabling high-speed online detection, thus providing an objective basis for testing the randomness of quantum random numbers. Attached Figure Description
[0034] To make the content of this invention easier to understand, the invention will be further described in detail below with reference to specific embodiments and accompanying drawings, wherein...
[0035] Figure 1 This is a flowchart illustrating a method for verifying the randomness of quantum random numbers proposed in this invention.
[0036] Figure 2 This is a schematic diagram illustrating a specific implementation of the randomness testing method for quantum random numbers proposed in this invention. Detailed Implementation
[0037] The present invention will be further described below with reference to the accompanying drawings and specific embodiments, so that those skilled in the art can better understand and implement the present invention. However, the embodiments described are not intended to limit the present invention.
[0038] Reference Figure 1 As shown, this embodiment of the invention provides a method for testing the randomness of quantum random numbers, including the following steps:
[0039] S1: Obtain quantum random numbers generated by the quantum random number generator;
[0040] S2: Extract n random arrays of length m from the obtained quantum random numbers, compare the size of the n random arrays of length m with the preset n default values, and generate a binary number with randomness related to S for each array.
[0041] S3: Repeat step S2 twice. m Next, all the generated binary numbers are combined into a random computation binary bit stream for random calculation. The size of the random computation binary bit stream is related to a default value, the randomness of the binary bit stream is related to the obtained quantum random number, and the length of the binary bit stream is 2. m ;
[0042] S4: Perform operations on the aforementioned random computation binary bitstream as the operand in random computation to obtain a set of length 2. m Random computation of binary bit streams;
[0043] S5: Transform a length of 2 m The random computation binary bit stream is converted into a binary number M of length m;
[0044] S6: Generate an expected value C based on n sets of default values and m values, and verify the randomness of the quantum random number based on the expected value C and the value M.
[0045] The present invention discloses a method for testing the randomness of quantum random numbers. This method uses the principle of random computation to amplify and demonstrate the randomness of random numbers. Specifically, it uses quantum random numbers as factors to convert them into random numbers that can be used for random computation. After multiple random computations, the final result is converted back into a binary number. The difference between this binary number and the expected value corresponding to the default value can be used as a standard for measuring randomness. This method does not require a large amount of computing resources and has good performance in testing randomness. It can achieve high-speed online detection, thus providing an objective basis for testing the randomness of quantum random numbers.
[0046] In step S4, the random computation binary bit stream is used as the operand in the random computation to obtain a set of bits of length 2. m The method for randomly calculating a binary bit stream includes performing addition on a portion of the randomly calculated binary bit stream as an operand in random calculation, performing addition on the remaining portion of the randomly calculated binary bit stream as an operand in random calculation, and then performing random multiplication on the result of the two random calculation additions to obtain a set of bits of length 2. m Random computation of binary bit streams.
[0047] In S5, the length is 2 m The random binary bit stream is converted into a binary number M of length m by a counter.
[0048] In S6, the method for testing the randomness of quantum random numbers based on the expected value C and the value M includes using |MC| / (2 m As a standard for measuring the randomness of the tested quantum random number, when the value approaches 0, it indicates good randomness, and vice versa.
[0049] The following examples illustrate in detail the specific content of the randomness testing method for quantum random numbers provided by this invention.
[0050] As an example, such as Figure 2 As shown, random arrays S1, S2, S4, and S5 of length 8 are extracted from the generated quantum random numbers, and four default values (N1, N2, N3, and N4) are set. S3 and S6 are random numbers of length 1 extracted from the detected quantum random numbers (used for addition operations in random calculations). N1, N2, N3, and N4 are all less than 2. 8 The constant is N1, N2, S1, and S2. N1, N2, S1, and S2 are converted into a "random computation binary bit stream" by a comparator, and then random addition is performed using S0 and a selector. N3, N4, S4, and S5 are also converted into a "random computation binary bit stream" by a comparator, and then random addition is performed using S0 and a selector. The result of the two random addition operations is then subjected to random multiplication, and the final "random computation binary bit stream" is converted into a binary number M by a counter. The quantum random number generator verifies the randomness by monitoring the value of M in real time.
[0051] The above-mentioned quantum random number generator verifies randomness by real-time monitoring of the M value. The method is as follows: set δ, when δ is much smaller than min[N1 / 2], ... 8 N2 / 2 8 N3 / 2 8 N4 / 2 8 ], take γ = (M / 2 8 )-((N1 / 2 8 +N2 / 2 8 ) / 2)*((N3 / 2 8 +N4 / 2 8 ) / 2); When γ<=δ, the randomness is good; when δ<γ<=2.5δ, the randomness is average; when γ>5δ, the randomness is insufficient.
[0052] This invention employs a random calculation method to verify the randomness of quantum random numbers. It uses quantum random numbers generated by a quantum random number generator as the random number source for random addition operations. The coherence of the tested random numbers is amplified through multiple random calculations. A probability distribution function is generated through random operations on a constant. The comparison between the measured result and the estimated expected error range is used as the verification standard for randomness verification.
[0053] Corresponding to the embodiments of the above method, the present invention also provides an FPGA that implements the steps of the above-described method for verifying the randomness of quantum random numbers.
[0054] The following describes a randomness testing system for quantum random numbers disclosed in an embodiment of the present invention. The randomness testing system for quantum random numbers described below can be referred to in correspondence with the randomness testing method for quantum random numbers described above.
[0055] This invention also provides a system for testing the randomness of quantum random numbers, comprising:
[0056] A quantum random number acquisition module, wherein the quantum random number acquisition module is used to acquire quantum random numbers generated by a quantum random number generator;
[0057] A binary number generation module is used to extract n random arrays of length m from the acquired quantum random numbers, compare the size of the n random arrays of length m with the size of the n preset default values, and generate a binary number with randomness related to S respectively.
[0058] A binary bit stream composition module is used to repeatedly perform the steps of generating binary numbers 2. m Next, all the generated binary numbers are combined into a random computation binary bit stream for random calculation. The size of the random computation binary bit stream is related to a default value, the randomness of the binary bit stream is related to the obtained quantum random number, and the length of the binary bit stream is 2. m ;
[0059] The binary bitstream arithmetic module is used to perform operations on the random computation binary bitstream as the operand in random computation, resulting in a set of bits of length 2. m Random computation of binary bit streams;
[0060] A binary bitstream conversion module, wherein the binary bitstream conversion module is used to convert a binary bitstream of length 2 m The random computation binary bit stream is converted into a binary number M of length m;
[0061] A randomness testing module is used to generate an expected value C based on n sets of default values and m values, and to test the randomness of quantum random numbers using the expected value C and the value M.
[0062] In one embodiment of the present invention, the binary bitstream arithmetic module uses the randomly calculated binary bitstream as the operand in random computation to perform operations, resulting in a set of bits of length 2. m Methods for randomly calculating binary bit streams include:
[0063] The random computation binary bit stream is used as an operand in a random computation and added together. The remaining part of the random computation binary bit stream is also used as an operand in a random computation and added together. The result of the two random computation additions is then multiplied together again to obtain a set of length 2. m Random computation of binary bit streams.
[0064] In one embodiment of the present invention, the method by which the randomness testing module tests the randomness of a quantum random number based on the expected value C and the value M includes:
[0065] Using |MC| / (2) m As a standard for measuring the randomness of the tested quantum random number, when the value approaches 0, it indicates good randomness, and vice versa.
[0066] The present invention discloses a randomness testing system for quantum random numbers. This system amplifies and displays the randomness of random numbers through random computation. Specifically, it uses quantum random numbers as factors, converting them into random numbers suitable for random computation. After multiple random computations, the final result is converted back into binary numbers. The difference between this binary number and the expected value corresponding to the default value can be used as a standard for measuring randomness. This method does not require a large amount of computing resources and has good performance in testing randomness, enabling high-speed online detection. Therefore, it provides an objective basis for testing the randomness of quantum random numbers.
[0067] The randomness testing system for quantum random numbers in this embodiment is used to implement the aforementioned randomness testing method for quantum random numbers. Therefore, the specific implementation of this system can be found in the embodiment section of the randomness testing method for quantum random numbers above. Thus, its specific implementation can be referred to the description of the corresponding embodiments, and will not be elaborated here.
[0068] Furthermore, since the randomness testing system for quantum random numbers in this embodiment is used to implement the aforementioned randomness testing method for quantum random numbers, its function corresponds to the function of the above method, and will not be repeated here.
[0069] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0070] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0071] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0072] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0073] Obviously, the above embodiments are merely illustrative examples for clear explanation and are not intended to limit the implementation. Those skilled in the art will recognize that other variations or modifications can be made based on the above description. It is neither necessary nor possible to exhaustively list all possible implementations here. However, obvious variations or modifications derived therefrom are still within the scope of protection of this invention.
Claims
1. A method for testing the randomness of quantum random numbers, characterized in that: Includes the following steps: S1: Obtain quantum random numbers generated by the quantum random number generator; S2: Extract n random arrays of length m from the obtained quantum random numbers, compare the size of the n random arrays of length m with the preset n default values, and generate a binary number with randomness related to S for each array. S3: Repeat step S2 twice. m Next, all the generated binary numbers are combined into a random computation binary bit stream for random calculation. The size of the random computation binary bit stream is related to a default value, the randomness of the binary bit stream is related to the obtained quantum random number, and the length of the binary bit stream is 2. m ; S4: Perform operations on the aforementioned random computation binary bitstream as the operand in random computation to obtain a set of length 2. m Random computation of binary bit streams; S5: Transform a length of 2 m The random computation binary bit stream is converted into a binary number M of length m; S6: Generate an expected value C based on n sets of default values and m values, and test the randomness of the quantum random number based on the expected value C and the value M; In step S4, the random computation binary bit stream is used as the operand in the random computation to obtain a set of bits of length 2. m Methods for randomly calculating binary bit streams include: The random computation binary bit stream is used as an operand in a random computation and added together. The remaining part of the random computation binary bit stream is also used as an operand in a random computation and added together. The result of the two random computation additions is then multiplied together again to obtain a set of length 2. m Random computation of binary bit streams.
2. The method for testing the randomness of quantum random numbers according to claim 1, characterized in that: In S2, the n sets of default values have different sizes.
3. The method for testing the randomness of quantum random numbers according to claim 1 or 2, characterized in that: In S5, the length is 2. m The random binary bit stream is converted into a binary number M of length m by a counter.
4. The method for testing the randomness of quantum random numbers according to claim 1, characterized in that: In S6, the method for testing the randomness of quantum random numbers based on the expected value C and the value M includes: Using |MC| / (2) m As a standard for measuring the randomness of the tested quantum random number, when the value approaches 0, it indicates good randomness, and vice versa.
5. A randomness testing system for quantum random numbers, characterized in that: include: A quantum random number acquisition module, wherein the quantum random number acquisition module is used to acquire quantum random numbers generated by a quantum random number generator; A binary number generation module is used to extract n random arrays of length m from the acquired quantum random numbers, compare the size of the n random arrays of length m with the size of the n preset default values, and generate a binary number with randomness related to S for each. The binary bit stream composition module is used to repeatedly perform the steps of generating binary numbers 2. m Next, all the generated binary numbers are combined into a random computation binary bit stream for random calculation. The size of the random computation binary bit stream is related to a default value, the randomness of the binary bit stream is related to the obtained quantum random number, and the length of the binary bit stream is 2. m ; The binary bitstream arithmetic module is used to perform operations on the random computation binary bitstream as the operand in random computation, resulting in a set of bits of length 2. m Random computation of binary bit streams; The binary bitstream arithmetic module uses the randomly calculated binary bitstream as the operand in random computation to perform operations, resulting in a set of bits of length 2. m The method for randomly calculating a binary bit stream includes: performing addition on a portion of the randomly calculated binary bit stream as an operand in random calculation; performing addition on the remaining portion of the randomly calculated binary bit stream as an operand in random calculation; and performing random multiplication on the result of the two random calculation additions to obtain a set of bits of length 2. m Random computation of binary bit streams; A binary bitstream conversion module, wherein the binary bitstream conversion module is used to convert a binary bitstream of length 2 m The random computation binary bit stream is converted into a binary number M of length m; A randomness testing module is used to generate an expected value C based on n sets of default values and m values, and to test the randomness of quantum random numbers using the expected value C and the value M.
6. The randomness testing system for quantum random numbers according to claim 5, characterized in that: Length is 2 m The random binary bit stream is converted into a binary number M of length m by a counter.
7. The randomness testing system for quantum random numbers according to claim 5, characterized in that: The randomness testing module uses the expected value C and the value M to test the randomness of quantum random numbers, including the following methods: Using |MC| / (2) m As a standard for measuring the randomness of the tested quantum random number, when the value approaches 0, it indicates good randomness, and vice versa.
8. An FPGA, characterized in that, The FPGA implements the steps of the randomness verification method for quantum random numbers as described in any one of claims 1 to 4.
Citation Information
Patent Citations
Randomness test-based Android software reinforcement detection method
CN105046113A
Generation method and device for source independent continuous quantum random number
CN107368282A