WO2022027325A1 - Reconfigurable random number generator and implementation method therefor - Google Patents

Reconfigurable random number generator and implementation method therefor Download PDF

Info

Publication number
WO2022027325A1
WO2022027325A1 PCT/CN2020/107140 CN2020107140W WO2022027325A1 WO 2022027325 A1 WO2022027325 A1 WO 2022027325A1 CN 2020107140 W CN2020107140 W CN 2020107140W WO 2022027325 A1 WO2022027325 A1 WO 2022027325A1
Authority
WO
WIPO (PCT)
Prior art keywords
ring oscillator
random number
inverter
output
ring
Prior art date
Application number
PCT/CN2020/107140
Other languages
French (fr)
Chinese (zh)
Inventor
曹元�
陈帅
张睿
Original Assignee
武汉飞思灵微电子技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 武汉飞思灵微电子技术有限公司 filed Critical 武汉飞思灵微电子技术有限公司
Priority to CN202080080465.6A priority Critical patent/CN114902174A/en
Priority to PCT/CN2020/107140 priority patent/WO2022027325A1/en
Publication of WO2022027325A1 publication Critical patent/WO2022027325A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/58Random or pseudo-random number generators

Definitions

  • the invention relates to the technical field of random number generators, in particular to a reconfigurable random number generator and an implementation method thereof.
  • Random numbers are widely used in cryptography, Monte Carlo simulation, spread spectrum communication, statistical research, artificial intelligence, neural network and other engineering technology and scientific research fields.
  • the random number (key) used is completely random, and the length of the information to be encrypted is consistent and used once, the entire system will be absolutely secure. , unbreakable. Therefore, how to generate safe and reliable random numbers is of great significance to the entire cryptographic system, and thus to my country's national defense security, financial development, social stability and personal privacy.
  • true random number generators can be divided into four categories according to different entropy sources: 1. Based on environmental noise; 2. Based on chaos model; 3. Based on clock jitter; 4. Based on True random number generator for metastable circuits.
  • thermal noise is a good source of random entropy because its spectral distribution is relatively uniform and does not vary with the CMOS process. In early integrated circuits, this method was mostly used to extract random numbers. However, thermal noise is difficult to obtain, and an ultra-wide bandwidth, high-gain amplifier is usually required to amplify the noise, which is difficult to quantify.
  • the second type of chaotic system equations based on deterministic descriptions generate random numbers.
  • the third type is to use the jitter of the Ring Oscillator (Ring Oscillator, abbreviated as: RO) to generate true random numbers.
  • Ring Oscillator abbreviated as: RO
  • the advantage of this method is that it can be implemented on FPGA or ASIC conveniently and flexibly.
  • the principle is to use a clock with a slow jitter frequency to sample a fast jitter clock.
  • the fourth type is that the resource consumption and power consumption of the broadband amplifier are large.
  • a latch or static random access memory (SRAM) in metastable state can also be used to generate true random numbers, however, a true random generator for this entropy source generally requires a complex post-processing unit.
  • the random number generator As a widely used random number generator in the industry, although the random number generator based on ring oscillator has the advantages of easy implementation and small area, the mechanism is susceptible to process variations, temperature and voltage variations (process variations, voltage, thermal, Abbreviated as: PVT), which causes the random number output to be biased and affects the entropy value.
  • PVT process variations, voltage, thermal, Abbreviated as: PVT
  • the technical problem to be solved by the embodiments of the present invention is that although the random number generator based on the ring oscillator in the prior art has the advantages of easy implementation and small area, the mechanism is easily affected by process differences, temperature and voltage changes, resulting in The random number output is biased, affecting the entropy value.
  • the present invention provides a reconfigurable random number generator, comprising at least two ring oscillators, a sampling circuit, a counter and a logic control unit, specifically:
  • the ring oscillator includes n inverter groups, each inverter group is composed of at least two inverters arranged in parallel, and two selectors respectively arranged on the input side and the output side of the inverters ; where n is a natural number;
  • the control terminal of the corresponding selector in each inverter group is electrically connected with the logic control unit, and is used for receiving the reconstruction signal of the logic control unit and completing the specified inverter in each inverter group and its two
  • the selector on the side completes the conduction of the electrical signal channel;
  • the output terminals of the at least two ring oscillators are coupled to the input terminals of the counter; the output terminals of the counter are connected to the logic control unit; the sampling circuit obtains samples from the at least two ring oscillators an electrical signal, so as to output a random number according to the sampled electrical signal.
  • the logic control unit obtains the difference between the oscillation frequencies of the at least two ring oscillators through the counter, and is used to send a reconstruction signal to each selector in the ring oscillator, so as to adjust the frequency difference in the inverter group by adjusting
  • the selected inverters are passed through to complete the oscillation frequency difference between the ring oscillators is less than a preset threshold.
  • the output ends of the at least two ring oscillators are coupled to the input end of the counter, which specifically includes:
  • the output ends of the at least two ring oscillators are respectively connected to different input ports of the counter, so that the counter can complete the counting corresponding to the oscillation frequencies of different ring oscillators; or,
  • the output terminals of the at least two ring oscillators are connected to at least two input terminals of a count selector, and the output terminals of the count selector are connected to the input terminals of the counter, so that the logic control unit controls all the
  • the corresponding relationship between the input terminal and the output terminal that the counting selector is turned on is used to realize the counting of the oscillation frequency of the ring oscillator in sequence.
  • the ring oscillator further includes a NAND gate, and the inverter groups in the ring oscillator are cascaded, specifically:
  • the first input end of the NAND gate is connected with the enable signal; the second input end of the NAND gate is connected with the output port of the inverter group at the end of the cascade connection; the output of the NAND gate The terminal is used to connect the input port of the inverter group at the head of the cascade.
  • a random number source is formed by a first ring oscillator and a second ring oscillator in the random number generator, and the sampling circuit is formed by n D flip-flops, specifically:
  • each inverter group in the first ring oscillator is also respectively connected with the signal input port of a D flip-flop;
  • each inverter group in the second ring oscillator is also respectively connected with the clock input port of a D flip-flop;
  • the electrical signals of the output ports of the n D flip-flops in the sampling circuit form a random number.
  • the ring oscillator further includes m ordinary inverters, specifically:
  • the m ordinary inverters and the n inverter groups are cascaded according to a preset arrangement sequence
  • the preset sorting order includes:
  • the m ordinary inverters are cascaded, and the n inverter groups are cascaded; the m ordinary inverters after the cascade and the n inverters after the cascade to complete the cascade between; or,
  • the cascading is performed in a manner that the common inverters and the inverter groups are spaced apart from each other, wherein the distances spaced from each other are determined according to the proportional relationship between the m common inverters and the n inverter groups; or,
  • a random number source is composed of a third ring oscillator and a fourth ring oscillator in the random number generator, and the sampling circuit is composed of p D flip-flops, wherein n ⁇ p ⁇ m+n ,specific:
  • the output terminals of the specified inverter and/or the inverter group in the third ring oscillator are also respectively connected with the signal input ports of a D flip-flop;
  • the specified inverter group and/or the output terminals of the inverters are respectively connected with the clock input port of a D flip-flop;
  • the electrical signals of the output ports of the n D flip-flops in the sampling circuit form a random number.
  • the logic control unit is further configured to acquire excitation signals of one or more ring oscillators, specifically:
  • the logic control unit converts the excitation signal into a reconstructed signal corresponding to one or more ring oscillators
  • the logic control unit acquires the output oscillation frequency of one or more ring oscillators triggered by the excitation signal, and calculates a physically unclonable output result according to the corresponding oscillation frequency or the difference between the oscillation frequencies.
  • the excitation signal of the ring oscillator is specifically the output of a specified inverter group in the ring oscillator as a data source for calculating a physically unclonable output result.
  • the physical unclonable output result is calculated and obtained according to the corresponding oscillation frequency or the difference between the oscillation frequencies, which specifically includes:
  • the inverter is specifically one or more of a TTL NOT gate inverter, a CMOS inverter, a HPM disturbance effect inverter or a starvation inverter.
  • the at least two ring oscillators include a first ring oscillator, a second ring oscillator and a third ring oscillator
  • the first ring oscillator and the second ring oscillator form a random number source
  • the second ring oscillator and the third ring oscillator form a random number source
  • the first ring oscillator and the third ring oscillator constitute a random number source, and the second ring oscillator and the third ring oscillator constitute a random number source; or,
  • the first ring oscillator and the second ring oscillator constitute a random number source
  • the first ring oscillator and the third ring oscillator constitute a random number source
  • the present invention provides a method for implementing a reconfigurable random number generator, using the reconfigurable random number generator described in the first aspect, and the implementation method includes:
  • the logic control unit obtains the oscillation frequencies of the at least two ring oscillators through the counter;
  • the logic control unit determines the first ring oscillator and the second ring oscillator as a random number source, and analyzes the oscillation frequency difference of the first ring oscillator and the second ring oscillator;
  • the logic control unit sends a reconstruction signal to the first ring oscillator and/or the second ring oscillator, so as to control the first ring oscillator and the second ring oscillator
  • the selector in the oscillator completes the turn-on operation of the specified inverter signal channel in the corresponding inverter group;
  • the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than a preset threshold.
  • the adjustment of the reconstructed signal by the logic control unit one or more times, so that the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than a preset threshold specifically includes:
  • each time the reconstruction signal is adjusted if the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator can be reduced, the reconstruction signal at this time is retained as the reconstruction signal of the current state.
  • the oscillating frequency difference corresponding to the reconstructed signal in the current state is used to compare with the oscillating frequency difference under the next adjusted reconstructed signal, and the reconstructed signal with the smaller oscillating frequency difference is updated as the The reconstructed signal of the current state;
  • the traversing process is stopped until the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is smaller than a preset threshold.
  • the method further includes:
  • the logic control unit After completing the adjustment of the reconstructed signal by the logic control unit one or more times, so that the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than the preset threshold, the logic control unit will pass one or more times of logic The control unit adjusts the reconstruction signal of the third ring oscillator so that the difference between the oscillation frequencies of the first ring oscillator and the third ring oscillator is smaller than a preset threshold.
  • the reconfigurable ring oscillator proposed by the present invention can realize the calculation of the oscillation frequency difference between the output signals of different ring oscillators through the counter, and transmit it to the logic control unit as the result, and is controlled by the logic
  • the unit is used to further adjust the inverter group in the associated ring oscillator, so as to obtain the ring oscillator output that meets the conditions.
  • a solution for realizing a physically unclonable output result based on the reconfigurable ring oscillator is also proposed, and the implementation of the solution still relies on the present invention.
  • the core innovation point is the structure of the inverter group and the reconfiguration control of each inverter group in the ring oscillator by the logic control unit.
  • the reconfigurable function of each inverter group can keep the difference between the oscillation frequencies of the output data of the at least two ring oscillators for outputting random numbers within a preset threshold, thereby reducing the generation of random sequences
  • the bias of the circuit improves the adaptability to the environment, so that the circuit has the best performance in terms of power consumption, area, and efficiency of generating random numbers.
  • FIG. 1 is a schematic structural diagram of a reconfigurable random number generator provided by an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of an inverter group in a reconfigurable random number generator provided by an embodiment of the present invention
  • Fig. 3 is the structure schematic diagram of inverter group working state in a kind of reconfigurable random number generator provided by the embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a working state of an inverter group in a reconfigurable random number generator provided by an embodiment of the present invention
  • FIG. 5 is a schematic structural diagram of another reconfigurable random number generator provided by an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of another reconfigurable random number generator provided by an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of a ring oscillator provided by an embodiment of the present invention.
  • FIG. 8 is a schematic structural diagram of another ring oscillator provided by an embodiment of the present invention.
  • FIG. 9 is a schematic structural diagram of another reconfigurable random number generator provided by an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of another reconfigurable random number generator provided by an embodiment of the present invention.
  • FIG. 11 is a schematic flowchart of a method for implementing a reconfigurable random number generator according to an embodiment of the present invention
  • FIG. 12 is a schematic flowchart of a method for implementing a reconfigurable random number generator provided by an embodiment of the present invention
  • FIG. 13 is a schematic flowchart of a method for implementing a reconfigurable random number generator according to an embodiment of the present invention
  • FIG. 14 is a schematic structural diagram of a specific reconfigurable random number generator provided by an embodiment of the present invention.
  • 15 is a schematic structural diagram of a current starved inverter provided by an embodiment of the present invention.
  • 16 is a structural diagram of a D flip-flop provided by an embodiment of the present invention.
  • 17 is a timing diagram of a D flip-flop provided by an embodiment of the present invention.
  • FIG. 18 is a schematic flowchart of completing the reconstructed signal locking according to an embodiment of the present invention.
  • Embodiment 1 is a diagrammatic representation of Embodiment 1:
  • Embodiment 1 of the present invention provides a reconfigurable random number generator, as shown in FIG. 1 , including at least two ring oscillators (in FIG. 1 , the first ring oscillator to the yth ring oscillator are exemplified),
  • the sampling circuit, the counter and the logic control unit are described as at least two ring oscillators because in the specific implementation of the present invention, two ring oscillators are the minimum configuration requirements for forming a random number output,
  • the reconfigurable random number generator proposed in the embodiment of the present invention needs to output two or more random numbers at the same time in an actual application scenario, in this case, the corresponding ring oscillator will More than two or even more ring oscillators need to be configured.
  • the more ring oscillators are configured, the more random numbers that can be generated concurrently.
  • the reconfigurable random number generator includes:
  • the ring oscillator includes n inverter groups, as shown in FIG. 2 , each inverter group consists of at least two inverters arranged in parallel, and are respectively arranged on the input side of the inverters (ie, FIG. 2 ). 2) and two selectors on the output side (ie, the right side of the parallel inverters shown in FIG. 2); where n is a natural number.
  • the n has a certain correlation with the number of random numbers to be actually generated. Generally, the more the number of random numbers, the larger the corresponding value of n will be.
  • the description of the parallel-arranged inverters refers to the technical meaning that the selectors arranged on both sides of the inverters can be used to selectively perform electrical signals on at least two parallel-arranged inverters.
  • the function of channel conduction, in an inverter group, relative to the inverter with electrical signal conduction, other inverters will be in the state of electrical signal channel blocking, because they are located before and after the corresponding inverter.
  • the selector does not specify that the interface to which it is connected is turned on.
  • the control terminal of the corresponding selector in each inverter group is electrically connected with the logic control unit, and is used for receiving the reconstruction signal of the logic control unit and completing the specified inverter in each inverter group and its two
  • the selector on the side completes the conduction of the electrical signal channel.
  • the selector is controlled, and the inverter labeled 1 is selected to enter the conduction state of the electrical channel, while the other inverters labeled 2 to x are in the electrical channel blocking state.
  • the output terminals of the at least two ring oscillators are coupled to the input terminals of the counter; the output terminals of the counter are connected to the logic control unit; the sampling circuit obtains samples from the at least two ring oscillators an electrical signal, so as to output a random number according to the sampled electrical signal.
  • the reconfigurable ring oscillator proposed by the embodiment of the present invention can realize the calculation of the oscillation frequency difference between the output signals of different ring oscillators through a counter, and transmit it to the logic control unit as the result, and based on the above
  • the logic control unit further adjusts the inverter group in the associated ring oscillator (which can be understood as a control signal for outputting a random number), so as to obtain a ring oscillator output that meets the conditions.
  • the reconfigurable function of each inverter group can keep the difference between the oscillation frequencies of the output data of the at least two ring oscillators for outputting random numbers within a preset threshold, thereby reducing the generation of The bias of the random sequence improves the adaptability to the environment, so that the circuit has the best performance in terms of power consumption, area, and efficiency of generating random numbers.
  • the logic control unit acquires the difference between the oscillation frequencies of the at least two ring oscillators through the counter, and is used to send a reconstruction signal (the value of the reconstruction signal) to each selector in the ring oscillator.
  • the function is to select the strobe of the parallel inverters configured in each inverter group.
  • the reconstructed signal sent to each inverter group should be greater than 1bit), so that the oscillation frequency difference between ring oscillators can be completed by adjusting the selected inverters in the inverter group to be less than the preset threshold or the minimum value in the range.
  • the preset threshold here is an empirical value, which can be verified by testing the repeatability of random numbers.
  • the oscillation frequency difference obtained when the repeatability of random numbers meets the specified requirements can be set as the preset threshold. parameter value. Specifically, it can be verified in the early stage that the random number generated by the frequency difference between the two inverters can pass the random number standard test (for example, the NIST random number test standard).
  • the output terminals of the at least two ring oscillators can be coupled with the input terminals of the counter in various ways.
  • the counter itself includes a plurality of counting input ports, similar to In the connection structure relationship shown in FIG. 1, the counter can count the output oscillation frequencies of at least two ring oscillators at the same time, then the output ends of the at least two ring oscillators are respectively connected to different input ports of the counter, so that the The counters complete the counting of the oscillation frequencies corresponding to different ring oscillators; in practical applications, the number of counters has no direct correspondence with the output of the random number to be generated, and a counter can be provided for each output of the random number (as shown in Figure 1).
  • the output terminals of the at least two ring oscillators are connected to at least two input terminals of a count selector, and the output terminals of the count selector are connected to the input terminals of the counter, so that the logic control unit controls all the
  • the corresponding relationship between the input terminal and the output terminal that the counting selector is turned on is used to realize the counting of the oscillation frequency of the ring oscillator in sequence.
  • a NAND gate is usually set on the input port side of the ring oscillator, and the inverting phase in the ring oscillator is The cascade mode is formed between the device groups, specifically:
  • the first input terminal of the NAND gate is connected with the enable signal; the second input terminal of the NAND gate is connected to the inverter group at the end of the cascade (for example, the rightmost inverter in FIG. 5 )
  • the output port of the NAND gate is used to connect to the input port of the inverter group located in the cascade header (for example, the leftmost inverter group in FIG. 5 ).
  • a random number source is formed by a first ring oscillator and a second ring oscillator in the random number generator, and the sampling circuit is formed by n D flip-flops, as shown in FIG. 6 . ,specific:
  • each inverter group in the first ring oscillator is also respectively connected with the signal input port of a D flip-flop; in the second ring oscillator, the output ends of each inverter group are also respectively connected with a D flip-flop
  • the clock input ports of the n D flip-flops are connected to each other; the electrical signals of the output ports of the n D flip-flops in the sampling circuit form a random number.
  • the ring oscillator in addition to the cascaded implementation of a single inverter group similar to that illustrated in FIG. 1 , FIG. 5 and FIG.
  • the ring oscillator also includes m ordinary inverters (that is, in FIG. 8 and FIG. 7, the ordinary inverters that are cascaded with the above-mentioned inverter group), specifically of:
  • the m ordinary inverters and the n inverter groups are cascaded according to a preset arrangement sequence
  • the preset sorting order includes:
  • Mode 1 As shown in FIG. 7 , the m ordinary inverters are cascaded, and the n inverter groups are cascaded; the m ordinary inverters after the cascade are connected to the The cascade is completed between the n inverters after the cascade.
  • Mode 2 cascade the common inverters and inverter groups in a way that they are spaced apart from each other, wherein the distances spaced from each other are based on the m common inverters and n inverter groups.
  • the proportional relationship between them is determined. It should be noted here that both m and n here are natural numbers, and the values of n here and n corresponding to Figure 5 can be adjusted according to the needs of their respective application scenarios, which do not necessarily mean that the two are in their respective scenarios. The value below needs to be consistent between the two.
  • Mode 3 Between the m ordinary inverters and the n inverter groups, the cascading of the ordinary inverters and the inverter groups is completed in a random order.
  • the three-phase comparison method of method 2 forms a structure by cascading the regular expressions of each other at intervals.
  • Method 3 emphasizes that the settings are not set according to the specified rules. From a certain realization possibility, method 3 can bring more possibilities. , it can be understood that the uncertainty in the process of processing is further weakened by the random sorting method, so that it is possible to find a ring oscillator whose oscillation frequency characteristics exceed the regular mutual interval setting in the later testing process. .
  • the random ordering here is relative to the design circuit, and for the completed reconfigurable random number generator, the arrangement relationship between the inverter group in the corresponding ring oscillator and the ordinary inverter is a kind of The relationship is confirmed.
  • the random number generator is composed of a third ring oscillator and a fourth ring oscillator. a random number source, the random number generator further includes a sampling circuit, wherein the sampling circuit is composed of p D flip-flops, where n ⁇ p ⁇ m+n, as shown in FIG. 9, specifically:
  • the outputs of the specified inverters and/or inverter groups in the third ring oscillator are also respectively connected to the signal input ports of a D flip-flop; the inverter groups and/or inverter groups are specified in the fourth ring oscillator.
  • the output ends of the phaser are also respectively connected with the clock input ports of a D flip-flop; the electrical signals of the output ports of the n D flip-flops in the sampling circuit form a random number.
  • n refer to the structure shown in FIG. 10 .
  • the structures similar to those shown in Fig. 9 and Fig. 10 are only feasible solutions to present the key difference structures through the most concise diagrams.
  • the structures similar to those shown in Figs. 9 and 10 can be added to the above-mentioned expansion solutions.
  • a NAND gate is added to complete the enable signal control, and an extended implementation scheme of a single-input port counter similar to that shown in FIG. 5 can also be used.
  • An organic combination can be performed in each implementation scheme of the present invention, which will not be repeated here.
  • PAFs Physical Unclonable Functions
  • the present invention can further multiplex the above-mentioned reconfigurable random number generator into a physical unclonable function, realize circuit multiplexing, and save resources; the present invention can reconfigure the ring oscillator to adjust the two ring oscillators The relative frequency of , removes deterministic noise (such as manufacturing variance) or inherent bias caused by PVT, thereby ensuring the randomness of the output random number.
  • the reconfigurable random number generator proposed by the embodiment of the present invention is further multiplexed into a physical unclonable function, specifically:
  • the logic control unit is also used to obtain excitation signals of one or more ring oscillators (for example: directly input the excitation signals of one or more ring oscillators to the logic control unit through the host computer; the excitation signals may represent For the selection of the working output of the specified reflector group in each ring oscillator, the combination form of the reflector group working in the ring oscillator can be dynamically changed by adjusting the excitation signal, so that the ring oscillator can meet the requirements of a specific environment. ), the logic control unit converts the excitation signal into a reconstructed signal corresponding to one or more ring oscillators;
  • the logic control unit acquires the output oscillation frequency of one or more ring oscillators triggered by the excitation signal, and calculates a physically unclonable output result according to the corresponding oscillation frequency or the difference between the oscillation frequencies.
  • the physical unclonable output result is calculated and obtained according to the corresponding oscillation frequency or the difference between the oscillation frequencies, specifically including:
  • the method process integrates the true random number mode and the physical unclonable mode, and the working mode can be selected between the two in the specific method implementation process.
  • the corresponding method process includes:
  • step 101 the logic control unit performs frequency statistics on at least two ring oscillators through the counter to obtain a frequency difference.
  • the logic control unit performs frequency statistics on at least two ring oscillators through the counter to obtain a frequency difference.
  • step 102 if it is a true random number mode, then go to step 102 , if it is a physical unclonable mode, go to step 104 .
  • step 102 by adjusting the reconstructed signal one or more times by the logic control unit, different inverters are gated, so that the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than a preset value threshold.
  • step 103 the oscillator jitter caused by the phase noise of the two ring oscillators is sampled, and a random number is generated.
  • step 104 the logic control unit adjusts the reconstructed signal multiple times, selects different inverters, and obtains the oscillation frequency or the frequency difference of the ring oscillator each time.
  • step 105 a physical unclonable output result is calculated according to the corresponding oscillation frequency or the difference between the oscillation frequencies.
  • An embodiment of the present invention proposes a method for implementing a reconfigurable random number generator, using the reconfigurable random number generator described in Embodiment 1, as shown in FIG. 12 , the implementation method includes:
  • step 201 the logic control unit acquires the oscillation frequencies of the at least two ring oscillators through the counter.
  • step 202 the logic control unit determines the first ring oscillator and the second ring oscillator as a random number source, and analyzes the oscillation frequency difference of the first ring oscillator and the second ring oscillator.
  • step 203 if the oscillation frequency is greater than a preset threshold, the logic control unit sends a reconstruction signal to the first ring oscillator and/or the second ring oscillator, so as to control the first ring oscillator
  • the selector and the selector in the second ring oscillator complete the turn-on operation of the signal channel of the designated inverter in the corresponding inverter group.
  • step 204 the reconstructed signal is adjusted one or more times by the logic control unit, so that the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is smaller than a preset threshold.
  • the method for realizing the reconfigurable ring oscillator proposed by the embodiment of the present invention can realize the calculation of the oscillation frequency difference between the output signals of different ring oscillators through the counter, and transmit the difference to the logic control unit as the result, and based on the The logic control unit further adjusts the inverter group in the associated ring oscillator, so as to obtain the ring oscillator output that meets the conditions.
  • the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than a preset threshold, as shown in the figure. 12, including:
  • step 2041 by adjusting the reconstructed signal multiple times, the traversal of the selection control of the inverters for conducting electrical signals in each inverter group is completed one by one.
  • step 2042 each time the reconstructed signal is adjusted, if the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator can be reduced, the reconstructed signal at this time is kept as the current state.
  • the reconstructed signal, the oscillation frequency difference corresponding to the reconstructed signal in the current state is used to compare with the oscillation frequency difference under the reconstructed signal after the next adjustment, and the reconstructed signal with the smaller oscillation frequency difference is updated is the reconstructed signal of the current state.
  • step 2043 the traversal process is stopped until the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than a preset threshold.
  • Embodiment 1 and Embodiment 2 will further combine an example situation in the specific implementation process, and describe the process details of the implementation of the complete solution with the corresponding drawings.
  • a current starved inverter is further used to form a corresponding inverter group, thereby further improving the performance.
  • the circuit structure of this configurable random number generator is shown in Figure 14. It mainly includes two ring oscillators (ring oscillator RO1 and ring oscillator RO2), a counter, a group of D flip-flops, and a parallel-to-serial interface circuit (it can be seen that in the implementation scheme of Embodiment 1, the The parallel-to-serial interface circuit is not directly introduced, because, as an optional implementation solution, the parallel-to-serial interface circuit does not necessarily need to be integrated and implemented by the technical solutions of the embodiments of the present invention. It is realized by combining with peripheral circuits), and a group of control logic (C 0 ⁇ C 2n-1 , EN).
  • the control logic is responsible for switching the operating mode of the ring oscillator.
  • the reconfigurable random number generator in the embodiment of the present invention has two working modes: a random number generator mode and a physical unclonable function mode.
  • the two ring oscillators RO1 and RO2 are each composed of a NAND gate (NAND1, NAND2) and n inverter groups (IVs0 ⁇ IVsn-1, IVsn ⁇ IVs2n-1); each The inverter group is composed of a multiplexer (the one-of-two selector is taken as an example in the figure, which can be any multiplexer) and a current- starved inverter .
  • n D triggers
  • the generators (D 0 ⁇ D n-1 ) form a sampling circuit, which samples the oscillator jitter caused by the phase noise of the two ring oscillators to generate random numbers;
  • the count selection circuit is used in the random number generator mode to detect the ring oscillators
  • the working state is used to generate the output of the physical unclonable function in the physical unclonable function mode;
  • the logic control unit is used to configure the working state of the circuit (random number mode or physical unclonable function mode), and according to the output of the counting circuit, by reconstructing the signal (C 0 to C 2n-1 ) reconstruct the ring oscillator.
  • the two reconfigurable current-starved ring oscillators can be used as high-entropy random number generators or physically unclonable functions.
  • the parallel-to-serial interface output circuit is used to serially output the random numbers generated by the random number generator.
  • the jitter noises of the two current-starved ring oscillators operating in the subthreshold range are sampled from each other to generate high-entropy random numbers.
  • the current-starved ring oscillator works in the sub-threshold region, the noise of each stage of the current-starved ring oscillator will be larger, and the random number entropy value will be higher; in addition, working in the sub-threshold region can facilitate the control of the inverter. Therefore, the charging and discharging time of the inverter is controlled, the purpose of controlling the frequency of the ring oscillator is achieved, and the power consumption of the ring oscillator is controlled and reduced at the same time.
  • the sub-threshold region ring oscillator can reconstruct the inverter group (IVs 0 ⁇ IVs n-1 , IVs n ⁇ IVs 2n-1 ) by reconstructing the signals C 0 ⁇ C 2n -1 , so as to select Different current-starved inverters form an oscillator, which in turn adjusts the oscillation frequencies f RO1 and f RO2 of the ring oscillator.
  • the frequencies f RO1 and f RO2 of the two groups of ring oscillators are calculated by the bidirectional counter to calculate the frequency difference; the logic processing control circuit analyzes the frequency difference, and if the frequency difference does not meet the preset threshold, the reconstructed signals C 0 ⁇ C 2n- 1 to adjust the output frequency of the ring oscillator; when the frequency count difference between f RO1 and f RO2 is less than the preset threshold, the reconstruction signal is fixed; after that, each stage of the two groups of ring oscillators is reconstructed to the inverter
  • the output of the D flip-flop (D 0 ⁇ D n-1 ) is used as the data signal and clock signal to complete the sampling; using the oscillator jitter caused by the phase noise, the D flip-flop (D 0 ⁇ D n-1 ) will Continuously output random numbers in parallel; and then output a serial true random number bit stream through a parallel-to-serial interface circuit.
  • C 0 ⁇ C 2n-1 When working in the physical unclonable function mode, C 0 ⁇ C 2n-1 will be used as the excitation of the physical unclonable function; due to the random deviation generated in the manufacturing process of the integrated circuit, the output terminals of the two cascaded oscillators are extracted by the counter. Oscillation frequency difference; then the output of the physical unclonable function is obtained; by changing the excitation C 0 ⁇ C 2n-1 in the exponential space, the physical unclonable function generates a unique response based on a certain excitation C 0 ⁇ C 2n-1 .
  • the random number generator is an indispensable and important part of the existing information security system.
  • the physical unclonable function is used for security authentication or key generation, and is used to replace the existing key storage and security authentication mechanism based on volatile memory. It can effectively resist various physical attacks such as intrusive attacks.
  • the invention can configure the same circuit as a random number generator or a physical unclonable function, realizes circuit multiplexing and saves resources; the invention can reconstruct the ring oscillator to adjust the relative frequencies of the two ring oscillators, Remove deterministic noise (such as manufacturing differences) or inherent bias caused by PVT, thereby ensuring the randomness of output random numbers; the embodiment of the present invention uses a current starvation inverter to construct a random number generator, which has a better energy efficiency ratio; In the embodiment of the present invention, the current starved inverter is operated in a zero temperature state (Zero-TC), thereby further reducing the influence of temperature.
  • Zero-TC zero temperature state
  • the parallel-to-serial interface circuit includes n D flip-flops and (n-1) data selectors MUX;
  • the clock control terminals CLK of the N D flip-flops are connected to the clock signal Nf0, and the data selection control terminals of the (N-1) data selectors MUX are connected to the clock signal f0;
  • the input terminal D of the first D flip-flop is connected to the parallel input signal P0, the output terminal Q is connected to an input terminal of the first data selector MUX, and the output terminal of the first data selector is connected to the input of the second D flip-flop.
  • Terminal D the output terminal of the second D flip-flop is connected to an input terminal of the second data selector, and so on, the output terminal of the (N-1)th D flip-flop is connected to the (N-1)th data
  • the parallel output signals P1, P2...PN are sequentially connected to the other input terminals of the (N-1) data selectors MUX.
  • the inverter shown in FIG. 15 By adjusting the inverter shown in FIG. 15 to be a current starved inverter used in the embodiment of the present invention, it includes two PMOS devices M1 and M2 and two NMOS devices M3 and M4; the source of M1 is connected to a high power supply Voltage V dd ; the drain of M1 is connected to the source of M2, the drain of M2 is connected to the drain of M3, the source of M3 is connected to the drain of M4, and the source of M4 is grounded; the gate of M1 is connected to the bias voltage V p , the gate of M4 is connected to the bias voltage V n ; the gates of M2 and M3 are input terminals V i , and the drains of M2 and M3 are output terminals V o .
  • the bias voltages V P and V n make the inverter work in a zero temperature state (Zero-Tc), so that the random number generator is not easily affected by temperature.
  • the model principle is that the frequency of the ring oscillators RO1 and RO2 is determined by the delay of each stage of the inverter:
  • C 0 is the total circuit load
  • V dd is the power supply voltage
  • is the inverter circuit constant
  • ID is the saturation current
  • the channel length W, the channel width L, the gate-source voltage V GS , the gate capacitance C OX , the threshold voltage V t , and the carrier mobility ⁇ are the channel length, the channel width, the gate - source voltage, gate capacitance, threshold voltage and carrier mobility; further, the temperature coefficient of the switching current of the saturation current at temperature T is:
  • bias voltages V P and V n need to follow the following principles: that is, on the premise that the circuit can switch normally, make V GS as much as possible small.
  • FIG. 16 it is a schematic structural diagram of a D flip-flop (D 0 to Dn-1 ) provided by an embodiment of the present invention.
  • the D flip-flop includes two AND gates (AND_1, AND_2), two OR gates (AND_1, AND_2). NOT gate (NOR_1, NOR_2), 1 inverter (inverter), 1 capacitor C and 1 resistor R.
  • the clock control signal CLK is input to an input end of the AND gate AND_1 and an input end of the AND gate AND_2 respectively through the capacitor C.
  • a resistor R is connected to the connection between the capacitor C and the AND gate AND_1 and the AND gate AND_2, and the other end of the resistor R ground;
  • the input terminal of the inverter inverter is connected to the input signal D, and the output terminal is connected to the AND gate AND_1; the input terminal of the AND gate AND_1 is respectively connected to the output terminal of the inverter inverter and an input terminal of the AND gate AND_2; the input terminals of the AND gate AND_2 are respectively The input signal D and the AND gate AND_1 are connected, and the output terminal is connected to an input terminal of the NOR gate NOR_2; the input terminal of the NOR gate NOR_1 is respectively connected to the output terminal of the NOR gate NOR_2 of the output terminal of the AND gate AND_1, and the output terminal is connected to the NOR gate.
  • An input terminal of NOR_2 simultaneously outputs the output signal Q of the D flip-flop; the input terminal of the NOR gate NOR_2 is respectively connected to the output terminal of the NOR gate NOR_1 of the output terminal of the AND gate AND_2, and the output terminal is connected to an input terminal of the NOR gate NOR_1 , while outputting the output signal of the D flip-flop
  • the timing diagram when the D flip-flop generates a random signal is shown in Figure 17.
  • the trigger signal and clock control signal with similar frequencies are generated by two oscillators and input to the D and CLK terminals. Due to the deviation caused by jitter noise, the signals on CLK and D are not completely corresponding.
  • the rising edge of CLK corresponds to the high level on D
  • output 1 the falling edge of CLK corresponds to the low level on D
  • the rising edge of the next clock cycle corresponds to The low level on D outputs 0.
  • the frequencies of the two ring oscillators need to be as close as possible to generate enough frequency jitter to generate random numbers with high entropy.
  • the flowchart of the control logic unit searching for the optimal reconstruction signal C 0 -C 2n-1 is shown in FIG. 18 .
  • N1 is the count value of the oscillation frequency of the ring oscillator R01
  • N2 is the count value of the oscillation frequency of the ring oscillator R02
  • these C 0 ⁇ C 2n-1 can be directly input from the outside, and by comparing the frequency values of the two oscillators, under each input excitation, a unique response is generated; a typical response generation
  • the method is: if f RO1 >f RO2 , output 0, if f RO1 ⁇ f RO2 , output 1, and vice versa; different from the true random number generator, the frequency difference is sent to the control logic, only those frequency differences Outputs with a value large enough to be marked as stable bit outputs are discarded otherwise. In this way, the stability of the designed physical unclonable function is improved.
  • the delay unit as the basic structure of the oscillator, and use the E-TSPC type flip-flop as the counting unit of the bidirectional counter.
  • test result is also provided:
  • the circuit of this solution is implemented in a pure digital circuit on Xilinx Artix-7FPGA (using a common inverter instead of a current-starved inverter, because there are only common inverters in the FPGA ), use an oscilloscope to test the frequencies of the two ring oscillators RO, so as to observe whether the expected effect can be achieved through the reconstruction of the circuit of this scheme.
  • the first row is the frequency and frequency difference of the ring oscillator RO of the automatic layout and routing;
  • the second row is the frequency difference of the automatic placement and routing ring oscillator RO through the reconfiguration process
  • the third row is the frequency difference of the ring oscillator RO through the reconstruction process using manual placement and routing;

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Pure & Applied Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Manipulation Of Pulses (AREA)
  • Stabilization Of Oscillater, Synchronisation, Frequency Synthesizers (AREA)

