[go: up one dir, main page]

CN107025092A - A kind of random number extracting method based on latch structure real random number generators - Google Patents

A kind of random number extracting method based on latch structure real random number generators Download PDF

Info

Publication number
CN107025092A
CN107025092A CN201710458323.9A CN201710458323A CN107025092A CN 107025092 A CN107025092 A CN 107025092A CN 201710458323 A CN201710458323 A CN 201710458323A CN 107025092 A CN107025092 A CN 107025092A
Authority
CN
China
Prior art keywords
random number
true random
latch structure
number generator
oscillation
Prior art date
Legal status (The legal status 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 status listed.)
Granted
Application number
CN201710458323.9A
Other languages
Chinese (zh)
Other versions
CN107025092B (en
Inventor
梁华国
王浩宇
徐秀敏
蒋翠云
黄正峰
易茂祥
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hefei University of Technology
Original Assignee
Hefei University of Technology
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 Hefei University of Technology filed Critical Hefei University of Technology
Priority to CN201710458323.9A priority Critical patent/CN107025092B/en
Publication of CN107025092A publication Critical patent/CN107025092A/en
Application granted granted Critical
Publication of CN107025092B publication Critical patent/CN107025092B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • G06F7/588Random number generators, i.e. based on natural stochastic processes

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)
  • Tests Of Electronic Circuits (AREA)

Abstract

本发明提供一种基于latch结构真随机数发生器的随机数提取方法,具体包括如下步骤:在FPGA上实现latch结构真随机数发生器;利用亚稳态现象使得真随机数发生模块开始振荡,通过计数器记录真随机数发生模块的振荡周期,同时利用FPGA的系统时钟记录振荡时间;利用真随机数发生模块中的多路选择器配置真随机数发生模块不同的路径来调整振荡周期,使振荡周期大于70;提取计数器最低2位作为随机数输出,利用亚稳态现象使latch结构真随机数发生器产生满足数量需求的真随机数。本发明的有益效果在于:大大提高了随机数产生的速度;对于温度、电压和工艺的变化具有较高的鲁棒性,在不同条件下产生的数据均能通过NIST随机性测试。

The present invention provides a random number extraction method based on a latch structure true random number generator, which specifically includes the following steps: realizing a latch structure true random number generator on an FPGA; using metastable phenomena to make a true random number generation module start to oscillate, The oscillation period of the true random number generator module is recorded by the counter, and the oscillation time is recorded by the system clock of the FPGA; The period is greater than 70; the lowest 2 bits of the counter are extracted as random number output, and the metastable phenomenon is used to make the latch structure true random number generator generate true random numbers that meet the quantity requirements. The beneficial effect of the present invention is that: the speed of random number generation is greatly improved; the method has high robustness against changes in temperature, voltage and process, and the data generated under different conditions can all pass the NIST randomness test.

Description

一种基于latch 结构真随机数发生器的随机数提取方法A Random Number Extraction Method Based on Latch Structure True Random Number Generator

技术领域technical field

本发明属于信息安全及集成电路技术领域,具体涉及一种基于latch结构真随机数发生器的随机数提取方法。The invention belongs to the technical fields of information security and integrated circuits, and in particular relates to a random number extraction method based on a latch structure true random number generator.

背景技术Background technique

随着云计算、物联网和大数据的广泛应用,人与人、人与物之间通信规模急速增长,信息安全问题变得越来越重要。数据加密是保证信息安全的主要方法甚至是唯一方法,而随机数是数据加密的基础,随机数的应用包括在密码算法中生成安全密钥、安全因特网协议中产生会话ID、生成移动互联网设备ID和各种操作系统协议等。随机数发生器有真随机和伪随机之分,伪随机数发生器(PRNG)使用确定性算法将短随机串扩展成" 随机查找"位流,并且具有周期性,所产生随机数无法满足随机性需求高的加密系统。而真随机数发生器(TRNG)是从物理噪声源收获熵,无周期、不可预测、具有实时的随机性,为高可靠性的加密系统提供了保障。With the widespread application of cloud computing, the Internet of Things and big data, the scale of communication between people and between people and things has increased rapidly, and information security issues have become more and more important. Data encryption is the main method or even the only method to ensure information security, and random numbers are the basis of data encryption. The application of random numbers includes generating security keys in cryptographic algorithms, generating session IDs in secure Internet protocols, and generating mobile Internet device IDs. And various operating system protocols, etc. Random number generators can be divided into true random and pseudo-random. Pseudo-random number generators (PRNG) use deterministic algorithms to expand short random strings into "random search" bit streams, and are periodic, so the generated random numbers cannot meet the requirements of randomness. Encryption systems with high performance requirements. The true random number generator (TRNG) harvests entropy from physical noise sources, is non-periodic, unpredictable, and has real-time randomness, providing a guarantee for a highly reliable encryption system.

