Random number generation methods, circuits, and chips

By using the same entropy source clock to generate sampling and jitter clock signals in a field-programmable gate array (FPGA) chip, the jitter edge position is determined to generate multi-bit random numbers, solving the problem of low generation rate in existing technologies and achieving efficient true random number generation.

CN117555517BActive Publication Date: 2026-11-10UNIV OF SCI & TECH OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311527459.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-11-14
Publication Date
2026-11-10
Estimated Expiration
2043-11-14

AI Technical Summary

Technical Problem

Existing methods for generating random numbers are inefficient, especially in field-programmable gate array (FPGA) chips, where data compression during sampling and post-processing reduces the generation rate.

Method used

By using the same entropy source clock to generate a sampling clock signal and a jitter clock signal, the jitter edge information of the jitter clock signal is sampled to determine the jitter edge position, and multi-bit random numbers are generated from a preset edge position distribution range to avoid the rate reduction caused by clock asynchrony, and the bias is eliminated in post-processing.

Benefits of technology

It achieves the generation of multi-bit random numbers in each sampling period under single-channel conditions, which improves the generation rate and consumes less hardware resources. The generated random numbers are truly random and have unpredictability and non-repeatability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117555517B_ABST
    Figure CN117555517B_ABST
Patent Text Reader

Abstract

This disclosure provides a random number generation method, circuit, and chip, which can be applied to the field of random number technology. The method includes: sampling a jittered clock signal according to the sampling period of a sampling clock signal to obtain jitter edge sampling information of the jittered clock signal; determining the jitter edge position information of the jittered clock signal within the sampling period based on the jitter edge sampling information, wherein the jitter edge position information is the offset position of the jittered clock signal relative to the sampling clock signal at the same sampling time; determining a target edge position distribution interval corresponding to the jitter edge position information from a preset edge position distribution interval set based on the jitter edge position information, wherein the preset edge position distribution interval set includes N preset edge position distribution intervals and a binary number corresponding to each preset edge position distribution interval, where N is an integer greater than 1; and generating a random number based on the binary number corresponding to the target edge position distribution interval.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of random number technology, and more specifically, to a random number generation method, circuit, and chip. Background Technology

[0002] Random numbers are the result of specially designed random experiments. Random numbers have many uses, such as generating keys in quantum key distribution (QKD) systems, generating private keys in symmetric key encryption systems, generating private and public keys in public key encryption systems, cryptography, simulation, and the Internet of Things (IoT).

[0003] In realizing the concept of this disclosure, the inventors discovered at least the following problems in the related art: the methods for generating random numbers in the related art are inefficient. Summary of the Invention

[0004] In view of this, this disclosure provides a random number generation method, circuit, and chip.

[0005] One aspect of this disclosure provides a method for generating random numbers, comprising:

[0006] The jitter clock signal is sampled according to the sampling period of the sampling clock signal to obtain the jitter edge sampling information of the jitter clock signal. The sampling clock signal and the jitter clock signal are generated by the same entropy source clock.

[0007] Based on the jitter edge sampling information, the jitter edge position information of the jitter clock signal within the sampling period is determined, wherein the jitter edge position information is the offset position of the jitter clock signal relative to the sampling clock signal at the same sampling time.

[0008] Based on the jitter edge position information, a target edge position distribution interval corresponding to the jitter edge position information is determined from the preset edge position distribution interval set. The preset edge position distribution interval set includes N preset edge position distribution intervals and a binary number corresponding to each preset edge position distribution interval, where N is an integer greater than 1.

[0009] A random number is generated based on the binary number corresponding to the distribution interval of the target edge position.

[0010] According to embodiments of this disclosure, the above method further includes:

[0011] Based on the jitter edge distribution position of the jitter clock signal, determine the normal distribution plot related to the jitter edge distribution position;

[0012] Divide the above normal distribution graph into N equal parts to obtain N normal distribution intervals;

[0013] Determine the binary number corresponding to each of the above N normal distribution intervals, and use the above N normal distribution intervals as the above N preset edge position distribution intervals to obtain the above preset edge position distribution interval set.

[0014] According to embodiments of this disclosure, determining the jitter edge position information of the jitter clock signal within the sampling period based on the jitter edge sampling information includes:

[0015] Based on the jitter edge sampling information, the temperature code of the jitter clock signal within the sampling period is determined.

[0016] Based on the aforementioned thermometer code, the jitter edge position information of the aforementioned jitter clock signal within the aforementioned sampling period is determined.

[0017] According to embodiments of this disclosure, the above method further includes:

[0018] The delay of the jitter clock signal is adjusted according to the number of random numbers associated with each of the preset edge position distribution intervals, so that the jitter clock signal and the sampling clock signal are edge aligned.

[0019] According to embodiments of this disclosure, the above method further includes:

[0020] A random number sequence is constructed based on multiple of the above random numbers;

[0021] The above random number sequence is post-processed to eliminate the bias in the random number sequence.

[0022] According to embodiments of this disclosure, the aforementioned binary number is a number of at least two bits.

[0023] A second aspect of this disclosure provides a random number generation circuit, comprising:

[0024] Entropy source clock, configured to generate sampling clock signal and jitter clock signal;

