A quantum random number real-time high-speed post-processor and post-processing implementation method

By using FFT hardware resources in FPGA to decompose and expand the Toeplitz matrix, and combining it with the self-test module to detect random number signals, the problem of high FPGA LUT resource usage and insufficient random number security is solved, and high-rate and high-quality random number generation is achieved. and circuit safety improvements.

CN115860127BActive Publication Date: 2024-09-10SHANGHAI AISINOCHIP ELECTRONICS TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202211638616.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-19
Publication Date
2024-09-10
Estimated Expiration
2042-12-19

AI Technical Summary

Technical Problem

In the existing technology, FPGAs occupy a large amount of LUT resources, and the quality and safety of the random number sources in the Toeplitz matrix generation module are not fully considered, making it difficult to meet the demand for high-rate and high-quality random numbers.

Method used

Using the FFT hardware resources of FPGA, the decomposition of the Toeplitz matrix is ​​realized through the quantum random number source signal generation module, Toeplitz submatrix generation module, Toeplitz submatrix expansion module, data expansion module, fast FFT calculation module and Toeplitz submatrix operation result merging module. and fast calculation, and increase the security of the self-test module to detect random number signals.

Benefits of technology

It reduces the occupation of LUT resources in the FPGA, improves the quality and speed of output random numbers, enhances the security of the circuit, and ensures the generation of high-rate and high-quality random numbers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115860127B
    Figure CN115860127B
Patent Text Reader

Abstract

The present invention relates to a real-time high-speed post-processor of quantum random numbers and a post-processing implementation method. It is applied to the real-time post-processing of high-speed quantum random numbers and the improvement of data security, and uses the FFT hardware resources of FPGA, including a Toeplitz sub-matrix generation module, a Toeplitz sub-matrix expansion module, a data expansion module, a fast FFT calculation module, and a Toeplitz sub-matrix operation result merging module; the Toeplitz sub-matrix is ​​used to perform a decomposition pipeline operation, and the original random number is expanded by expanding the Toeplitz sub-matrix into a circulant matrix at the same time, so that the FFT hardware resources in the FPGA are used for processing, and the occupation of the LUT resources of the FPGA is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data post-processing and circuit security technology, and in particular to a quantum random number real-time high-speed post-processor and a post-processing implementation method. Background Art

[0002] With the rapid development of information technology, the unpredictability of random numbers has become increasingly important and is widely used in the generation of encryption keys, Monte Carlo simulations, the gaming industry, and quantum communications. In different application areas, there are different requirements for the output rate and randomness of random numbers. In early simple applications, there were not many random numbers needed, and there were no special requirements for speed. For example, randomly drawing a ball only required a few random numbers and basically no requirements for speed. However, with the rapid development of modern communications and information technology, the requirements for the rate and quality of random numbers are getting higher and higher. For example, quantum communications usually require high-speed random numbers of several Gbps, and the randomness cannot be reduced.

[0003] For a high-quality random number generator, the quality of the random source is crucial, and post-processing of the random source output is also essential. Similarly, for a high-rate random number, not only a high-rate random source output is required, but also a high-speed post-processing module is required. At present, the quantum random source that can generate high-rate and high-quality random sources is the quantum random source, and the corresponding post-processing includes Trevisan extractor, Toeplitz hash extractor, etc. Although the Trevisan extractor requires a shorter seed length, the extraction speed is not as fast as the Toeplitz hash extractor. Therefore, the Toeplitz hash extractor is widely used in occasions with high requirements for speed. The Toeplitz hash extractor uses the Toeplitz matrix to extract random numbers, and its security is also provable by information theory. At present, there are more and more high-speed implementation schemes for the Toeplitz hash extractor in FPGA. For example, the Chinese patent application 201610430082.2 proposed by the University of Science and Technology of China discloses a random number high-speed real-time processor and its implementation method, in which the Toeplitz matrix is ​​decomposed and pipelined, so that the post-processing performance can reach 4Gbps. And Wu Mingchuan's master's thesis "Parallel Real-time Post-processing of Quantum Random Number Generators" from Taiyuan University of Technology not only decomposes the Toeplitz matrix into a pipeline operation, but also uses multi-channel Toeplitz matrices to process multi-channel quantum random signals.

[0004] However, the above implementation schemes all use more FPGA LUT resources, and do not consider the security of the overall circuit, and do not make higher requirements for the source of random numbers in the Toeplitz matrix generation module. Therefore, the present invention uses the FFT hardware resources of the FPGA, which can occupy less FPGA LUT resources; and uses a quantum random signal as the input of the Toeplitz matrix generation module, which can improve the quality of the output random number; and adds a self-check module to detect the two-way quantum random signal. If the detection is abnormal, the random number will not be output, ensuring the security of the overall circuit. Summary of the invention