国内外关于TRNG的研究有很多种类,而主要的研究集中在三个方面:基于电阻热噪声的随机数发生器、基于振荡器的随机数发生器和基于亚稳态的随机数发生器。早期采用电阻热噪声直接放大提取随机数的方法,然而这类方法缺点表现在两个方面,一方面电源与衬底的耦合噪声难以消除,或其它非理想因素也在一定程度上影响产生的随机序列的随机性。另一方面这类方法多采用模拟器件,使得这类模拟设计难以应用在片上系统集成和技术移植方面。基于振荡器采样的方法是一种全数字的方法,与直接放大噪声的方法相比,全数字电路的方法对于工艺、电压和温度的变化具有高鲁棒性和易于集成等优点。其随机性的好坏主要依赖于低频振荡器相位抖动大小,以及低频振荡器相位抖动相对于高频振荡器周期的大小,因此需要多个振荡器以增加相位抖动,但也增加了硬件开销。基于亚稳态的方法也可以完全采用数字工艺实现,利用双稳态器件中的亚稳态现象来产生随机数。然而,传统亚稳态方法对环境变化比较敏感,由于工艺偏差的影响,通常需要大量的设计来校准以消除装置中系统和时序的不匹配。可见各类方法都存在着不足之处,还有很多待研究的地方。如吞吐率和功耗一直都是该方面研究的重点,为已有或即将出现的需求提供效率保障。There are many kinds of research on TRNG at home and abroad, and the main research focuses on three aspects: random number generator based on resistance thermal noise, random number generator based on oscillator and random number generator based on metastable state. In the early days, the method of directly amplifying and extracting random numbers by resistive thermal noise was used. However, the disadvantages of this method are manifested in two aspects. On the one hand, it is difficult to eliminate the coupling noise between the power supply and the substrate, or other non-ideal factors also affect the generated random numbers to a certain extent. The randomness of the sequence. On the other hand, most of these methods use analog devices, which makes it difficult to apply this type of analog design to system integration and technology transplantation on a chip. The method based on oscillator sampling is an all-digital method. Compared with the method of directly amplifying noise, the method of all-digital circuit has the advantages of high robustness and easy integration for changes in process, voltage and temperature. The quality of its randomness mainly depends on the phase jitter of the low-frequency oscillator, and the phase jitter of the low-frequency oscillator relative to the period of the high-frequency oscillator. Therefore, multiple oscillators are needed to increase the phase jitter, but also increase the hardware overhead. Metastability-based methods can also be implemented entirely in digital technology, using the metastable phenomenon in bistable devices to generate random numbers. However, traditional metastable methods are sensitive to environmental changes and usually require extensive design-in calibration to eliminate system and timing mismatches in the device due to process variations. It can be seen that there are deficiencies in all kinds of methods, and there are still many places to be studied. For example, throughput and power consumption have always been the focus of research in this area, providing efficiency guarantees for existing or upcoming needs.

发明内容Contents of the invention

为了解决现有技术中存在的上述技术缺陷,本发明提供一种基于latch结构真随机数发生器的随机数提取方法,在保证高鲁棒性的基础上,对于随机数产生速度具有很大的提升,以提高真随机数在信息安全领域上的应用效率。In order to solve the above-mentioned technical defects existing in the prior art, the present invention provides a random number extraction method based on a latch-structured true random number generator, which has great advantages for the random number generation speed on the basis of ensuring high robustness To improve the application efficiency of true random numbers in the field of information security.

本发明是通过以下技术方案实现的:The present invention is achieved through the following technical solutions:

一种基于latch结构真随机数发生器的随机数提取方法,其中,latch结构真随机数发生器包括依次连接的Microblaze软核,真随机数发生模块,计数器,有限状态机;Microblaze 软核分别与计数器和有限状态机连接;真随机数发生模块为采用偶数个门的latch结构。随机数提取方法包括如下步骤:A random number extraction method based on a latch structure true random number generator, wherein the latch structure true random number generator includes Microblaze soft cores connected in sequence, a true random number generation module, a counter, and a finite state machine; the Microblaze soft core is connected with The counter is connected with the finite state machine; the true random number generation module is a latch structure with an even number of gates. The random number extraction method includes the following steps:

初始化步骤:Initialization steps:

在FPGA上实现latch结构真随机数发生器;Implement a latch structure true random number generator on FPGA;

振荡开始步骤:Oscillation start steps:

利用亚稳态现象使得真随机数发生模块开始振荡,通过计数器记录真随机数发生模块的振荡周期,同时利用FPGA的系统时钟记录振荡时间;The metastable phenomenon is used to make the true random number generator module start to oscillate, the oscillation period of the true random number generator module is recorded by the counter, and the oscillation time is recorded by the system clock of the FPGA;

振荡调整步骤:Oscillation adjustment steps:

利用真随机数发生模块中的多路选择器配置真随机数发生模块不同的路径来调整振荡周期,使振荡周期大于70;Utilize the multiplexer in the true random number generating module to configure different paths of the true random number generating module to adjust the oscillation period, so that the oscillation period is greater than 70;

输出步骤:Output steps:

提取计数器最低2位作为随机数输出,利用亚稳态现象使latch结构真随机数发生器产生满足数量需求的真随机数。The lowest 2 bits of the counter are extracted as the random number output, and the metastable phenomenon is used to make the latch structure true random number generator generate true random numbers that meet the quantity requirements.

本发明相对于现有技术的有益效果在于:The beneficial effect of the present invention with respect to prior art is:

1、本发明提出的随机数提取方法,是在latch结构振荡结束之前就提取随机数,与已有的方法相比,很大地提高了随机数产生的速度。1. The method for extracting random numbers proposed by the present invention is to extract random numbers before the oscillation of the latch structure ends. Compared with the existing methods, the speed of random number generation is greatly improved.

2、本发明提出的随机数提取方法,对于温度、电压和工艺的变化具有较高的鲁棒性,在不同条件下产生的数据均能通过NIST随机性测试。2. The random number extraction method proposed by the present invention has high robustness to changes in temperature, voltage and process, and the data generated under different conditions can pass the NIST randomness test.

3、本发明提出的随机数提取方法,在FPGA平台上实现,相对于FPGA上广泛采用的真随机数发生器,本文方法具有较低的资源消耗,为FPGA上相关研究提供了新的参考。3. The random number extraction method proposed by the present invention is implemented on the FPGA platform. Compared with the widely used true random number generator on the FPGA, the method in this paper has lower resource consumption, and provides a new reference for related research on the FPGA.

附图说明Description of drawings

图1为本发明随机数提取方法的总流程图。Fig. 1 is a general flowchart of the random number extraction method of the present invention.

图2为latch结构真随机数发生器的结构示意图。FIG. 2 is a schematic structural diagram of a true random number generator with a latch structure.

图3为真随机数发生模块的结构示意图。FIG. 3 is a schematic structural diagram of a true random number generating module.

图4a为基本亚稳态结构。Figure 4a shows the basic metastable structure.

图4b为亚稳态转移曲线。Figure 4b is the metastable transition curve.

图5为本发明随机数提取方法的信号时序图。FIG. 5 is a signal sequence diagram of the random number extraction method of the present invention.

图6为本发明随机数提取方法的整体工作流程图。Fig. 6 is an overall working flow chart of the random number extraction method of the present invention.

具体实施方式detailed description

为了使本发明的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本发明进行进一步详细说明。应当理解,此处所描述的具体实施方式仅仅用以解释本发明,并不用于限定本发明。In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, and are not intended to limit the present invention.

实施例1:Example 1:

本实验在xc6vlx240t-1ffg1156FPGA开发板上实现真随机数发生器,开发板系统工作频率50Mhz,正常工作电压1.0V,正常工作温度25℃,Microblaze工作频率100Mhz。软件使用ISE14.3版本,用于Verilog代码的书写,综合,映射,布局布线,生成bit文件。如图1所示,本实施例提供一种基于latch结构真随机数发生器的随机数提取方法,其中:This experiment implements a true random number generator on the xc6vlx240t-1ffg1156FPGA development board. The system operating frequency of the development board is 50Mhz, the normal operating voltage is 1.0V, the normal operating temperature is 25°C, and the Microblaze operating frequency is 100Mhz. The software uses ISE14.3 version for Verilog code writing, synthesis, mapping, layout and routing, and bit file generation. As shown in Figure 1, this embodiment provides a random number extraction method based on a latch structure true random number generator, wherein:

latch结构真随机数发生器的具体结构如图2所示,包括依次连接的Microblaze软核,真随机数发生模块,计数器,有限状态机;Microblaze软核分别与计数器和有限状态机连接;真随机数发生模块为采用偶数个门的latch结构。在图2中,Microblaze为FPGA 自带软核,利用串口和中断控制数据传输;latch为加入偶数个门结构的真随机数发生模块;Counter为计数器;FMS为有限状态机;Enable信号用于使真随机数发生模块latch 开始振荡,count为计数器值,Clear信号用于清空计数器值,TRN为有限状态机按照程序设定获取的计数器某时刻的值。Microblaze软核通过USB端口实现latch结构真随机数发生器与外部计算机HOST(PC)的连接。The specific structure of the latch structure true random number generator is shown in Figure 2, including the Microblaze soft core connected in sequence, the true random number generation module, the counter, and the finite state machine; the Microblaze soft core is connected with the counter and the finite state machine respectively; the true random The number generating module is a latch structure with an even number of gates. In Figure 2, Microblaze is the FPGA with its own soft core, which uses serial ports and interrupts to control data transmission; latch is a true random number generator module with an even number of gate structures; Counter is a counter; FMS is a finite state machine; The true random number generation module latch starts to oscillate, count is the counter value, the Clear signal is used to clear the counter value, and TRN is the value of the counter at a certain moment obtained by the finite state machine according to the program setting. The Microblaze soft core realizes the connection between the latch structure true random number generator and the external computer HOST (PC) through the USB port.

本实施例示出的真随机数发生模块的具体结构如图1所示,包括2条选择通道,其中:每条选择通道包括依次连接的1个或非门和2个非门选择单元;或非门的两个输入端分别作为选择通道的两个输入端,末端的非门选择单元的输出端作为选择通道的输出端。非门选择单元包括4个非门和1个多路选择器,每个非门的输出端对应连接多路选择器的一个输入端,4个非门的输入端共同作为非门选择单元的输入端,多路选择器的输出端作为非门选择单元的输出端。The specific structure of the true random number generation module shown in this embodiment is shown in Figure 1, including 2 selection channels, wherein: each selection channel includes 1 NOR gate and 2 NOR gate selection units connected in sequence; The two input terminals of the gate are used as the two input terminals of the selection channel respectively, and the output terminal of the selection unit of the non-gate at the end is used as the output terminal of the selection channel. The NOT gate selection unit includes 4 NOT gates and 1 multiplexer, the output of each NOT gate corresponds to an input terminal of the multiplexer, and the input terminals of the 4 NOT gates are jointly used as the input of the NOT gate selection unit terminal, the output terminal of the multiplexer is used as the output terminal of the NOT gate selection unit.