[0025] A signal sampling converter is configured to sample a jitter clock signal according to the sampling period of a sampling clock signal to obtain jitter edge sampling information of the jitter clock signal. Based on the jitter edge sampling information, the jitter edge position information of the jitter clock signal within the sampling period is determined. The jitter edge position information is the offset position of the jitter clock signal relative to the sampling clock signal at the same sampling time. Based on the jitter edge position information, a target edge position distribution interval corresponding to the jitter edge position information is determined from a preset edge position distribution interval set. The sampling clock signal and the jitter clock signal are generated by the same entropy source clock. The preset edge position distribution interval set includes N preset edge position distribution intervals and a binary number corresponding to each preset edge position distribution interval, where N is an integer greater than 1.

[0026] The random number encoding circuit is configured to generate random numbers based on the binary numbers corresponding to the distribution interval of the target edge position.

[0027] According to embodiments of this disclosure, the signal sampling converter described above includes a delay chain, a trigger, and an encoder;

[0028] The aforementioned delay chain is configured to determine the sampling clock edge in the aforementioned sampling clock signal;

[0029] The aforementioned trigger is configured to sample the jitter clock signal based on the aforementioned sampling clock edge to obtain jitter edge sampling information of the jitter clock signal, and to determine the jitter edge position information of the jitter clock signal within the sampling period based on the aforementioned jitter edge sampling information.

[0030] The encoder is configured to determine a target edge position distribution interval corresponding to the jitter edge position information from a preset edge position distribution interval set based on the jitter edge position information, and convert the jitter edge position information into a binary number corresponding to the target edge position distribution interval.

[0031] According to embodiments of this disclosure, the circuit further includes:

[0032] The delay control logic circuit is configured to adjust the delay of the jitter clock signal according to the number of random numbers associated with each of the preset edge position distribution intervals, so as to align the jitter clock signal and the sampling clock signal at their edges.

[0033] The post-processing circuit is configured to post-process the random number sequence formed from the plurality of the above-mentioned random numbers to eliminate the bias in the random number sequence.

[0034] A third aspect of this disclosure provides a chip comprising:

[0035] The above-mentioned random number generation circuit.

[0036] According to embodiments of this disclosure, since the sampling clock signal and the jitter clock signal are generated from the same entropy source clock, the sampling frequency and the frequency being sampled can be consistent, avoiding the reduction in random number generation rate caused by clock asynchrony. Furthermore, the binary number corresponding to the preset edge position distribution interval can be set to a multi-bit number, ensuring that each generated random number is multi-bit. Therefore, the efficiency of random number generation is further improved. Attached Figure Description

[0037] The above and other objects, features and advantages of this disclosure will become clearer from the following description of embodiments with reference to the accompanying drawings, in which:

[0038] Figure 1 A flowchart illustrating a random number generation method according to an embodiment of the present disclosure is shown schematically;

[0039] Figure 2 This diagram illustrates the preset edge position distribution interval set of a two-bit binary number.

[0040] Figure 3 This diagram illustrates the preset edge position distribution interval set of a three-bit binary number.

[0041] Figure 4 A block diagram of a random number generation circuit according to an embodiment of the present disclosure is shown schematically;

[0042] Figure 5 A schematic diagram of the structure of a random number generation circuit according to an embodiment of the present disclosure is shown.

[0043] Figure 6A A schematic diagram illustrating the structure of an entropy source clock according to an embodiment of the present disclosure is shown.

[0044] Figure 6B A schematic diagram illustrating the structure of yet another entropy source clock according to an embodiment of the present disclosure is shown.

[0045] Figure 7A A schematic diagram of the structure of a signal sampling converter according to an embodiment of the present disclosure is shown.

[0046] Figure 7B A schematic diagram illustrating the structure of a delay chain according to an embodiment of the present disclosure is shown.

[0047] Figure 8 A schematic diagram illustrating the sampling interval distribution according to an embodiment of the present disclosure is shown;

[0048] Figure 9A schematic diagram of the structure of a post-processing circuit according to an embodiment of the present disclosure is shown; and

[0049] Figure 10 A block diagram of a chip according to an embodiment of the present disclosure is shown schematically. Detailed Implementation

[0050] The embodiments of the present disclosure will now be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the disclosure. In the following detailed description, numerous specific details are set forth to provide a thorough understanding of the embodiments of the present disclosure for ease of explanation. However, it will be apparent that one or more embodiments may be practiced without these specific details. Furthermore, descriptions of well-known structures and techniques are omitted in the following description to avoid unnecessarily obscuring the concepts of the present disclosure.

[0051] The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit this disclosure. The terms “comprising,” “including,” etc., as used herein indicate the presence of the stated features, steps, operations, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, or components.

[0052] All terms used herein (including technical and scientific terms) have the meanings commonly understood by those skilled in the art, unless otherwise defined. It should be noted that the terms used herein are to be interpreted in a manner consistent with the context of this specification, and not in an idealized or overly rigid way.

[0053] When using expressions such as "at least one of A, B, and C," the expression should generally be interpreted in accordance with the meaning commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, and C" should include, but is not limited to, systems having A alone, having B alone, having C alone, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.). Similarly, when using expressions such as "at least one of A, B, or C," the expression should generally be interpreted in accordance with the meaning commonly understood by a person skilled in the art (e.g., "a system having at least one of A, B, or C" should include, but is not limited to, systems having A alone, having B alone, having C alone, having A and B, having A and C, having B and C, and / or having A, B, and C, etc.).