[0005] The present invention solves the technical problem of excessive occupation of LUT resources of FPGA in the prior art by providing a quantum random number real-time high-speed post-processor and a post-processing implementation method.

[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions to achieve them.

[0007] One aspect of the present invention provides a quantum random number real-time high-speed post-processor, which is applied to real-time post-processing of high-speed quantum random numbers and improvement of data security, using the FFT hardware resources of FPGA, including a quantum random number source signal generation module, a Toeplitz sub-matrix generation module, a Toeplitz sub-matrix expansion module, a data expansion module, a fast FFT calculation module and a Toeplitz sub-matrix operation result merging module;

[0008] The quantum random number source signal generation module is used to output two quantum random number signals, which include a first quantum random signal and a second quantum random signal; the first quantum random signal is used as an original random number signal, and outputs a j-bit random number each time; the second quantum random signal is used as an input of a Toeplitz submatrix generation module, and also outputs a j-bit random number each time;

[0009] The Toeplitz submatrix generation module is used to output a j-bit random number according to the received second quantum random signal; specifically, according to extracting an m-bit random number from an n-bit random number, construct a Toeplitz matrix with m rows and n columns, and divide the Toeplitz matrix with m rows and n columns into (n / j) m-row and j-column Toeplitz submatrices, where m is greater than j and less than n, and n is an integer multiple of j; the data expansion module is used to expand the j-bit random number output by the received first quantum random signal into an m-row and column matrix;

[0010] The Toeplitz submatrix expansion module is used to expand the m×j Toeplitz submatrix generated by the Toeplitz submatrix generation module into an m×m circulant matrix;

[0011] The fast FFT calculation module is used to calculate the product of the m×m circulant matrix expanded by the Toeplitz submatrix expansion module and the m-row and column matrix expanded by the data expansion module to obtain an m×1 intermediate matrix;

[0012] The Toeplitz submatrix operation result merging module is used to accumulate the calculation results of the fast FFT calculation module n / j times, the m×1 intermediate matrix, and output an m-bit random number. The final merging result is equal to the product of the m×n Toeplitz matrix and the n-bit random number.

[0013] According to an embodiment of the present invention, the data expansion module expands the j-bit random number into an m-row and column matrix and supplements the expansion bits with 0.

[0014] According to an embodiment of the present invention, it also includes a self-checking module and an output selection module;

[0015] According to an embodiment of the present invention, the self-check module is used to detect whether the random number signal is attacked by intrusion, and if so, an alarm will be issued and the random number output will be stopped;

[0016] The output selection module is used to select whether to output a random number according to the detection signal of the self-check module.

[0017] According to an embodiment of the present invention, the self-check module includes a counter, a comparator and an alarm circuit, which are used to determine whether an alarm is required and to stop outputting random numbers, so as to improve the security of the overall circuit.

[0018] According to an embodiment of the present invention, the counter includes a first counter and a second counter, and the comparator includes a first comparator and / or a second comparator and / or a third comparator;

[0019] The first counter is used to count the number of 0s and 1s continuously transmitted by the first quantum random signal;

[0020] The second counter is used to count the number of 0s and 1s continuously transmitted by the second quantum random signal;

[0021] The first comparator is used to determine whether the value of the first counter is greater than a set value;

[0022] The second comparator is used to determine whether the value of the second counter is greater than a set value;

[0023] The third comparator is used to compare whether the first quantum random signal and the second quantum random signal are equal.

[0024] According to an embodiment of the present invention, if the first comparator determines that the value of the first counter is greater than the set value, the alarm circuit alarms, the output selection module chooses to stop the output of random numbers, and clears the counter value;

[0025] or

[0026] If the second comparator determines that the value of the second counter is greater than the set value, the alarm circuit alarms, the output selection module stops the output of random numbers, and clears the counter value;

[0027] or

[0028] If the third comparator determines that the first quantum random signal is equal to the second quantum random signal, the alarm circuit alarms, the output selection module chooses to stop the output of random numbers, and clears the counter value.

[0029] According to an embodiment of the present invention, the working clocks of each module are the same clock, and the clock signal is sent to each module through the global clock path; each clock outputs a j-bit random number, and each module adopts a pipeline working form under the control of the system clock:

[0030] The first-stage pipeline generates an m×j Toeplitz submatrix for the Toeplitz submatrix generation module;

[0031] The second-stage pipeline is a Toeplitz submatrix expansion module that expands the m×j Toeplitz submatrix into an m×m circulant matrix and a data expansion module that expands the j-bit random number into an m-row matrix; the input of the m×m circulant matrix and the m-row matrix are performed synchronously;

[0032] The third-stage pipeline is a fast FFT calculation module that calculates the product of the m×m circulant matrix and the m-row-column matrix to obtain an m×1 intermediate matrix;

[0033] The fourth stage is a Toeplitz submatrix operation result merging module which accumulates the calculation results of the fast FFT calculation module n / j times into an m×1 intermediate matrix and outputs an m-bit random number;

[0034] After a pipeline cycle, an m-bit random number is output.

[0035] Another aspect of the present invention provides a method for implementing real-time high-speed post-processing of quantum random numbers, which is applied to real-time post-processing of high-speed quantum random numbers and improvement of data security, using the FFT hardware resources of FPGA, and is characterized by comprising the following steps:

[0036] Output two quantum random number signals, the two quantum random number signals include a first quantum random signal and a second quantum random signal; the first quantum random signal is used as an original random number signal, and outputs a j-bit random number each time; the second quantum random signal is used as an input of a Toeplitz submatrix generation module, and also outputs a j-bit random number each time;

[0037] Expanding the j-bit random number output by the received first quantum random signal into an m-row matrix, and generating an m×j Toeplitz submatrix according to the j-bit random number output by the received second quantum random signal;

[0038] Expand the generated m×j Toeplitz submatrix to an m×m circulant matrix;

[0039] Calculate the product of the expanded m×m circulant matrix and the expanded m row-column matrix to obtain an m×1 intermediate matrix;

[0040] The m×1 intermediate matrix is ​​accumulated n / j times to output an m-bit random number.

[0041] According to an embodiment of the present invention, the extension bits of the j-bit random number expanded into an m-row and m-column matrix are supplemented with 0s;

[0042] The method outputs two quantum random number signals, and each time after outputting a j-bit random number, it also includes detecting whether the random number signal is attacked by an intrusive attack;

[0043] The Toeplitz submatrix operation result merging module is used to accumulate the m×1 intermediate matrix n / j times to output an m-bit random number, and further includes selecting whether to output a random number according to a detection signal of the self-check module.

[0044] According to an embodiment of the present invention, the detection of whether the random number signal is attacked by an intrusive attack includes determining whether an alarm is required and whether to stop outputting random numbers, so as to improve the security of the overall circuit; specifically, it includes:

[0045] Determine whether the value of the first counter is greater than the set value. If so, an alarm is triggered, the output of random numbers is stopped, and the value of the counter is cleared;

[0046] or

[0047] Determine whether the value of the second counter is greater than the set value. If so, an alarm is triggered, the output of random numbers is stopped, and the value of the counter is cleared;

[0048] or

[0049] It is determined whether the first quantum random signal and the second quantum random signal are equal. If they are equal, an alarm is triggered, the output of random numbers is stopped, and the counter value is cleared.

[0050] The advantages of the present invention are:

[0051] Compared with the prior art, the advantages of the quantum random number real-time high-speed post-processor and post-processing implementation method provided by the present invention are: the present invention divides the m×n Toeplitz matrix into n / j Toeplitz sub-matrices, and generates and processes random numbers in segments in a manner that each clock outputs a j-bit random number, thereby reducing the burden of subsequent data processing and improving the speed of extracting quantum random numbers in FPGA.

[0052] The data expansion module and the Toeplitz submatrix expansion module are used to expand the j-bit random number into an m-row and column matrix and the m×j Toeplitz submatrix into an m×m circulant matrix, respectively, so that the matrix has the conditions for fast FFT calculation.

[0053] The fast FFT calculation module calculates the product of the m×m circulant matrix and the m-row and column matrix to obtain an m×1 intermediate matrix, which speeds up the calculation. The hardware resources and LUT resources of the FFT calculation module are in different components of the FPGA, thereby reducing the occupancy of the LUT resources in the FPGA.

[0054] The present application includes two quantum random number signals, namely a first quantum random signal and a second quantum random signal, wherein one random number signal is used as an original random number signal, and the other random number signal is used as an input of a Toeplitz submatrix generation module, thereby improving the quality of the output random number.

[0055] The present application also includes a self-check module for detecting whether the random number signal is attacked intrusively and determining whether it is necessary to issue an alarm and stop outputting random numbers, and an output selection module for selecting whether to output random numbers based on the detection signal of the self-check module, thereby ensuring the security of the overall circuit. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 Schematic diagram of a module of a real-time high-speed post-processor of a quantum random number in one embodiment of the present invention;

[0057] Figure 2 is a module schematic diagram of a self-check module in an embodiment of the present invention;

[0058] Figure 3 is a flow chart of a method for implementing real-time and high-speed post-processing of quantum random numbers in one embodiment of the present invention; DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution in the embodiment of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiment of the present invention. Obviously, the described embodiment is a part of the embodiment of the present invention, not all the embodiments. Based on the embodiment of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0060] The existing parallel real-time post-processing of quantum random number generators adopts pipeline operation to decompose the Toeplitz matrix and uses multiple Toeplitz matrices to process multiple quantum random signals, but both occupy the LUT resources of FPGA.