一个选择通道的一个输入端与另一个选择通道的一个输入端共同作为真随机数发生模块的输入端,一个选择通道的另一个输入端与另一个选择通道的输出端连接,一个选择通道的输出端与另一个选择通道的另一个输入端连接,两个选择通道的输出端共同作为真随机数发生模块的输出端。One input terminal of one selection channel and one input terminal of another selection channel are used as the input terminal of the true random number generator module, the other input terminal of one selection channel is connected with the output terminal of another selection channel, and the output terminal of one selection channel The terminal is connected to the other input terminal of another selection channel, and the output terminals of the two selection channels are jointly used as the output terminal of the true random number generating module.

随机数提取方法包括如下步骤:The random number extraction method includes the following steps:

步骤S1,初始化步骤:Step S1, initialization step:

在FPGA上实现latch结构真随机数发生器。具体包括:利用预设的约束文件定义latch 结构真随机数发生器在FPGA上的位置;再利用约束文件进行时序约束,防止时序违规。以实现如图3的为例,真随机数发生模块在FPGA中占用6个Slice,其中2个配置为或非门,各占用1个查找表的2个输入端。剩下每个配置为4个非门连接一个多路选择器的结构,各占用1个查找表6个输入端。Implement a latch structure true random number generator on FPGA. Specifically include: use the preset constraint file to define the position of the latch structure true random number generator on the FPGA; then use the constraint file to perform timing constraints to prevent timing violations. Taking the implementation as shown in Figure 3 as an example, the true random number generator module occupies 6 slices in the FPGA, 2 of which are configured as NOR gates, each occupying 2 input terminals of a look-up table. The remaining structures are each configured as 4 NOT gates connected to a multiplexer, each occupying 6 input terminals of a look-up table.

步骤S2,振荡开始步骤:Step S2, the oscillation start step:

利用亚稳态现象使得真随机数发生模块开始振荡,通过计数器记录真随机数发生模块的振荡周期,同时利用FPGA的系统时钟记录振荡时间。The metastable phenomenon is used to make the true random number generation module start to oscillate, the oscillation period of the true random number generation module is recorded by the counter, and the oscillation time is recorded by the system clock of the FPGA.

首先简单的介绍亚稳态现象,如图4a所示,其中输入信号Enable驱动A和B两个或非门。当Enable=1时,Y1Y2=00。如图4b为Y1Y2转移曲线,从中可以看出Y1Y2=00 是强制处于亚稳态状态。将Enable从1跳变到0,则A、B两门都相当于反相器,因此 Y1和Y2都具有转化为稳定状态的趋势,使得结构产生振荡的现象。由于latch中的门会受到噪声和工艺偏差的影响,会导致其中一边的电平信号传输快,整个latch结构最终达到稳定的状态,Y1Y2=01或Y1Y2=10,此过程是传统的亚稳态现象。First briefly introduce the metastability phenomenon, as shown in Figure 4a, where the input signal Enable drives two NOR gates A and B. When Enable=1, Y 1 Y 2 =00. Figure 4b is the transfer curve of Y 1 Y 2 , from which it can be seen that Y 1 Y 2 =00 is forced to be in a metastable state. When Enable jumps from 1 to 0, both gates A and B are equivalent to inverters, so both Y 1 and Y 2 have a tendency to transform into a stable state, causing the structure to oscillate. Since the gates in the latch will be affected by noise and process deviation, the level signal transmission on one side will be fast, and the entire latch structure will eventually reach a stable state, Y 1 Y 2 =01 or Y 1 Y 2 =10, this process is a traditional metastable phenomenon.

结合图2所示的latch结构真随机数发生器的结构进行说明,利用亚稳态现象使得真随机数发生模块latch结构开始振荡,其操作时序如图5所示,其中Enable信号为振荡使能信号,Enable下降沿到来时则latch结构开始振荡。Clear信号清除计数器值,为1时始终保持计数器值清零。CLK为系统时钟,用来记录振荡了多少周期,Counter为计数器,记录振荡周期。Combined with the structure of the latch structure true random number generator shown in Figure 2, the metastable phenomenon is used to make the latch structure of the true random number generation module start to oscillate, and its operation sequence is shown in Figure 5, where the Enable signal is the oscillation enable signal, when the Enable falling edge arrives, the latch structure starts to oscillate. The Clear signal clears the counter value, and keeps the counter value cleared when it is 1. CLK is the system clock, which is used to record the number of oscillation cycles, and Counter is a counter, which records the oscillation cycle.

步骤S3,振荡调整步骤:Step S3, oscillation adjustment step:

利用真随机数发生模块中的多路选择器配置真随机数发生模块不同的路径来调整振荡周期,使振荡周期大于等于70。The multiplexer in the true random number generating module is used to configure different paths of the true random number generating module to adjust the oscillation period, so that the oscillation period is greater than or equal to 70.