[0054] Random numbers include both true random numbers and truly random numbers. True random numbers are unpredictable numbers that cannot be repeatedly generated over a sufficiently long sequence. They are typically derived from a physical entropy source. The unpredictability of true random numbers increases their resistance to security attacks on cryptographic systems. For security reasons, and to avoid attacks, the randomness of random numbers is crucial; otherwise, all random numbers could be obtained through repeated generation or algorithmic cracking. Therefore, secure systems may require or expect the generation of truly random numbers that are both unpredictable and non-repeatable.

[0055] True random number generators can be broadly categorized into pseudo-random number generators and true random number generators. A true random number generator utilizes and extracts randomness from physical phenomena and typically includes an entropy source, entropy extraction circuitry, and post-processing circuitry. An entropy source is used to generate entropy, which is unpredictable data, by leveraging randomness inherent in physical processes (such as thermal noise or shot noise in circuits). Entropy sources can include ring oscillators, phase-locked loops (PLLs), and Galois rings. Based on the different physical processes that serve as the entropy source in a true random number generator, they can be classified into hardware random number generators and quantum random number generators.

[0056] Traditional hardware random number generators limit the final random number generation rate due to their use of post-processing methods involving data compression and the use of a sampling clock signal with a slower frequency than the sampled clock signal during the sampling process. Depending on the hardware implementation method, true random number generators can be further divided into Field Programmable Gate Array (FPGA) based True Random Number Generators (TRNGs) and Application Specific Integrated Circuit (ASIC) based True Random Number Generators (TRNGs).

[0057] True random number generators can be used in a variety of products, including processors, memory, controllers, smart cards, embedded security elements, digital TVs, and IoT devices, so the importance of true random number generators that can generate random numbers at high speed is increasing.

[0058] With the development of Field-Programmable Gate Array (FPGA) chips, their manufacturing processes have become increasingly refined, resulting in a greater number of proprietary intellectual property cores and more logic resources available for hardware programming. Simultaneously, the software functionality provided by FPGA manufacturers has become increasingly powerful. Therefore, compared to Application-Specific Integrated Circuits (ASICs), FPGAs offer greater configuration flexibility and are more convenient for constructing true random number generators. However, traditional FPGA-based true random number generators typically require data compression during sampling and post-processing, which reduces the random number generation rate. Increasing the generation rate necessitates increasing the number of random number generation channels, which in turn consumes more hardware resources.

[0059] In view of this, this disclosure proposes a random number generation method, comprising: sampling a jitter clock signal according to the sampling period of a sampling clock signal to obtain jitter edge sampling information of the jitter clock signal, wherein the sampling clock signal and the jitter clock signal are generated by the same entropy source clock; determining the jitter edge position information of the jitter clock signal within the sampling period according to the jitter edge sampling information, wherein the jitter edge position information is the offset position of the jitter clock signal relative to the sampling clock signal at the same sampling time; determining a target edge position distribution interval corresponding to the jitter edge position information from a preset edge position distribution interval set according to the jitter edge position information, wherein the preset edge position distribution interval set includes N preset edge position distribution intervals and a binary number corresponding to each preset edge position distribution interval, where N is an integer greater than 1; and generating a random number according to the binary number corresponding to the target edge position distribution interval.

[0060] Figure 1 A flowchart illustrating a random number generation method according to an embodiment of the present disclosure is shown schematically.

[0061] like Figure 1 As shown, the random number generation method includes operations S110 to S140.

[0062] In operation S110, the jitter clock signal is sampled according to the sampling period of the sampling clock signal to obtain the jitter edge sampling information of the jitter clock signal. The sampling clock signal and the jitter clock signal are generated by the same entropy source clock.

[0063] According to embodiments of this disclosure, the jitter clock signal is the signal being sampled, and the sampling clock signal is the sampling signal. Both the sampling clock signal and the jitter clock signal are generated by the same entropy source clock, ensuring that the frequency of the sampling signal is consistent with the frequency of the signal being sampled, thus guaranteeing that the random number generation rate is not affected by the frequency of the sampling clock signal.

[0064] According to embodiments of this disclosure, the jitter of the jitter clock signal is random. Therefore, the jitter edges of the jitter clock signal can be sampled to obtain jitter edge sampling information, and then a random number can be obtained through subsequent processing based on the jitter edge sampling information.

[0065] In operation S120, the jitter edge position information of the jitter clock signal within the sampling period is determined based on the jitter edge sampling information. The jitter edge position information is the offset position of the jitter clock signal relative to the sampled clock signal at the same sampling time.

[0066] According to embodiments of this disclosure, the jitter edge sampling information can be information obtained by sampling the jitter edge of the jitter clock signal. For example, the jitter edge sampling information can be "0000111111", where "0" can represent a low level and "1" can represent a high level.

[0067] According to embodiments of this disclosure, the boundary between high and low levels of the jitter edge sampling information can be the location of the jitter edge. Therefore, the jitter edge position information of the jitter clock signal within the sampling period can be determined based on the boundary between high and low levels of the jitter edge sampling information.

[0068] According to embodiments of this disclosure, since the jitter clock signal and the sampling clock signal are generated by the same entropy source clock, the jitter clock signal and the sampling clock signal have the same frequency. When the jitter clock signal jitters, the signal edge will be offset relative to the sampling clock signal. Therefore, the jitter edge position information can be the offset position of the jitter clock signal relative to the sampling clock signal at the same sampling time.