Abstract

A reconfigurable random number generator and an implementation method therefor, the generator comprising at least two ring oscillators, a sampling circuit, a counter, and a logic control unit, a control end of a corresponding selector in each inverter group is electrically connected to the logic control unit, same being used for receiving a reconfiguration signal of the logic control unit, and for completing electrical signal channel conduction for a designated inverter and selectors at two sides thereof among the inverter groups; output ends of the at least two ring oscillators are coupled to an input end of the counter; an output end of the counter is connected to the logic control unit; and the sampling circuit obtains a sampled electrical signal from among the at least two ring oscillators, so as to facilitate outputting a random number according to the sampled electrical signal. The present generator can improve environmental adaptability, and allows a circuit to achieve optimal performance with respect to power consumption, size, efficiency in generating random numbers, etc.

Description

一种可重构随机数发生器及其实现方法A reconfigurable random number generator and its realization method 【技术领域】【Technical field】
本发明涉及随机数发生器技术领域,特别是涉及一种可重构随机数发生器及其实现方法。The invention relates to the technical field of random number generators, in particular to a reconfigurable random number generator and an implementation method thereof.
【背景技术】【Background technique】
随机数广泛应用于密码学、蒙特卡洛仿真、扩频通信,统计学研究,人工智能、神经网络等工程技术与科学研究领域。特别是在密码学领域,根据香农理论(Shannon Theory),只要保证所使用的随机数(密钥)是完全随机的,且与所要加密的信息长度一致并且一次使用,那整个系统将是绝对安全,不可破解的。因此,如何产生安全、可靠的随机数对于整个密码系统,进而对我国国防安全、金融发展、社会稳定和个人隐私有着极其重要的意义。Random numbers are widely used in cryptography, Monte Carlo simulation, spread spectrum communication, statistical research, artificial intelligence, neural network and other engineering technology and scientific research fields. Especially in the field of cryptography, according to Shannon Theory, as long as the random number (key) used is completely random, and the length of the information to be encrypted is consistent and used once, the entire system will be absolutely secure. , unbreakable. Therefore, how to generate safe and reliable random numbers is of great significance to the entire cryptographic system, and thus to my country's national defense security, financial development, social stability and personal privacy.
目前,在CMOS集成电路领域,真随机数发生器根据熵源的不同,主要可以分有四类:1、基于环境噪声的;2、基于混沌模型的;3、基于时钟抖动的;4、基于亚稳态电路的真随机数发生器。首先,第一类热噪声是一个很好的随机熵源,因为它的频谱分布相对均匀且不随CMOS工艺变化。早期集成电路内,大多采用该方式提取随机数。然而,热噪声难以获取,通常需要一个超宽带宽、高增益的放大器来放大噪声,难以完成量化。第二类基于确定性描述的混沌系统方程生成随机数,由于对初始条件极为敏感,因此生成的随机数具有长期的不可预测性。然而,该高熵值真随机数发生器一般由于要实现混沌图,具有较大的面积与功耗消耗。第三类是利用环形振荡器(Ring Oscillator,简写为:RO)的抖动(jitter)来产生真随机数。该方法的优势在于可以方便、灵活的在FPGA或者ASIC上实现。其原理是利用慢抖动频率的时钟来采样快速抖动时钟。第四类是宽频放大器资源消耗与功耗均较大。其次,处于亚稳态的锁存器或静态随机存储器(SRAM)也可用来产生真随机数,然而,该熵源的真随机发生器一般需要一个复杂的后处理单元。At present, in the field of CMOS integrated circuits, true random number generators can be divided into four categories according to different entropy sources: 1. Based on environmental noise; 2. Based on chaos model; 3. Based on clock jitter; 4. Based on True random number generator for metastable circuits. First, the first type of thermal noise is a good source of random entropy because its spectral distribution is relatively uniform and does not vary with the CMOS process. In early integrated circuits, this method was mostly used to extract random numbers. However, thermal noise is difficult to obtain, and an ultra-wide bandwidth, high-gain amplifier is usually required to amplify the noise, which is difficult to quantify. The second type of chaotic system equations based on deterministic descriptions generate random numbers. Since they are extremely sensitive to initial conditions, the generated random numbers have long-term unpredictability. However, the high-entropy true random number generator generally has a large area and power consumption due to the realization of a chaotic graph. The third type is to use the jitter of the Ring Oscillator (Ring Oscillator, abbreviated as: RO) to generate true random numbers. The advantage of this method is that it can be implemented on FPGA or ASIC conveniently and flexibly. The principle is to use a clock with a slow jitter frequency to sample a fast jitter clock. The fourth type is that the resource consumption and power consumption of the broadband amplifier are large. Second, a latch or static random access memory (SRAM) in metastable state can also be used to generate true random numbers, however, a true random generator for this entropy source generally requires a complex post-processing unit.
作为工业界应用广泛的随机数生成器,基于环形振荡器的随机数发生器尽管具有易实现、面积小等优势,但是该机制易受工艺差异、温度以及电压变化(process variations、voltage、thermal,简写为:PVT)的影响,导致随机数输出发生偏置,影响熵值。As a widely used random number generator in the industry, although the random number generator based on ring oscillator has the advantages of easy implementation and small area, the mechanism is susceptible to process variations, temperature and voltage variations (process variations, voltage, thermal, Abbreviated as: PVT), which causes the random number output to be biased and affects the entropy value.
鉴于此,克服该现有技术所存在的缺陷是本技术领域亟待解决的问题。In view of this, overcoming the defects of the prior art is an urgent problem to be solved in the technical field.
【发明内容】[Content of the invention]
本发明实施例要解决的技术问题是现有技术中的基于环形振荡器的随机数发生器尽管具有易实现、面积小等优势,但是该机制易受工艺差异、温度以及电压变化的影响,导致随机数输出发生偏置,影响熵值。The technical problem to be solved by the embodiments of the present invention is that although the random number generator based on the ring oscillator in the prior art has the advantages of easy implementation and small area, the mechanism is easily affected by process differences, temperature and voltage changes, resulting in The random number output is biased, affecting the entropy value.
本发明实施例采用如下技术方案:The embodiment of the present invention adopts the following technical solutions:
第一方面,本发明提供了一种可重构随机数发生器,包括至少两个环形振荡器、采样电路、计数器和逻辑控制单元,具体的:In a first aspect, the present invention provides a reconfigurable random number generator, comprising at least two ring oscillators, a sampling circuit, a counter and a logic control unit, specifically:
所述环形振荡器包括n个反相器组,每一个反相器组由至少两个并行设置的反相器,以及分别设置在所述反相器输入侧和输出侧的两个选择器构成;其 中,n为自然数;The ring oscillator includes n inverter groups, each inverter group is composed of at least two inverters arranged in parallel, and two selectors respectively arranged on the input side and the output side of the inverters ; where n is a natural number;
每一个反相器组中相应选择器的控制端与所述逻辑控制单元电气连接,用于接收所述逻辑控制单元的重构信号,并完成每一个反相器组中指定反相器与其两侧的选择器完成电信号通道导通;The control terminal of the corresponding selector in each inverter group is electrically connected with the logic control unit, and is used for receiving the reconstruction signal of the logic control unit and completing the specified inverter in each inverter group and its two The selector on the side completes the conduction of the electrical signal channel;
所述至少两个环形振荡器的输出端与所述计数器的输入端耦合;所述计数器的输出端与所述逻辑控制单元连接;所述采样电路从所述至少两个环形振荡器中获取采样电信号,以便于根据所述采样电信号输出随机数。The output terminals of the at least two ring oscillators are coupled to the input terminals of the counter; the output terminals of the counter are connected to the logic control unit; the sampling circuit obtains samples from the at least two ring oscillators an electrical signal, so as to output a random number according to the sampled electrical signal.
优选的,所述逻辑控制单元通过所述计数器获取所述至少两个环形振荡器的振荡频率差值,用于给环形振荡器中各个选择器发送重构信号,以便通过调整反相器组中选择通过的反相器来完成环形振荡器之间振荡频率差值小于预设阈值。Preferably, the logic control unit obtains the difference between the oscillation frequencies of the at least two ring oscillators through the counter, and is used to send a reconstruction signal to each selector in the ring oscillator, so as to adjust the frequency difference in the inverter group by adjusting The selected inverters are passed through to complete the oscillation frequency difference between the ring oscillators is less than a preset threshold.
优选的,所述至少两个环形振荡器的输出端与所述计数器的输入端耦合,具体包括:Preferably, the output ends of the at least two ring oscillators are coupled to the input end of the counter, which specifically includes:
所述至少两个环形振荡器的输出端分别与计数器的不同输入端口相连,以便于所述计数器完成对应不同环形振荡器的振荡频率的计数;或者,The output ends of the at least two ring oscillators are respectively connected to different input ports of the counter, so that the counter can complete the counting corresponding to the oscillation frequencies of different ring oscillators; or,
所述至少两个环形振荡器的输出端与计数选择器的至少两个输入端相连,所述计数选择器的输出端与所述计数器的输入端相连,以便于通过所述逻辑控制单元控制所述计数选择器导通的输入端与输出端对应关系,实现依次对环形振荡器的振荡频率的计数。The output terminals of the at least two ring oscillators are connected to at least two input terminals of a count selector, and the output terminals of the count selector are connected to the input terminals of the counter, so that the logic control unit controls all the The corresponding relationship between the input terminal and the output terminal that the counting selector is turned on is used to realize the counting of the oscillation frequency of the ring oscillator in sequence.
优选的,所述环形振荡器还包括一个与非门,所述环形振荡器中的反相器组之间形成级联,具体的:Preferably, the ring oscillator further includes a NAND gate, and the inverter groups in the ring oscillator are cascaded, specifically:
所述与非门的第一输入端与使能信号连接;所述与非门的第二输入端与位于所述级联末端的反相器组的输出端口连接;所述与非门的输出端用于连接位于所述级联首部的反相器组的输入端口。The first input end of the NAND gate is connected with the enable signal; the second input end of the NAND gate is connected with the output port of the inverter group at the end of the cascade connection; the output of the NAND gate The terminal is used to connect the input port of the inverter group at the head of the cascade.
优选的,在所述随机数发生器中由第一环形振荡器和第二环形振荡器构成一随机数源,所述采样电路由n个D触发器构成,具体的:Preferably, a random number source is formed by a first ring oscillator and a second ring oscillator in the random number generator, and the sampling circuit is formed by n D flip-flops, specifically:
在第一环形振荡器内各反相器组的输出端还分别与一个D触发器的信号输入端口相连;The output ends of each inverter group in the first ring oscillator are also respectively connected with the signal input port of a D flip-flop;
在第二环形振荡器内各反相器组的输出端还分别与一个D触发器的时钟输入端口相连;The output ends of each inverter group in the second ring oscillator are also respectively connected with the clock input port of a D flip-flop;
所述采样电路中n个D触发器的输出端口的电信号构成一随机数。The electrical signals of the output ports of the n D flip-flops in the sampling circuit form a random number.
优选的,所述环形振荡器还包括m个普通反相器,具体的:Preferably, the ring oscillator further includes m ordinary inverters, specifically:
所述m个普通反相器和n个反相器组按照预设的排列顺序进行级联;The m ordinary inverters and the n inverter groups are cascaded according to a preset arrangement sequence;
其中,预设的排列顺序包括:Among them, the preset sorting order includes:
所述m个普通反相器之间进行级联,所述n个反相器组之间进行级联;级联之后的m个普通反相器与所述级联之后的n个反相器之间完成级联;或者,The m ordinary inverters are cascaded, and the n inverter groups are cascaded; the m ordinary inverters after the cascade and the n inverters after the cascade to complete the cascade between; or,
以普通反相器和反相器组相互间隔的方式进行级联,其中,相互间隔的距离根据所述m个普通反相器与n个反相器组按照之间的比例关系确定;或者,The cascading is performed in a manner that the common inverters and the inverter groups are spaced apart from each other, wherein the distances spaced from each other are determined according to the proportional relationship between the m common inverters and the n inverter groups; or,
所述m个普通反相器和n个反相器组之间,按照随机排序的方式完成各普通反相器和反相器组的级联。Between the m ordinary inverters and the n inverter groups, the cascading of the ordinary inverters and the inverter groups is completed in a random order.
优选的,在所述随机数发生器中由第三环形振荡器和第四环形振荡器构成一随机数源,所述采样电路由p个D触发器构成,其中,n≤p≤m+n,具体的:Preferably, a random number source is composed of a third ring oscillator and a fourth ring oscillator in the random number generator, and the sampling circuit is composed of p D flip-flops, wherein n≤p≤m+n ,specific:
在第三环形振荡器内指定反相器和/或反相器组的输出端还分别与一个D触发器的信号输入端口相连;The output terminals of the specified inverter and/or the inverter group in the third ring oscillator are also respectively connected with the signal input ports of a D flip-flop;
在第四环形振荡器内指定反相器组和/或反相器的输出端还分别与一个D触发器的时钟输入端口相连;In the fourth ring oscillator, the specified inverter group and/or the output terminals of the inverters are respectively connected with the clock input port of a D flip-flop;
所述采样电路中n个D触发器的输出端口的电信号构成一随机数。The electrical signals of the output ports of the n D flip-flops in the sampling circuit form a random number.
优选的,在所述随机数发生器工作在物理不可克隆函数模式时,所述逻辑控制单元还用于获取一个或者多个环形振荡器的激励信号,具体的:Preferably, when the random number generator works in a physical unclonable function mode, the logic control unit is further configured to acquire excitation signals of one or more ring oscillators, specifically:
所述逻辑控制单元将所述激励信号转换为相应一个或者多个环形振荡器的重构信号;The logic control unit converts the excitation signal into a reconstructed signal corresponding to one or more ring oscillators;
所述逻辑控制单元获取由所述激励信号触发的一个或者多个环形振荡器的输出振荡频率,并根据相应振荡频率或者振荡频率的差值,计算得到物理不可克隆输出结果。The logic control unit acquires the output oscillation frequency of one or more ring oscillators triggered by the excitation signal, and calculates a physically unclonable output result according to the corresponding oscillation frequency or the difference between the oscillation frequencies.
优选的,所述环形振荡器的激励信号具体为针对环形振荡器中的指定反相器组输出作为计算物理不可克隆输出结果的数据源。Preferably, the excitation signal of the ring oscillator is specifically the output of a specified inverter group in the ring oscillator as a data source for calculating a physically unclonable output result.
优选的,所述并根据相应振荡频率或者振荡频率的差值,计算得到物理不可克隆输出结果,具体包括:Preferably, the physical unclonable output result is calculated and obtained according to the corresponding oscillation frequency or the difference between the oscillation frequencies, which specifically includes:
振荡频率的差值大于0,则输出0,振荡频率的差值小于0则输出1;或者,If the difference between the oscillation frequencies is greater than 0, output 0, and if the difference between the oscillation frequencies is less than 0, output 1; or,
振荡频率的差值大于0,则输出1,振荡频率的差值小于0则输出0;或者,If the difference of oscillation frequency is greater than 0, output 1, and if the difference of oscillation frequency is less than 0, output 0; or,
取振荡频率小数点后指定长度参数值作为整数值输出。Take the value of the specified length parameter after the decimal point of the oscillation frequency and output it as an integer value.
优选的,所述反相器具体为TTL非门反相器、CMOS反相器、HPM扰乱效应反相器或者饥饿型反相器中的一种或者多种。Preferably, the inverter is specifically one or more of a TTL NOT gate inverter, a CMOS inverter, a HPM disturbance effect inverter or a starvation inverter.
优选的,在所述至少两个环形振荡器包括第一环形振荡器、第二环形振荡器和第三环形振荡器时,Preferably, when the at least two ring oscillators include a first ring oscillator, a second ring oscillator and a third ring oscillator,
所述第一环形振荡器和第二环形振荡器构成一随机数源,所述第二环形振荡器和第三环形振荡器构成一随机数源;或者,The first ring oscillator and the second ring oscillator form a random number source, and the second ring oscillator and the third ring oscillator form a random number source; or,
所述第一环形振荡器和第三环形振荡器构成一随机数源,所述第二环形振荡器和第三环形振荡器构成一随机数源;或者,The first ring oscillator and the third ring oscillator constitute a random number source, and the second ring oscillator and the third ring oscillator constitute a random number source; or,
所述第一环形振荡器和第二环形振荡器构成一随机数源,所述第一环形振荡器和第三环形振荡器构成一随机数源。The first ring oscillator and the second ring oscillator constitute a random number source, and the first ring oscillator and the third ring oscillator constitute a random number source.
第二方面,本发明提供了一种可重构随机数发生器的实现方法,使用如第一方面所述的可重构随机数发生器,实现方法包括:In a second aspect, the present invention provides a method for implementing a reconfigurable random number generator, using the reconfigurable random number generator described in the first aspect, and the implementation method includes:
逻辑控制单元通过所述计数器获取所述至少两个环形振荡器的振荡频率;The logic control unit obtains the oscillation frequencies of the at least two ring oscillators through the counter;
所述逻辑控制单元确定作为一随机数源的第一环形振荡器和第二环形振荡器,并分析所述第一环形振荡器和第二环形振荡器的振荡频率差值;The logic control unit determines the first ring oscillator and the second ring oscillator as a random number source, and analyzes the oscillation frequency difference of the first ring oscillator and the second ring oscillator;
若所述振荡频率大于预设阈值,所述逻辑控制单元向所述第一环形振荡器和/或第二环形振荡器发送重构信号,以便于控制所述第一环形振荡器和第二环形振荡器中的选择器,完成相应反相器组中指定反相器信号通道导通操作;If the oscillation frequency is greater than a preset threshold, the logic control unit sends a reconstruction signal to the first ring oscillator and/or the second ring oscillator, so as to control the first ring oscillator and the second ring oscillator The selector in the oscillator completes the turn-on operation of the specified inverter signal channel in the corresponding inverter group;
通过一次或者多次逻辑控制单元对重构信号的调整,使得所述第一环形振 荡器和第二环形振荡器的振荡频率差值小于预设阈值。By adjusting the reconstructed signal one or more times by the logic control unit, the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than a preset threshold.
优选的,所述通过一次或者多次逻辑控制单元对重构信号的调整,使得所述第一环形振荡器和第二环形振荡器的振荡频率差值小于预设阈值,具体包括:Preferably, the adjustment of the reconstructed signal by the logic control unit one or more times, so that the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than a preset threshold, specifically includes:
通过多次对重构信号的调整,逐一完成对各个反相器组中的用于电信号导通的反相器的选择控制的遍历;By adjusting the reconstructed signal multiple times, the traversal of the selection control of the inverters used for electrical signal conduction in each inverter group is completed one by one;
其中,每一次对重构信号的调整,若能促使所述第一环形振荡器和第二环形振荡器的振荡频率差值减小,则保留此时的重构信号为当前状态的重构信号,所述当前状态的重构信号所对应的振荡频率差,用于与下一次调整后的重构信号下的振荡频率差进行比较,取其中振荡频率差更小的重构信号更新为所述当前状态的重构信号;Wherein, each time the reconstruction signal is adjusted, if the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator can be reduced, the reconstruction signal at this time is retained as the reconstruction signal of the current state. , the oscillating frequency difference corresponding to the reconstructed signal in the current state is used to compare with the oscillating frequency difference under the next adjusted reconstructed signal, and the reconstructed signal with the smaller oscillating frequency difference is updated as the The reconstructed signal of the current state;
直到所述第一环形振荡器和第二环形振荡器的振荡频率差值小于预设阈值,停止所述遍历过程。The traversing process is stopped until the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is smaller than a preset threshold.
优选的,若还包括第三环形振荡器,并且由第一环形振荡器和第三环形振荡器构成另一随机数源时,方法还包括:Preferably, if a third ring oscillator is further included, and another random number source is formed by the first ring oscillator and the third ring oscillator, the method further includes:
在完成所述一次或者多次逻辑控制单元对重构信号的调整,使得所述第一环形振荡器和第二环形振荡器的振荡频率差值小于预设阈值后,再通过一次或者多次逻辑控制单元对第三环形振荡器的重构信号的调整,使得所述第一环形振荡器和第三环形振荡器的振荡频率差值小于预设阈值。After completing the adjustment of the reconstructed signal by the logic control unit one or more times, so that the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than the preset threshold, the logic control unit will pass one or more times of logic The control unit adjusts the reconstruction signal of the third ring oscillator so that the difference between the oscillation frequencies of the first ring oscillator and the third ring oscillator is smaller than a preset threshold.
与现有技术相比,本发明实施例的有益效果在于:Compared with the prior art, the beneficial effects of the embodiments of the present invention are:
本发明提出的可重构环形振荡器,可以通过计数器实现不同环形振荡器之间的输出信号之间振荡频率差值计算,并将其作为结果传递给逻辑控制单元,并基由所述逻辑控制单元来进一步调整关联的环形振荡器中反相器组,从而得到满足条件的环形振荡器输出。The reconfigurable ring oscillator proposed by the present invention can realize the calculation of the oscillation frequency difference between the output signals of different ring oscillators through the counter, and transmit it to the logic control unit as the result, and is controlled by the logic The unit is used to further adjust the inverter group in the associated ring oscillator, so as to obtain the ring oscillator output that meets the conditions.
进一步的,在本发明的优选实现方案中,还提出了一种基于所述可重构环形振荡器来实现物理不可克隆输出结果的解决方案,而所述解决方案实现仍然依靠的是本发明的核心创新点,即反相器组结构,以及逻辑控制单元对环形振荡器中各反相器组的重构控制。Further, in a preferred implementation scheme of the present invention, a solution for realizing a physically unclonable output result based on the reconfigurable ring oscillator is also proposed, and the implementation of the solution still relies on the present invention. The core innovation point is the structure of the inverter group and the reconfiguration control of each inverter group in the ring oscillator by the logic control unit.
在本发明中,各反相器组的可重构功能可以使用于输出随机数的至少两个环形振荡器的输出数据的振荡频率之差保持在一个预设阈值内,从而减小产生随机序列的偏置,提高对环境的适应能力,让电路在功耗,面积,产生随机数的效率等方面性能最优。In the present invention, the reconfigurable function of each inverter group can keep the difference between the oscillation frequencies of the output data of the at least two ring oscillators for outputting random numbers within a preset threshold, thereby reducing the generation of random sequences The bias of the circuit improves the adaptability to the environment, so that the circuit has the best performance in terms of power consumption, area, and efficiency of generating random numbers.
【附图说明】【Description of drawings】
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention, and for those of ordinary skill in the art, other drawings can also be obtained from these drawings without creative effort.
图1是本发明实施例提供的一种可重构随机数发生器结构示意图;1 is a schematic structural diagram of a reconfigurable random number generator provided by an embodiment of the present invention;
图2是本发明实施例提供的一种可重构随机数发生器中反相器组结构示意图;2 is a schematic structural diagram of an inverter group in a reconfigurable random number generator provided by an embodiment of the present invention;
图3是本发明实施例提供的一种可重构随机数发生器中反相器组工作状态 结构示意图;Fig. 3 is the structure schematic diagram of inverter group working state in a kind of reconfigurable random number generator provided by the embodiment of the present invention;
图4是本发明实施例提供的一种可重构随机数发生器中反相器组工作状态结构示意图;4 is a schematic structural diagram of a working state of an inverter group in a reconfigurable random number generator provided by an embodiment of the present invention;
图5是本发明实施例提供的另一种可重构随机数发生器结构示意图;5 is a schematic structural diagram of another reconfigurable random number generator provided by an embodiment of the present invention;
图6是本发明实施例提供的另一种可重构随机数发生器结构示意图;6 is a schematic structural diagram of another reconfigurable random number generator provided by an embodiment of the present invention;
图7是本发明实施例提供的一种环形振荡器结构示意图;7 is a schematic structural diagram of a ring oscillator provided by an embodiment of the present invention;
图8是本发明实施例提供的另一种环形振荡器结构示意图;8 is a schematic structural diagram of another ring oscillator provided by an embodiment of the present invention;
图9是本发明实施例提供的另一种可重构随机数发生器结构示意图;9 is a schematic structural diagram of another reconfigurable random number generator provided by an embodiment of the present invention;
图10是本发明实施例提供的还一种可重构随机数发生器结构示意图;10 is a schematic structural diagram of another reconfigurable random number generator provided by an embodiment of the present invention;
图11是本发明实施例提供的一种可重构随机数发生器实现方法流程示意图;11 is a schematic flowchart of a method for implementing a reconfigurable random number generator according to an embodiment of the present invention;
图12是本发明实施例提供的一种可重构随机数发生器实现方法流程示意图;12 is a schematic flowchart of a method for implementing a reconfigurable random number generator provided by an embodiment of the present invention;
图13是本发明实施例提供的一种可重构随机数发生器实现方法流程示意图;13 is a schematic flowchart of a method for implementing a reconfigurable random number generator according to an embodiment of the present invention;
图14是本发明实施例提供的具体一种可重构随机数发生器结构示意图;14 is a schematic structural diagram of a specific reconfigurable random number generator provided by an embodiment of the present invention;
图15是本发明实施例提供的一种电流饥饿型反相器结构示意图;15 is a schematic structural diagram of a current starved inverter provided by an embodiment of the present invention;
图16是本发明实施例提供的一种为D触发器结构图;16 is a structural diagram of a D flip-flop provided by an embodiment of the present invention;
图17是本发明实施例提供的一种为D触发器时序图;17 is a timing diagram of a D flip-flop provided by an embodiment of the present invention;
图18是本发明实施例提供的一种完成重构信号锁定的流程示意图。FIG. 18 is a schematic flowchart of completing the reconstructed signal locking according to an embodiment of the present invention.
【具体实施方式】【detailed description】
为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本发明,并不用于限定本发明。In order to make the objectives, technical solutions and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention, but not to limit the present invention.
在本发明的描述中,术语“内”、“外”、“纵向”、“横向”、“上”、“下”、“顶”、“底”等指示的方位或位置关系为基于附图所示的方位或位置关系,仅是为了便于描述本发明而不是要求本发明必须以特定的方位构造和操作,因此不应当理解为对本发明的限制。In the description of the present invention, the orientation or positional relationship indicated by the terms "inner", "outer", "longitudinal", "lateral", "upper", "lower", "top", "bottom", etc. are based on the drawings The orientation or positional relationship shown is only for the convenience of describing the present invention rather than requiring the present invention to be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the present invention.
此外,下面所描述的本发明各个实施方式中所涉及到的技术特征只要彼此之间未构成冲突就可以相互组合。In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.
实施例1:Embodiment 1:
本发明实施例1提供了一种可重构随机数发生器,如图1所示,包括至少两个环形振荡器(图1中示例了包含第一环形振荡器~第y环形振荡器)、采样电路、计数器和逻辑控制单元,其中,之所以描述为至少两个环形振荡器,是因为在本发明具体实现方式中,两个环形振荡器是构成一个随机数输出而言最低的配置要求,而作为可选的实现方案,若实际应用场景中,需要本发明实施例所提出的可重构随机数发生器同时输出两个或者两个以上的随机数,此时,相应的环形振荡器就需要配置有两个以上,甚至于更多个环形振荡器,环形振荡器配置的越多,同时能够并发生成的随机数也将更多。对于本发明实施例而言,所述可重构随机数发生器中包括: Embodiment 1 of the present invention provides a reconfigurable random number generator, as shown in FIG. 1 , including at least two ring oscillators (in FIG. 1 , the first ring oscillator to the yth ring oscillator are exemplified), The sampling circuit, the counter and the logic control unit are described as at least two ring oscillators because in the specific implementation of the present invention, two ring oscillators are the minimum configuration requirements for forming a random number output, As an optional implementation solution, if the reconfigurable random number generator proposed in the embodiment of the present invention needs to output two or more random numbers at the same time in an actual application scenario, in this case, the corresponding ring oscillator will More than two or even more ring oscillators need to be configured. The more ring oscillators are configured, the more random numbers that can be generated concurrently. For this embodiment of the present invention, the reconfigurable random number generator includes:
所述环形振荡器包括n个反相器组,如图2所示,每一个反相器组由至少两个并行设置的反相器,以及分别设置在所述反相器输入侧(即图2中所示的并行排列的反相器的左侧)和输出侧(即图2中所示的并行排列的反相器的右 侧)的两个选择器构成;其中,n为自然数。所述n与实际要产生的随机数位数有一定的关联性,通常情况下随机数位数越多,相应的n的取值也会越大。The ring oscillator includes n inverter groups, as shown in FIG. 2 , each inverter group consists of at least two inverters arranged in parallel, and are respectively arranged on the input side of the inverters (ie, FIG. 2 ). 2) and two selectors on the output side (ie, the right side of the parallel inverters shown in FIG. 2); where n is a natural number. The n has a certain correlation with the number of random numbers to be actually generated. Generally, the more the number of random numbers, the larger the corresponding value of n will be.
此处,描述的并行设置的反相器,其指代的技术含义是,通过设置在反相器两侧的选择器,可以起到对至少两个并行设置的反相器择一进行电信号通道导通的作用,在一个反相器组中,相对于电信号导通的反相器而言,其它的反相器将处于电信号通道阻隔的状态,这是因为位于相应反相器前后的选择器并未指定与之连接的接口导通。Here, the description of the parallel-arranged inverters refers to the technical meaning that the selectors arranged on both sides of the inverters can be used to selectively perform electrical signals on at least two parallel-arranged inverters. The function of channel conduction, in an inverter group, relative to the inverter with electrical signal conduction, other inverters will be in the state of electrical signal channel blocking, because they are located before and after the corresponding inverter. The selector does not specify that the interface to which it is connected is turned on.
每一个反相器组中相应选择器的控制端与所述逻辑控制单元电气连接,用于接收所述逻辑控制单元的重构信号,并完成每一个反相器组中指定反相器与其两侧的选择器完成电信号通道导通。例如,图3所示的反相器组中通过选择器控制,选择了其中标号为1的反相器进入电气通道导通状态,而其它标号为2~x的反相器则处于电气通道阻隔状态;如图4所示,反相器组中通过选择器控制,选择了其中标号为2的反相器进入电气通道导通状态,而其它标号为1,3~x的反相器则处于电气通道阻隔状态。需要指出的是,在本发明实施例中单纯从选择器的控制功能来说,属于本领域已经成熟的技术内容,而本发明创新点在于将其使用到本发明实施例所阐述的整体结构技术方案中。The control terminal of the corresponding selector in each inverter group is electrically connected with the logic control unit, and is used for receiving the reconstruction signal of the logic control unit and completing the specified inverter in each inverter group and its two The selector on the side completes the conduction of the electrical signal channel. For example, in the inverter group shown in Figure 3, the selector is controlled, and the inverter labeled 1 is selected to enter the conduction state of the electrical channel, while the other inverters labeled 2 to x are in the electrical channel blocking state. state; as shown in Figure 4, the inverter group is controlled by the selector, and the inverter labeled 2 is selected to enter the conduction state of the electrical channel, while the other inverters labeled 1, 3~x are in the state of conduction. Electrical channel barrier status. It should be pointed out that in the embodiment of the present invention, purely from the control function of the selector, it belongs to the mature technical content in the field, and the innovation of the present invention is to apply it to the overall structural technology described in the embodiment of the present invention. in the plan.
所述至少两个环形振荡器的输出端与所述计数器的输入端耦合;所述计数器的输出端与所述逻辑控制单元连接;所述采样电路从所述至少两个环形振荡器中获取采样电信号,以便于根据所述采样电信号输出随机数。The output terminals of the at least two ring oscillators are coupled to the input terminals of the counter; the output terminals of the counter are connected to the logic control unit; the sampling circuit obtains samples from the at least two ring oscillators an electrical signal, so as to output a random number according to the sampled electrical signal.
本发明实施例提出的可重构环形振荡器,可以通过计数器实现不同环形振荡器之间的输出信号之间振荡频率差值计算,并将其作为结果传递给逻辑控制单元,并基由所述逻辑控制单元来进一步调整关联的环形振荡器中反相器组(可以理解为用于输出一个随机数的控制信号),从而得到满足条件的环形振荡器输出。The reconfigurable ring oscillator proposed by the embodiment of the present invention can realize the calculation of the oscillation frequency difference between the output signals of different ring oscillators through a counter, and transmit it to the logic control unit as the result, and based on the above The logic control unit further adjusts the inverter group in the associated ring oscillator (which can be understood as a control signal for outputting a random number), so as to obtain a ring oscillator output that meets the conditions.
在本发明实施例中,各反相器组的可重构功能可以使用于输出随机数的至少两个环形振荡器的输出数据的振荡频率之差保持在一个预设阈值内,从而减小产生随机序列的偏置,提高对环境的适应能力,让电路在功耗,面积,产生随机数的效率等方面性能最优。In the embodiment of the present invention, the reconfigurable function of each inverter group can keep the difference between the oscillation frequencies of the output data of the at least two ring oscillators for outputting random numbers within a preset threshold, thereby reducing the generation of The bias of the random sequence improves the adaptability to the environment, so that the circuit has the best performance in terms of power consumption, area, and efficiency of generating random numbers.
在本发明实施例中,所述逻辑控制单元通过所述计数器获取所述至少两个环形振荡器的振荡频率差值,用于给环形振荡器中各个选择器发送重构信号(重构信号的作用,就是选择各反相器组中配置的并行反相器的选通,对于单个反相器组设置有多于2个反向器时,送到每个反向器组的重构信号应该大于1bit),以便通过调整反相器组中选择通过的反相器来完成环形振荡器之间振荡频率差值小于预设阈值或范围内最小值。此处的预设阈值是一个经验值,具体可以通过测试随机数的重复性进行验证,在随机数的重复性达到指定要求情况下所得到的振荡频率差值可以设定为所述预设阈值的参数取值。具体可以通过前期验证两个反相器频率差在多少范围内所产生的随机数可以通过随机数标准测试(例如NIST随机数测试标准)。In this embodiment of the present invention, the logic control unit acquires the difference between the oscillation frequencies of the at least two ring oscillators through the counter, and is used to send a reconstruction signal (the value of the reconstruction signal) to each selector in the ring oscillator. The function is to select the strobe of the parallel inverters configured in each inverter group. When there are more than 2 inverters in a single inverter group, the reconstructed signal sent to each inverter group should be greater than 1bit), so that the oscillation frequency difference between ring oscillators can be completed by adjusting the selected inverters in the inverter group to be less than the preset threshold or the minimum value in the range. The preset threshold here is an empirical value, which can be verified by testing the repeatability of random numbers. The oscillation frequency difference obtained when the repeatability of random numbers meets the specified requirements can be set as the preset threshold. parameter value. Specifically, it can be verified in the early stage that the random number generated by the frequency difference between the two inverters can pass the random number standard test (for example, the NIST random number test standard).
在本发明实施例中,所述至少两个环形振荡器的输出端与所述计数器的输入端耦合的实现方式,可以有多种,例如:计数器本身就包含有多个计数输入 端口,类似与图1所示的连接结构关系,计数器可以同时对至少两个环形振荡器的输出振荡频率进行计数,则所述至少两个环形振荡器的输出端分别与计数器的不同输入端口相连,以便于所述计数器完成对应不同环形振荡器的振荡频率的计数;在实际运用中,计数器的数量与所要生成随机数的输出没有直接对应关系,可以为每一个随机数的输出配备一个计数器(如图1所示),也可以在计数器功能足够强情况下,对应多个随机数仅采用一个计数器来实现。而作为更切合实际成本考虑的解决方案,相应的计数器更倾向于采用单一计数输入口的器件,此时,存在另一种可行的解决方案,如图5所述,具体包括:In this embodiment of the present invention, the output terminals of the at least two ring oscillators can be coupled with the input terminals of the counter in various ways. For example, the counter itself includes a plurality of counting input ports, similar to In the connection structure relationship shown in FIG. 1, the counter can count the output oscillation frequencies of at least two ring oscillators at the same time, then the output ends of the at least two ring oscillators are respectively connected to different input ports of the counter, so that the The counters complete the counting of the oscillation frequencies corresponding to different ring oscillators; in practical applications, the number of counters has no direct correspondence with the output of the random number to be generated, and a counter can be provided for each output of the random number (as shown in Figure 1). shown), or if the counter function is strong enough, only one counter can be used to correspond to multiple random numbers. As a solution that is more cost-effective, the corresponding counter is more inclined to use a device with a single counting input port. At this time, there is another feasible solution, as shown in Figure 5, which includes:
所述至少两个环形振荡器的输出端与计数选择器的至少两个输入端相连,所述计数选择器的输出端与所述计数器的输入端相连,以便于通过所述逻辑控制单元控制所述计数选择器导通的输入端与输出端对应关系,实现依次对环形振荡器的振荡频率的计数。The output terminals of the at least two ring oscillators are connected to at least two input terminals of a count selector, and the output terminals of the count selector are connected to the input terminals of the counter, so that the logic control unit controls all the The corresponding relationship between the input terminal and the output terminal that the counting selector is turned on is used to realize the counting of the oscillation frequency of the ring oscillator in sequence.
如图1和图5所示,为了起到环形振荡器的使能控制,通常在所述环形振荡器的输入端口侧还设置有一个与非门,并且,所述环形振荡器中的反相器组之间形成级联方式,具体的:As shown in FIG. 1 and FIG. 5 , in order to enable control of the ring oscillator, a NAND gate is usually set on the input port side of the ring oscillator, and the inverting phase in the ring oscillator is The cascade mode is formed between the device groups, specifically:
所述与非门的第一输入端与使能信号连接;所述与非门的第二输入端与位于所述级联末端的反相器组(例如图5中位于最右侧的反相器组)的输出端口连接;所述与非门的输出端用于连接位于所述级联首部的反相器组的输入端口(例如图5中位于最左侧的反相器组)。The first input terminal of the NAND gate is connected with the enable signal; the second input terminal of the NAND gate is connected to the inverter group at the end of the cascade (for example, the rightmost inverter in FIG. 5 ) The output port of the NAND gate is used to connect to the input port of the inverter group located in the cascade header (for example, the leftmost inverter group in FIG. 5 ).
在本发明实施例中,在所述随机数发生器中由第一环形振荡器和第二环形振荡器构成一随机数源,所述采样电路由n个D触发器构成,如图6所示,具体的:In the embodiment of the present invention, a random number source is formed by a first ring oscillator and a second ring oscillator in the random number generator, and the sampling circuit is formed by n D flip-flops, as shown in FIG. 6 . ,specific:
在第一环形振荡器内各反相器组的输出端还分别与一个D触发器的信号输入端口相连;在第二环形振荡器内各反相器组的输出端还分别与一个D触发器的时钟输入端口相连;所述采样电路中n个D触发器的输出端口的电信号构成一随机数。The output ends of each inverter group in the first ring oscillator are also respectively connected with the signal input port of a D flip-flop; in the second ring oscillator, the output ends of each inverter group are also respectively connected with a D flip-flop The clock input ports of the n D flip-flops are connected to each other; the electrical signals of the output ports of the n D flip-flops in the sampling circuit form a random number.
在本发明具体实现方式中,除了类似上述图1、图5和图6示例的,由单一的反相器组级联实现方式外,本发明实施例还提供了类似图7和图8所示的一种环形振荡器的实现方式,所述环形振荡器还包括m个普通反相器(即图8和图7中,与上述反相器组实现级联的普通的反相器),具体的:In the specific implementation of the present invention, in addition to the cascaded implementation of a single inverter group similar to that illustrated in FIG. 1 , FIG. 5 and FIG. An implementation of a ring oscillator, the ring oscillator also includes m ordinary inverters (that is, in FIG. 8 and FIG. 7, the ordinary inverters that are cascaded with the above-mentioned inverter group), specifically of:
所述m个普通反相器和n个反相器组按照预设的排列顺序进行级联;The m ordinary inverters and the n inverter groups are cascaded according to a preset arrangement sequence;
其中,预设的排列顺序包括:Among them, the preset sorting order includes:
方式一、如图7所示,所述m个普通反相器之间进行级联,所述n个反相器组之间进行级联;级联之后的m个普通反相器与所述级联之后的n个反相器之间完成级联。 Mode 1. As shown in FIG. 7 , the m ordinary inverters are cascaded, and the n inverter groups are cascaded; the m ordinary inverters after the cascade are connected to the The cascade is completed between the n inverters after the cascade.
方式二、如图8所示,以普通反相器和反相器组相互间隔的方式进行级联,其中,相互间隔的距离根据所述m个普通反相器与n个反相器组按照之间的比例关系确定。这里需要说明的是,此处的m和n都为自然数,而此处的n与对应图5的n的取值可以根据各自应用场景的需求进行调整,并不一定表示两者在各自的场景下的取值需要保持两者之间的一致。 Mode 2, as shown in FIG. 8 , cascade the common inverters and inverter groups in a way that they are spaced apart from each other, wherein the distances spaced from each other are based on the m common inverters and n inverter groups. The proportional relationship between them is determined. It should be noted here that both m and n here are natural numbers, and the values of n here and n corresponding to Figure 5 can be adjusted according to the needs of their respective application scenarios, which do not necessarily mean that the two are in their respective scenarios. The value below needs to be consistent between the two.
方式三、所述m个普通反相器和n个反相器组之间,按照随机排序的方式完成各普通反相器和反相器组的级联。需要说明的是,方式三相比较方式二的规则式的相互间隔级联形成结构,方式三讲求不按照指定规则设置,从某种实现的可能来说,方式三能够带来更多的可能性,可理解为将工艺加工过程中的不确定性,通过所述随机排序的方式进一步弱化,从而可能在后期测试过程中,寻找到一种在振荡频率特性上超越规则相互间隔设置的环形振荡器。此处随机排序是相对于设计电路而言,而对于制作完成的可重构随机数发生器而言,相应的环形振荡器中的反相器组和普通反相器之间排列关系就是一种确定关系了。Mode 3: Between the m ordinary inverters and the n inverter groups, the cascading of the ordinary inverters and the inverter groups is completed in a random order. It should be noted that the three-phase comparison method of method 2 forms a structure by cascading the regular expressions of each other at intervals. Method 3 emphasizes that the settings are not set according to the specified rules. From a certain realization possibility, method 3 can bring more possibilities. , it can be understood that the uncertainty in the process of processing is further weakened by the random sorting method, so that it is possible to find a ring oscillator whose oscillation frequency characteristics exceed the regular mutual interval setting in the later testing process. . The random ordering here is relative to the design circuit, and for the completed reconfigurable random number generator, the arrangement relationship between the inverter group in the corresponding ring oscillator and the ordinary inverter is a kind of The relationship is confirmed.
针对上述提出的在反相器组级联结构中引入普通反相器,构成复合式级联结构,由此,在所述随机数发生器中由第三环形振荡器和第四环形振荡器构成一随机数源,则所述随机数发生器还包括采样电路,其中,所述采样电路由p个D触发器构成,其中,n≤p≤m+n,如图9所示,具体的:In view of the above-mentioned proposal, common inverters are introduced into the cascade structure of inverter groups to form a composite cascade structure. Therefore, the random number generator is composed of a third ring oscillator and a fourth ring oscillator. a random number source, the random number generator further includes a sampling circuit, wherein the sampling circuit is composed of p D flip-flops, where n≤p≤m+n, as shown in FIG. 9, specifically:
在第三环形振荡器内指定反相器和/或反相器组的输出端还分别与一个D触发器的信号输入端口相连;在第四环形振荡器内指定反相器组和/或反相器的输出端还分别与一个D触发器的时钟输入端口相连;所述采样电路中n个D触发器的输出端口的电信号构成一随机数。从图9可以看出,其结构采用的是p取值等于n的实现方式,即其中仍然是以各个反相器组的输出端口引出电信号作为生成随机数的依据;而对于p=m+n的实现方式,可以参考图10所示结构。需要指出的是,类似图9图10所示的结构,仅仅是为了通过最为精简的图示呈现关键性差异结构,而做了可行的方案,类似图9和图10结构可以加入上述的扩展方案中加入与非门的方式来完成使能信号控制,也可以采用类似图5所示的单输入口计数器延伸实现方案,因此,在本发明实施例中各扩展方案中所提出的可选方案均可在本发明各实现方案中进行有机的组合,在此不一一赘述。The outputs of the specified inverters and/or inverter groups in the third ring oscillator are also respectively connected to the signal input ports of a D flip-flop; the inverter groups and/or inverter groups are specified in the fourth ring oscillator. The output ends of the phaser are also respectively connected with the clock input ports of a D flip-flop; the electrical signals of the output ports of the n D flip-flops in the sampling circuit form a random number. As can be seen from Fig. 9, the structure adopts the realization method that the value of p is equal to n, that is, the electrical signal drawn from the output port of each inverter group is still used as the basis for generating random numbers; and for p=m+ For the implementation of n, refer to the structure shown in FIG. 10 . It should be pointed out that the structures similar to those shown in Fig. 9 and Fig. 10 are only feasible solutions to present the key difference structures through the most concise diagrams. The structures similar to those shown in Figs. 9 and 10 can be added to the above-mentioned expansion solutions. A NAND gate is added to complete the enable signal control, and an extended implementation scheme of a single-input port counter similar to that shown in FIG. 5 can also be used. An organic combination can be performed in each implementation scheme of the present invention, which will not be repeated here.
进一步需要解释说明的是,在本发明实施例中涉及的第一、第二、第三、第四的称呼,仅仅是为了表述上的方便,一定意义上也是为了区别描述的对象和个体,除此以外,它们不具备特殊的限定意义,不应将其过渡解释来限缩本发明的保护范围。It should be further explained that the names of the first, second, third and fourth involved in the embodiments of the present invention are only for the convenience of expression, and in a certain sense, are also used to distinguish between the described objects and individuals. Besides, they have no special limiting meaning, and should not be interpreted to limit the protection scope of the present invention.
作为一种新型信息安全机制,物理不可克隆函数(PhysicalUnclonable Functions,简写为PUFs)受到工业界广泛关注,并已实现了产业化应用。物理不可克隆函数可广泛应用于安全认证以及密钥生成机制,能够抵御包括侵入式攻击在内的多种物理攻击,具有低成本,高安全性的优势。As a new type of information security mechanism, Physical Unclonable Functions (PUFs for short) have received extensive attention in the industry and have been industrialized. Physical unclonable functions can be widely used in security authentication and key generation mechanisms, and can resist various physical attacks including intrusive attacks, with the advantages of low cost and high security.
事实上,工业界开始将真随机数发生器和物理不可克隆函数模块作为独立的电路,集成在一块芯片内,作为安全模块的安全基础,例如美国美信公司(Maxim)推出的安全芯片“ChipDNA”。In fact, the industry has begun to use the true random number generator and the physical unclonable function module as an independent circuit, integrated in a chip, as the security basis of the security module, such as the security chip "ChipDNA" launched by Maxim. .
本发明能够将上述的可重构随机数发生器进一步复用为物理不可克隆函数,实现电路复用,节省资源;本发明可对环形振荡器进行重构处理,用于调整两个环形振荡器的相对频率,去除确定性噪声(如制造差异)或PVT造成的固有偏置,从而保证输出随机数的随机性。而另一方面,当将本发明实施例所提出的可重构随机数发生器进一步复用为物理不可克隆函数时,具体的:The present invention can further multiplex the above-mentioned reconfigurable random number generator into a physical unclonable function, realize circuit multiplexing, and save resources; the present invention can reconfigure the ring oscillator to adjust the two ring oscillators The relative frequency of , removes deterministic noise (such as manufacturing variance) or inherent bias caused by PVT, thereby ensuring the randomness of the output random number. On the other hand, when the reconfigurable random number generator proposed by the embodiment of the present invention is further multiplexed into a physical unclonable function, specifically:
所述逻辑控制单元还用于获取一个或者多个环形振荡器的激励信号(例如: 直接通过上位机给所述逻辑控制单元输入一个或者多个环形振荡器的激励信号;所述激励信号可以表现为对于各个环形振荡器中的指定反射器组的工作输出的选择,从而能够通过调整激励信号来动态的改变环形振荡器中工作的反射器组的组合形式,使得环形振荡器满足在特定环境需求),所述逻辑控制单元将所述激励信号转换为相应一个或者多个环形振荡器的重构信号;The logic control unit is also used to obtain excitation signals of one or more ring oscillators (for example: directly input the excitation signals of one or more ring oscillators to the logic control unit through the host computer; the excitation signals may represent For the selection of the working output of the specified reflector group in each ring oscillator, the combination form of the reflector group working in the ring oscillator can be dynamically changed by adjusting the excitation signal, so that the ring oscillator can meet the requirements of a specific environment. ), the logic control unit converts the excitation signal into a reconstructed signal corresponding to one or more ring oscillators;
所述逻辑控制单元获取由所述激励信号触发的一个或者多个环形振荡器的输出振荡频率,并根据相应振荡频率或者振荡频率的差值,计算得到物理不可克隆输出结果。The logic control unit acquires the output oscillation frequency of one or more ring oscillators triggered by the excitation signal, and calculates a physically unclonable output result according to the corresponding oscillation frequency or the difference between the oscillation frequencies.
在本发明的上述优选实现方案中,提出了一种基于所述可重构环形振荡器来实现物理不可克隆输出结果的解决方案,而所述解决方案实现仍然依靠的是本发明的核心创新点,即反相器组结构,以及逻辑控制单元对环形振荡器中各反相器组的重构控制。In the above-mentioned preferred implementation scheme of the present invention, a solution for realizing a physically unclonable output result based on the reconfigurable ring oscillator is proposed, and the realization of the solution still relies on the core innovation of the present invention , namely the structure of the inverter group, and the reconfiguration control of each inverter group in the ring oscillator by the logic control unit.
在具体实现过程中,要达到满足预期要求的物理不可克隆输出结果要求,通常还需要通过计数器和逻辑控制单元配合,完成环形振荡器中各个反相器组的重构,使得用于形成振荡频率差的两个环形振荡器的振荡频率相差较大为宜。原因是,此时,相对频率差异不再来源于jitter,而是来源于制造差异等固定因素。因此,此时便符合物理不可克隆函数(PUF)电路的特性。对于64级可重构环形振荡器(即包括64个反相器组),配置信号组合为2 64,里面具有固定输出的配置信号所生成的固定输出便可用于密钥生成等机制。 In the specific implementation process, in order to achieve the physical unclonable output result that meets the expected requirements, it is usually necessary to cooperate with the counter and the logic control unit to complete the reconstruction of each inverter group in the ring oscillator, so as to form the oscillation frequency. It is advisable that the oscillation frequencies of the two ring oscillators with the difference are quite different. The reason is that, at this time, the relative frequency difference is no longer derived from jitter, but from fixed factors such as manufacturing differences. Therefore, the characteristics of a physical unclonable function (PUF) circuit are met at this time. For a 64-stage reconfigurable ring oscillator (that is, including 64 inverter groups), the configuration signal combination is 2 64 , and the fixed output generated by the configuration signal with fixed output can be used for mechanisms such as key generation.
所述并根据相应振荡频率或者振荡频率的差值,计算得到物理不可克隆输出结果,具体包括:The physical unclonable output result is calculated and obtained according to the corresponding oscillation frequency or the difference between the oscillation frequencies, specifically including:
振荡频率的差值大于0,则输出0,振荡频率的差值小于0则输出1;或者,If the difference between the oscillation frequencies is greater than 0, output 0, and if the difference between the oscillation frequencies is less than 0, output 1; or,
振荡频率的差值大于0,则输出1,振荡频率的差值小于0则输出0;或者,If the difference of oscillation frequency is greater than 0, output 1, and if the difference of oscillation frequency is less than 0, output 0; or,
取振荡频率小数点后指定长度参数值作为整数值输出。Take the value of the specified length parameter after the decimal point of the oscillation frequency and output it as an integer value.
作为本发明一个较完整实现方案的呈现,如图11所示,方法过程集合了真随机数模式和物理不可克隆模式,并且可以在具体方法实现过程中,在两者之间进行选择工作模式。如图11所示,相应方法过程包括:As a presentation of a relatively complete implementation scheme of the present invention, as shown in FIG. 11 , the method process integrates the true random number mode and the physical unclonable mode, and the working mode can be selected between the two in the specific method implementation process. As shown in Figure 11, the corresponding method process includes:
在步骤101中,逻辑控制单元通过计数器对至少两个环形振荡器进行频率统计,获取频率差值。此时,根据逻辑控制单元中所设置的工作模式,若为真随机数模式,则进入步骤102,若是物理不可克隆模式,则进入步骤104。In step 101, the logic control unit performs frequency statistics on at least two ring oscillators through the counter to obtain a frequency difference. At this time, according to the working mode set in the logic control unit, if it is a true random number mode, then go to step 102 , if it is a physical unclonable mode, go to step 104 .
在步骤102中,通过一次或者多次逻辑控制单元对重构信号的调整,选通不同的反相器,使得所述第一环形振荡器和第二环形振荡器的振荡频率差值小于预设阈值。In step 102, by adjusting the reconstructed signal one or more times by the logic control unit, different inverters are gated, so that the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than a preset value threshold.
在步骤103中,采样两个环形振荡器的相位噪声所导致的振荡器抖动,生成随机数。In step 103, the oscillator jitter caused by the phase noise of the two ring oscillators is sampled, and a random number is generated.
在步骤104中,多次逻辑控制单元对重构信号的调整,选通不同的反相器,得到每一次的环形振荡器的震荡频率或者频率差值。In step 104, the logic control unit adjusts the reconstructed signal multiple times, selects different inverters, and obtains the oscillation frequency or the frequency difference of the ring oscillator each time.
在步骤105中,根据相应振荡频率或振荡频率的差值,计算得到物理不可克隆输出结果。In step 105, a physical unclonable output result is calculated according to the corresponding oscillation frequency or the difference between the oscillation frequencies.
相应各模式下的具体方法过程,将在实施例2中具体展开阐述,在本发明 实施例中不过多赘述。The specific methods and processes in the corresponding modes will be specifically described in Embodiment 2, and will not be repeated in the embodiments of the present invention.
实施例2:Example 2:
本发明实施例提出了一种可重构随机数发生器的实现方法,使用如实施例1所述的可重构随机数发生器,如图12所示,实现方法包括:An embodiment of the present invention proposes a method for implementing a reconfigurable random number generator, using the reconfigurable random number generator described in Embodiment 1, as shown in FIG. 12 , the implementation method includes:
在步骤201中,逻辑控制单元通过所述计数器获取所述至少两个环形振荡器的振荡频率。In step 201, the logic control unit acquires the oscillation frequencies of the at least two ring oscillators through the counter.
在步骤202中,所述逻辑控制单元确定作为一随机数源的第一环形振荡器和第二环形振荡器,并分析所述第一环形振荡器和第二环形振荡器的振荡频率差值。In step 202, the logic control unit determines the first ring oscillator and the second ring oscillator as a random number source, and analyzes the oscillation frequency difference of the first ring oscillator and the second ring oscillator.
在步骤203中,若所述振荡频率大于预设阈值,所述逻辑控制单元向所述第一环形振荡器和/或第二环形振荡器发送重构信号,以便于控制所述第一环形振荡器和第二环形振荡器中的选择器,完成相应反相器组中指定反相器信号通道导通操作。In step 203, if the oscillation frequency is greater than a preset threshold, the logic control unit sends a reconstruction signal to the first ring oscillator and/or the second ring oscillator, so as to control the first ring oscillator The selector and the selector in the second ring oscillator complete the turn-on operation of the signal channel of the designated inverter in the corresponding inverter group.
在步骤204中,通过一次或者多次逻辑控制单元对重构信号的调整,使得所述第一环形振荡器和第二环形振荡器的振荡频率差值小于预设阈值。In step 204, the reconstructed signal is adjusted one or more times by the logic control unit, so that the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is smaller than a preset threshold.
本发明实施例提出的可重构环形振荡器实现方法,可以通过计数器实现不同环形振荡器之间的输出信号之间振荡频率差值计算,并将其作为结果传递给逻辑控制单元,并基由所述逻辑控制单元来进一步调整关联的环形振荡器中反相器组,从而得到满足条件的环形振荡器输出。The method for realizing the reconfigurable ring oscillator proposed by the embodiment of the present invention can realize the calculation of the oscillation frequency difference between the output signals of different ring oscillators through the counter, and transmit the difference to the logic control unit as the result, and based on the The logic control unit further adjusts the inverter group in the associated ring oscillator, so as to obtain the ring oscillator output that meets the conditions.
结合本发明实施例,对于所述通过一次或者多次逻辑控制单元对重构信号的调整,使得所述第一环形振荡器和第二环形振荡器的振荡频率差值小于预设阈值,如图12所示,具体包括:With reference to the embodiment of the present invention, for the adjustment of the reconstructed signal by the logic control unit one or more times, the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than a preset threshold, as shown in the figure. 12, including:
在步骤2041中,通过多次对重构信号的调整,逐一完成对各个反相器组中的用于电信号导通的反相器的选择控制的遍历。In step 2041 , by adjusting the reconstructed signal multiple times, the traversal of the selection control of the inverters for conducting electrical signals in each inverter group is completed one by one.
在步骤2042中,每一次对重构信号的调整,若能促使所述第一环形振荡器和第二环形振荡器的振荡频率差值减小,则保留此时的重构信号为当前状态的重构信号,所述当前状态的重构信号所对应的振荡频率差,用于与下一次调整后的重构信号下的振荡频率差进行比较,取其中振荡频率差更小的重构信号更新为所述当前状态的重构信号。In step 2042, each time the reconstructed signal is adjusted, if the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator can be reduced, the reconstructed signal at this time is kept as the current state. The reconstructed signal, the oscillation frequency difference corresponding to the reconstructed signal in the current state is used to compare with the oscillation frequency difference under the reconstructed signal after the next adjustment, and the reconstructed signal with the smaller oscillation frequency difference is updated is the reconstructed signal of the current state.
在步骤2043中,直到所述第一环形振荡器和第二环形振荡器的振荡频率差值小于预设阈值,停止所述遍历过程。In step 2043, the traversal process is stopped until the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than a preset threshold.
值得说明的是,上述装置内的模块、单元之间的信息交互、执行过程等内容,由于与本发明的处理方法实施例基于同一构思,具体内容可参见本发明方法实施例中的叙述,此处不再赘述。It is worth noting that the information exchange and execution process between modules and units in the above-mentioned device are based on the same concept as the processing method embodiment of the present invention. For details, please refer to the description in the method embodiment of the present invention. It is not repeated here.
实施例3:Example 3:
本发明实施例在实施例1和实施例2基础上,将进一步结合具体实现过程中的一种实例情况,配合相应的附图阐述完整方案实现的过程细节。相比较实施例1中采用至少两个反相器构成反相器组的结构,在本发明实施例中进一步采用了电流饥饿型反相器来构成相应的反相器组,从而进一步提升性能。On the basis of Embodiment 1 and Embodiment 2, the embodiments of the present invention will further combine an example situation in the specific implementation process, and describe the process details of the implementation of the complete solution with the corresponding drawings. Compared with the structure of using at least two inverters to form an inverter group in the first embodiment, in the embodiment of the present invention, a current starved inverter is further used to form a corresponding inverter group, thereby further improving the performance.
此可配置随机数发生器电路结构如图14所示。其主要包括两个环形振荡器 (环形振荡器RO1和环形振荡器RO2),一个计数器,一组D触发器,一个并转串的接口电路(可以看出,在实施例1的实现方案中并未直接引入所述并转串的接口电路,这是因为,作为可选实现方案而言,所述并转串的接口电路并不一定是要由本发明实施例技术方案集成到一体实现,也可以是通过配合外围电路组合实现的方式实现),以及一组控制逻辑(C 0~C 2n-1,EN…)。 The circuit structure of this configurable random number generator is shown in Figure 14. It mainly includes two ring oscillators (ring oscillator RO1 and ring oscillator RO2), a counter, a group of D flip-flops, and a parallel-to-serial interface circuit (it can be seen that in the implementation scheme of Embodiment 1, the The parallel-to-serial interface circuit is not directly introduced, because, as an optional implementation solution, the parallel-to-serial interface circuit does not necessarily need to be integrated and implemented by the technical solutions of the embodiments of the present invention. It is realized by combining with peripheral circuits), and a group of control logic (C 0 ~ C 2n-1 , EN...).
控制逻辑负责环形振荡器的工作模式转化。本发明实施例中的可重构随机数发生器具有两个工作模式:随机数发生器模式和物理不可克隆函数模式。The control logic is responsible for switching the operating mode of the ring oscillator. The reconfigurable random number generator in the embodiment of the present invention has two working modes: a random number generator mode and a physical unclonable function mode.
如图14所示,两个环形振荡器RO1,RO2各由1个与非门(NAND1,NAND2)以及n个反相器组(IVs0~IVsn-1,IVsn~IVs2n-1)组成;每个反相器组由多路选择器(图中以二选一选择器为例,可为任意多路选择器)以及电流饥饿型反相器构成,可根据重构信号(C 0~C 2n-1)进行重构,以降低工艺偏差、电压变化以及温度变化(PVT)对电路所造成的影响,保证随机数生成器的高熵值以及物理不可克隆函数电路的高可靠性;n个D触发器(D 0~D n-1)构成采样电路,采样两个环形振荡器的相位噪声所导致的振荡器抖动,生成随机数;计数选择电路在随机数生成器模式下用于检测环形振荡器工作状态,在物理不可克隆函数模式下用于生成物理不可克隆函数输出;逻辑控制单元用于配置电路工作状态(随机数模式或物理不可克隆函数模式),以及根据计数电路输出,通过重构信号(C 0~C 2n-1)重构环形振荡器。通过逻辑处理控制电路,两个可重构电流饥饿型环形振荡器可用作高熵值随机数发生器或物理不可克隆函数。并转串接口输出电路用于将随机数生成器生成的随机数串行输出。 As shown in Figure 14, the two ring oscillators RO1 and RO2 are each composed of a NAND gate (NAND1, NAND2) and n inverter groups (IVs0~IVsn-1, IVsn~IVs2n-1); each The inverter group is composed of a multiplexer (the one-of-two selector is taken as an example in the figure, which can be any multiplexer) and a current- starved inverter . 1 ) Reconstruction to reduce the influence of process deviation, voltage change and temperature change (PVT) on the circuit, to ensure the high entropy value of the random number generator and the high reliability of the physical unclonable function circuit; n D triggers The generators (D 0 ~ D n-1 ) form a sampling circuit, which samples the oscillator jitter caused by the phase noise of the two ring oscillators to generate random numbers; the count selection circuit is used in the random number generator mode to detect the ring oscillators The working state is used to generate the output of the physical unclonable function in the physical unclonable function mode; the logic control unit is used to configure the working state of the circuit (random number mode or physical unclonable function mode), and according to the output of the counting circuit, by reconstructing the signal (C 0 to C 2n-1 ) reconstruct the ring oscillator. By logically processing the control circuit, the two reconfigurable current-starved ring oscillators can be used as high-entropy random number generators or physically unclonable functions. The parallel-to-serial interface output circuit is used to serially output the random numbers generated by the random number generator.
在真随机数工作模式下,工作在亚阈值区间的两个电流饥饿型环形振荡器的抖动噪声互相采样,产生高熵值随机数。其中电流饥饿型环形振荡器工作在亚阈值区,电流饥饿型环形振荡器每一级的噪声会更大,产生随机数熵值更高;此外,工作在亚阈值区可以便于控制反相器工作电流,从而控制反相器充放电时间,达到控制环形振荡器频率的目的,同时控制了降低了环形振荡器的功耗。产生随机数过程如下:亚阈值区环形振荡器可通过重构信号C 0~C 2n-1重构反相器组(IVs 0~IVs n-1,IVs n~IVs 2n-1),从而选择不同的电流饥饿型反相器组成振荡器,进而调整环形振荡器的振荡频率f RO1,f RO2。两组环形振荡器的频率f RO1,f RO2经双向计数器计算频率差;逻辑处理控制电路对此频率差进行分析,若频率差不符合预设阈值,则改变重构信号C 0~C 2n-1从而对环形振荡器的输出频率进行调整;当f RO1,f RO2的频率计数差小于预设阈值,则固定重构信号;之后,将两组环形振荡器的每一级重构反相器的输出用作D触发器(D 0~D n-1)的数据信号和时钟信号,从而完成采样;利用相位噪声带来的振荡器抖动,D触发器(D 0~D n-1)将持续并行输出随机数;进而经并转串接口电路输出串行真随机数比特流。 In the true random number working mode, the jitter noises of the two current-starved ring oscillators operating in the subthreshold range are sampled from each other to generate high-entropy random numbers. Among them, the current-starved ring oscillator works in the sub-threshold region, the noise of each stage of the current-starved ring oscillator will be larger, and the random number entropy value will be higher; in addition, working in the sub-threshold region can facilitate the control of the inverter. Therefore, the charging and discharging time of the inverter is controlled, the purpose of controlling the frequency of the ring oscillator is achieved, and the power consumption of the ring oscillator is controlled and reduced at the same time. The process of generating random numbers is as follows: the sub-threshold region ring oscillator can reconstruct the inverter group (IVs 0 ˜IVs n-1 , IVs n ˜IVs 2n-1 ) by reconstructing the signals C 0 ˜C 2n -1 , so as to select Different current-starved inverters form an oscillator, which in turn adjusts the oscillation frequencies f RO1 and f RO2 of the ring oscillator. The frequencies f RO1 and f RO2 of the two groups of ring oscillators are calculated by the bidirectional counter to calculate the frequency difference; the logic processing control circuit analyzes the frequency difference, and if the frequency difference does not meet the preset threshold, the reconstructed signals C 0 ~ C 2n- 1 to adjust the output frequency of the ring oscillator; when the frequency count difference between f RO1 and f RO2 is less than the preset threshold, the reconstruction signal is fixed; after that, each stage of the two groups of ring oscillators is reconstructed to the inverter The output of the D flip-flop (D 0 ~ D n-1 ) is used as the data signal and clock signal to complete the sampling; using the oscillator jitter caused by the phase noise, the D flip-flop (D 0 ~ D n-1 ) will Continuously output random numbers in parallel; and then output a serial true random number bit stream through a parallel-to-serial interface circuit.
当工作在物理不可克隆函数模式时,C 0~C 2n-1将作为物理不可克隆函数的激励;由于集成电路制造过程中产生的随机偏差,通过计数器提取两个级联后振荡器的输出端的震荡频率差异;进而得到物理不可克隆函数的输出;通过改变指数级空间的激励C 0~C 2n-1,物理不可克隆函数基于某一激励C 0~C 2n-1,生成唯一响应。 When working in the physical unclonable function mode, C 0 ~ C 2n-1 will be used as the excitation of the physical unclonable function; due to the random deviation generated in the manufacturing process of the integrated circuit, the output terminals of the two cascaded oscillators are extracted by the counter. Oscillation frequency difference; then the output of the physical unclonable function is obtained; by changing the excitation C 0 ~C 2n-1 in the exponential space, the physical unclonable function generates a unique response based on a certain excitation C 0 ~C 2n-1 .
随机数生成器是现有信息安全系统不可或缺的重要组成部分、物理不可克隆函数用于安全认证或密钥生成,用于取代现存的基于易失性存储器的密钥存 储及安全认证机制,能够有效抵御侵入式攻击等多种物理攻击。本发明能够将同一电路配置为随机数生成器或物理不可克隆函数,实现电路复用,节省资源;本发明可对环形振荡器进行重构处理,用于调整两个环形振荡器的相对频率,去除确定性噪声(如制造差异)或PVT造成的固有偏置,从而保证输出随机数的随机性;本发明实施例使用电流饥饿型反相器构建随机数生成器,具有较优的能效比;本发明实施例将电流饥饿型反相器工作于零温态(Zero-TC),从而进一步降低温度影响。The random number generator is an indispensable and important part of the existing information security system. The physical unclonable function is used for security authentication or key generation, and is used to replace the existing key storage and security authentication mechanism based on volatile memory. It can effectively resist various physical attacks such as intrusive attacks. The invention can configure the same circuit as a random number generator or a physical unclonable function, realizes circuit multiplexing and saves resources; the invention can reconstruct the ring oscillator to adjust the relative frequencies of the two ring oscillators, Remove deterministic noise (such as manufacturing differences) or inherent bias caused by PVT, thereby ensuring the randomness of output random numbers; the embodiment of the present invention uses a current starvation inverter to construct a random number generator, which has a better energy efficiency ratio; In the embodiment of the present invention, the current starved inverter is operated in a zero temperature state (Zero-TC), thereby further reducing the influence of temperature.
结合本发明实施例如图14所示的可重构随机数发生器,进一步阐述上述的并转接口电路的实现原理如下:With reference to the reconfigurable random number generator shown in FIG. 14 according to an embodiment of the present invention, the implementation principle of the above-mentioned parallel-to-interface circuit is further elaborated as follows:
所述并转串接口电路包括n个D触发器,(n-1)个数据选择器MUX;The parallel-to-serial interface circuit includes n D flip-flops and (n-1) data selectors MUX;
N个D触发器的时钟控制端CLK接时钟信号Nf0,(N-1)个数据选择器MUX的数据选择控制端接时钟信号f0;The clock control terminals CLK of the N D flip-flops are connected to the clock signal Nf0, and the data selection control terminals of the (N-1) data selectors MUX are connected to the clock signal f0;
第一个D触发器的输入端D接并行输入信号P0,输出端Q接第一个数据选择器MUX的一个输入端,第一个数据选择器的输出端接第二个D触发器的输入端D,第二个D触发器的输出端接第二个数据选择器的一个输入端,以此类推,第(N-1)个D触发器的输出端接第(N-1)个数据选择器MUX的一个输入端,第(N-1)个数据选择器MUX的输出端接第N个D触发器的输入端D,第N个D触发器的输出端Q为串行输出信号;并行输出信号P1,P2……PN依次连接到(N-1)个数据选择器MUX的另一个输入端。The input terminal D of the first D flip-flop is connected to the parallel input signal P0, the output terminal Q is connected to an input terminal of the first data selector MUX, and the output terminal of the first data selector is connected to the input of the second D flip-flop. Terminal D, the output terminal of the second D flip-flop is connected to an input terminal of the second data selector, and so on, the output terminal of the (N-1)th D flip-flop is connected to the (N-1)th data An input end of the selector MUX, the output end of the (N-1)th data selector MUX is connected to the input end D of the Nth D flip-flop, and the output end Q of the Nth D flip-flop is a serial output signal; The parallel output signals P1, P2...PN are sequentially connected to the other input terminals of the (N-1) data selectors MUX.
通过调整图15示出的反相器为本发明实施例中所采用的电流饥饿型反相器,包括2个PMOS器件M1和M2、2个NMOS器件M3和M4;M1的源极接高供电电压V dd;M1的漏极接M2的源极,M2的漏极接M3的漏极,M3的源极接M4的漏极,M4的源极接地;M1的栅极接偏置电压V p,M4的栅极接偏置电压V n;M2、M3的栅极为输入端V i,M2、M3的漏极为输出端V o。其中,偏置电压V P与V n,使得反相器工作于零温态(Zero-Tc),以使得随机数生成器不易受到温度影响。其模型原理在于:环形振荡器RO1,RO2的频率决定于每一级反相器的延时: By adjusting the inverter shown in FIG. 15 to be a current starved inverter used in the embodiment of the present invention, it includes two PMOS devices M1 and M2 and two NMOS devices M3 and M4; the source of M1 is connected to a high power supply Voltage V dd ; the drain of M1 is connected to the source of M2, the drain of M2 is connected to the drain of M3, the source of M3 is connected to the drain of M4, and the source of M4 is grounded; the gate of M1 is connected to the bias voltage V p , the gate of M4 is connected to the bias voltage V n ; the gates of M2 and M3 are input terminals V i , and the drains of M2 and M3 are output terminals V o . Among them, the bias voltages V P and V n make the inverter work in a zero temperature state (Zero-Tc), so that the random number generator is not easily affected by temperature. The model principle is that the frequency of the ring oscillators RO1 and RO2 is determined by the delay of each stage of the inverter:
Figure PCTCN2020107140-appb-000001
Figure PCTCN2020107140-appb-000001
其中,C 0为总的电路负载、V dd为电源电压、η为反相器电路常数、I D为饱和电流;进一步,饱和电流I DAmong them, C 0 is the total circuit load, V dd is the power supply voltage, η is the inverter circuit constant, and ID is the saturation current; further, the saturation current ID is
Figure PCTCN2020107140-appb-000002
Figure PCTCN2020107140-appb-000002
其中,沟道长W、沟道宽L、栅极-源极电压V GS、栅电容C OX、阈值电压V t、以及载流子迁移率μ分别为沟道长、沟道宽、栅极-源极电压、栅电容、阈值电压以及载流子迁移率;进一步,饱和电流在温度T时的开关电流温度系数为: Among them, the channel length W, the channel width L, the gate-source voltage V GS , the gate capacitance C OX , the threshold voltage V t , and the carrier mobility μ are the channel length, the channel width, the gate - source voltage, gate capacitance, threshold voltage and carrier mobility; further, the temperature coefficient of the switching current of the saturation current at temperature T is:
Figure PCTCN2020107140-appb-000003
Figure PCTCN2020107140-appb-000003
该系数需要尽可能小,以降低饱和电流受温度的影响,因此在设计中,偏置电压V P与V n需要遵循以下原则:即电路能够正常开关工作的前提下,要使得V GS尽可能小。 This coefficient needs to be as small as possible to reduce the influence of temperature on the saturation current. Therefore, in the design, the bias voltages V P and V n need to follow the following principles: that is, on the premise that the circuit can switch normally, make V GS as much as possible small.
如图16所示,为本发明实施例提供的一种D触发器(D 0Dn-1)结构示意图,在所述D触发器中包括2个与门(AND_1,AND_2),2个或非门(NOR_1,NOR_2),1个反相器(inverter),1个电容C和1个电阻R。 As shown in FIG. 16 , it is a schematic structural diagram of a D flip-flop (D 0 to Dn-1 ) provided by an embodiment of the present invention. The D flip-flop includes two AND gates (AND_1, AND_2), two OR gates (AND_1, AND_2). NOT gate (NOR_1, NOR_2), 1 inverter (inverter), 1 capacitor C and 1 resistor R.
时钟控制信号CLK经过电容C分别输入与门AND_1一个输入端和与门AND_2的一个输入端,电容C和与门AND_1和与门AND_2之间的连线上接有电阻R,电阻R的另一端接地;The clock control signal CLK is input to an input end of the AND gate AND_1 and an input end of the AND gate AND_2 respectively through the capacitor C. A resistor R is connected to the connection between the capacitor C and the AND gate AND_1 and the AND gate AND_2, and the other end of the resistor R ground;
反相器inverter的输入端接输入信号D,输出端接与门AND_1;与门AND_1的输入端分别接反相器inverter的输出端和与门AND_2的一个输入端;与门AND_2的输入端分别接输入信号D和与门AND_1,输出端接或非门NOR_2的一个输入端;或非门NOR_1的输入端分别接与门AND_1的输出端的或非门NOR_2的输出端,输出端接或非门NOR_2的一个输入端,同时输出D触发器的输出信号Q;或非门NOR_2的输入端分别接与门AND_2的输出端的或非门NOR_1的输出端,输出端接或非门NOR_1的一个输入端,同时输出D触发器的输出信号
Figure PCTCN2020107140-appb-000004
The input terminal of the inverter inverter is connected to the input signal D, and the output terminal is connected to the AND gate AND_1; the input terminal of the AND gate AND_1 is respectively connected to the output terminal of the inverter inverter and an input terminal of the AND gate AND_2; the input terminals of the AND gate AND_2 are respectively The input signal D and the AND gate AND_1 are connected, and the output terminal is connected to an input terminal of the NOR gate NOR_2; the input terminal of the NOR gate NOR_1 is respectively connected to the output terminal of the NOR gate NOR_2 of the output terminal of the AND gate AND_1, and the output terminal is connected to the NOR gate. An input terminal of NOR_2 simultaneously outputs the output signal Q of the D flip-flop; the input terminal of the NOR gate NOR_2 is respectively connected to the output terminal of the NOR gate NOR_1 of the output terminal of the AND gate AND_2, and the output terminal is connected to an input terminal of the NOR gate NOR_1 , while outputting the output signal of the D flip-flop
Figure PCTCN2020107140-appb-000004
D触发器产生随机信号时的时序图如图17所示。在第一个时钟周期期间,分别由两个振荡器产生具有相近频率的触发信号和时钟控制信号输入D端和CLK端,由于抖动噪声带来的偏差,CLK和D上的信号并非完全对应,在第一个时钟周期里,CLK的上升沿对应的是D上的高电平,输出1,CLK的下降沿对应的是D上的低电平,输出0,下一个时钟周期的上升沿对应的是D上的低电平输出0。The timing diagram when the D flip-flop generates a random signal is shown in Figure 17. During the first clock cycle, the trigger signal and clock control signal with similar frequencies are generated by two oscillators and input to the D and CLK terminals. Due to the deviation caused by jitter noise, the signals on CLK and D are not completely corresponding. In the first clock cycle, the rising edge of CLK corresponds to the high level on D, output 1, the falling edge of CLK corresponds to the low level on D, output 0, and the rising edge of the next clock cycle corresponds to The low level on D outputs 0.
两个环形振荡器的频率需要尽可能接近,以产生足够的频率抖动、生成高熵值的随机数。控制逻辑单元搜索最优重构信号C 0-C 2n-1的流程图如图18所示。开始阶段,C 0-C 2n-1被预置一组初值,通过计数器在时间t内正向计数环形振荡器RO1,在下一个时间t反向计数环形振荡器RO2得到ΔN=N1-N2,其中N1是环形振荡器R01的振荡频率计数值,N2是环形振荡器R02的振荡频率计数值;定义一个变量i,对其赋初值0;第一步,针对i=0,将重构信号C 0取反,得到C 0’,即选择反相器组内的另一个反相器;使用重构信号C 0’~C 2n-1重复上述计数过程,得到ΔN′;判断ΔN是否比ΔN′小,如果是则保留C 0~C 2n-1,并i+1;如果为否,即得到了更小的差值则保留变化后的C 0’,再使i+1,最后判断i是否等于n-1,如果是则表示已完成对前n-1个反相器的遍历得到局部最优解。 The frequencies of the two ring oscillators need to be as close as possible to generate enough frequency jitter to generate random numbers with high entropy. The flowchart of the control logic unit searching for the optimal reconstruction signal C 0 -C 2n-1 is shown in FIG. 18 . In the initial stage, C 0 -C 2n-1 are preset with a set of initial values, and the ring oscillator RO1 is counted forward by the counter within the time t, and the ring oscillator RO2 is counted backward at the next time t to obtain ΔN=N1-N2, Among them, N1 is the count value of the oscillation frequency of the ring oscillator R01, and N2 is the count value of the oscillation frequency of the ring oscillator R02; define a variable i and assign an initial value of 0 to it; the first step is to reconstruct the signal for i=0 Invert C 0 to obtain C 0 ', that is, select another inverter in the inverter group; use the reconstructed signals C 0 ' to C 2n-1 to repeat the above counting process to obtain ΔN'; judge whether ΔN is larger than ΔN ' is small, if yes, keep C 0 ~C 2n-1 , and i+1; if no, that is, if a smaller difference is obtained, keep the changed C 0 ', then make i+1, and finally judge i Whether it is equal to n-1, if so, it means that the traversal of the first n-1 inverters has been completed to obtain the local optimal solution.
在物理不可克隆函数模式下,这C 0~C 2n-1可以由外部直接输入,通过比较两个振荡器的频率值,,在每一个输入激励下,生成唯一响应;一种典型的响应生成方式为:若f RO1>f RO2,则输出0,若f RO1≤f RO2则输出1,反之亦可;与真随机数发生器不同的是,频率差值送入控制逻辑,只有那些频率差值足够大的输出才能被标记为稳定的比特输出,否则将被丢弃。以此提高所设计的物理不可克隆函数的稳定性。 In the physical unclonable function mode, these C 0 ~ C 2n-1 can be directly input from the outside, and by comparing the frequency values of the two oscillators, under each input excitation, a unique response is generated; a typical response generation The method is: if f RO1 >f RO2 , output 0, if f RO1 ≤ f RO2 , output 1, and vice versa; different from the true random number generator, the frequency difference is sent to the control logic, only those frequency differences Outputs with a value large enough to be marked as stable bit outputs are discarded otherwise. In this way, the stability of the designed physical unclonable function is improved.
在电路设计上,还将实现高速,低功耗的目的,结合本电路的特点,拟采用延时单元作为振荡器的基本结构,用E-TSPC型触发器作为双向计数器的计数单元。In the circuit design, the purpose of high speed and low power consumption will also be achieved. Combined with the characteristics of this circuit, it is planned to use the delay unit as the basic structure of the oscillator, and use the E-TSPC type flip-flop as the counting unit of the bidirectional counter.
实施例4:Example 4:
在本发明实施例中,还提供了一个测试结果:In the embodiment of the present invention, a test result is also provided:
Figure PCTCN2020107140-appb-000005
Figure PCTCN2020107140-appb-000005
为了初步验证本发明方案的实际效果,在Xilinx Artix-7FPGA上对本方案的电路进行了纯数字电路实现(使用普通反相器,而不是电流饥饿型反相器,因为FPGA中只有普通反相器),使用示波器测试两个环形振荡器RO的频率,从而观察通过本方案电路的重构,是否可以达到预期效果。In order to preliminarily verify the actual effect of the solution of the present invention, the circuit of this solution is implemented in a pure digital circuit on Xilinx Artix-7FPGA (using a common inverter instead of a current-starved inverter, because there are only common inverters in the FPGA ), use an oscilloscope to test the frequencies of the two ring oscillators RO, so as to observe whether the expected effect can be achieved through the reconstruction of the circuit of this scheme.
表中所示出的为:第一行为自动布局布线的环形振荡器RO的频率及频率差;Shown in the table are: the first row is the frequency and frequency difference of the ring oscillator RO of the automatic layout and routing;
第二行为自动布局布线的环形振荡器RO经过重构过程的频率差;The second row is the frequency difference of the automatic placement and routing ring oscillator RO through the reconfiguration process;
第三行为使用手动布局布线的环形振荡器RO经过重构过程的频率差;The third row is the frequency difference of the ring oscillator RO through the reconstruction process using manual placement and routing;
结果表明,重构过程可以大幅度降低两个环形振荡器RO(环形振荡器RO1和环形振荡器RO2)的频率差,从而提升输出的随机性。即使是自动布局布线情况下,也能取得良好的效果。The results show that the reconstruction process can greatly reduce the frequency difference between the two ring oscillators RO (ring oscillator RO1 and ring oscillator RO2), thereby improving the randomness of the output. Even with automatic placement and routing, good results can be achieved.
进一步测试其输出的随机性,成功通过了NIST randomness test suit的测试,满足随机性要求。The randomness of its output was further tested, and it successfully passed the NIST randomness test suit to meet the randomness requirements.
本领域普通技术人员可以理解实施例的各种方法中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,该程序可以存储于一计算机可读存储介质中,存储介质可以包括:只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁盘或光盘等。Those skilled in the art can understand that all or part of the steps in the various methods of the embodiments can be completed by instructing relevant hardware through a program, and the program can be stored in a computer-readable storage medium, and the storage medium can include: Read memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or CD, etc.
以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included in the protection of the present invention. within the range.