如果布局不对称,latch两边延时差较大,且系统偏差较大,崩溃周期只能达到十几次,产生随机数速率较慢。如果布局对称,latch两边延时差非常接近并且系统偏差较小的情况下,振荡周期可以达到几十万次,具有较高的速率。通过配置不同的路径,调整振荡周期到需要的范围,振荡周期大于70则计数器至少有2位可以作为随机位输出。If the layout is asymmetrical, the delay difference between the two sides of the latch is large, and the system deviation is large, the crash cycle can only reach a dozen times, and the rate of generating random numbers is slow. If the layout is symmetrical, the delay difference on both sides of the latch is very close and the system deviation is small, the oscillation cycle can reach hundreds of thousands of times, with a high rate. By configuring different paths, adjust the oscillation period to the required range. If the oscillation period is greater than 70, at least 2 bits of the counter can be output as random bits.

此处多路选择器的具体配置方法如下:非门选择单元既是4个非门连接一个多路选择器,该单元用一个6输入查找表实现,其中两个输入端作为多路选择器控制端口,剩下四个输入端为四个非门,调整振荡周期时,通过状态机改变多路选择器控制端口的值选通不同的非门,既选择不同的路径。The specific configuration method of the multiplexer here is as follows: the NOT gate selection unit is 4 NOT gates connected to a multiplexer, and the unit is implemented with a 6-input lookup table, two of which are used as multiplexer control ports , and the remaining four input terminals are four NOT gates. When adjusting the oscillation period, the value of the multiplexer control port is changed through the state machine to select different NOT gates, and different paths are selected.

步骤S4,校准步骤:Step S4, calibration step:

振荡结束之前,利用有限状态机调整采样时间,选取振荡周期大于等于70的时刻进行采样。Before the oscillation ends, use the finite state machine to adjust the sampling time, and select the moment when the oscillation period is greater than or equal to 70 for sampling.

由于受到工艺偏差的影响,相同的采样时间在不同芯片上可能会得到不同的结果,为确保采样时间满足要求,在不同的FPGA芯片上实现该真随机数发生模块TRNG也需要通过有限状态机先进行校准。校准方式具体为:调整采样时间,收集5000组数据后,判断其均值是否大于或等于70,选取振荡周期大于等于70的时刻进行采样;若均值小于 70,则将采样时间向后加1,继续收集数据进行判断,待到其均值大于或等于70则校准完毕,随后的随机数采集以此时刻为标准。Due to the influence of process deviation, the same sampling time may get different results on different chips. In order to ensure that the sampling time meets the requirements, the realization of the true random number generation module TRNG on different FPGA chips also needs to be implemented through a finite state machine. to calibrate. The calibration method is as follows: adjust the sampling time, after collecting 5000 sets of data, judge whether the average value is greater than or equal to 70, and select the time when the oscillation cycle is greater than or equal to 70 to sample; if the average value is less than 70, add 1 to the sampling time backward, and continue The data is collected for judgment, and the calibration is completed when the mean value is greater than or equal to 70, and the subsequent random number collection is based on this moment.

步骤S5,输出步骤:Step S5, the output step:

提取计数器最低2位作为随机数输出,利用亚稳态现象使latch结构真随机数发生器产生满足数量需求的真随机数。The lowest 2 bits of the counter are extracted as the random number output, and the metastable phenomenon is used to make the latch structure true random number generator generate true random numbers that meet the quantity requirements.

由于整个结构是亚稳态节结构,因此在规定时刻的计数分布服从逆高斯分布,因此可以采用计数器最低2位作为随机数输出,则这2位具有相同的0、1分布。在前面的步骤完成之后,后续就是根据需求产生随机数,整体操作流程图如图6所示,根据图5的时序不断产生随机数,待数据量满足需求则随机数输出完毕。Since the whole structure is a metastable node structure, the counting distribution at the specified time obeys the inverse Gaussian distribution, so the lowest 2 bits of the counter can be used as the random number output, and these 2 bits have the same 0, 1 distribution. After the previous steps are completed, the follow-up is to generate random numbers according to the requirements. The overall operation flow chart is shown in Figure 6. Random numbers are continuously generated according to the sequence in Figure 5. When the amount of data meets the requirements, the random numbers are output.

在本实施例中,为了对输出的随机数进行测试,保证数据的准确性,还可以进一步包括步骤S6,测试步骤:In this embodiment, in order to test the output random number and ensure the accuracy of the data, it may further include step S6, the testing step:

利用NIST随机性测试套件对latch结构真随机数发生器产生的随机数进行测试,测试结果输出一系列P值,在P值大于0.0001时则表示该数据随机性通过。Use the NIST randomness test suite to test the random numbers generated by the latch structure true random number generator. The test results output a series of P values. When the P value is greater than 0.0001, it means that the data has passed the randomness.

在具体应用中,可使用NIST SP800-22标准随机性测试软件进行测试。表1示出的是在正常的温度和电压下实验测试计数器第二个最低位并收集1K数据,经过测试可知,输出的数据全部通过了15项NIST随机性测试,并且具有较高的P值,以及较高的熵(Proportion为测试300次通过的概率)。In specific applications, NIST SP800-22 standard randomness testing software can be used for testing. Table 1 shows that the second lowest bit of the counter is experimentally tested under normal temperature and voltage and 1K data is collected. After testing, it can be seen that the output data have all passed 15 NIST randomness tests and have a high P value , and higher entropy (Proportion is the probability of passing the test 300 times).