[0069] In operation S130, based on the jitter edge position information, the target edge position distribution interval corresponding to the jitter edge position information is determined from the preset edge position distribution interval.

[0070] According to embodiments of this disclosure, the preset edge position distribution interval set includes N preset edge position distribution intervals and a binary number corresponding to each preset edge position distribution interval, where N is an integer greater than 1.

[0071] According to embodiments of this disclosure, the jitter of the jittered clock signal is random, but it also conforms to certain patterns. The preset edge position distribution interval set can be the distribution probability interval set related to the jitter edges of the jittered clock signal.

[0072] According to embodiments of this disclosure, since the jitter of the jitter clock signal occurs randomly, the determination of the target edge position distribution interval corresponding to the jitter edge position information is also randomly determined from a preset edge position distribution interval.

[0073] According to embodiments of this disclosure, the binary number may be determined based on the number of preset edge position distribution intervals.

[0074] In operation S140, a random number is generated based on the binary number corresponding to the distribution interval of the target edge position.

[0075] According to embodiments of this disclosure, binary data can be used as random numbers to generate random numbers.

[0076] According to embodiments of this disclosure, since the sampling clock signal and the jitter clock signal are generated from the same entropy source clock, the sampling frequency and the frequency being sampled can be consistent, avoiding the reduction in random number generation rate caused by clock asynchrony. Furthermore, the binary number corresponding to the preset edge position distribution interval can be set to a multi-bit number, ensuring that each generated random number is multi-bit. Therefore, the efficiency of random number generation is further improved.

[0077] According to embodiments of this disclosure, the binary number is a number with at least two bits. For example, the binary number can be a two-bit "01", a three-bit "010", or a four-bit "0011".

[0078] According to embodiments of this disclosure, the number of preset edge position distribution intervals, i.e., the size of N, can be determined based on the required number of bits.

[0079] According to embodiments of this disclosure, the jitter edges of the jittered clock signal occur randomly and conform to a normal distribution. The actual position of each cycle of the jittered clock signal edge is quantized into multiple bits. Therefore, the random number generation method may further include:

[0080] Based on the jitter edge distribution location of the jitter clock signal, determine the normal distribution plot related to the jitter edge distribution location;

[0081] Divide the normal distribution graph into N equal parts to obtain N normal distribution intervals;

[0082] Determine the binary number corresponding to each of the N normal distribution intervals, and use the N normal distribution intervals as N preset edge position distribution intervals to obtain the preset edge position distribution interval set.

[0083] According to embodiments of this disclosure, the binary number can be M bits, where M is a positive integer and N can be 2^N. M The size of the normal distribution graph can be determined by dividing it into N equal parts based on the number of bits in the binary representation, resulting in N normal distribution intervals. Each normal distribution interval is assigned a preset edge position distribution interval. Each normal distribution interval is matched with a corresponding binary number to obtain the preset edge position distribution interval set.

[0084] The following is based on Figure 2 , Figure 3 We will introduce the cases where the binary number is two bits and three bits respectively.

[0085] Figure 2 The diagram illustrates a set of preset edge position distribution intervals for a two-bit binary number.

[0086] Figure 3 The diagram illustrates a set of preset edge position distribution intervals for a three-bit binary number.

[0087] like Figure 2 As shown, the actual position of the edge of a jittery clock signal per cycle is quantized into two bits. In the diagram, ta, tb, and tc represent the four equal division points of a normal distribution, meaning the preset edge position distribution intervals include four preset edge position distribution intervals, corresponding to binary numbers 00, 01, 10, and 11, respectively. tr represents the actual edge position of the jittery clock signal. When tr falls to the left of the division point ta, it corresponds to binary number 00, generating a random number of 00; when tr falls to the right of ta and to the left of tb, it corresponds to binary number 01, generating a random number of 01; when tr falls to the right of tb and to the left of tc, it corresponds to binary number 10, generating a random number of 10; and when tr falls to the right of tc, it corresponds to binary number 11, generating a random number of 11. This is only an example encoding and is not the only encoding that can be used. Figure 2 The sampling points in the diagram represent the individual taps in the delay chain, and all sampling points can cover the location of the incoming clock edge of a jittery signal.

[0088] like Figure 3As shown, the actual position of the edge of the jittered clock signal per cycle is quantized into three bits. In the figure, ta, tb, tc, td, te, tf, and tg represent eight equal division points of a normal distribution, meaning the preset edge position distribution intervals consist of eight preset edge position distribution intervals. The binary numbers corresponding to the zero preset edge position distribution intervals are 000, 001, 010, 011, 100, 101, 110, and 111, respectively. tr represents the actual edge position of the jittered clock signal. If `tr` falls to the left of the 8th division point `ta`, corresponding to the binary number 000, the generated random number is 000. If `tr` falls to the right of the 8th division point `ta` and to the left of `tb`, corresponding to the binary number 001, the generated random number is 001. If `tr` falls to the right of the 8th division point `tb` and to the left of `tc`, corresponding to the binary number 010, the generated random number is 010. If `tr` falls to the right of the 8th division point `tc`, corresponding to the binary number 011, the generated random number is 011. If `tr` falls to the right of the 8th division point `td` and to the left of `te`, corresponding to the binary number 100, the generated random number is 100. If `tr` falls to the right of the 8th division point `te` and to the left of `tf`, corresponding to the binary number 101, the generated random number is 101. If `tr` falls to the right of the 8th division point `tf` and to the left of `tg`, corresponding to the binary number 110, the generated random number is 110. If `tr` falls to the right of the 8th division point `tg`, corresponding to the binary number 111, the generated random number is 111. This is just an example encoding; this encoding is not the only one that can be used.