[0061] Among them, FPGA (Field Programmable Gate Array), the simplified FPGA basic structure consists of 6 parts, namely programmable input / output units, basic programmable logic units, embedded block RAM, rich wiring resources, bottom-level embedded functional units and embedded dedicated hard cores.

[0062] Among them, the programmable logic unit is called Configurable Logic Block (CLB), which is the smallest editable logic unit. Each CLB contains two logic slices, and each slice consists of 4 lookup tables (LUTs), 8 flip-flops (FFs) and some other logics.

[0063] According to the chip manual, the Look Up Table (LUT) can be configured as a 6-input LUT (64-bit ROM) and one output, or as two 5-input LUTs (32-bit ROM) with separate outputs but common address or logic inputs. The Look Up Table generally performs pure combinational logic functions.

[0064] Among them, the bottom embedded functional units include phase locked loop (PLL), delay locked loop (DLL), DSP, CPU, etc. Among them, DSP, CPU, etc. are mainly used for various complex mathematical operations, multiplication, division and common functional functions such as: finite impulse response filter (FIR), infinite impulse response filter (IIR), fast Fourier transform (FFT), discrete cosine transform (DCT), etc. These functional functions will consume a lot of logic resources during operation, and the LUT and register resources in FPGA are limited. At this time, using the embedded multiplication unit will not cause waste of logic resources.