表1 2 LSB NIST测试结果Table 1 2 LSB NIST test results

本发明相对于现有技术的有益效果在于:The beneficial effect of the present invention with respect to prior art is:

1、本发明提出的随机数提取方法,是在latch结构振荡结束之前就提取随机数,与已有的方法相比,很大地提高了随机数产生的速度。1. The method for extracting random numbers proposed by the present invention is to extract random numbers before the oscillation of the latch structure ends. Compared with the existing methods, the speed of random number generation is greatly improved.

2、本发明提出的随机数提取方法,对于温度、电压和工艺的变化具有较高的鲁棒性,在不同条件下产生的数据均能通过NIST随机性测试。2. The random number extraction method proposed by the present invention has high robustness to changes in temperature, voltage and process, and the data generated under different conditions can pass the NIST randomness test.

3、本发明提出的随机数提取方法,在FPGA平台上实现,相对于FPGA上广泛采用的真随机数发生器,本文方法具有较低的资源消耗,为FPGA上相关研究提供了新的参考。3. The random number extraction method proposed by the present invention is implemented on the FPGA platform. Compared with the widely used true random number generator on the FPGA, the method in this paper has lower resource consumption, and provides a new reference for related research on the FPGA.

本领域的技术人员容易理解,以上所述仅为本发明的较佳实施例而已,并不用以限制本发明,凡在本发明的精神和原则之内所作的任何修改、等同替换和改进等,均应包含在本发明的保护范围之内。Those skilled in the art can easily understand that 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, All should be included within the protection scope of the present invention.

Claims (6)