[0089] According to embodiments of this disclosure, determining the jitter edge position information of the jitter clock signal within the sampling period based on jitter edge sampling information includes:

[0090] Based on the jitter edge sampling information, determine the temperature code of the jitter clock signal within the sampling period;

[0091] Based on the thermometer code, determine the jitter edge position information of the jitter clock signal within the sampling period.

[0092] According to embodiments of this disclosure, the jitter edge sampling information can be the result of sampling the high and low levels of the jitter clock signal, which can be information of 0 and 1. Based on the jitter edge sampling information, the thermometer code of the jitter clock signal can be determined. The 0s and 1s in the thermometer code can be clearly divided into two parts, thereby determining the jitter edge position information of the jitter clock signal within the sampling period. For example, if the thermometer code is "0000011111", it can be determined that the jitter edge position information of the jitter clock signal within the sampling period indicates that the jitter edge of the jitter clock signal is located in the middle position, that is, the offset position compared to the sampled clock signal is 0; if the thermometer code is "0001111111", it can be determined that the jitter edge position information of the jitter clock signal within the sampling period indicates that the jitter edge of the jitter clock signal is located in a position slightly ahead of the middle, that is, the offset position compared to the sampled clock signal is 2.

[0093] According to embodiments of this disclosure, the random number generation method further includes:

[0094] The delay of the jitter clock signal is adjusted based on the number of random numbers associated with each preset edge position distribution interval, so that the jitter clock signal and the sampling clock signal are edge aligned.

[0095] According to embodiments of this disclosure, since the jitter clock signal and the sampling clock signal will be at different positions at the same time after jitter occurs, the jitter clock signal and the sampling clock signal can be edge aligned.

[0096] According to embodiments of this disclosure, since the preset edge position distribution interval is related to the position of the jitter edge of the jitter clock signal, the delay of the jitter clock signal can be adjusted based on the number of random numbers generated that are related to the preset edge position distribution interval. For example, as Figure 2 The preset edge position distribution intervals include four, namely the first preset edge position distribution interval, the second preset edge position distribution interval, the third preset edge position distribution interval, and the fourth preset edge position distribution interval. The middle of the second and third preset edge position distribution intervals should be the edge position. However, the number of random numbers related to the first preset edge position distribution interval is the largest. Therefore, it can be determined that the position of the jitter clock signal has shifted compared to the sampling clock signal. Therefore, in order to detect the jitter edge of the jitter clock signal, the delay of the jitter clock signal needs to be adjusted.

[0097] According to embodiments of this disclosure, the method further includes:

[0098] A random number sequence is constructed from multiple random numbers;

[0099] Post-processing is performed on the random number sequence to eliminate bias in the random number sequence.

[0100] According to embodiments of this disclosure, multiple random numbers can be generated, forming a random number sequence. Post-processing of the random number sequence can be a shift-and-XOR operation, which can eliminate biases in the original sequence without changing the generation rate.

[0101] According to embodiments of this disclosure, the random number generation method can also generate multi-bit random numbers greater than one bit per sampling period in a single-channel scenario. Because this method fully extracts the jitter of the jittered clock signal and does not compress data during post-processing, it can generate multi-bit random numbers within one period, thus improving the random number generation rate. Compared to traditional random number generation methods, it improves the random number generation rate and consumes relatively low hardware resources.

[0102] Figure 4 A block diagram of a random number generation circuit according to an embodiment of the present disclosure is shown schematically.

[0103] like Figure 4 As shown, the random number generation circuit 400 of this embodiment includes an entropy source clock 410, a signal sampling converter 420, and a random number encoding circuit 430.

[0104] The entropy source clock 410 can be configured to generate a sampling clock signal and a jitter clock signal.

[0105] The signal sampling converter 420 can be configured to sample the jitter clock signal according to the sampling period of the sampling clock signal to obtain the jitter edge sampling information of the jitter clock signal. Based on the jitter edge sampling information, the jitter edge position information of the jitter clock signal within the sampling period is determined. The jitter edge position information is the offset position of the jitter clock signal relative to the sampling clock signal at the same sampling time. Based on the jitter edge position information, a target edge position distribution interval corresponding to the jitter edge position information is determined from a preset edge position distribution interval set. The sampling clock signal and the jitter clock signal are generated by the same entropy source clock. The preset edge position distribution interval set includes N preset edge position distribution intervals and a binary number corresponding to each preset edge position distribution interval, where N is an integer greater than 1.

[0106] The random number encoding circuit 430 can be configured to generate random numbers based on the binary numbers corresponding to the distribution interval of the target edge position.

[0107] According to embodiments of this disclosure, the signal sampling converter 420 can be used to perform the operations S110 to S130 described above, which will not be repeated here. The random number encoding circuit 430 can be used to perform the operation S140 described above, which will not be repeated here.