[0065] Taking the above problems into consideration, the present application implements the random number extraction function in quantum random number post-processing through the hardware resources of the fast Fourier transform (FFT) calculation module of the underlying embedded functional unit to reduce the occupation of the LUT resources of the FPGA.

[0066] Embodiment 1 of the present invention provides a specific implementation of a real-time high-speed post-processor for quantum random numbers, which is applied to real-time post-processing of high-speed quantum random numbers and improvement of data security. The FFT hardware resources of FPGA are used. The real-time high-speed post-processor for quantum random numbers specifically includes the following contents:

[0067] Quantum random number source signal generation module, Toeplitz submatrix generation module, Toeplitz submatrix expansion module, data expansion module, fast FFT calculation module and Toeplitz submatrix operation result merging module;

[0068] The quantum random number source signal generation module is used to output two quantum random number signals, which include a first quantum random signal and a second quantum random signal; the first quantum random signal is used as the original random number signal, and outputs a j-bit random number each time; the second quantum random signal is used as the input of the Toeplitz submatrix generation module, and also outputs a j-bit random number each time;

[0069] The Toeplitz submatrix generation module is used to output a j-bit random number according to the received second quantum random signal; specifically, according to extracting an m-bit random number from an n-bit random number, construct a Toeplitz matrix with m rows and n columns, and divide the Toeplitz matrix with m rows and n columns into (n / j) Toeplitz submatrices with m rows and j columns, where m is greater than j and less than n, and n is an integer multiple of j; wherein the Toeplitz matrix with m rows and n columns is an m×n Toeplitz matrix;

[0070] The data expansion module is used to expand the j-bit random number output according to the received first quantum random signal into an m-row matrix; that is, m bits, and the data expansion module expands the j-bit random number into an m-row matrix and supplements the expansion bits with 0;

[0071] The Toeplitz submatrix expansion module is used to expand the m×j Toeplitz submatrix generated by the Toeplitz submatrix generation module into an m×m circulant matrix;

[0072] The fast FFT calculation module is used to calculate the product of the m×m circulant matrix expanded by the Toeplitz submatrix expansion module and the m-row and column matrix expanded by the data expansion module to obtain an m×1 intermediate matrix;

[0073] The Toeplitz submatrix operation result merging module is used to accumulate the calculation results of the n / j times fast FFT calculation module m×1 intermediate matrix to output an m-bit random number. The final merging result is equal to the product of the m×n Toeplitz matrix and the n-bit random number. Among them, m, n, and j are all positive integers.

[0074] The working clocks of the above modules are the same clock, and the clock signal is sent to each module through the global clock path; each clock outputs a j-bit random number, and each module adopts the pipeline working form under the control of the system clock:

[0075] The first-stage pipeline generates an m×j Toeplitz submatrix for the Toeplitz submatrix generation module;

[0076] The second-stage pipeline is a Toeplitz submatrix expansion module that expands the m×j Toeplitz submatrix into an m×m circulant matrix and a data expansion module that expands the j-bit random number into an m-row matrix; the input of the m×m circulant matrix and the m-row matrix are performed synchronously;

[0077] The third-stage pipeline is a fast FFT calculation module that calculates the product of an m×m circulant matrix and an m-row-column matrix to obtain an m×1 intermediate matrix;

[0078] The fourth level is the Toeplitz submatrix operation result merging module, which accumulates the n / j times of m×1 intermediate matrices and outputs an m-bit random number.

[0079] Among them, after one pipeline cycle is completed, an m-bit random number is output.