1.一种基于latch结构真随机数发生器的随机数提取方法,其中,所述latch结构真随机数发生器包括依次连接的Microblaze软核,真随机数发生模块,计数器,有限状态机;1. a method for extracting random numbers based on a latch structure true random number generator, wherein the latch structure true random number generator includes a Microblaze soft core connected successively, a true random number generation module, a counter, and a finite state machine; 所述Microblaze软核分别与所述计数器和所述有限状态机连接;所述真随机数发生模块为采用偶数个门的latch结构;其特征在于,所述随机数提取方法包括如下步骤:The Microblaze soft core is connected with the counter and the finite state machine respectively; the true random number generating module is a latch structure adopting an even number of gates; it is characterized in that the random number extraction method comprises the steps: 初始化步骤:Initialization steps: 在FPGA上实现所述latch结构真随机数发生器;Realize described latch structure true random number generator on FPGA; 振荡开始步骤:Oscillation start steps: 利用亚稳态现象使得所述真随机数发生模块开始振荡,通过所述计数器记录所述真随机数发生模块的振荡周期,同时利用FPGA的系统时钟记录振荡时间;Using the metastable phenomenon to make the true random number generation module start to oscillate, record the oscillation period of the true random number generation module by the counter, and utilize the system clock of the FPGA to record the oscillation time; 振荡调整步骤:Oscillation adjustment steps: 利用所述真随机数发生模块中的多路选择器配置所述真随机数发生模块不同的路径来调整振荡周期,使振荡周期大于等于70;Using the multiplexer in the true random number generating module to configure different paths of the true random number generating module to adjust the oscillation period, so that the oscillation period is greater than or equal to 70; 输出步骤:Output steps: 提取所述计数器最低2位作为随机数输出,利用亚稳态现象使所述latch结构真随机数发生器产生满足数量需求的真随机数。The lowest 2 bits of the counter are extracted as random number output, and the metastable phenomenon is used to make the latch structure true random number generator generate true random numbers meeting the quantity requirement. 2.根据权利要求1所述的基于latch结构真随机数发生器的随机数提取方法,其特征在于,所述真随机数发生模块具体包括2条选择通道,其中:2. the random number extraction method based on the latch structure true random number generator according to claim 1, is characterized in that, described true random number generation module specifically comprises 2 selection channels, wherein: 所述选择通道包括依次连接的1个或非门和2个非门选择单元;所述或非门的两个输入端分别作为所述选择通道的两个输入端,末端的所述非门选择单元的输出端作为所述选择通道的输出端;The selection channel includes 1 NOR gate and 2 NOR gate selection units connected in sequence; the two input terminals of the NOR gate are respectively used as the two input terminals of the selection channel, and the NOR gate at the end selects The output terminal of the unit is used as the output terminal of the selected channel; 所述非门选择单元包括4个非门和1个多路选择器,每个所述非门的输出端对应连接所述多路选择器的一个输入端,4个所述非门的输入端共同作为所述非门选择单元的输入端,所述多路选择器的输出端作为所述非门选择单元的输出端;The NOT gate selection unit includes 4 NOT gates and 1 multiplexer, the output of each of the NOT gates is correspondingly connected to an input of the multiplexer, and the input terminals of the 4 NOT gates Commonly used as the input terminal of the NOT gate selection unit, and the output terminal of the multiplexer is used as the output terminal of the NOT gate selection unit; 一个所述选择通道的一个输入端与另一个所述选择通道的一个输入端共同作为所述真随机数发生模块的输入端,一个所述选择通道的另一个输入端与另一个所述选择通道的输出端连接,一个所述选择通道的输出端与另一个所述选择通道的另一个输入端连接,两个所述选择通道的输出端共同作为所述真随机数发生模块的输出端。An input end of one said selection channel and an input end of another said selection channel are jointly used as the input end of said true random number generating module, and the other input end of one said selection channel is connected with another said selection channel The output terminals of one of the selection channels are connected to the other input terminal of the other selection channel, and the output terminals of the two selection channels are jointly used as the output terminals of the true random number generation module. 3.根据权利要求1或2所述的基于latch结构真随机数发生器的随机数提取方法,其特征在于,所述初始化步骤进一步包括:3. the random number extracting method based on latch structure true random number generator according to claim 1 or 2, is characterized in that, described initialization step further comprises: 利用预设的约束文件定义所述latch结构真随机数发生器在FPGA上的位置;再利用所述约束文件进行时序约束,防止时序违规。Using a preset constraint file to define the position of the latch structure true random number generator on the FPGA; and then using the constraint file to perform timing constraints to prevent timing violations. 4.根据权利要求1或2所述的基于latch结构真随机数发生器的随机数提取方法,其特征在于,在所述输出步骤之前还包括校准步骤:4. the random number extracting method based on latch structure true random number generator according to claim 1 or 2, is characterized in that, also comprises calibration step before described output step: 振荡结束之前,利用所述有限状态机调整采样时间,选取振荡周期大于等于70的时刻进行采样。Before the oscillation ends, the finite state machine is used to adjust the sampling time, and the time when the oscillation cycle is greater than or equal to 70 is selected for sampling. 5.根据权利要求4所述的基于latch结构真随机数发生器的随机数提取方法,其特征在于,所述校准步骤进一步包括:5. the random number extracting method based on latch structure true random number generator according to claim 4, is characterized in that, described calibration step further comprises: 利用所述有限状态机先进行校准,调整采样时间,收集5000组数据后,判断其均值是否大于或等于70,选取振荡周期大于等于70的时刻进行采样;若均值小于70,则将采样时间向后加1,继续收集数据进行判断,待到其均值大于或等于70则校准完毕,随后的随机数采集以此时刻为标准。Utilize described finite state machine to carry out calibration first, adjust sampling time, after collecting 5000 groups of data, judge whether its mean value is greater than or equal to 70, select the moment of oscillation cycle greater than or equal to 70 to sample; if mean value is less than 70, then change sampling time to After adding 1, continue to collect data for judgment. When the average value is greater than or equal to 70, the calibration is completed, and the subsequent random number collection is based on this moment. 6.根据权利要求1或2所述的基于latch结构真随机数发生器的随机数提取方法,其特征在于,在所述输出步骤之后还包括测试步骤:6. according to the random number extracting method based on latch structure true random number generator according to claim 1 and 2, it is characterized in that, also comprise testing step after described outputting step: 利用NIST随机性测试套件对所述latch结构真随机数发生器产生的随机数进行测试,测试结果输出一系列P值,在P值大于0.0001时则表示该数据随机性通过。Use the NIST randomness test suite to test the random numbers generated by the latch structure true random number generator. The test results output a series of P values. When the P value is greater than 0.0001, it means that the data has passed the randomness.
CN201710458323.9A 2017-06-16 2017-06-16 Random number extraction method based on latch structure true random number generator Expired - Fee Related CN107025092B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710458323.9A CN107025092B (en) 2017-06-16 2017-06-16 Random number extraction method based on latch structure true random number generator

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710458323.9A CN107025092B (en) 2017-06-16 2017-06-16 Random number extraction method based on latch structure true random number generator

Publications (2)

Publication Number Publication Date
CN107025092A true CN107025092A (en) 2017-08-08
CN107025092B CN107025092B (en) 2020-07-17

Family

ID=59531875

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710458323.9A Expired - Fee Related CN107025092B (en) 2017-06-16 2017-06-16 Random number extraction method based on latch structure true random number generator

Country Status (1)