[0108] According to embodiments of this disclosure, the selection of the entropy source clock can be determined based on the number of bits of the random number to be generated in each sampling period. The entropy source clock can be constructed using the proprietary cores provided by the field-programmable gate array (FPGA) chip, or it can be designed and constructed independently using the resources within the FPGA chip.

[0109] According to embodiments of this disclosure, since the sampling clock signal and the jitter clock signal are generated from the same entropy source clock, the sampling frequency and the frequency being sampled can be consistent, avoiding the reduction in random number generation rate caused by clock asynchrony. Furthermore, the binary number corresponding to the preset edge position distribution interval can be set to a multi-bit number, ensuring that each generated random number is multi-bit. Therefore, the efficiency of random number generation is further improved.

[0110] According to embodiments of this disclosure, the random number generation method can also generate multi-bit random numbers greater than one bit per sampling period in a single-channel scenario. Because this method fully extracts the jitter of the jittered clock signal and does not compress data during post-processing, it can generate multi-bit random numbers within one period, thus improving the random number generation rate. Compared to traditional random number generation methods, it improves the random number generation rate and consumes relatively low hardware resources.

[0111] According to embodiments of this disclosure, the signal sampling converter includes a delay chain, a trigger, and an encoder;

[0112] The delay chain is configured to determine the sampling clock edge in the sampling clock signal;

[0113] The trigger is configured to sample the jitter clock signal based on the sampling clock edge to obtain the jitter edge sampling information of the jitter clock signal, and determine the jitter edge position information of the jitter clock signal within the sampling period based on the jitter edge sampling information.

[0114] The encoder is configured to determine the target edge position distribution interval corresponding to the jitter edge position information from a preset edge position distribution interval based on the jitter edge position information, and convert the jitter edge position information into a binary number corresponding to the target edge position distribution interval.

[0115] According to embodiments of this disclosure, the average sampling interval in the random number generation circuit can be the average value of adjacent delays in the delay chain of the signal sampling converter, and the average sampling interval can be measured by the code density method.

[0116] According to embodiments of this disclosure, the average delay of the delay chain taps is measured, and the desired number of bits for the random number to be generated in each sampling period is determined, while ensuring that the jitter of the entropy source clock is sufficiently large to satisfy the sampling conditions. For example, for generating a two-bit random number in each sampling period, the average delay of the delay chain taps, i.e., the average sampling interval d, and the root mean square (RMS) of the randomness jitter at the clock signal edges are considered. RJ Satisfies: d≤0.1RMS RJ In other words, the root mean square value of the random jitter of the jitter clock signal generated by the entropy source clock must be greater than or equal to ten times the average sampling interval.

[0117] According to embodiments of this disclosure, the jitter clock signal and the sampling clock signal propagate in the delay chain, such as Figure 2 and Figure 3 Each sampling point in the time delay chain can represent a tap in the time delay chain.

[0118] According to embodiments of this disclosure, an encoder can be used to determine the thermometer code of the jitter clock signal within the sampling period based on the jitter edge sampling information; and to determine the jitter edge position information of the jitter clock signal within the sampling period based on the thermometer code.

[0119] According to embodiments of this disclosure, the random number generation circuit further includes:

[0120] The delay control logic circuit is configured to adjust the delay of the jitter clock signal according to the number of random numbers associated with each preset edge position distribution interval, so as to align the jitter clock signal and the sampling clock signal at the edges.

[0121] The post-processing circuit is configured to post-process a random number sequence formed from multiple random numbers to eliminate bias in the random number sequence.

[0122] According to embodiments of this disclosure, the delay control logic circuit may include multiple input / output delay modules. The number of input / output delay modules can be determined based on the frequency of the signal generated by the entropy source clock, so that the adjustable range of the delay amount covers at least half of the sampling period of the entropy source clock. This is to ensure that the random number generation circuit can sample at least one jitter edge of a jitter clock signal with jitter.

[0123] According to embodiments of this disclosure, the delay control logic circuit can be constructed using the proprietary core inherent in the field-programmable gate array (FPGA) chip or using the logic resources in the chip.

[0124] According to embodiments of this disclosure, the post-processing circuit can eliminate bias in the random number sequence, improving randomness without reducing the random number generation rate.

[0125] According to embodiments of this disclosure, the random numbers generated by this disclosure are all truly random numbers.

[0126] Figure 5 A schematic diagram of the structure of a random number generation circuit according to an embodiment of the present disclosure is shown.

[0127] like Figure 5 As shown, the random number generation circuit includes an entropy source clock 510, a delay control logic circuit 520, a signal sampling converter 530, a random number encoding circuit 540, and a post-processing circuit 550.

[0128] According to embodiments of this disclosure, the entropy source clock 510 can generate a sampling clock signal and a jitter clock signal. The random number encoding circuit 540 can be a circuit for encoding a two-bit binary number, or it can be a three-bit, four-bit, etc. The random number encoding circuit 540 is used to sample the jitter clock signal to obtain jitter edge sampling information, and obtain jitter edge position information based on the jitter edge sampling information. The thermometer code represented by the jitter edge position information is encoded into a binary number by the signal sampling converter 530. The random number encoding circuit 540 quantizes this binary number into a random number. The processing circuit 550 can be a linear feedback shift register (LSFR) post-processing circuit. The linear feedback shift register can perform a shift-XOR operation on the generated true random number, eliminating the bias in the original sequence without changing the generation rate. The delay control logic circuit 520 can accumulate and count the jittered edge sampling information in the signal sampling converter 530 to adjust the delay amount of the input delay module, thereby changing the position of the actual edge and enabling the signal sampling converter 530 to sample the jittered actual clock edge in each sampling cycle. The control logic in the random number generation circuit accumulates and counts the intermediate sampling results in the delay chain of the signal sampling converter 530, and after a certain period, determines whether to change the delay amount based on the 0,1 ratio.

