A toeplitz matrix randomness extraction method and system based on a lookup table method
By transforming Toeplitz matrix multiplication into lookup tables and XOR operations, the high complexity and resource consumption of Toeplitz matrix randomness extraction in existing QRNGs are solved, achieving efficient randomness extraction on low-cost hardware platforms, which is suitable for embedded systems.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- NO 30 INST OF CHINA ELECTRONIC TECH GRP CORP
- Filing Date
- 2026-03-19
- Publication Date
- 2026-07-14
AI Technical Summary
Existing methods for extracting the randomness of the Toeplitz matrix in QRNG suffer from high computational complexity, high hardware resource consumption, high cost, and difficulty in implementation on embedded platforms.
A Toeplitz matrix randomness extraction method based on lookup table (LUT) is adopted. The Toeplitz matrix multiplication operation is pre-completed and solidified into a lookup table. Random sequences are generated by XOR operation on the lookup table, avoiding high-complexity computation and direct dependence on hardware resources.
It significantly reduces computational complexity and resource consumption, can be implemented on low-cost hardware platforms, is suitable for low-cost quantum random number generator systems, and improves adaptability and versatility.
Smart Images

Figure CN122388031A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of information technology, and in particular relates to a method and system for extracting the randomness of a Toeplitz matrix based on a lookup table. Background Technology
[0002] In the field of modern information technology, random numbers are a crucial resource in key areas such as cryptography, statistics, and scientific simulation. Particularly in cryptography, the quality of random numbers directly impacts the reliability of secure communication protocols such as encryption, digital signatures, and authentication. Traditional pseudo-random number generators (PRNGs) rely on deterministic algorithms and initial seeds to generate random number sequences. However, the random numbers generated by PRNGs may exhibit regularity or predictability in certain situations. Especially under attack, attackers could potentially deduce or reproduce the generated sequences, thereby threatening the system's security.
[0003] In contrast, the Quantum Random Number Generator (QRNG), as an emerging technology, extracts random numbers by observing quantum physical processes, providing a random number generation scheme based on the uncertainty principle of quantum mechanics. Unlike classical pseudo-random number generation methods, the random numbers generated by QRNG originate from quantum uncertainty and are theoretically unpredictable, possessing the characteristics of ideal true random numbers. Therefore, QRNG exhibits significant advantages in applications requiring high security.
[0004] A typical QRNG system comprises four core modules: a quantum entropy source (QES), a sampling module, a post-processing module, and a randomness detection module, as shown in Figure 1. The quantum entropy source generates a random quantum signal through a quantum light source and a detection module, which is then converted into an analog electrical signal after detection. The sampling module discretizes the analog electrical signal into an original random sequence. The subsequent post-processing module processes the original random sequence to remove deviations and inhomogeneities that may be caused by systematic errors or classical noise, ensuring that the final generated random sequence meets the randomness requirement of an ideal uniform distribution. Finally, the randomness detection module performs statistical analysis on the generated final random sequence to ensure that it complies with relevant domestic and international standards, such as NIST SP800-22 and GM / T 0005-2021.
[0005] There are various implementations of post-processing methods in QRNG, including lightweight post-processing (such as von Neumann correction, least significant bit (m-LSB), and XOR methods), strong randomness extraction methods (such as Toeplitz matrices and Trevisan matrices), and post-processing methods based on cryptographic functions (such as hash functions and block ciphers). Each of these methods has its own characteristics, and in practical applications, a comprehensive consideration of factors such as security, efficiency, and cost is necessary to achieve the optimal balance between performance and security.
[0006] Currently, the Toeplitz matrix method, due to its concise matrix structure and theoretical information security, has been widely used in the randomness extraction of QRNGs. Suppose we have a matrix of length... The original random sequence ,in We hope to achieve this through a Toeplitz matrix. To extract randomness, the Toeplitz matrix method is essentially a randomness extractor assisted by a random seed, based on a length of... m+n 1 A high-quality random seed is used to initialize the Toeplitz matrix, which is determined by its first row and first column, where... n It is the length of the input sequence. m This is the length of the output sequence. For a length of... n The original random number sequence, after being processed by a sequence of size 1, 2, 3, 4, 5, 6 n ×m Multiplying the Toeplitz matrices yields a matrix of length . m The output random sequence, i.e. The specific calculation formula is as follows: = . Based on the above definition, the formula for calculating this matrix multiplication for random extraction in QRNG is:
[0007] in, It is a matrix The Line number Column elements; It is an input random sequence The Bit; This represents modulo-2 addition, equivalent to the XOR operation. For each output element... We need to do The XOR operation and multiplication are performed. The time complexity of multiplying the Toeplitz matrix with the input vector without optimization is [missing information - likely a time complexity value]. By employing the Fast Fourier Transform (FFT) for acceleration, its theoretical optimal computational complexity can be optimized to [value missing]. ).
[0008] In existing Toeplitz matrix operation methods, GPU-based implementations can significantly accelerate large-scale matrix operations through parallel computing, making them particularly suitable for processing large amounts of data. However, GPU implementations also face several challenges. GPU implementations have significant drawbacks, especially in terms of cost and miniaturization. First, the high cost of GPU hardware makes it uncompetitive in many applications requiring high cost-effectiveness. Second, in miniaturized devices, the size and power consumption of GPUs also pose challenges, especially in embedded systems or portable devices. While GPUs have advantages in parallel computing, their large hardware resource requirements and high cost prevent their widespread application in miniaturized systems that demand high performance and low cost.
[0009] On the other hand, FPGA-based Toeplitz matrix operations can achieve low latency and high throughput through hardware-level parallel computing, making them suitable for high-performance applications. While FPGAs offer advantages in customization and high efficiency, they also have some drawbacks. FPGA design and implementation are complex, requiring specialized hardware design knowledge and resulting in long development cycles. Furthermore, FPGAs are less flexible when handling dynamic tasks because modifications to their hardware circuitry are costly once programmed. Additionally, large-scale Toeplitz matrix operations demand significant hardware resources, leading to higher costs associated with FPGA implementations.
[0010] A lookup table (LUT) is a method that pre-calculates and stores results, then quickly retrieves those results when needed. It is widely used in computer science, engineering, and mathematics, especially in scenarios requiring efficient computation or where resources are limited. The core idea of the lookup table is to transform complex computational tasks into simple lookup operations. Specifically, the results of certain functions or operations are pre-calculated and stored in a table. When a calculation is needed, the corresponding value is directly looked up from the table, rather than recalculating it.
[0011] To address the problems of high computational complexity, large hardware resource requirements, high cost, and high power consumption encountered in Toeplitz matrix operations, this application proposes a Toeplitz matrix randomness extraction method based on lookup table (LUT). Summary of the Invention
[0012] The purpose of this application is to address the problems of high computational complexity, large hardware resource consumption, and difficulty in implementation on embedded platforms in existing Toeplitz matrix randomness extraction methods in QRNG, and to disclose a Toeplitz matrix randomness extraction method and system based on table lookup.
[0013] On the one hand, the objective of this application is achieved through the following technical solution: A method for extracting the randomness of a Toeplitz matrix based on a lookup table, the method comprising: S1: In the offline pre-computation stage, the Toeplitz matrix multiplication operation is pre-computed and fixed into a lookup table; S2: In the online randomness extraction stage, the lookup table is preloaded and a lookup and XOR operation are performed to generate the final random sequence.
[0014] According to a preferred embodiment, step S1 includes: S11: Preparation of the original random sequence, wherein the original random sequence includes the random sequence output by the entropy source of the QRNG; S12: Estimate the minimum entropy of the sequence. By performing statistical analysis on the input original random sequence, the level of randomness contained in the original random sequence is determined by the minimum entropy. S13: Design the Toeplitz matrix and estimate the compression ratio based on the minimum entropy. r=m / n Let n be the length of the original input random sequence, determine the length m of the output sequence, and then construct a sequence with size m. n×m The Toeplitz matrix can be constructed by defining the first row and first column of the Toeplitz matrix using a random bit sequence of length m+n-1, thus satisfying the requirement for randomness extraction. ; S14: Set the bit width w and perform pre-calculation, including: Set bit width parameter and the matrix Logically group the row vectors by bit width:
[0015] For any set, consider its corresponding One input bit:
[0016] Able to retrieve all There are 10 possible combinations; the Toeplitz mapping contribution for each combination is:
[0017] For all By calculating the corresponding linear combination of each bit combination, the column group can be obtained. By iterating through all column groups, one can obtain all the pre-computed results required to construct the lookup table from the possible output vectors. S15: Creation and storage of lookup tables Based on the pre-calculation results obtained in step S14, the corresponding columns of each group are... Each output vector is a combination of its input bits: The indexes are organized into a lookup table; the constructed lookup table data structure is written into non-volatile memory.
[0018] According to a preferred embodiment, in step S11, when the original random sequence comes from a quantum random number generator, the quantum entropy source extracts randomness based on quantum physical phenomena. After passing through the detection module, it outputs a continuous electrical signal, which is then sampled and quantized by a sampling module such as an analog-to-digital converter to output a discrete binary original random sequence, which serves as the data input for subsequent minimum entropy estimation and randomness extraction.
[0019] According to a preferred embodiment, in step S12, the specific expression for calculating the minimum entropy is:
[0020] To output sequence elements, It reflects the probability of the most likely outcome in the output sequence, characterizes the predictability of the sequence, and provides a lower bound on the number of random bits that can be extracted subsequently.
[0021] According to a preferred embodiment, step S2 includes: S21: Preloading and caching of lookup tables: The controller moves all lookup table data blocks stored in Flash to high-speed random access memory at once, and all subsequent lookup operations will be addressed based on RAM. S22: Lookup table to retrieve the pre-calculated result corresponding to this column group. The original random sequence will be input.
[0022] By width Divided into The nth consecutive bit block, the nth A consecutive block of bits is represented as:
[0023] This Bit blocks are treated as binary indices:
[0024] This means being able to access the lookup table entries for the corresponding column group and directly retrieve the pre-calculated result for that column group from the lookup table based on the index: ; S23: XOR operation. Based on the linear structure of the Toeplitz operation, the lookup results of all column groups are XORed sequentially to obtain the final random sequence. ; S24: Output the result. After performing the XOR operation, the final output bit sequence is obtained.
[0025] It is used as the result of randomness extraction and, as needed, is further sent to the randomness detection process to verify that it meets the relevant randomness detection standards.
[0026] On the other hand, this application also discloses: A Toeplitz matrix randomness extraction system based on table lookup method, wherein the Toeplitz matrix randomness extraction system performs randomness extraction of the Toeplitz matrix based on the aforementioned method.
[0027] According to a preferred embodiment, the Toeplitz matrix randomness extraction system based on the lookup table method includes: The original random sequence preparation module is used to receive the original random sequence from the quantum random number generator (QRNG) and complete the data reading and buffer storage, providing a stable input source for subsequent processing. The minimum entropy estimation module is used to perform statistical analysis on the original random sequence and estimate its minimum entropy. The compression ratio calculation module calculates the compression ratio based on the minimum entropy estimation result, thereby determining the length m of the output sequence; The Toeplitz matrix construction module is used to construct a Toeplitz matrix of size m×n that satisfies the requirement of randomness extraction according to a compression ratio r. ; The bit width setting module is used to set the bit width parameter. and the Toeplitz matrix The row vectors are logically divided according to their bit width; Pre-calculation module for each column group Given a column vector, enumerate all its corresponding columns. The input bit combination is obtained by traversing all column groups. With all bit combinations This yields a complete set of pre-computed results uniquely determined by the Toeplitz matrix, providing a data foundation for the construction of lookup tables; The lookup table building and storage module is used to organize pre-calculated results into lookup tables.
[0028] According to a preferred embodiment, the Toeplitz matrix randomness extraction system based on the lookup table method includes: The lookup table preloading module is used to load all lookup table data blocks stored in Flash into high-speed random access memory (RAM) at once. The lookup table addressing module is used to quickly look up the linear contribution of the matrix that maps the actual input. The XOR operation module is used to perform an XOR cumulative operation on the lookup results of all column groups to generate the final output sequence. The results output module is used to output the final extracted sequence.
[0029] The aforementioned main solution and its various further alternative solutions can be freely combined to form multiple solutions, all of which are solutions that can be adopted and are claimed in this application. Those skilled in the art, after understanding the solution of this application, will realize that there are many combinations based on the prior art and common general knowledge, all of which are technical solutions to be protected in this application, and will not be exhaustively listed here.
[0030] The beneficial effects of this application are: To address the high computational complexity, high hardware resource consumption, and high power consumption issues of existing Toeplitz matrix randomness extraction methods in QRNGs, this paper proposes a Toeplitz matrix randomness extraction method and system based on lookup table (LUT). By converting traditional matrix multiplication into LUT-based lookup table and XOR operations, the computational complexity of the Toeplitz matrix randomness extraction method is significantly reduced. This scheme does not rely on high-cost, high-performance hardware such as GPUs and FPGAs, and can be implemented on various low-cost hardware platforms, enabling its widespread application in low-cost quantum random number generator systems. Attached Figure Description
[0031] Figure 1 This is a typical QRNG system; Figure 2 This is a flowchart illustrating the method of this application; Figure 3 This is a schematic diagram of the system principle of this application. Detailed Implementation
[0032] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.
[0033] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.
[0034] This application presents a Toeplitz matrix randomness extraction method based on lookup tables, which mainly comprises three key steps: First, pre-computation of the lookup table. In this stage, based on the set Toeplitz matrix and a specific bit width w (e.g., 4 bits, 8 bits), all possible input combinations are preprocessed, and a lookup table (LUT) is generated. Next, during actual operation, the original random sequence is grouped according to the preset bit width, and each group value is quickly addressed through the lookup table to obtain the corresponding pre-computed result. Finally, the desired output random sequence is generated by performing an XOR operation.
[0035] Specifically, in terms of bit width For example (i.e., a half-byte Nibble), for Toeplitz matrix operations ,Right now: =
[0036] , in, Representation matrix T The row vector. Assuming n is a multiple of 4, the input original random sequence... It is divided into multiple 4-bit blocks (i.e., half-bytes), and each half-byte can take 16 integers between 0 and 15 (i.e., 0000~1111).
[0037] make , The details are as follows:
[0038] The output sequence is: . For each Since each nibble can take 16 integers between 0 and 15, then There are 16 possible outcomes. Record these 16 outcomes and add them to the LUT table, i.e.:
[0039] Traversal Pre-calculation in sequence The 16 possible outcomes are calculated and added to the LUT table, i.e.:
[0040] After completing the design of the Toeplitz matrix and the construction of the lookup table (LUT), the system enters the raw random sequence processing stage. The raw random sequence is divided into groups of four binary bits (i.e., Nibs), and each Nibble is input into the lookup table module as an independent addressing unit. Based on the value of each Nibble, the system performs a corresponding fast addressing operation in the pre-generated lookup table to obtain the pre-computed response result of that input group under the Toeplitz matrix mapping. The lookup results corresponding to all Nibs are then XORed, i.e., This generates the final random sequence.
[0041] However, in practical applications, due to environmental changes, device aging, and other factors, the entropy source may degrade, and the minimum entropy of the output original random sequence may decrease. To ensure the security and quality of the final random sequence, the compression ratio needs to be adjusted. To address this issue, this application provides a flexible solution that dynamically adjusts the compression ratio based on the minimum entropy assessed in real time. Assume that when initially constructing the Toeplitz matrix, based on the minimum entropy... The design involves a Toeplitz matrix with the following dimensions: ,in This indicates the length of the original input random sequence. This represents the length of the output sequence. When the entropy source is affected by environmental factors, the minimum entropy of the original random output sequence decreases. Let's assume the minimum entropy at this point is... ,and At this point, there is no need to redesign the Toeplitz matrix or recompile the lookup table (LUT); simply use each result vector from the previous LUT. Adjust proportionally, taking the previous result. Only one element is needed.
[0042] This method ensures the security and quality of the final random sequence while avoiding the need for frequent redesign of the Toeplitz matrix and pre-computation, significantly improving the adaptability and versatility of randomness extraction. This operation achieves the goal of maintaining the security and quality of the final random sequence without frequent Toeplitz matrix design and pre-computation, thus enhancing the adaptability and versatility of randomness extraction at the algorithmic level.
[0043] Example 1 refer to Figure 2 As shown, the Toeplitz matrix randomness extraction method based on the lookup table method in this application is structurally divided into two interconnected but functionally distinct parts: an offline pre-computation stage and an online randomness extraction stage. By moving the highly complex calculations in Toeplitz matrix multiplication to the offline stage, the online stage only needs to perform lookup and XOR operations, thereby significantly reducing real-time computational overhead while ensuring the safety of randomness extraction.
[0044] Phase 1: Offline Pre-computation Phase This step is the initial configuration phase of the system and only needs to be run once before the official runtime phase. Its core objective is to pre-compile the highly complex Toeplitz matrix multiplication operations and embed them into a lookup table (LUT), thereby avoiding repeated calculations during real-time execution. The specific steps are as follows: Step 1.1: Preparation of the original random sequence The method described in this application is applicable to raw random sequences output by entropy sources, including but not limited to QRNGs. It is assumed that the raw random sequence originates from a quantum random number generator. The quantum entropy source utilizes quantum physical phenomena (such as ASE light sources, vacuum state fluctuations, etc.) to extract randomness. After passing through a detection module, it outputs a continuous electrical signal, which is then sampled and quantized by a sampling module such as an analog-to-digital converter (ADC) to output a discrete binary raw random sequence. This sequence serves as the data input for subsequent minimum entropy estimation and randomness extraction.
[0045] Step 1.2: Estimate the minimum entropy of the sequence By performing statistical analysis on the original input random sequence, its level of randomness is determined, with the most commonly used indicator being minimum entropy. The specific formula for calculating minimum entropy is:
[0046] It reflects the probability of the most likely outcome in the output sequence, characterizes the predictability of the sequence, and provides a lower bound on the number of random bits that can be extracted subsequently.
[0047] Step 1.3: Design the Toeplitz matrix Compression ratio obtained from minimum entropy estimation r=m / nFirst, determine the length of the output sequence. m ,in n Let be the length of the original input random sequence. Based on this, construct a sequence with size . n×m The Toeplitz matrix is a structured matrix that is uniquely determined by a small number of parameters. All diagonal elements from the top left to the bottom right are identical, thus the entire matrix is uniquely determined by its first row and first column. All other matrix elements are generated according to the constant diagonal structure. This is achieved by using a matrix of length... m+n- By defining the first row and first column of the random bit sequence of 1, a Toeplitz matrix that satisfies the requirement of randomness extraction can be efficiently constructed.
[0048] Step 1.4: Set bit width w And perform pre-calculation In constructing the Toeplitz matrix Then, set the bit width parameter. (e.g., 4-bit, 8-bit), and logically group the row vectors of the matrix according to their bit width:
[0049] For any set, consider its corresponding One input bit:
[0050] Can retrieve all There are possible combinations. The Toeplitz map contribution for each combination is:
[0051] For all By calculating the above linear combination using various bit combinations, the column group can be obtained. There are several possible output vectors. Traversing all column groups yields all the pre-computed results needed to construct the lookup table.
[0052] Step 1.5: Creation and storage of the lookup table (LUT) Based on the pre-calculation results obtained in step four, assign each column group to... Each output vector is a combination of its input bits: The indexes are organized into a lookup table (LUT). The constructed LUT data structure is written to non-volatile memory (such as Flash) and then loaded into RAM at system runtime to ensure that the lookup operation has a sufficiently high access speed.
[0053] Phase 2: Online Randomness Extraction Phase Its core principle is to achieve lower-complexity streaming processing by utilizing pre-stored data. This stage eliminates the computational bottleneck of matrix multiplication through a "static storage—dynamic loading" mechanism. The specific steps are as follows: Step 2.1: Preloading and caching of lookup tables The specific operation is as follows: During system initialization, the controller (such as an MCU or CPU) moves all LUT data blocks stored in Flash to high-speed Random Access Memory (RAM) in one go. RAM has a random access speed several orders of magnitude faster than Flash. Through this high-speed caching mechanism, all subsequent table lookup operations will be based on RAM addressing, thereby completely eliminating the bottleneck that might have been caused by Flash read speed, ensuring that every table lookup operation in the online retrieval process can be performed at approximately the same speed as Flash. It achieves the task with a time complexity that meets the requirements of high throughput and low latency.
[0054] Step 2.2: Table lookup and addressing During the runtime phase, the original random sequence will be input: By width Divided into A consecutive block of bits. A consecutive block of bits is represented as:
[0055] This Bit blocks are treated as binary indices:
[0056] You can then access the lookup table entry for the corresponding column group and directly retrieve the pre-computed result for that column group from the lookup table based on the index.
[0057] Step 2.3: XOR operation Based on the linear structure of the Toeplitz operation, the lookup results of all column groups are XORed sequentially to obtain the final random sequence: Step 2.4: Output Results After performing the XOR operation, the final output bit sequence is obtained:
[0058] This sequence can be used as a randomness extraction result and, if necessary, further sent to a randomness detection process to verify that it meets the relevant randomness detection standards.
[0059] Example 2 refer to Figure 3Based on Example 1, this implementation discloses a Toeplitz matrix randomness extraction system based on a lookup table method. It consists of the following functional modules, which work together to complete the entire process from the input sequence to the final output bits.
[0060] Phase 1: Offline Pre-computation Phase (1) Original random sequence preparation module This module is responsible for receiving the raw random sequence from the quantum random number generator (QRNG):
[0061] It also completes data reading and buffer storage, providing a stable input source for subsequent processing.
[0062] (2) Minimum Entropy Estimation Module This module performs statistical analysis on the original random sequence and estimates its minimum entropy. This estimate forms the basis for determining the number of bits that can be safely extracted.
[0063] (3) Compression ratio calculation module Calculate the appropriate compression ratio based on the minimum entropy estimation results:
[0064] This determines the length of the output sequence. This module ensures that the generated sequences meet information-theoretic security constraints.
[0065] (4) Toeplitz matrix construction module This module is based on compression ratio. Construction dimensions are Toeplitz matrix A Toeplitz matrix has the structural property of diagonal invariance, meaning that any diagonal element from the top left to the bottom right is identical. Therefore, the entire matrix can be uniquely determined by its first row and first column, with the remaining elements generated according to the diagonal invariance rule. A matrix typically consists of a matrix of length... It is obtained by initializing a random bit sequence.
[0066] (5) Bit width setting module This module sets the bit width parameter. (like or ), and logically divide the row vectors of the Toeplitz matrix according to their bit width. Each column group is defined as:
[0067] This partitioning relies solely on the construction of the Toeplitz matrix and does not involve the actual input sequence, providing a basic organizational form for subsequent pre-computation.
[0068] (6) Pre-calculation module This module is for each column group Given a column vector, enumerate all its corresponding columns. Let there be a combination of input bits. The binary expansion is
[0069] The output of the linear mapping corresponding to this combination is:
[0070] By iterating through all column groups With all bit combinations This yields a complete set of pre-calculated results uniquely determined by the Toeplitz matrix, providing a data foundation for the construction of the lookup table.
[0071] (7) Lookup table construction and storage module This module organizes the pre-calculated results into a lookup table (LUT). For each column group... The size of the construction is Mapping table:
[0072] LUT data is stored in non-volatile memory such as Flash and loaded into high-speed memory (such as RAM) during system runtime to support fast lookup.
[0073] Phase Two: Online Randomness Extraction Phase (8) Lookup table preloading module When the system begins online randomness extraction, this module loads all LUT data blocks stored in Flash into high-speed random access memory (RAM) at once. This high-speed caching mechanism eliminates the bottleneck caused by Flash read speed, ensuring that each table lookup operation has approximately the same performance. This reduces the time complexity, thus meeting the requirements of high throughput and low latency.
[0074] (9) Table lookup addressing module This module processes the input sequence by bit width during runtime. Grouping:
[0075] Treating bit blocks as lookup table indexes
[0076] And extract the pre-computed output vector from the corresponding lookup table:
[0077] This module implements a fast lookup process for mapping actual inputs to the linear contribution of matrices.
[0078] (10) XOR operation module This module performs an XOR cumulative operation on the lookup results of all column groups to generate the final output sequence:
[0079] (11) Result Output Module This module outputs the final extracted sequence.
[0080] It can also be transmitted to the randomness detection module to verify whether the output sequence meets the randomness detection criteria.
[0081] This application's method transforms the calculation of the Toeplitz matrix into a pre-computed lookup table and a fast lookup operation, avoiding highly complex matrix operations and dependence on high-performance hardware, thus significantly reducing computational overhead and resource consumption. When faced with resource constraints, this method can be efficiently implemented on various hardware platforms, including microcontroller units (MCUs), field-programmable gate arrays (FPGAs), complex programmable logic devices (CPLDs), digital signal processors (DSPs), and application-specific integrated circuits (ASICs).
[0082] Especially on low-cost hardware platforms such as MCUs, the flexible access method of Flash + RAM can further improve implementation efficiency, facilitate miniaturization and integration design, and effectively reduce hardware costs. During system operation, pre-generated lookup table (LUT) data is stored in Flash memory to save memory space. When the system executes a task, the LUT table is loaded into RAM through a data migration mechanism to achieve fast addressing and access. This "static storage-dynamic loading" approach significantly reduces the long-term storage pressure on the MCU and avoids frequent external access overhead while ensuring efficient table lookup operations. In this way, the originally complex Toeplitz matrix multiplication is transformed into a series of addressing lookups and XOR operations, which not only significantly improves computational efficiency but also reduces resource consumption and power consumption in hardware implementation, making it particularly suitable for high-speed, low-power, and embedded system applications.
[0083] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A method for extracting the randomness of a Toeplitz matrix based on a lookup table, characterized in that, The Toeplitz matrix randomness extraction method based on table lookup includes: S1: In the offline pre-computation stage, the Toeplitz matrix multiplication operation is pre-computed and fixed into a lookup table; S2: In the online randomness extraction stage, the lookup table is preloaded and a lookup and XOR operation are performed to generate the final random sequence.
2. The method for extracting the randomness of a Toeplitz matrix based on a lookup table as described in claim 1, characterized in that, Step S1 includes: S11: Preparation of the original random sequence, wherein the original random sequence includes the random sequence output by the entropy source of the QRNG; S12: Estimate the minimum entropy of the sequence. By performing statistical analysis on the input original random sequence, the level of randomness contained in the original random sequence is determined by the minimum entropy. S13: Design the Toeplitz matrix and estimate the compression ratio based on the minimum entropy. r=m / n Let n be the length of the original input random sequence, determine the length m of the output sequence, and then construct a sequence with size m. n×m The Toeplitz matrix can be constructed by defining the first row and first column of the Toeplitz matrix using a random bit sequence of length m+n-1, thus satisfying the requirement for randomness extraction. ; S14: Set the bit width w and perform pre-calculation, including: Set bit width parameter and the matrix Logically group the row vectors by bit width: For any set, consider its corresponding One input bit: Able to retrieve all There are 10 possible combinations; the Toeplitz mapping contribution for each combination is: For all By calculating the corresponding linear combination of each bit combination, the column group can be obtained. By iterating through all column groups, one can obtain all the pre-computed results required to construct the lookup table from the possible output vectors. S15: Creation and storage of lookup tables Based on the pre-calculation results obtained in step S14, the corresponding columns of each group are... Each output vector is a combination of its input bits: The indexes are organized into a lookup table; the constructed lookup table data structure is written into non-volatile memory.
3. The Toeplitz matrix randomness extraction method based on table lookup as described in claim 2, characterized in that, In step S11, when the original random sequence comes from a quantum random number generator, the quantum entropy source extracts randomness based on quantum physical phenomena. After passing through the detection module, it outputs a continuous electrical signal. After being sampled and quantized by a sampling module such as an analog-to-digital converter, it outputs a discrete binary original random sequence, which serves as the data input for subsequent minimum entropy estimation and randomness extraction.
4. The method for extracting the randomness of a Toeplitz matrix based on a lookup table as described in claim 2, characterized in that, In step S12, the specific expression for calculating the minimum entropy is: To output sequence elements, It reflects the probability of the most likely outcome in the output sequence, characterizes the predictability of the sequence, and provides a lower bound on the number of random bits that can be extracted subsequently.
5. The Toeplitz matrix randomness extraction method based on table lookup as described in claim 2, characterized in that, Step S2 includes: S21: Preloading and caching of lookup tables: The controller moves all lookup table data blocks stored in Flash to high-speed random access memory at once, and all subsequent lookup operations will be addressed based on RAM. S22: Lookup table to retrieve the pre-calculated result corresponding to this column group. The original random sequence will be input. By width Divided into The nth consecutive bit block, the nth A consecutive block of bits is represented as: This Bit blocks are treated as binary indices: This means being able to access the lookup table entries for the corresponding column group and directly retrieve the pre-calculated result for that column group from the lookup table based on the index: ; S23: XOR operation. Based on the linear structure of the Toeplitz operation, the lookup results of all column groups are XORed sequentially to obtain the final random sequence. ; S24: Output the result. After performing the XOR operation, the final output bit sequence is obtained. It is used as the result of randomness extraction and, as needed, is further sent to the randomness detection process to verify that it meets the relevant randomness detection standards.
6. A system for extracting the randomness of a Toeplitz matrix based on a lookup table method, characterized in that, The Toeplitz matrix randomness extraction system based on the lookup table method completes the randomness extraction of the Toeplitz matrix based on any one of the Toeplitz matrix randomness extraction methods in claims 1 to 5.
7. The Toeplitz matrix randomness extraction system based on table lookup method as described in claim 6, characterized in that, The Toeplitz matrix randomness extraction system based on the lookup table method includes: The original random sequence preparation module is used to receive the original random sequence from the quantum random number generator (QRNG) and complete the data reading and buffer storage, providing a stable input source for subsequent processing. The minimum entropy estimation module is used to perform statistical analysis on the original random sequence and estimate its minimum entropy. The compression ratio calculation module calculates the compression ratio based on the minimum entropy estimation result, thereby determining the length m of the output sequence; The Toeplitz matrix construction module is used to construct a Toeplitz matrix of size m×n that satisfies the requirement of randomness extraction according to a compression ratio r. ; The bit width setting module is used to set the bit width parameter. and the Toeplitz matrix The row vectors are logically divided according to their bit width; Pre-calculation module for each column group Given a column vector, enumerate all its corresponding columns. The input bit combination is obtained by traversing all column groups. With all bit combinations This yields a complete set of pre-computed results uniquely determined by the Toeplitz matrix, providing a data foundation for the construction of lookup tables; The lookup table building and storage module is used to organize pre-calculated results into lookup tables.
8. The Toeplitz matrix randomness extraction system based on table lookup method as described in claim 7, characterized in that, The Toeplitz matrix randomness extraction system based on the lookup table method includes: The lookup table preloading module is used to load all lookup table data blocks stored in Flash into high-speed random access memory (RAM) at once. The lookup table addressing module is used to quickly look up the linear contribution of the matrix that maps the actual input. The XOR operation module is used to perform an XOR cumulative operation on the lookup results of all column groups to generate the final output sequence. The results output module is used to output the final extracted sequence.