Claims (15)

  1. 一种可重构随机数发生器,其特征在于,包括至少两个环形振荡器、采样电路、计数器和逻辑控制单元,具体的:A reconfigurable random number generator, characterized in that it includes at least two ring oscillators, a sampling circuit, a counter and a logic control unit, specifically:
    所述环形振荡器包括n个反相器组,每一个反相器组由至少两个并行设置的反相器,以及分别设置在所述反相器输入侧和输出侧的两个选择器构成;其中,n为自然数;The ring oscillator includes n inverter groups, each inverter group is composed of at least two inverters arranged in parallel, and two selectors respectively arranged on the input side and the output side of the inverters ; where n is a natural number;
    每一个反相器组中相应选择器的控制端与所述逻辑控制单元电气连接,用于接收所述逻辑控制单元的重构信号,并完成每一个反相器组中指定反相器与其两侧的选择器完成电信号通道导通;The control terminal of the corresponding selector in each inverter group is electrically connected with the logic control unit, and is used for receiving the reconstruction signal of the logic control unit and completing the specified inverter in each inverter group and its two The selector on the side completes the conduction of the electrical signal channel;
    所述至少两个环形振荡器的输出端与所述计数器的输入端耦合;所述计数器的输出端与所述逻辑控制单元连接;所述采样电路从所述至少两个环形振荡器中获取采样电信号,以便于根据所述采样电信号输出随机数。The output terminals of the at least two ring oscillators are coupled to the input terminals of the counter; the output terminals of the counter are connected to the logic control unit; the sampling circuit obtains samples from the at least two ring oscillators an electrical signal, so as to output a random number according to the sampled electrical signal.
  2. 根据权利要求1所述的可重构随机数发生器,其特征在于,所述逻辑控制单元通过所述计数器获取所述至少两个环形振荡器的振荡频率差值,用于给环形振荡器中各个选择器发送重构信号,以便通过调整反相器组中选择通过的反相器来完成环形振荡器之间振荡频率差值小于预设阈值。The reconfigurable random number generator according to claim 1, wherein the logic control unit obtains the oscillation frequency difference of the at least two ring oscillators through the counter, and is used to provide the ring oscillator Each selector sends a reconstruction signal, so that the difference between the oscillation frequencies of the ring oscillators is smaller than a preset threshold by adjusting the selected inverters in the inverter group.
  3. 根据权利要求1所述的可重构随机数发生器,其特征在于,所述至少两个环形振荡器的输出端与所述计数器的输入端耦合,具体包括:The reconfigurable random number generator according to claim 1, wherein the output ends of the at least two ring oscillators are coupled to the input ends of the counter, and specifically include:
    所述至少两个环形振荡器的输出端分别与计数器的不同输入端口相连,以便于所述计数器完成对应不同环形振荡器的振荡频率的计数;或者,The output ends of the at least two ring oscillators are respectively connected to different input ports of the counter, so that the counter can complete the counting corresponding to the oscillation frequencies of different ring oscillators; or,
    所述至少两个环形振荡器的输出端与计数选择器的至少两个输入端相连,所述计数选择器的输出端与所述计数器的输入端相连,以便于通过所述逻辑控制单元控制所述计数选择器导通的输入端与输出端对应关系,实现依次对环形振荡器的振荡频率的计数。The output terminals of the at least two ring oscillators are connected to at least two input terminals of a counting selector, and the output terminals of the counting selector are connected to the input terminals of the counter, so as to be controlled by the logic control unit. The corresponding relationship between the input terminal and the output terminal that the counting selector is turned on is used to realize the counting of the oscillation frequency of the ring oscillator in sequence.
  4. 根据权利要求1所述的可重构随机数发生器,其特征在于,所述环形振荡器还包括一个与非门,所述环形振荡器中的反相器组之间形成级联,具体的:The reconfigurable random number generator according to claim 1, wherein the ring oscillator further comprises a NAND gate, and the inverter groups in the ring oscillator are cascaded. :
    所述与非门的第一输入端与使能信号连接;所述与非门的第二输入端与位于所述级联末端的反相器组的输出端口连接;所述与非门的输出端用于连接位于所述级联首部的反相器组的输入端口。The first input end of the NAND gate is connected with the enable signal; the second input end of the NAND gate is connected with the output port of the inverter group at the end of the cascade connection; the output of the NAND gate The terminal is used to connect the input port of the inverter group at the head of the cascade.
  5. 根据权利要求4所述的可重构随机数发生器,其特征在于,在所述随机数发生器中由第一环形振荡器和第二环形振荡器构成一随机数源,所述采样电路由n个D触发器构成,具体的:The reconfigurable random number generator according to claim 4, wherein a random number source is formed by the first ring oscillator and the second ring oscillator in the random number generator, and the sampling circuit is composed of Formed by n D flip-flops, specifically:
    在第一环形振荡器内各反相器组的输出端还分别与一个D触发器的信号输入端口相连;The output ends of each inverter group in the first ring oscillator are also respectively connected with the signal input port of a D flip-flop;
    在第二环形振荡器内各反相器组的输出端还分别与一个D触发器的时钟输入端口相连;The output ends of each inverter group in the second ring oscillator are also respectively connected with the clock input port of a D flip-flop;
    所述采样电路中n个D触发器的输出端口的电信号构成一随机数。The electrical signals of the output ports of the n D flip-flops in the sampling circuit form a random number.
  6. 根据权利要求1-3任一所述的可重构随机数发生器,其特征在于,所述环形振荡器还包括m个普通反相器,具体的:The reconfigurable random number generator according to any one of claims 1-3, wherein the ring oscillator further comprises m ordinary inverters, specifically:
    所述m个普通反相器和n个反相器组按照预设的排列顺序进行级联;The m ordinary inverters and the n inverter groups are cascaded according to a preset arrangement sequence;
    其中,预设的排列顺序包括:Among them, the preset sorting order includes:
    所述m个普通反相器之间进行级联,所述n个反相器组之间进行级联;级联之后的m个普通反相器与所述级联之后的n个反相器之间完成级联;或者,The m ordinary inverters are cascaded, and the n inverter groups are cascaded; the m ordinary inverters after the cascade and the n inverters after the cascade to complete the cascade between; or,
    以普通反相器和反相器组相互间隔的方式进行级联,其中,相互间隔的距离根据所述m个普通反相器与n个反相器组按照之间的比例关系确定;或者,The cascading is performed in a manner that the common inverters and the inverter groups are spaced apart from each other, wherein the distances spaced from each other are determined according to the proportional relationship between the m common inverters and the n inverter groups; or,
    所述m个普通反相器和n个反相器组之间,按照随机排序的方式完成各普通反相器和反相器组的级联。Between the m ordinary inverters and the n inverter groups, the cascading of the ordinary inverters and the inverter groups is completed in a random order.
  7. 根据权利要求6所述的可重构随机数发生器,其特征在于,在所述随机数发生器中由第三环形振荡器和第四环形振荡器构成一随机数源,所述采样电路由p个D触发器构成,其中,n≤p≤m+n,具体的:The reconfigurable random number generator according to claim 6, wherein a random number source is formed by a third ring oscillator and a fourth ring oscillator in the random number generator, and the sampling circuit is composed of It is composed of p D flip-flops, where n≤p≤m+n, specifically:
    在第三环形振荡器内指定反相器和/或反相器组的输出端还分别与一个D触发器的信号输入端口相连;The output terminals of the specified inverter and/or the inverter group in the third ring oscillator are also respectively connected with the signal input ports of a D flip-flop;
    在第四环形振荡器内指定反相器组和/或反相器的输出端还分别与一个D触发器的时钟输入端口相连;In the fourth ring oscillator, the specified inverter group and/or the output terminals of the inverters are respectively connected with the clock input port of a D flip-flop;
    所述采样电路中n个D触发器的输出端口的电信号构成一随机数。The electrical signals of the output ports of the n D flip-flops in the sampling circuit form a random number.
  8. 根据权利要求1所述的可重构随机数发生器,其特征在于,在所述随机数发生器工作在物理不可克隆函数模式时,所述逻辑控制单元还用于获取一个或者多个环形振荡器的激励信号,具体的:The reconfigurable random number generator according to claim 1, wherein when the random number generator operates in a physical unclonable function mode, the logic control unit is further configured to acquire one or more ring oscillations The excitation signal of the device, specifically:
    所述逻辑控制单元将所述激励信号转换为相应一个或者多个环形振荡器的重构信号;The logic control unit converts the excitation signal into a reconstructed signal corresponding to one or more ring oscillators;
    所述逻辑控制单元获取由所述激励信号触发的一个或者多个环形振荡器的输出振荡频率,并根据相应振荡频率或者振荡频率的差值,计算得到物理不可克隆输出结果。The logic control unit acquires the output oscillation frequency of one or more ring oscillators triggered by the excitation signal, and calculates a physically unclonable output result according to the corresponding oscillation frequency or the difference between the oscillation frequencies.
  9. 根据权利要求8所述的可重构随机数发生器,其特征在于,所述环形振荡器的激励信号具体为针对环形振荡器中的指定反相器组输出作为计算物理不可克隆输出结果的数据源。The reconfigurable random number generator according to claim 8, wherein the excitation signal of the ring oscillator is specifically the data output as a result of calculating a physical unclonable output for a specified inverter group in the ring oscillator source.
  10. 根据权利要求8或9所述的可重构随机数发生器,其特征在于,所述并根据相应振荡频率或者振荡频率的差值,计算得到物理不可克隆输出结果,具体包括:The reconfigurable random number generator according to claim 8 or 9, wherein said and according to the corresponding oscillation frequency or the difference between the oscillation frequencies, the physical unclonable output result is calculated and obtained, specifically including:
    振荡频率的差值大于0,则输出0,振荡频率的差值小于0则输出1;或者,If the difference between the oscillation frequencies is greater than 0, output 0, and if the difference between the oscillation frequencies is less than 0, output 1; or,
    振荡频率的差值大于0,则输出1,振荡频率的差值小于0则输出0;或者,If the difference of oscillation frequency is greater than 0, output 1, and if the difference of oscillation frequency is less than 0, output 0; or,
    取振荡频率小数点后指定长度参数值作为整数值输出。Take the value of the specified length parameter after the decimal point of the oscillation frequency and output it as an integer value.
  11. 根据权利要求1所述的可重构随机数发生器,其特征在于,所述反相器具体为TTL非门反相器、CMOS反相器、HPM扰乱效应反相器或者饥饿型反相器中的一种或者多种。The reconfigurable random number generator according to claim 1, wherein the inverter is specifically a TTL NOT gate inverter, a CMOS inverter, an HPM disturbance effect inverter or a starvation inverter one or more of them.
  12. 根据权利要求1所述的可重构随机数发生器,其特征在于,在所述至少两个环形振荡器包括第一环形振荡器、第二环形振荡器和第三环形振荡器时,The reconfigurable random number generator according to claim 1, wherein when the at least two ring oscillators comprise a first ring oscillator, a second ring oscillator and a third ring oscillator,
    所述第一环形振荡器和第二环形振荡器构成一随机数源,所述第二环形振荡器和第三环形振荡器构成一随机数源;或者,The first ring oscillator and the second ring oscillator form a random number source, and the second ring oscillator and the third ring oscillator form a random number source; or,
    所述第一环形振荡器和第三环形振荡器构成一随机数源,所述第二环形振荡器和第三环形振荡器构成一随机数源;或者,The first ring oscillator and the third ring oscillator constitute a random number source, and the second ring oscillator and the third ring oscillator constitute a random number source; or,
    所述第一环形振荡器和第二环形振荡器构成一随机数源,所述第一环形振荡器和第三环形振荡器构成一随机数源。The first ring oscillator and the second ring oscillator constitute a random number source, and the first ring oscillator and the third ring oscillator constitute a random number source.
  13. 一种可重构随机数发生器的实现方法,其特征在于,使用如权利要求1-12任一所述的可重构随机数发生器,实现方法包括:A realization method of a reconfigurable random number generator, characterized in that, using the reconfigurable random number generator according to any one of claims 1-12, the realization method comprises:
    逻辑控制单元通过所述计数器获取所述至少两个环形振荡器的振荡频率;The logic control unit obtains the oscillation frequencies of the at least two ring oscillators through the counter;
    所述逻辑控制单元确定作为一随机数源的第一环形振荡器和第二环形振荡器,并分析所述第一环形振荡器和第二环形振荡器的振荡频率差值;The logic control unit determines the first ring oscillator and the second ring oscillator as a random number source, and analyzes the oscillation frequency difference of the first ring oscillator and the second ring oscillator;
    若所述振荡频率大于预设阈值,所述逻辑控制单元向所述第一环形振荡器和/或第二环形振荡器发送重构信号,以便于控制所述第一环形振荡器和第二环形振荡器中的选择器,完成相应反相器组中指定反相器信号通道导通操作;If the oscillation frequency is greater than a preset threshold, the logic control unit sends a reconstruction signal to the first ring oscillator and/or the second ring oscillator, so as to control the first ring oscillator and the second ring oscillator The selector in the oscillator completes the turn-on operation of the signal channel of the specified inverter in the corresponding inverter group;
    通过一次或者多次逻辑控制单元对重构信号的调整,使得所述第一环形振荡器和第二环形振荡器的振荡频率差值小于预设阈值。By adjusting the reconstructed signal one or more times by the logic control unit, the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than a preset threshold.
  14. 根据权利要求13所述的可重构随机数发生器的实现方法,其特征在于,所述通过一次或者多次逻辑控制单元对重构信号的调整,使得所述第一环形振荡器和第二环形振荡器的振荡频率差值小于预设阈值,具体包括:The method for implementing a reconfigurable random number generator according to claim 13, wherein the adjustment of the reconstructed signal by the logic control unit one or more times makes the first ring oscillator and the second ring oscillator The difference between the oscillation frequencies of the ring oscillator is less than the preset threshold, which includes:
    通过多次对重构信号的调整,逐一完成对各个反相器组中的用于电信号导通的反相器的选择控制的遍历;By adjusting the reconstructed signal multiple times, the traversal of the selection control of the inverters used for electrical signal conduction in each inverter group is completed one by one;
    其中,每一次对重构信号的调整,若能促使所述第一环形振荡器和第二环形振荡器的振荡频率差值减小,则保留此时的重构信号为当前状态的重构信号,所述当前状态的重构信号所对应的振荡频率差,用于与下一次调整后的重构信号下的振荡频率差进行比较,取其中振荡频率差更小的重构信号更新为所述当前状态的重构信号;Wherein, each time the reconstruction signal is adjusted, if the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator can be reduced, the reconstruction signal at this time is retained as the reconstruction signal of the current state. , the oscillating frequency difference corresponding to the reconstructed signal in the current state is used to compare with the oscillating frequency difference under the next adjusted reconstructed signal, and the reconstructed signal with the smaller oscillating frequency difference is updated as the The reconstructed signal of the current state;
    直到所述第一环形振荡器和第二环形振荡器的振荡频率差值小于预设阈值,停止所述遍历过程。The traversing process is stopped until the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is smaller than a preset threshold.
  15. 根据权利要求14所述的可重构随机数发生器的实现方法,其特征在于,若还包括第三环形振荡器,并且由第一环形振荡器和第三环形振荡器构成另一随机数源时,方法还包括:The method for implementing a reconfigurable random number generator according to claim 14, wherein if a third ring oscillator is further included, and the first ring oscillator and the third ring oscillator constitute another random number source , the method also includes:
    在完成所述一次或者多次逻辑控制单元对重构信号的调整,使得所述第一环形振荡器和第二环形振荡器的振荡频率差值小于预设阈值后,再通过一次或者多次逻辑控制单元对第三环形振荡器的重构信号的调整,使得所述第一环形振荡器和第三环形振荡器的振荡频率差值小于预设阈值。After completing the adjustment of the reconstructed signal by the logic control unit one or more times, so that the difference between the oscillation frequencies of the first ring oscillator and the second ring oscillator is less than the preset threshold, the logic control unit will pass one or more times of logic The control unit adjusts the reconstruction signal of the third ring oscillator so that the difference between the oscillation frequencies of the first ring oscillator and the third ring oscillator is smaller than a preset threshold.