[0129] Figure 6A The schematic diagram illustrates the structure of an entropy source clock according to an embodiment of the present disclosure.

[0130] Figure 6B A schematic diagram of the structure of another entropy source clock according to an embodiment of the present disclosure is shown.

[0131] like Figure 6A As shown, an entropy source clock can be composed of components such as a frequency and phase detector, a charge pump, a loop filter, a voltage-controlled oscillator, and a frequency divider to generate a signal clock with jitter. The clock frequency can be adjusted according to the input clock.

[0132] like Figure 6BAs shown, the entropy source clock can be a ring oscillator, consisting of a series of inverters connected end-to-end. The more stages of inverters there are, the lower the generated clock frequency and the greater the random jitter of the signal clock. Therefore, a suitable ring oscillator can be constructed according to the requirements when selecting one.

[0133] Figure 7A The schematic diagram illustrates a structural schematic of a signal sampling converter according to an embodiment of the present disclosure.

[0134] Figure 7B A schematic diagram of the structure of a delay chain according to an embodiment of the present disclosure is shown.

[0135] like Figure 7A As shown, the signal sampling converter includes a series of delay chain basic units and a position encoding circuit. The delay chain basic unit consists of a delay chain and flip-flops connected to each tap of the delay chain. The position encoding circuit converts the thermometer code into binary code.

[0136] like Figure 7B As shown, the basic unit of the delay chain consists of a part of the total delay chain and flip-flops connected to each tap of the delay chain. Each basic unit of the delay chain includes 16 flip-flops, that is, 16 output terminals. The flip-flops sample the jitter clock signal on the delay chain and then output the thermometer code at the corresponding position.

[0137] Figure 8 A schematic diagram illustrating the sampling interval distribution according to an embodiment of the present disclosure is shown.

[0138] like Figure 8 As shown, in a single-clock-cycle two-bit high-speed true random number generator embodiment, the sampling interval distribution diagram of a delay chain, i.e., the bin width distribution diagram of the signal sampling converter, is presented. The code density method is a commonly used method for measuring the bin width of a signal sampling converter. The bin width is the delay amount of the delay chain taps, which is the sampling interval of the signal sampling converter. The code density method generates an external square wave signal uncorrelated with the system clock as an external trigger signal. Each rising edge of this signal triggers a time-to-digital converter to perform a time stamp measurement. Since the external trigger signal is uncorrelated with the system clock signal, the arrival time of the external trigger signal should be evenly distributed within one cycle of the system clock, and the number of events occurring at each delay chain tap, i.e., the number of measurements, should be proportional to the bin width.

[0139] In this embodiment of the disclosure, a delay chain was tested 1,000,000 times using the code density method described above, with a system sampling clock of 550 MHz and a period of 1 / 550 MHz = 1818.18 picoseconds. Figure 8As shown, the delay chain has a total of 698 taps. Therefore, the average delay of the delay chain taps, which is also the average sampling interval, is 1818.18 / 698 = 2.605 ps (picoseconds).

[0140] Figure 9 A schematic diagram of the structure of a post-processing circuit according to an embodiment of the present disclosure is shown.

[0141] like Figure 9 As shown, in the post-processing circuit, each random number is fed into a linear feedback shift register of a channel. A tapped XOR operation is performed on some registers in the two channels, that is, multiple random numbers are fed into a series of XOR gates as inputs, and the output is the random number finally generated by that channel.

[0142] According to embodiments of this disclosure, the randomness of random numbers generated by the random number generation method of this disclosure can be verified, and the results are shown in Table 1. The results show that for the 1000000000 bits of binary data in the test example, divided into 1000 groups of 1000000 data points of the same size, the pass rate exceeded 0.980, and the P-value exceeded 0.01, indicating that the randomness of the test example is very good.

[0143] Table 1

[0144] Test Project Name p-value By proportion Frequency test 0.488534 0.990 Intra-block frequency test 0.643366 0.997 Cumulative Sum Test 0.680755 0.988 Total number of trips test 0.939005 0.998 Longest run test within a block 0.094854 0.982 Rank test of a binary matrix 0.807412 0.992 Discrete Fourier Transform Test 0.268917 0.994 Non-overlapping template matching test 0.448424 0.995 Overlapping template matching test 0.246750 0.993 General Statistical Test 0.214439 0.991 Approximate Entropy Test 0.258307 0.986 Random walk state test 0.191178 0.996 Random walk frequency test 0.572544 0.995 Sequence testing 0.490483 0.992 Linear complexity test 0.231956 0.990

[0145] Figure 10 A block diagram of a chip according to an embodiment of the present disclosure is shown schematically.

[0146] like Figure 10 As shown, the chip 1000 in this embodiment includes a random number generation circuit 1010 according to this disclosure.