[0080] Exemplarily, based on extracting m-bit random numbers from n-bit random numbers, a Toeplitz matrix with m rows and n columns is constructed, and the Toeplitz matrix with m rows and n columns is divided into (n / j) Toeplitz submatrices with m rows and j columns for operation. Take m=5, n=6, j=3; then at the first clock, the first quantum random signal and the second quantum random signal generate 3 bits of random data respectively, and the matrix B1 is generated according to the 3-bit random number (b1, b2, b3) generated by the first quantum random signal, and the Toeplitz submatrix generation module generates a 5×3 Toeplitz submatrix such as matrix A1 according to the 3-bit random number (a1, a2, a3) generated by the second quantum random signal plus the initially generated (5-3) random numbers (r0, r1);

[0081]

[0082] The data expansion module expands the received 3-bit random number into a 5×1 matrix B1', i.e., 5 bits; the Toeplitz submatrix expansion module expands the 5×3 Toeplitz submatrix into a 5×5 circulant matrix A1';

[0083]

[0084] The fast FFT calculation module is used to calculate the product of the 5×5 circulant matrix expanded by the Toeplitz submatrix expansion module and the 5-row-column matrix expanded by the data expansion module to obtain a 5×1 intermediate matrix C1;

[0085]

[0086] Then, at the second clock, the first quantum random signal and the second quantum random signal generate 3 bits of random data respectively, and the matrix B2 is generated according to the 3 bits of random numbers (b4, b5, b6) generated by the first quantum random signal. The Toeplitz submatrix generation module generates a 5×3 Toeplitz submatrix such as the matrix A2 according to the 3 bits of random numbers (a4, a5, a6) generated by the second quantum random signal plus the initially generated (5-3) random numbers (r0, r1);

[0087]

[0088] The data expansion module expands the received 3-bit random number into a 5×1 matrix B2', i.e., 5 bits; the Toeplitz submatrix expansion module expands the 5×3 Toeplitz submatrix into a 5×5 circulant matrix A2';

[0089]

[0090] The fast FFT calculation module is used to calculate the product of the 5×5 circulant matrix expanded by the Toeplitz submatrix expansion module and the 5-row-column matrix expanded by the data expansion module to obtain a 5×1 intermediate matrix C2;

[0091]

[0092] The Toeplitz submatrix operation result merging module accumulates the results C1 and C2 of the two operations to obtain the final result C, that is, the final 5-digit random number. The final merged result is equal to the product of the 5×6 Toeplitz matrix and the 6-digit random number.

[0093]

[0094] Embodiment 2 of the present invention provides a specific implementation of a real-time high-speed post-processor for quantum random numbers, which is applied to real-time post-processing of high-speed quantum random numbers and improvement of data security, using the FFT hardware resources of FPGA, such as Figure 1 The real-time high-speed post-processor of quantum random numbers specifically includes the following contents: Toeplitz submatrix generation module, Toeplitz submatrix expansion module, data expansion module, fast FFT calculation module, Toeplitz submatrix operation result merging module, self-check module and output selection module.

[0095] Generate two quantum random number signals, which can be generated by a quantum random number source signal generation module. The two quantum random number signals are as follows: Figure 1 The first quantum random signal and the second quantum random signal shown in ; the first quantum random signal is used as the original random number signal, and outputs a j-bit random number each time; the second quantum random signal is used as the input of the Toeplitz submatrix generation module, and also outputs a j-bit random number each time; the Toeplitz submatrix generation module is used to generate an m×j Toeplitz submatrix according to the j-bit random number output by the received second quantum random signal plus the initial (mj)-bit random number; and n / j Toeplitz submatrices can form an m×n Toeplitz matrix, wherein m is the number of rows of the Toeplitz matrix and the Toeplitz submatrix, n is the number of columns of the Toeplitz matrix, j is the number of columns of the Toeplitz submatrix, and n is an integer multiple of j, and m is greater than j;

[0096] The data expansion module is used to expand the j-bit random number output according to the received first quantum random signal into an m-row matrix; that is, m bits, and the data expansion module expands the j-bit random number into an m-row matrix and supplements the expansion bits with 0;

[0097] The Toeplitz submatrix expansion module is used to expand the m×j Toeplitz submatrix generated by the Toeplitz submatrix generation module into an m×m circulant matrix;

[0098] The fast FFT calculation module is used to calculate the product of the m×m circulant matrix expanded by the Toeplitz submatrix expansion module and the m-row and column matrix expanded by the data expansion module to obtain an m×1 intermediate matrix;

[0099] The Toeplitz submatrix operation result merging module is used to accumulate the calculation results of the n / j times fast FFT calculation module m×1 intermediate matrix to output an m-bit random number. The final merging result is equal to the product of the m×n Toeplitz matrix and the n-bit random number. Among them, m, n, and j are all positive integers.

[0100] The self-check module is used to detect whether the random number signal is attacked by intrusion. If it is attacked by intrusion, it will alarm and stop outputting random numbers; the output selection module is used to select whether to output random numbers according to the detection signal of the self-check module.