PCT/CN2020/107140 2020-08-05 2020-08-05 Reconfigurable random number generator and implementation method therefor WO2022027325A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080080465.6A CN114902174A (en) 2020-08-05 2020-08-05 Reconfigurable random number generator and implementation method thereof
PCT/CN2020/107140 WO2022027325A1 (en) 2020-08-05 2020-08-05 Reconfigurable random number generator and implementation method therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/107140 WO2022027325A1 (en) 2020-08-05 2020-08-05 Reconfigurable random number generator and implementation method therefor

Publications (1)

Publication Number Publication Date
WO2022027325A1 true WO2022027325A1 (en) 2022-02-10

Family

ID=80119674

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/107140 WO2022027325A1 (en) 2020-08-05 2020-08-05 Reconfigurable random number generator and implementation method therefor

Country Status (2)

Country Link
CN (1) CN114902174A (en)
WO (1) WO2022027325A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114417437A (en) * 2022-01-26 2022-04-29 湖北工业大学 Hybrid PUF circuit based on chip-PCB time delay and response generation method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107038015A (en) * 2016-11-18 2017-08-11 杭州电子科技大学 A kind of high-speed, true random-number generator
CN109783060A (en) * 2019-01-16 2019-05-21 河海大学常州校区 High-speed, true random-number generator based on current-steering ring oscillator
US10452358B2 (en) * 2017-01-11 2019-10-22 Canon Kabushiki Kaisha Random number generating apparatus
CN111008005A (en) * 2019-11-22 2020-04-14 深圳市纽创信安科技开发有限公司 True random number generator and true random number generation method
CN111198671A (en) * 2018-11-20 2020-05-26 三星电子株式会社 Random number generator

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107038015A (en) * 2016-11-18 2017-08-11 杭州电子科技大学 A kind of high-speed, true random-number generator
US10452358B2 (en) * 2017-01-11 2019-10-22 Canon Kabushiki Kaisha Random number generating apparatus
CN111198671A (en) * 2018-11-20 2020-05-26 三星电子株式会社 Random number generator
CN109783060A (en) * 2019-01-16 2019-05-21 河海大学常州校区 High-speed, true random-number generator based on current-steering ring oscillator
CN111008005A (en) * 2019-11-22 2020-04-14 深圳市纽创信安科技开发有限公司 True random number generator and true random number generation method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114417437A (en) * 2022-01-26 2022-04-29 湖北工业大学 Hybrid PUF circuit based on chip-PCB time delay and response generation method
CN114417437B (en) * 2022-01-26 2023-07-04 湖北工业大学 chip-PCB (printed circuit board) delay-based hybrid PUF (physical unclonable function) circuit and response generation method