[0147] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions. Those skilled in the art will understand that the features recited in the various embodiments and / or claims of this disclosure can be combined and / or combined in various ways, even if such combinations or combinations are not expressly described in this disclosure. In particular, the features described in the various embodiments and / or claims of this disclosure may be combined and / or combined in various ways without departing from the spirit and teachings of this disclosure. All such combinations and / or combinations fall within the scope of this disclosure.

[0148] The embodiments of this disclosure have been described above. However, these embodiments are for illustrative purposes only and are not intended to limit the scope of this disclosure. Although various embodiments have been described above, this does not mean that the measures in the various embodiments cannot be used advantageously in combination. The scope of this disclosure is defined by the appended claims and their equivalents. Various substitutions and modifications can be made by those skilled in the art without departing from the scope of this disclosure, and all such substitutions and modifications should fall within the scope of this disclosure.

Claims

1. A method for generating random numbers, comprising: The jitter clock signal is sampled according to the sampling period of the sampling clock signal to obtain the jitter edge sampling information of the jitter clock signal, wherein the sampling clock signal and the jitter clock signal are generated by the same entropy source clock. Based on the jitter edge sampling information, the jitter edge position information of the jitter clock signal within the sampling period is determined, wherein the jitter edge position information is the offset position of the jitter clock signal relative to the sampled clock signal at the same sampling time. Based on the jitter edge position information, a target edge position distribution interval corresponding to the jitter edge position information is determined from a preset edge position distribution interval set. The preset edge position distribution interval set includes N preset edge position distribution intervals and a binary number corresponding to each preset edge position distribution interval, where N is an integer greater than 1. Generate random numbers based on the binary numbers corresponding to the distribution interval of the target edge positions; Also includes: Based on the jitter edge distribution position of the jitter clock signal, determine the normal distribution map related to the jitter edge distribution position; Divide the normal distribution graph into N equal parts to obtain N normal distribution intervals; Determine the binary number corresponding to each of the N normal distribution intervals, and use the N normal distribution intervals as the N preset edge position distribution intervals to obtain the preset edge position distribution interval set.

2. The method according to claim 1, wherein, The step of determining the jitter edge position information of the jitter clock signal within the sampling period based on the jitter edge sampling information includes: Based on the jitter edge sampling information, the temperature code of the jitter clock signal within the sampling period is determined; Based on the thermometer code, determine the jitter edge position information of the jitter clock signal within the sampling period.

3. The method according to claim 1, further comprising: The delay of the jitter clock signal is adjusted according to the number of random numbers associated with each of the preset edge position distribution intervals, so that the jitter clock signal and the sampling clock signal are edge aligned.

4. The method according to claim 1, further comprising: A random number sequence is constructed based on the multiple random numbers mentioned above; The random number sequence is post-processed to eliminate the bias in the random number sequence.

5. The method according to claim 1, wherein, The binary number is a number with at least two bits.

6. A random number generation circuit, comprising: Entropy source clock, configured to generate sampling clock signal and jitter clock signal; A signal sampling converter is configured to sample a jitter clock signal according to the sampling period of a sampling clock signal to obtain jitter edge sampling information of the jitter clock signal. Based on the jitter edge sampling information, the jitter edge position information of the jitter clock signal within the sampling period is determined. The jitter edge position information is the offset position of the jitter clock signal relative to the sampling clock signal at the same sampling time. Based on the jitter edge position information, a target edge position distribution interval corresponding to the jitter edge position information is determined from a preset edge position distribution interval set. The sampling clock signal and the jitter clock signal are generated by the same entropy source clock. The preset edge position distribution interval set includes N preset edge position distribution intervals and a binary number corresponding to each preset edge position distribution interval, where N is an integer greater than 1. The random number encoding circuit is configured to generate random numbers based on the binary numbers corresponding to the distribution interval of the target edge position; The preset edge position distribution interval set is obtained through the following operation: Based on the jitter edge distribution position of the jitter clock signal, determine the normal distribution map related to the jitter edge distribution position; Divide the normal distribution graph into N equal parts to obtain N normal distribution intervals; Determine the binary number corresponding to each of the N normal distribution intervals, and use the N normal distribution intervals as the N preset edge position distribution intervals to obtain the preset edge position distribution interval set.

7. The circuit according to claim 6, wherein, The signal sampling converter includes a delay chain, a trigger, and an encoder; The delay chain is configured to determine the sampling clock edge in the sampling clock signal; The trigger is configured to sample the jitter clock signal based on the sampling clock edge to obtain jitter edge sampling information of the jitter clock signal, and determine the jitter edge position information of the jitter clock signal within the sampling period based on the jitter edge sampling information. The encoder is configured to determine a target edge position distribution interval corresponding to the jitter edge position information from a preset edge position distribution interval set based on the jitter edge position information, and convert the jitter edge position information into a binary number corresponding to the target edge position distribution interval.

8. The circuit according to claim 6, further comprising: The delay control logic circuit is configured to adjust the delay of the jitter clock signal according to the number of random numbers associated with each of the preset edge position distribution intervals, so as to align the jitter clock signal and the sampling clock signal at their edges. The post-processing circuit is configured to post-process a random number sequence formed from the plurality of said random numbers to eliminate bias in the random number sequence.

9. A chip, comprising: The circuit as described in any one of claims 6 to 8.

Citation Information

Patent Citations

  • Power consumption and rate adjustable physical random number generation method

    CN110795063A

  • True random number generation circuit based on clock jitter and metastable state

    CN114968179A