[0101] The self-check module includes a counter, a comparator and an alarm circuit, which are used to determine whether an alarm is required and to stop outputting random numbers, so as to improve the safety of the overall circuit.

[0102] The counter includes a first counter and a second counter, and the comparator includes a first comparator and / or a second comparator and / or a third comparator;

[0103] The first counter is used to count the number of 0s and 1s continuously transmitted by the first quantum random signal;

[0104] The second counter is used to count the number of 0s and 1s continuously transmitted by the second quantum random signal;

[0105] The first comparator is used to determine whether the value of the first counter is greater than a set value;

[0106] The second comparator is used to determine whether the value of the second counter is greater than a set value;

[0107] The third comparator is used to compare whether the first quantum random signal and the second quantum random signal are equal.

[0108] If the first comparator determines that the value of the first counter is greater than the set value, the alarm circuit alarms, the output selection module stops the output of random numbers, and clears the counter value;

[0109] or

[0110] If the second comparator determines that the value of the second counter is greater than the set value, the alarm circuit alarms, the output selection module stops the output of random numbers, and clears the counter value;

[0111] or

[0112] If the third comparator determines that the first quantum random signal is equal to the second quantum random signal, the alarm circuit alarms, the output selection module chooses to stop the output of random numbers, and clears the counter value.

[0113] Exemplarily, the self-check module includes: Figure 2The first counter, the second counter, the first comparator, the second comparator, the third comparator and the alarm circuit are shown. When the first comparator determines that the value of the first counter is greater than the set value, the results of the second comparator and the third comparator are arbitrary, the alarm circuit starts the alarm, the output selection module chooses to stop the output of random numbers, and clears the value of the counter; when the second comparator determines that the value of the second counter is greater than the set value, the results of the first comparator and the third comparator are arbitrary, the alarm circuit starts the alarm, the output selection module chooses to stop the output of random numbers, and clears the value of the counter; when the third comparator determines that the first quantum random signal is equal to the second quantum random signal, the results of the second comparator and the third comparator are arbitrary, the alarm circuit starts the alarm, the output selection module chooses to stop the output of random numbers, and clears the value of the counter.

[0114] In another embodiment, the self-check module includes a first counter, a second counter, a first comparator, a second comparator and an alarm circuit. When the first comparator determines that the value of the first counter is greater than the set value, the result of the second comparator is random, the alarm circuit starts an alarm, the output selection module chooses to stop the output of random numbers, and clears the value of the counter; when the second comparator determines that the value of the second counter is greater than the set value, the result of the first comparator is random, the alarm circuit starts an alarm, the output selection module chooses to stop the output of random numbers, and clears the value of the counter.

[0115] In one embodiment, the self-check module includes a first counter, a second counter, a third comparator and an alarm circuit. When the third comparator determines that the first quantum random signal is equal to the second quantum random signal, the alarm circuit starts an alarm, the output selection module stops the output of random numbers, and clears the counter value.

[0116] The working clocks of the above modules are the same clock, and the clock signal is sent to each module through the global clock path; each clock outputs a j-bit random number, and each module adopts the pipeline working form under the control of the system clock:

[0117] The first-stage pipeline generates an m×j Toeplitz submatrix for the Toeplitz submatrix generation module;

[0118] The second-stage pipeline is a Toeplitz submatrix expansion module that expands the m×j Toeplitz submatrix into an m×m circulant matrix and a data expansion module that expands the j-bit random number into an m-row matrix; the input of the m×m circulant matrix and the m-row matrix are performed synchronously;

[0119] The third-stage pipeline is a fast FFT calculation module that calculates the product of an m×m circulant matrix and an m-row-column matrix to obtain an m×1 intermediate matrix;

[0120] The fourth level is the Toeplitz submatrix operation result merging module, which accumulates the n / j times of m×1 intermediate matrices and outputs an m-bit random number;

[0121] After a pipeline cycle, an m-bit random number is output.

[0122] Embodiment 3 of the present invention provides a method for implementing real-time high-speed post-processing of quantum random numbers, which is applied to real-time post-processing of high-speed quantum random numbers and improvement of data security, using the FFT hardware resources of FPGA, such as Figure 3 , the implementation method includes the following steps:

[0123] S110: Output two quantum random number signals, the two quantum random number signals include a first quantum random signal and a second quantum random signal; the first quantum random signal is used as the original random number signal, and outputs a j-bit random number each time; the second quantum random signal is used as the input of the Toeplitz submatrix generation module, and also outputs a j-bit random number each time; each time after outputting a j-bit random number, it also includes detecting whether the random number signal is attacked intrusively. The detection of whether the random number signal is attacked intrusively includes determining whether an alarm is required and stopping the output of random numbers, which is used to improve the security of the overall circuit; specifically includes:

[0124] Determine whether the value of the first counter is greater than a set value, and if so, give an alarm, stop the output of random numbers, and clear the value of the counter;

[0125] or

[0126] Determine whether the value of the second counter is greater than a set value, and if so, give an alarm, stop the output of random numbers, and clear the value of the counter;

[0127] or

[0128] Determine whether the first quantum random signal and the second quantum random signal are equal. If they are equal, an alarm is issued, the output of random numbers is stopped, and the counter value is cleared.

[0129] S120: Expand the j-bit random number outputted by the received first quantum random signal into an m-row matrix, and generate an m×j Toeplitz submatrix according to the j-bit random number outputted by the received second quantum random signal, wherein the extended bits of the j-bit random number expanded into the m-row matrix are supplemented with 0.

[0130] S130: Expand the generated m×j Toeplitz submatrix to an m×m circulant matrix.

[0131] S140: Calculate the product of the extended m×m circulant matrix and the extended m-row-column matrix to obtain an m×1 intermediate matrix.

[0132] S150: Accumulate the m×1 intermediate matrices n / j times to output an m-bit random number. After the step of accumulating the m×1 intermediate matrices n / j times to output an m-bit random number, the method further includes selecting whether to output a random number according to a detection signal of a self-checking module.

[0133] In summary, the technical solution proposed in the present invention realizes the improvement of real-time post-processing and data security applied to high-speed quantum random numbers, and uses the FFT hardware resources of FPGA, including Toeplitz submatrix generation module, Toeplitz submatrix expansion module, data expansion module, fast FFT calculation module and Toeplitz submatrix operation result merging module; decomposition pipeline operation is performed through the Toeplitz submatrix, and the original random number is expanded by expanding the Toeplitz submatrix into a circulant matrix at the same time, so as to be processed by the FFT hardware resources in the FPGA, and the occupation of the LUT resources of the FPGA is reduced. The present application includes two quantum random number signals, namely the first quantum random signal and the second quantum random signal, wherein one random number signal is used as the original random number signal, and one random number signal is used as the input of the Toeplitz submatrix generation module, thereby improving the quality of the output random number. The present application also includes a self-check module for detecting whether the random number signal is attacked by intrusion, and judging whether it is necessary to issue an alarm and stop outputting random numbers, and an output selection module for selecting whether to output random numbers according to the detection signal of the self-check module, thereby ensuring the safety of the overall circuit.

[0134] The above description is only a description of the preferred embodiment of the technical solution of the present invention, and is not any limitation on the scope of the technical solution of the present invention. Any changes and modifications made by ordinary technicians in the field of the technical solution of the present invention based on the above disclosure shall fall within the scope of protection of the claims.

Claims

1. A real-time high-speed post-processor for quantum random numbers, applied to real-time post-processing of high-speed quantum random numbers and improvement of data security, using the FFT hardware resources of FPGA, characterized in that: It includes a quantum random number source signal generation module, a Toeplitz submatrix generation module, a Toeplitz submatrix expansion module, a data expansion module, a fast FFT calculation module and a Toeplitz submatrix operation result merging module; The quantum random number source signal generation module is used to output two quantum random number signals, and the two quantum random number signals include a first quantum random signal and a second quantum random signal; the first quantum random signal is used as an original random number signal, and a j-bit random number is output each time; the second quantum random signal is used as an input of a Toeplitz submatrix generation module, and a j-bit random number is also output each time; The Toeplitz submatrix generation module is used to output a j-bit random number according to the received second quantum random signal; specifically, according to extracting an m-bit random number from an n-bit random number, construct a Toeplitz matrix with m rows and n columns, and divide the Toeplitz matrix with m rows and n columns into (n / j) m-row and j-column Toeplitz submatrices, where m is greater than j and less than n, and n is an integer multiple of j; The data expansion module is used to expand the j-bit random number output according to the received first quantum random signal into an m-row matrix; The Toeplitz submatrix expansion module is used to expand the m×j Toeplitz submatrix generated by the Toeplitz submatrix generation module into an m×m circulant matrix; The fast FFT calculation module is used to calculate the product of the m×m circulant matrix expanded by the Toeplitz submatrix expansion module and the m-row and column matrix expanded by the data expansion module to obtain an m×1 intermediate matrix; The Toeplitz submatrix operation result merging module is used to accumulate the calculation results of the fast FFT calculation module (n / j) times, the m×1 intermediate matrix, to output an m-bit random number, and the final merged result is equal to the product of the m×n Toeplitz matrix and the n-bit random number.

2. A quantum random number real-time high-speed post-processor according to claim 1, characterized in that: The data expansion module expands the j-bit random number into an m-row and column matrix and supplements the expansion bits with 0.

3. A quantum random number real-time high-speed post-processor according to claim 2, characterized in that: It also includes a self-test module and an output selection module; The self-check module is used to detect whether the random number signal is attacked by intrusion. If so, it will alarm and stop outputting random numbers; The output selection module is used to select whether to output a random number according to the detection signal of the self-check module.