Country Link
CN (1) CN107025092B (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109117118A (en) * 2018-08-20 2019-01-01 合肥工业大学 Random number extracting method based on ring oscillator structure real random number generator
CN109361516A (en) * 2018-12-13 2019-02-19 北京汉能光伏投资有限公司 A kind of encryption method and device of Internet of things chip
CN110531956A (en) * 2019-09-02 2019-12-03 合肥工业大学 Portable real random number generator and its method based on correlation sampling self-timing ring
CN110825347A (en) * 2018-08-09 2020-02-21 旺宏电子股份有限公司 Adjustable random number generation circuit and adjustable random number generation method
CN111443896A (en) * 2020-03-31 2020-07-24 海晨 High-temperature resistance-resistant true random number generator and method for generating true random number
CN111966330A (en) * 2020-09-02 2020-11-20 湖北大学 A True Random Number Generator Based on Wien Bridge Oscillator Structure
CN113835679A (en) * 2021-09-30 2021-12-24 海宁奕斯伟集成电路设计有限公司 Random number generation method, device and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1662875A (en) * 2002-06-20 2005-08-31 皇家飞利浦电子股份有限公司 Method and apparatus for generating a random number using meta-stable latches
US20100281088A1 (en) * 2009-04-29 2010-11-04 Psigenics Corporation Integrated true random number generator
CN103514134A (en) * 2013-10-22 2014-01-15 浪潮电子信息产业股份有限公司 Random transmission method for chip prototype verification messages

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1662875A (en) * 2002-06-20 2005-08-31 皇家飞利浦电子股份有限公司 Method and apparatus for generating a random number using meta-stable latches
US20100281088A1 (en) * 2009-04-29 2010-11-04 Psigenics Corporation Integrated true random number generator
CN103514134A (en) * 2013-10-22 2014-01-15 浪潮电子信息产业股份有限公司 Random transmission method for chip prototype verification messages

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
ELENA DUBROVA等: "TVL-TRNG: Sub-microwatt True Random Number Generator Exploiting Metastability in Ternary Valued Latches", 《2017 IEEE 47TH INTERNATIONAL SYMPOSIUM ON MULTIPLE-VALUED LOGIC》 *
张聪 等: "一种基于FPGA的真随机数发生器设计与实现", 《电子设计工程》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110825347A (en) * 2018-08-09 2020-02-21 旺宏电子股份有限公司 Adjustable random number generation circuit and adjustable random number generation method
CN110825347B (en) * 2018-08-09 2023-05-09 旺宏电子股份有限公司 Adjustable random number generation circuit and adjustable random number generation method
CN109117118A (en) * 2018-08-20 2019-01-01 合肥工业大学 Random number extracting method based on ring oscillator structure real random number generator
CN109117118B (en) * 2018-08-20 2022-09-30 合肥工业大学 Random number extraction method based on ring oscillator structure true random number generator
CN109361516A (en) * 2018-12-13 2019-02-19 北京汉能光伏投资有限公司 A kind of encryption method and device of Internet of things chip
CN110531956A (en) * 2019-09-02 2019-12-03 合肥工业大学 Portable real random number generator and its method based on correlation sampling self-timing ring
CN111443896A (en) * 2020-03-31 2020-07-24 海晨 High-temperature resistance-resistant true random number generator and method for generating true random number
CN111443896B (en) * 2020-03-31 2022-04-19 海晨 High-temperature resistance-resistant true random number generator and method for generating true random number
CN111966330A (en) * 2020-09-02 2020-11-20 湖北大学 A True Random Number Generator Based on Wien Bridge Oscillator Structure
CN111966330B (en) * 2020-09-02 2022-06-17 湖北大学 True random number generator based on Venturi bridge oscillator structure
CN113835679A (en) * 2021-09-30 2021-12-24 海宁奕斯伟集成电路设计有限公司 Random number generation method, device and system
CN113835679B (en) * 2021-09-30 2023-09-29 海宁奕斯伟集成电路设计有限公司 A method, device and system for generating random numbers

Also Published As

Publication number Publication date
CN107025092B (en) 2020-07-17

Similar Documents

Publication Publication Date Title
CN107025092B (en) Random number extraction method based on latch structure true random number generator
CA2971212C (en) Reliability enhancement methods for physically unclonable function bitstring generation
TWI723006B (en) High speed data transfer using calibrated, single-clock source synchronous serializer-deserializer protocol
CN103299576B (en) Bit generating device and bit generating method
Majzoobi et al. Automated design, implementation, and evaluation of arbiter-based PUF on FPGA using programmable delay lines
CN106919764B (en) Reliability detection method for ring oscillator physical unclonable function based on FPGA
CN108768619B (en) A working method of strong PUF circuit based on ring oscillator
CN111124363B (en) A True Random Number Generation Method and True Random Number Generator
CN109117118B (en) Random number extraction method based on ring oscillator structure true random number generator
US11294637B2 (en) Method and apparatus for generating true random numbers for an integrated circuit
WO2018191683A2 (en) Circuit for meeting setup and hold times of a control signal with respect to a clock
CN111782179A (en) A true random number generator
CN111352608B (en) Low-overhead FPGA (field programmable Gate array) basic true random number generation system
Lin et al. MEDAC: A metastability condition detection and correction technique for a near-threshold-voltage multi-voltage-/frequency-domain network-on-chip
CN102843127A (en) Digital data delaying method for agile signal control
CN110795063B (en) Physical random number generation method with adjustable power consumption and rate
CN107766642B (en) Feedback Multiplexer PUF Structure Device Based on Duty Cycle Measurement
Kumar et al. Design of energy efficient true random number generator using mux-metastable approach
CN116992499A (en) A lightweight M_SR PUF circuit and system based on FPGA
Cao et al. A lightweight true random number generator based on multi‐stage sampling the current starve based ring oscillator
CN112130810B (en) Safe high-speed random number generator and structure optimization method thereof
CN111949242B (en) Metastable true random number generator based on FPGA
Xu et al. An ultra-low energy PUF matching security platform using programmable delay lines
CN116325648A (en) Method and apparatus for generating true random numbers in cryptographic hardware
Awaludin et al. AnyTRNG: generic, high-throughput, low-area true random number generator based on synchronous edge sampling

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20200717