Also Published As

Publication number Publication date
CN114902174A (en) 2022-08-12

Similar Documents

Publication Publication Date Title
US9846568B2 (en) System and method for dynamic tuning feedback control for random number generator
Epstein et al. Design and implementation of a true random number generator based on digital circuit artifacts
US6240432B1 (en) Enhanced random number generator
Della Sala et al. A novel ultra-compact FPGA-compatible TRNG architecture exploiting latched ring oscillators
WO2019222866A1 (en) True random number generation method and device having detection and correction functions
US9405510B2 (en) Random number generator
Cui et al. Design of true random number generator based on multi-stage feedback ring oscillator
US7602219B2 (en) Inverting cell
Majzoobi et al. Automated design, implementation, and evaluation of arbiter-based PUF on FPGA using programmable delay lines
CN113672199A (en) Multi-entropy source random number generator with physical unclonable function
Cao et al. An energy-efficient true random number generator based on current starved ring oscillators
WO2022027325A1 (en) Reconfigurable random number generator and implementation method therefor
Addabbo et al. Lightweight true random bit generators in PLDs: Figures of merit and performance comparison
Zhang et al. A high reliability physically unclonable function based on multiple tunable ring oscillator
Günay et al. IC random number generator exploiting two simultaneous metastable events of tetrahedral oscillators
Yanambaka et al. Secure multi-key generation using ring oscillator based physical unclonable function
US11489681B2 (en) Multifunctional physically unclonable function device based on hybrid Boolean network
Yanambaka et al. Reconfigurable robust hybrid oscillator arbiter PUF for IoT security based on DL-FET
Devi et al. Hardware random number generator using FPGA
KR101127961B1 (en) True Random Number Generation Device using Oscillator Sampling Method
Yao et al. DCDRO: A true random number generator based on dynamically configurable dual-output ring oscillator
Lu et al. Efficient FPGA implementation of high-speed true random number generator
Chiou et al. A reliable delay-based physical unclonable function with dark-bit avoidance
Zhang et al. Multi-incentive delay-based (MID) PUF
Authimuthu et al. Low–power and high-speed multi-operational shift register on silicon using bi-enabled pulsed latch

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20948090

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20948090

Country of ref document: EP

Kind code of ref document: A1