4. A quantum random number real-time high-speed post-processor according to claim 3, characterized in that: The self-check module includes a counter, a comparator and an alarm circuit, which are used to determine whether an alarm is required and to stop outputting random numbers, so as to improve the safety of the overall circuit.

5. A quantum random number real-time high-speed post-processor according to claim 4, characterized in that: The counter includes a first counter and a second counter, and the comparator includes a first comparator and / or a second comparator and / or a third comparator; The first counter is used to count the number of 0s and 1s continuously transmitted by the first quantum random signal; The second counter is used to count the number of 0s and 1s continuously transmitted by the second quantum random signal; The first comparator is used to determine whether the value of the first counter is greater than a set value; The second comparator is used to determine whether the value of the second counter is greater than a set value; The third comparator is used to compare whether the first quantum random signal and the second quantum random signal are equal.

6. A quantum random number real-time high-speed post-processor according to claim 5, characterized in that: If the first comparator determines that the value of the first counter is greater than the set value, the alarm circuit alarms, the output selection module stops the output of random numbers, and clears the counter value; or If the second comparator determines that the value of the second counter is greater than the set value, the alarm circuit alarms, the output selection module stops the output of random numbers, and clears the counter value; or If the third comparator determines that the first quantum random signal is equal to the second quantum random signal, the alarm circuit sounds an alarm, the output selection module stops outputting random numbers, and clears the counter value.

7. A quantum random number real-time high-speed post-processor according to claim 1 or 3, characterized in that: The working clocks of the modules are the same clock, and the clock signal is sent to each module through the global clock path; each clock outputs a j-bit random number, and each module adopts the pipeline working form under the control of the system clock: The first-stage pipeline generates an m×j Toeplitz submatrix for the Toeplitz submatrix generation module; The second-stage pipeline is a Toeplitz submatrix expansion module that expands the m×j Toeplitz submatrix into an m×m circulant matrix and a data expansion module that expands the j-bit random number into an m-row matrix; the input of the m×m circulant matrix and the m-row matrix are performed synchronously; The third-stage pipeline is a fast FFT calculation module that calculates the product of the m×m circulant matrix and the m-row-column matrix to obtain an m×1 intermediate matrix; The fourth stage is a Toeplitz submatrix operation result merging module which accumulates the calculation results of the fast FFT calculation module (n / j) times into an m×1 intermediate matrix and outputs an m-bit random number; After a pipeline cycle, an m-bit random number is output.

8. A method for implementing real-time high-speed post-processing of quantum random numbers using a real-time high-speed post-processor of quantum random numbers as described in any one of claims 1 to 7, applied to real-time post-processing of high-speed quantum random numbers and improvement of data security, using the FFT hardware resources of FPGA, characterized in that: The method comprises the following steps: outputting two quantum random number signals, wherein the two quantum random number signals comprise a first quantum random signal and a second quantum random signal; the first quantum random signal is used as an original random number signal, and a j-bit random number is output each time; the second quantum random signal is used as an input of a Toeplitz submatrix generation module, and a j-bit random number is also output each time; According to the first received quantum random signal, the output j-bit random number is expanded into an m-row and column matrix, and according to the second received quantum random signal, the output j-bit random number is generated into an m×j Toeplitz submatrix; Expand the generated m×j Toeplitz submatrix into an m×m circulant matrix; Calculate the product of the expanded m×m circulant matrix and the expanded m-row-column matrix to obtain an m×1 intermediate matrix; The m×1 intermediate matrix is ​​accumulated (n / j) times to output an m-bit random number.

9. A method for implementing real-time high-speed post-processing of quantum random numbers according to claim 8, wherein the expansion bits of the j-bit random number expanded into an m-row matrix are supplemented with 0s; The method outputs two quantum random number signals, and each time after outputting a j-bit random number, further includes detecting whether the random number signal is attacked by an intrusive attack; The Toeplitz submatrix operation result merging module is used to accumulate the m×1 intermediate matrices (n / j) times to output an m-bit random number, and also includes selecting whether to output a random number according to a detection signal of a self-check module.

10. According to the method for implementing real-time high-speed post-processing of quantum random numbers in claim 9, the detecting whether the random number signal is attacked by intrusion includes judging whether an alarm is required and stopping the output of random numbers, so as to improve the security of the overall circuit; specifically comprising: Determine whether the value of the first counter is greater than the set value. If so, an alarm is triggered, the output of random numbers is stopped, and the value of the counter is cleared; or Determine whether the value of the second counter is greater than the set value. If so, an alarm is triggered, the output of random numbers is stopped, and the value of the counter is cleared; or Determine whether the first quantum random signal and the second quantum random signal are equal. If they are equal, an alarm is issued, the output of random numbers is stopped, and the counter value is cleared.