Circuit and method for detecting anomaly of random numbers, circuit and radar for generating random numbers
By introducing an abnormal detection circuit into the random number generation unit, the security problems caused by the random number generation unit due to failure or being controlled by hackers are solved, and the high reliability and information security of random numbers are achieved.
Patent Information
- Application Number
- CN202210134498.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-14
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2042-02-14
AI Technical Summary
The random number generation unit may physically fail due to manufacturing or aging factors, or be controlled by hackers, resulting in the failure of the security system of the entire chip. The existing technology is difficult to effectively solve this problem.
A circuit for detecting random number abnormalities is provided, including a storage module, an exception detection module and an exception processing module. By performing abnormality detection on the random number and the random number generation unit, a signal of the abnormality detection result is output to perform abnormality processing.
It effectively improves the reliability of random numbers, enhances information security, and thus ensures the personal and property safety of users.
Smart Images

Figure CN114489570B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a circuit and method for detecting anomalies of random numbers, a circuit for generating random numbers, and a radar. Background Art
[0002] With the rapid development of computer technology and information technology, information security issues are receiving more and more attention. For autonomous driving technology, the personal safety and property safety of users are particularly important. Random numbers are the basic technology of information security. For example, information can be encrypted based on random numbers to ensure information security, thereby ensuring the personal safety and property safety of users.
[0003] Taking autonomous driving technology as an example, radar can collect environmental information so that the autonomous driving decision-making system can adopt driving strategies that are compatible with the environmental information, such as obstacle avoidance. The applicant found that the random number generation unit, as the source of security randomness of the radar's main control chip, is one of the cores of the main control chip's security protection and error correction algorithm. The random number generation unit may fail physically due to manufacturing or aging factors, or it may be controlled and attacked by hackers, causing the entire chip's security system to fail from the source. Summary of the invention
[0004] In order to solve or partially solve the problems existing in the related art, the present application provides a circuit and method for detecting random number anomalies, a circuit and radar for generating random numbers, which can detect random number anomalies, improve information security, and further improve the personal safety and property safety of users.
[0005] The first aspect of the present application provides a circuit for detecting anomalies in random numbers, comprising a storage module, an anomaly detection module and an anomaly processing module. The storage module is configured to store a first random number from a first random number generating unit; the anomaly detection module is connected to the storage module and configured to perform an anomaly detection on the first random number and / or the first random number generating unit to obtain an anomaly detection result; the anomaly processing module is connected to the anomaly detection module and configured to output a signal corresponding to the anomaly detection result when the anomaly detection result is an abnormality.
[0006] The second aspect of the present application provides a circuit for generating random numbers, comprising a first random number generating unit and the above-mentioned circuit for detecting anomalies in random numbers. The first random number generating unit is configured to output a first random number; the circuit for detecting anomalies in random numbers is connected to the first random number generating unit and is configured to output a signal corresponding to an anomaly detection result.
[0007] A third aspect of the present application provides a radar, comprising the circuit for generating random numbers as described above.
[0008] A fourth aspect of the present application provides a method for detecting a random number anomaly, comprising: obtaining a first random number, the first random number being a data string generated by a first random number generating unit; performing anomaly detection on the first random number and / or the first random number generating unit to obtain an anomaly detection result; and when the anomaly detection result is anomaly, outputting a signal corresponding to the anomaly detection result.
[0009] A fifth aspect of the present application provides an electronic device, comprising: a processor; and a memory, on which executable code is stored, and when the executable code is executed by the processor, the processor executes the method as described above.
[0010] A sixth aspect of the present application provides a computer-readable storage medium having executable code stored thereon. When the executable code is executed by a processor of an electronic device, the processor executes the above method.
[0011] A seventh aspect of the present application provides a computer program product, comprising an executable code, which implements the above method when the executable code is executed.
[0012] The technical solution provided by this application may have the following beneficial effects:
[0013] In the embodiments of the present application, certain embodiments of the present application perform abnormality detection on the first random number and / or the first random number generating unit, and can perform abnormality detection on the randomness of the first random number and the state of the first random number generating unit, etc., effectively improving the reliability of the first random number, and helping to improve the personal safety and property safety of users.
[0014] In addition, in some embodiments of the present application, the randomness of each first random number and the randomness difference between the first random numbers generated in different periods are calculated, which helps to further improve the reliability of the first random numbers.
[0015] In addition, in some embodiments of the present application, it is possible to monitor whether each bit in the first random number is suspected of being controlled, which helps to further improve the reliability of the first random number.
[0016] In addition, in some embodiments of the present application, it is possible to monitor whether the random number circuit has physically failed or has been subjected to a destructive chip attack, which helps to further improve the reliability of the first random number.
[0017] In addition, in some embodiments of the present application, the detection results of at least one of the above detection means can be comprehensively analyzed to automatically provide the cause of the random number anomaly, thereby effectively improving the convenience of anomaly handling and anomaly troubleshooting.
[0018] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The above and other objects, features and advantages of the present application will become more apparent by describing in more detail exemplary embodiments of the present application in conjunction with the accompanying drawings, wherein the same reference numerals generally represent the same components in the exemplary embodiments of the present application.
[0020] Figure 1 It is a schematic diagram of an application scenario of a circuit and method for detecting anomalies of random numbers, a circuit for generating random numbers, and a radar shown in an embodiment of the present application;
[0021] Figure 2 It is a schematic diagram of another application scenario of a circuit and method for detecting a random number anomaly, a circuit for generating random numbers, and a radar shown in an embodiment of the present application;
[0022] Figure 3 is a block diagram of a circuit for detecting a random number anomaly according to an embodiment of the present application;
[0023] Figure 4 is a block diagram of an abnormality detection module shown in an embodiment of the present application;
[0024] Figure 5 is a block diagram of a random number detection circuit shown in an embodiment of the present application;
[0025] Figure 6 is a block diagram of a Hamming weight calculation unit shown in an embodiment of the present application;
[0026] Figure 7 is a block diagram of another random number detection circuit shown in an embodiment of the present application;
[0027] Figure 8 is a block diagram of a Hamming distance calculation unit shown in an embodiment of the present application;
[0028] Fig. 9 It is a schematic diagram of the principle of calculating the Hamming distance shown in an embodiment of the present application;
[0029] Fig.10 is a block diagram of a circuit for detecting a random number anomaly according to another embodiment of the present application;
[0030] Fig.11 is a schematic diagram of a slice attack shown in an embodiment of the present application;
[0031] Fig.12 is a block diagram of a circuit for detecting a random number anomaly according to another embodiment of the present application;
[0032] Fig.13 is a schematic diagram of an abnormality analysis unit shown in an embodiment of the present application;
[0033] Fig.14 is a schematic diagram of a circuit for generating random numbers according to an embodiment of the present application;
[0034] Fig.15 It is a flowchart of a method for detecting a random number anomaly according to an embodiment of the present application;
[0035] Fig.16 It is a structural schematic diagram of a device for detecting anomalies of random numbers shown in an embodiment of the present application;
[0036] Fig.17 is a schematic diagram of the structure of a radar shown in an embodiment of the present application;
[0037] Fig.18 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application. DETAILED DESCRIPTION
[0038] The embodiments of the present application will be described in more detail below with reference to the accompanying drawings. Although the embodiments of the present application are shown in the accompanying drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to make the present application more thorough and complete, and to fully convey the scope of the present application to those skilled in the art.
[0039] The terms used in this application are for the purpose of describing specific embodiments only and are not intended to limit this application. The singular forms of "a", "an" and "the" used in this application and the appended claims are also intended to include plural forms unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used herein refers to and includes any or all possible combinations of one or more associated listed items.
[0040] It should be understood that although the terms "first", "second", "third", etc. may be used in this application to describe various information, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of this application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of this application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0041] In order to facilitate the understanding of the present application, some concepts involved in the present application are first explained.
[0042] Lidar: It can be divided into remote sensing, military and vehicle-mounted according to its use. The transmission power of remote sensing and military computing radar is much greater than that of vehicle-mounted radar, and it can identify the physical properties such as distance and shape of long-distance targets. The detection distance of vehicle-mounted radar is 200 meters to 500 meters, and the identifiable physical properties may only include distance and reflectivity. It can be used for small machines such as vehicles and robots. Vehicle-mounted radar includes vehicle-mounted Lidar, vehicle-mounted millimeter-wave radar and vehicle-mounted ultrasonic radar.
[0043] Vehicle-mounted laser radar: By emitting outgoing light (such as a laser beam) with a wavelength of about 900nm, the outgoing light will be reflected by the obstacle after encountering it. The processing unit calculates the distance between the obstacle and the vehicle-mounted laser radar based on the time difference between the reflected light and the outgoing light. In addition, the processing unit can also estimate the reflectivity of the target based on the cross-section of the reflected light signal obtained after receiving the reflected light. Vehicle-mounted laser radar has a small size and a high degree of integration.
[0044] Artificial Intelligence (AI) is a comprehensive technology in computer science that can process and act on input information in a way similar to human intelligence.
[0045] Among artificial intelligence technologies, autonomous driving technology is developing particularly rapidly. Autonomous driving technology includes high-precision maps, environmental perception, behavioral decision-making, path planning, motion control and other technologies, and has broad application prospects.
[0046] In the autonomous driving scenario, the system architecture suitable for the autonomous driving scenario may include mobile devices, networks, and the cloud.
[0047] The network includes wired network and wireless network, etc., which is not limited in this application.
[0048] The cloud can include a server cluster or distributed system consisting of multiple physical servers. The cloud can be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content distribution (CDN), and big data and artificial intelligence platforms.
[0049] Mobile devices include, but are not limited to: cars, ships, robots, aircraft, etc. Mobile devices may be equipped with electronic devices such as sensors to obtain information about obstacles in the surrounding environment of the mobile device, etc. Electronic devices may include: radars (including laser radars), image sensors, etc. Many electronic devices require the use of random numbers during operation or communication.
[0050] The embodiments of the present application provide a circuit and method for detecting anomalies in random numbers, a circuit and a radar for generating random numbers. Anomaly detection is performed on a first random number and / or a first random number generating unit to obtain an anomaly detection result, which facilitates anomaly processing based on the anomaly detection result, effectively improving the security and reliability of the random numbers, so that information (such as radar data) can be encrypted and decrypted based on secure and reliable random numbers to ensure information security, thereby ensuring the personal safety and property safety of users.
[0051] The technical solution of the embodiments of the present application is described in detail below with reference to the accompanying drawings.
[0052] Figure 1 It is a schematic diagram of an application scenario of a circuit and method for detecting random number anomalies, a circuit for generating random numbers, and a radar shown in an embodiment of the present application.
[0053] Figure 1 The hardware structure of a vehicle 10 supporting assisted driving or automatic driving functions is shown. For example, at least one laser imaging detection and ranging (LIDAR) 11 is mounted on the roof and / or the side of the vehicle body of the vehicle 10. The detection area of the LIDAR 11 can be fixed, such as a certain LIDAR 11 can be used only to detect a preset area. The detection area of the LIDAR 11 can be adjustable, such as the laser radar on the vehicle body can scan multiple detection areas by adjusting the posture, etc., or by adjusting the field of view angle range of the laser radar itself. Specifically, the vehicle 10 can be equipped with 5 LIDARs 11: the top of the vehicle, the front side of the vehicle, the rear side of the vehicle, the left side of the vehicle, and the right side of the vehicle. Through multiple LIDARs 11, the outline of objects existing in the area around the vehicle and the distance to the object can be detected.
[0054] In addition, a camera may be mounted on the vehicle 10. The camera can capture the environment in front of the vehicle at a predetermined viewing angle. For example, the camera may be a monocular camera, a multi-camera camera, or the like.
[0055] In addition, the vehicle 10 may be equipped with a plurality of millimeter wave radars in a manner surrounding the vehicle 10. For example, the vehicle 10 may be equipped with four millimeter wave radars to detect the left side in front of the vehicle, the right side in front of the vehicle, the left side behind the vehicle, and the right side behind the vehicle. The millimeter wave radars can detect the distance of an object in each detection area, and can detect the relative speed between the object and the vehicle 10.
[0056] Furthermore, the vehicle 10 may also be equipped with a positioning device 12 , such as a Beidou positioning device, a Global Positioning System (GPS), etc. The current position of the vehicle 10 can be determined by the positioning device 12 .
[0057] In addition, the vehicle 10 may also be equipped with an electronic control unit (ECU). The detection signal of at least one of the LIDAR 11, millimeter wave radar and positioning device 12 is sent to the ECU. The ECU can detect and identify obstacles (such as roadblocks, moving objects, trees, adjacent vehicles, etc. around the vehicle 10) based on these signals. In addition, the ECU can be physically divided into multiple units according to their functions, which are collectively referred to as ECUs in this application.
[0058] It should be noted that although the movable device is described as a car, such description is not restrictive and is applicable to a variety of movable devices, such as land robots, water robots, etc.
[0059] Figure 2 It is a schematic diagram of another application scenario of a circuit and method for detecting a random number anomaly, a circuit for generating random numbers, and a radar shown in an embodiment of the present application.
[0060] Figure 2 The aircraft 20 shown may be an aircraft with an assisted driving function and an automatic driving function. The aircraft 20 may include a sensor system 21 and a power mechanism 22. In addition, the aircraft 20 may also include a communication system.
[0061] The sensing system 21 may include one or more sensors to sense at least one of the surrounding obstacles, spatial orientation, speed or acceleration of the aircraft 20. The types of sensors include, but are not limited to, ranging sensors, position sensors, motion sensors, inertial sensors or image sensors. The sensing data provided by the sensing system 21 can be used to control the spatial orientation, speed and / or acceleration of the aircraft 20. The sensing system 21 is used to collect relevant information of the aircraft 20. Different types of sensors can sense different types of signals or sense signals from different sources. For example, the sensor includes an inertial sensor, a GPS sensor, a distance sensor, or a visual / image sensor (such as a camera).
[0062] The power mechanism 22 may include one or more rotating bodies, propellers, blades, engines, motors, wheels, bearings, magnets, nozzles, etc. The aircraft 20 may include one or more power mechanisms 22. The types of all the power mechanisms 22 may be the same or different. The power mechanism 22 may be installed at any suitable position of the aircraft 20, such as the top, bottom, front end, rear end, side, or any combination thereof. For example, the power mechanism 22 may enable the aircraft 20 to take off from a surface at a certain angle (such as obliquely or vertically) relative to the ground plane, or to land on a surface. The power mechanism 22 may enable the aircraft 20 to fly or remain stationary in the air at a certain speed, altitude, etc.
[0063] The aircraft 20 can communicate with a remote device through the communication system. The remote device includes but is not limited to: a control terminal, a flight control center server, etc. For example, the communication system can transmit at least part of the data collected by the sensor system 21 to the remote device.
[0064] The circuit and method for detecting anomalies of random numbers and the circuit for generating random numbers in the embodiments of the present application can be applied to Figure 1 or Figure 2 Any one or more electronic devices such as the LIDAR 11, millimeter wave radar, positioning device 12, ECU, sensor system 21 or communication system shown need to use random numbers.
[0065] In the above-mentioned application scenarios such as assisted driving, autonomous driving, and smart transportation, quickly and accurately perceiving the surrounding environment of movable equipment is a key point.
[0066] Here, the vehicle's autonomous driving scenario is used as an example for illustrative explanation. According to the vehicle position information, obstacle information, and road information perceived by the sensor system, road signal control is coordinated to improve the quality and efficiency of road management. Specifically, the corresponding autonomous driving vehicle decision can be determined based on the information perceived by the sensor system, and the safe distance between autonomous driving vehicles can be adjusted, so that the vehicle can drive safely and reliably on the road.
[0067] As one of the most important sensors for autonomous driving, LiDAR can provide the decision-making system with the most important information about the location / size / motion of traffic participants in the fields of smart transportation / autonomous driving. Because LiDAR chips are like human eyes for autonomous vehicles, it is particularly important to protect the security of LiDAR data collection and transmission, which is directly related to the personal safety, property safety, and even life safety of the drivers and passengers of the vehicle.
[0068] The main control chip of the LiDAR is the core component of the LiDAR. The main control chip is responsible for the collection, processing and transmission of at least part of the LiDAR information. The random number generation unit is the root of the security randomness of the main control chip. The random number generation unit is one of the cores of the security protection and error correction algorithm of the main control chip.
[0069] However, the applicant has found that the random number generating unit may fail physically due to manufacturing defects or aging factors, etc. In addition, the random number generating unit may also fail from the source due to hackers controlling and attacking it.
[0070] In the related art, there is little security protection for random number generation units such as lidar, resulting in a lack of security protection defense. Based on the above reasons, this application aims to provide a technical solution that can realize at least some of the functions of monitoring, analyzing and handling exceptions of random number generation units.
[0071] For example, in some embodiments, an automatic judgment is made by comparing the randomness of each random number with the difference in randomness between random numbers generated in different periods. In addition, in some embodiments, each bit can be monitored for suspicion of being controlled. In addition, in some embodiments, it is also possible to monitor whether destructive chip attacks occur around the random number circuit. By performing random number anomaly detection from the above multiple angles, the ability to protect the functional safety of the random number generation unit can be effectively improved, thereby facilitating better implementation of the safe operation and data protection of the main control chip of the lidar, thereby improving the personal safety and property safety of users.
[0072] In addition, in some embodiments, after detecting a random number anomaly, an interrupt signal or a reset signal may be issued so that the system can protect and handle the main control chip.
[0073] Figure 3 It is a block diagram of a circuit for detecting random number anomalies according to an embodiment of the present application.
[0074] See also Figure 3 The circuit 300 for detecting a random number anomaly may include: a storage module 310 , an anomaly detection module 320 and an anomaly processing module 330 .
[0075] The storage module 310 is configured to store the first random number from the first random number generating unit.
[0076] The abnormality detection module 320 is connected to the storage module 310, and is configured to perform abnormality detection on the first random number and / or the first random number generating unit to obtain an abnormality detection result.
[0077] The exception handling module 330 is connected to the exception detection module 320 and is configured to output a signal corresponding to the exception detection result when the exception detection result is abnormal.
[0078] During data transmission, the specified encryption algorithm can be used to encrypt the data to ensure the integrity and authenticity of the transmitted data, such as the integrity and authenticity of the point cloud data collected by the LiDAR. During decryption, the key corresponding to the encryption algorithm can be used for decryption. For example, the ECU can decrypt the encrypted data based on the key to obtain the point cloud data collected by the LiDAR. In order to ensure the security of the key, the key can be generated based on a random number. The random number can be a value output by a random number generation unit. Random numbers can be divided into true random numbers and pseudo-random numbers.
[0079] Among them, in the process of generating true random numbers, random physical processes (such as environmental noise, thermal noise of circuits, radioactive decay, etc.) can be used as random number sources, and implemented using analog circuits, and then true random numbers are obtained through digital post-processing. True random numbers have no regularity at all and are unpredictable. It is impossible for an attacker to predict the next data generated through a large amount of data analysis. True random numbers can be generated by a true random number generator (TRNG). The unpredictability of the true random number generator makes it impossible for an attacker to guess the key through general rules, thereby improving the security of the key.
[0080] Pseudo-random numbers can be generated using a fixed generation algorithm. In order to increase the unpredictability of pseudo-random numbers, an initial seed can be set. However, pseudo-random numbers still follow certain rules. For example, an attacker can obtain the generation algorithm of pseudo-random numbers through a large amount of data analysis. However, pseudo-random numbers have the advantages of being easy to use and not requiring the introduction of additional hardware devices. Pseudo-random numbers can be generated by a pseudo-random number generator (PRNG).
[0081] In the embodiment of the present application, the first random number generating unit may be a true random number generating unit or a pseudo random number generating unit. Accordingly, the first random number may be a true random number or a pseudo random number.
[0082] It should be noted that in scenarios where information security requirements are high and may affect the personal safety and / or property safety of users, true random numbers can be used to improve security.
[0083] There are many implementation methods for true random number generation units in circuit design, such as discrete time chaos implementation method, oscillation sampling method, direct amplification thermal noise method, etc. Among them, the random source of the oscillation sampling method mainly comes from the phase jitter and noise of the oscillator, the metastable state in the circuit produces phase jitter, and the thermal noise in the circuit produces phase noise. The implementation circuit of the oscillation sampling method is relatively simple, the quality of the generated true random numbers is high, and it is widely used. Specifically, the random number source part can be implemented using an analog circuit, and the post-processing part can be implemented using a digital circuit.
[0084] As the attacker's attack capabilities continue to improve, it is easier for the attacker to find the analog circuit part of the main control chip, and then use an invasive attack method to attack the random number source part, cut off the random number source part or input a fixed sequence, so that the true random number generation unit generates random numbers according to the attacker's wishes. In addition, when the true random number generation unit is due to manufacturing defects and / or aging, it may also cause random number anomalies.
[0085] In order to solve the above problem, in this embodiment, the random number abnormality detection can be performed from at least one of the following aspects: detecting the quality of the random number or detecting the state of the random number generating unit. If the quality of the random number is poor, the random number can be regenerated. If the random number continues to fail to meet the random requirements, and / or the state of the random number generating unit is detected to be in an abnormal state, relevant processing such as stopping work and / or alarming can be performed.
[0086] For example, the quality of the random number can be judged by the number or ratio of repeated bits in the random number. For example, the quality of the random number can also be judged by the similarity of random numbers in different time periods. For example, the state of the random number generating unit can be judged by the working temperature, illumination, radiation intensity and other indicators.
[0087] For example, the processing methods of the exception handling module include but are not limited to: regenerating random numbers, optimizing random numbers, calling random numbers of different cycles, selecting random numbers from other channels, alarming, stopping outputting random numbers, etc., which are not limited here.
[0088] Figure 4 It is a block diagram of an abnormality detection module shown in an embodiment of the present application.
[0089] See also Figure 4 , the abnormality detection module 320 may include at least one of the following: a random number detection circuit 3210 and a first random number generation unit detection circuit 3220.
[0090] The random number detection circuit 3210 is configured to perform anomaly detection on the numerical attribute of the first random number to obtain a first anomaly detection sub-result. The numerical attribute includes but is not limited to: the similarity between different random numbers, the total number of bits with the same bit, the proportion of consecutive specific numbers in the numerical value, the length of consecutive specific numbers in the numerical value, etc.
[0091] The first random number generating unit detection circuit 3220 is configured to perform an abnormality detection on the physical property of the first random number generating unit to obtain a second abnormality detection sub-result. The physical property can be used to characterize the working state, the environmental state, etc. of the first random number generating unit. The working state may include a normal working state, a stopped working state, an abnormal state (such as abnormal voltage, abnormal current, abnormal temperature, etc.). The environmental state may include an ambient temperature state, a humidity state, an illumination state, a radiation state, etc.
[0092] In some embodiments, the quality of the random number may be determined by Hamming Weight (HW for short). Figure 5 It is a block diagram of a random number detection circuit shown in one embodiment of the present application.
[0093] See also Figure 5 The random number detection circuit 3210 may include: a Hamming weight calculation unit 3211 and a first threshold comparison unit 3212 .
[0094] Among them, the Hamming weight calculation unit 3211 is configured to calculate the Hamming weight of the first random number. The Hamming weight is the number of non-zero symbols in a string of symbols. Therefore, it is equivalent to the Hamming distance between the first random number and a string of all zero numbers of the same length. In the most common data bit symbol string, the Hamming weight is the number of 1s. The calculation process of the Hamming weight can be implemented by a dedicated processor, such as a dedicated circuit including an AND gate, a NOT gate, a NAND gate, an XOR gate, a shift circuit, etc. The calculation process of the Hamming weight can also be implemented by a general-purpose processor, such as calculating the Hamming weight by software. In addition, the calculation process of the Hamming weight can also be implemented by a dedicated processor and a general-purpose processor.
[0095] The first threshold comparison unit 3212 is configured to send a first signal to the exception handling module when the Hamming weight exceeds a first threshold.
[0096] Taking the calculation of Hamming weight by a dedicated processor as an example, Figure 6 It is a block diagram of a Hamming weight calculation unit shown in an embodiment of the present application.
[0097] See also Figure 6The Hamming weight calculation unit is responsible for checking the Hamming weight of the random number (the total number of bits with a value of 1). If the Hamming weight is equal to 256, it means that the values of all bits in the first random number are all 1. If the Hamming weight is equal to 0, it means that the values of all bits in the first random number are all 0. When the random number is 256 bits, the closer the Hamming weight is to 128, the better its randomness. The specific implementation method is to count the bits that are 1 in the random number. The circuit of the Hamming weight calculation unit includes a serial shift circuit. When the shift value is 1, the count value is accumulated by 1. When the shift value is 0, the count value is not accumulated. When the shift is completed, the value of the counter is the Hamming weight.
[0098] Specifically, the Hamming weight calculation unit includes: a shift register group and a first counter.
[0099] The shift register group includes a plurality of serially connected registers, and is configured to store the first random number. For example, each register stores one bit of the first random number. Figure 6 4 takes the first random number with a length of 4 as an example to illustrate the Hamming weight calculation circuit.
[0100] The first counter (see counter) is configured to determine the number of bits of the first random number whose value is 1 or 0, so as to determine the total number of bits of the first random number whose value is 1. The total number of bits is the value of the Hamming weight.
[0101] Taking the calculation of Hamming weight by software as an example, the calculation process of the random number n is illustrated. Specifically, the operation: n&(n – 1) can be repeatedly performed until n becomes 0. Among them, the function of the operation: n&(n – 1) is to remove the last 1 of n, that is, the last 1 of n becomes 0. For example, let n = 10110, the calculation process is as follows: n = 10100, the count is 1; n = 10000, the count is 2; n = 00000, the count is 3; the Hamming weight of the random number n = 10110 is 3.
[0102] In some embodiments, the first threshold comparison unit may include: a first storage circuit and a first threshold comparison circuit.
[0103] Wherein, the first storage circuit is used to store the first threshold. The first threshold can be configurable or solidified in the storage circuit, which is not limited here. For example, the first threshold can be related to the total number of digits of the first random number. If the total number of digits of the first random number is N, the first threshold can be N / 3~2N / 3, etc. In addition, the first threshold can be a fixed value, such as 3, 10, 15, 30, 50, 100, etc. The first threshold can be a fixed value range, such as 3-10, 8-50, 20-60, 10-100, etc.
[0104] The first threshold comparison circuit includes a first logic circuit, a first input terminal group, a first control terminal group, and a first output terminal group, wherein the first input terminal group is connected to the first storage circuit. The first logic circuit is used to: in response to the Hamming weight input from the first control terminal group, when the Hamming weight exceeds the first threshold, output a first signal from the first output terminal group.
[0105] In some embodiments, the quality of the random number may be determined by Hamming Distance (HD). Figure 7 It is a block diagram of another random number detection circuit shown in an embodiment of the present application.
[0106] See also Figure 7 In order to facilitate the calculation of the Hamming distance between at least two random numbers, the first random numbers output by the first random number generating unit in different periods can be stored in multiple storage spaces respectively, so as to calculate the Hamming distance between each of the multiple first random numbers.
[0107] Specifically, the storage module 310 includes at least two storage units (such as a first storage unit and a second storage unit), and the at least two storage units are each configured to store the first random number output by the first random number generating unit in different cycles.
[0108] Accordingly, the random number detection circuit 3210 includes: a Hamming distance calculation unit 3213 and a second threshold comparison unit 3214 .
[0109] The Hamming distance calculation unit 3213 is configured to calculate the Hamming distance between the first random numbers output by the first random number generation unit in different cycles. In information theory, the Hamming distance represents the number of different characters in corresponding positions of two equal-length strings. For example, d(x, y) can be used to represent the Hamming distance between the string x and the string y. The Hamming distance measures the minimum number of replacements required to convert the string x into y by replacing characters. The calculation process of the Hamming distance can be implemented by a dedicated processor, such as a dedicated circuit including an AND gate, a NOT gate, a NAND gate, an XOR gate, a shift circuit, etc. The calculation process of the Hamming weight can be implemented by a general-purpose processor, such as calculating the Hamming weight by software. The calculation process of the Hamming weight can also be implemented by a dedicated processor and a general-purpose processor.
[0110] The second threshold comparison unit 3214 is configured to send a second signal to the exception handling module when the Hamming distance exceeds the second threshold. The second threshold is configurable or solidified in the storage circuit, which is not limited here. For example, the second threshold can be related to the total number of bits of the first random number, the second threshold can be a fixed value, and the second threshold can be a fixed value range. For details, please refer to the first threshold, which will not be described in detail here.
[0111] Taking the calculation of Hamming distance by a dedicated processor as an example, Figure 8 It is a block diagram of a Hamming distance calculation unit shown in an embodiment of the present application.
[0112] Please also see Figure 7 and Figure 8 The storage module 310 includes a first storage unit and a second storage unit, which are configured to respectively store the first random number output by the first random number generating unit in the first cycle and the second cycle, respectively. For example, the first storage unit is configured to store the previous random number (the first random number of the previous cycle), and the second storage unit is configured to store the current random number (the first random number of the current cycle).
[0113] Figure 8 Each XOR gate is used to perform XOR logic calculation on the value of the same bit in the current random number and the previous random number. For example, XOR gate 1 is used to perform XOR logic calculation on the value of the first bit of the current random number and the value of the first bit of the previous random number, XOR gate 2 is used to perform XOR logic calculation on the value of the second bit of the current random number and the value of the second bit of the previous random number, and XOR gates 3 and 4 can be used in the same way, which will not be described in detail here. It should be noted that Figure 8 , a circuit diagram when the number of bits of the random number is 4 is shown, and it can also be applied to random numbers with more bits or fewer bits. The number of XOR gates can be the same as the number of bits of the random number. In addition, the Hamming distance between the two first random numbers can be obtained by numerical splicing.
[0114] In some embodiments, the Hamming distance calculation unit may include: an XOR logic calculation circuit, a value concatenation unit, and a second counter.
[0115] Wherein, N parallel XOR logic calculation circuits are configured to compare a first value and a second value, and if the first value and the second value are different, output 1. Wherein, the first value is the value of the i-th bit of the first random number corresponding to the first cycle. The second value is the value of the i-th bit of the first random number corresponding to the second cycle, i is an integer greater than or equal to 0, and N is the same as the number of bits of the first random number.
[0116] The numerical splicing unit is configured to splice the outputs of N parallel XOR logic calculation circuits according to the number of bits corresponding to each of the N parallel XOR logic calculation circuits to obtain a data string with different bits being 1, wherein the different bits are bits with different values in the first random number corresponding to the first period and the first random number corresponding to the second period.
[0117] The second counter is configured to determine the number of bits with a value of 1 or 0 in the data string, so as to determine the total number of bits with different bits in the first random number corresponding to the first cycle and the first random number corresponding to the second cycle. For example, the number of 1s in the data string with different bits being 1 can be directly counted. For example, the number of 0s x in the data string with different bits being 1 can be counted first, and then the number of 1s in the data string with different bits being 1 can be obtained using Nx.
[0118] In a specific embodiment, the Hamming distance calculation unit is responsible for checking the Hamming distance of two random numbers (the number of bits with different bit values corresponding to two random numbers with the same bit width). It can be considered that the Hamming distance reflects the similarity of the two numbers. If the two numbers are completely equal, the Hamming distance should be 0, and the maximum value of the Hamming distance should be the width of the random number bit. The larger the value of the Hamming distance between the two numbers, the better the performance of the random number generator. The specific circuit is similar to the circuit of the Hamming weight calculation unit, but a bitwise XOR logic operation circuit is added before the shift circuit. The two input values of the bitwise XOR logic operation circuit are the first random number of the current time and the first random number of the previous time. After the two first random numbers are subjected to the XOR logic operation according to the bit, a data string with the different bit positions between the two first random numbers being 1 is obtained. After the data string is processed by the shift circuit, the Hamming distance calculation is completed.
[0119] In some embodiments, the second threshold comparison unit may include: a second storage circuit and a second threshold comparison circuit.
[0120] The second storage circuit is used to store the second threshold. The second threshold may be a preset value or a value range. The second threshold may be editable.
[0121] The second threshold comparison circuit includes a second logic circuit, a second input terminal group, a second control terminal group, and a second output terminal group, wherein the second input terminal group is connected to the second storage circuit. The second logic circuit is used to: in response to the Hamming distance input from the second control terminal group, when the Hamming distance exceeds the second threshold, output a second signal from the second output terminal group.
[0122] Taking the calculation of the Hamming weight by software as an example, the calculation process of the random number n is exemplified. Specifically, the operation can be repeatedly performed: for binary strings a and b, the Hamming distance is equal to the number of 1s in a XOR b.
[0123] Fig. 9 It is a schematic diagram of the principle of calculating the Hamming distance shown in an embodiment of the present application.
[0124] See also Fig. 9, the first random number of the first cycle is 0101110100011, and the first random number of the second cycle is 0010011011001, then the XOR logic operation is performed on each bit of the above two data strings, and the obtained data is 0111101111010. By counting the total number of 1s in the statistics, it can be determined that the Hamming distance is 9.
[0125] In some embodiments, the random number detection circuit may further include a repeated bit statistics unit.
[0126] See also Figure 7 The repeated bit statistics unit 3215 is configured to calculate the position and number of repeated bits between the first random numbers output by the first random number generation unit in different periods. The repeated bit statistics unit is responsible for counting the position and number of the same bits when two random numbers are generated, and sending them to the attack analysis circuit.
[0127] In some embodiments, the repeated bit statistics unit may include: an XOR logic calculation circuit, a value splicing unit, and a third counter. After performing an XOR logic operation on the two first random numbers according to the bit position, a data string in which the same bit position between the two first random numbers is 1 is obtained. After the data string is processed by the shift circuit, the number of 1s in the data string is obtained, and the number and position of 1s in the data string are the result of repeated bit statistics.
[0128] It should be noted that the repeated bit statistical unit can also reuse the XOR logic calculation circuit and the value concatenation unit of the Hamming distance calculation unit to process the obtained data string to obtain the position and number of 0s in the data string.
[0129] Taking the repeated bit statistics by software as an example, the first random number a and the first random number b can be subjected to the "exclusive OR" operation (XNOR), and the calculation process is "same is 1, different is 0". The specific calculation formula can be: a same or b = ab + a'b', where a' is not a, and b' is not b.
[0130] In addition, the random number detection circuit may further include a third threshold comparison unit 3216 .
[0131] In some embodiments, the third threshold comparison unit may include: a third storage circuit and a third threshold comparison circuit.
[0132] The third storage circuit is used to store the third threshold.
[0133] The third threshold comparison circuit includes a third logic circuit, a third input terminal group, a third control terminal group, and a third output terminal group, wherein the third input terminal group is connected to the third storage circuit. The third logic circuit is used to: in response to the Hamming weight input from the third control terminal group, when the Hamming weight exceeds the third threshold, output a third signal from the third output terminal group. The Hamming weight input from the third control terminal group may be the Hamming weight of the data string obtained after the XOR operation.
[0134] Fig.10 It is a block diagram of a circuit for detecting random number anomalies according to another embodiment of the present application.
[0135] See also Fig.10 , the first random number generating unit detection circuit includes at least one of the following: a temperature sensor or a photosensor.
[0136] The temperature sensor is arranged around the first random number generating unit and / or in the packaging layer of the first random number generating unit, and is configured to detect the temperature of the first random number generating unit. A temperature sensor refers to a sensor that can sense temperature and convert it into a usable output signal, and can be divided into two categories according to the measurement method: contact type and non-contact type.
[0137] The detection part of the contact temperature sensor has good contact with the object being measured, also known as a thermometer, including but not limited to: bimetallic thermometer, pressure thermometer, resistance thermometer, thermistor and thermocouple, etc. The sensitive element of the non-contact temperature sensor does not contact the object being measured, also known as a non-contact temperature measuring instrument, and the test methods used include but are not limited to: brightness method (such as optical pyrometer), radiation method (such as radiation pyrometer) and colorimetry (such as colorimetric thermometer).
[0138] For example, the temperature sensor can be arranged inside or outside the encapsulation layer of the first random number generating unit. For a contact temperature sensor, it is necessary to be in direct or indirect contact with the first random number generating unit. For a non-contact temperature sensor, the non-contact temperature sensor can be arranged on the upper surface, around, etc. of the first random number generating unit. Specifically, the temperature sensor outputs a temperature value, and the abnormality analysis unit can determine whether it is attacked by high temperature or high-energy laser according to a reasonable temperature range.
[0139] The photosensitive sensor is arranged in the encapsulation layer of the first random number generating unit and is configured to detect the light intensity to which the circuit of the first random number generating unit is subjected. The photosensitive sensor is mainly used to detect slices, laser injection attacks, etc. Specifically, the photosensitive sensor can be arranged next to the registers and connections of key signals. If slices are sliced or laser injection is suffered, the photosensitive sensor will output a higher current signal, indicating that it has suffered slices or laser error injection attacks.
[0140] It should be noted that the temperature sensor and the photosensor can send detection signals to the random number generation unit or the central processing unit (CPU), ECU, etc., so as to determine corresponding processing measures, such as discarding the current random number, stopping the random number generation unit from generating random numbers, etc.
[0141] In this embodiment, by introducing a sensor for the first random number generating unit, the physical state of the first random number generating unit can be effectively detected, and the reliability of the first random number can be determined from more aspects. In addition, by detecting the physical state of the first random number generating unit and combining the data quality of the first random number, when the first random number is abnormal, the abnormal type can be further analyzed, such as aging, attack, slice attack, laser injection attack, etc.
[0142] See also Fig.10 The exception handling module includes at least one of the following: a reset generating unit and / or an interrupt generating unit. Accordingly, the above-mentioned first signal and the above-mentioned second signal may be reset signals or interrupt signals, respectively. For example, the first signal is a signal output when the random number quality is low for a short time (such as one or several cycles), and is used to improve the quality of the random number. For example, the second signal is a signal output when the random number quality is continuously low for a long time (such as more than a specific number of cycles), and\or, a signal output when the total number of low-quality random numbers exceeds a threshold, and is used to perform random number exception handling.
[0143] For example, the reset generating unit is configured to output a first signal, such as a reset signal, when the abnormality detection result is abnormal. For example, the first threshold and the second threshold may include multiple levels: a low-quality threshold level and an abnormal threshold level, etc. Among them, when the Hamming weight or the Hamming distance of the first random number is greater than the abnormal threshold level and less than the low-quality threshold level, a reset signal can be output. When the Hamming weight of the first random number is greater than the low-quality threshold level and the Hamming distance is less than the low-quality threshold level, a reset signal can be output. When the Hamming distance of the first random number is greater than the low-quality threshold level and the Hamming weight is less than the low-quality threshold level, a reset signal can be output. The quality of the random number is improved by the reset signal. It should be noted that the above conditions for outputting the reset signal are only exemplary and cannot be understood as a limitation of the present application. Specifically, the reset signal will reset the main circuit and clear the key information.
[0144] For example, the interrupt generating unit is configured to output a second signal, such as an interrupt signal, when the abnormality detection result is abnormal. For example, the first threshold and the second threshold may include multiple levels: a low-quality threshold level and an abnormal threshold level, etc. Among them, when the Hamming weight and the Hamming distance of the first random number are both less than the abnormal threshold level, an interrupt signal can be output. It should be noted that the above conditions for outputting an interrupt signal are only exemplary and cannot be understood as limitations on the present application. The potential risks of abnormal random numbers to users are reduced by interrupt signals. Specifically, an interrupt signal can be sent to the CPU, so that the CPU can respond to the interrupt signal and perform corresponding processing according to the interrupt type, such as destroying important information, restarting, shutting down the TRNG module, etc.
[0145] It should be noted that in addition to reset and interrupt processing, other processing methods can also be introduced: such as replacing the random number generation unit, alarm and other processing methods, which are not limited here. In addition, before the circuit for detecting random number anomalies is used, a threshold corresponding to the Hamming distance and the Hamming weight can be configured. When it is lower than the threshold, it indicates that the randomness of the random number is lower than the threshold, and reset, interrupt processing and other processing can be performed.
[0146] In some embodiments, the circuit for detecting anomalies of random numbers may further include: a threshold configuration unit (also referred to as a threshold configuration information storage unit), in which at least one threshold value may be stored. Specifically, the threshold configuration unit is configured to configure a first threshold and / or a second threshold corresponding to the first abnormality detection sub-result. For example, the threshold configuration unit may store the first threshold and / or the second threshold. In addition, the threshold configuration unit may allow a user to set and / or modify the threshold, etc. At least one of the above-mentioned first storage circuit, the second storage circuit, and the third storage circuit may be the same circuit as the threshold configuration unit.
[0147] Fig.11 It is a schematic diagram of a slice attack shown in an embodiment of the present application.
[0148] See also Fig.11 , Fig.11 The packaged chip and the sensor disposed on the packaged chip (as shown by the small solid line box and the small dotted line box) are shown. Fig.11 Some sensors are placed inside the packaging material, and some are placed outside the packaging material. After the packaged chip is sliced, the sensors will be exposed. Fig.11 If the photosensitive sensor outputs a current signal, it means that it is exposed or attacked by laser injection. Fig.11The chip packaging method is shown for exemplary purposes only. For example, more pins may be included or other packaging methods (such as flip-chip soldering, etc.) may be used. This should not be construed as a limitation on the present application.
[0149] In some embodiments, a plurality of abnormality detection sub-results may be processed comprehensively to obtain the cause of the random number abnormality, such as by analyzing the current temperature, the current light intensity, the current number of repeated bits, etc., to determine the cause of the abnormality.
[0150] Specifically, the circuit for detecting the anomaly of a random number may further include: an anomaly analysis unit, wherein the anomaly analysis unit may be a part of the anomaly processing module or a separate module.
[0151] For example, the abnormality analysis unit is configured to determine the abnormality type based on the first abnormality detection sub-result and the second abnormality detection sub-result, and output the abnormality type. The abnormality type can be output to the CPU, ECU, etc., so as to adopt a corresponding processing method.
[0152] Fig.12 It is a block diagram of a circuit for detecting random number anomalies shown in another embodiment of the present application.
[0153] See also Fig.12 , the outputs of the repeated bit statistics unit, the temperature sensor, and the photosensor are used as inputs of the abnormality analysis unit, and the corresponding abnormality analysis results are determined based on the information stored in the threshold configuration information storage unit: such as normal, failure, attack type, etc. For example, if the abnormality analysis unit outputs 0, it means normal, if the abnormality analysis unit outputs 1, it means failure, if the abnormality analysis unit outputs 2, it means temperature abnormality failure, and if the abnormality analysis unit outputs 3, it means sectioning or laser injection attack failure. It should be noted that the above attack types, output results, and their mapping relationships are only exemplary and are not limited here.
[0154] For example, when the fixed bits of multiple random numbers have the same value, the abnormal analysis unit will determine that these bits are physically invalid or at risk of being controlled by hackers, and can issue attack type analysis results. In addition, the system can also be notified to protect and dispose of the main control chip.
[0155] It should be noted that logical operations include but are not limited to: "OR", "AND", "NOT", "NOR", "NAND", "XOR", etc. Logical operation units include but are not limited to: "OR operation unit", "AND operation unit", "NOT operation unit", "NOR operation unit", "NAND operation unit", "XOR operation unit", etc. These logical operation units may also be referred to as logical operation circuits. In order to calculate the Hamming weight of a random number, the Hamming distance between two random numbers, and the repeated bits between two random numbers, a combination of multiple logical operations may be used to achieve this, and accordingly, a combination of multiple logical operation units may be used to achieve this, which is not limited here.
[0156] Fig.13 It is a schematic diagram of an abnormality analysis unit shown in an embodiment of the present application.
[0157] See also Fig.13 The abnormality analysis unit can be formed by at least one of a wiring switch, a multiplexer (MUX), a look-up table (LUT), etc.
[0158] In order to facilitate the editing of conditions corresponding to various exceptions, a wiring switch is used as an example for illustrative explanation. The wiring switch may include; a configurable logic block (CLB), wiring resources, and a programmable input / output module. The programmable logic block is surrounded by prefabricated wiring resource channels, and the programmable input / output modules are distributed on the outside of the wiring switch. In addition to the above three modules, it may further include optional resources such as random access memory (RAM), multipliers, etc.
[0159] Among them, the programmable logic block is the basic unit for realizing random number anomaly analysis. For example, the programmable logic block may include an interconnection switch matrix and at least one slice (SLICEs), each slice including at least one lookup table, at least one trigger and at least one multiplexer. The interconnection switch matrix is mainly composed of wires of different lengths and multiple switches. The multiplexer includes but is not limited to: 4-to-1 data selector, 8-to-1 data selector, 16-to-1 data selector, etc. Fig.13 , an n-to-1 data selector is shown, and its inputs include: i1 to in. For example, a plurality of entry information (S) in the lookup circuit table may be stored in the threshold configuration information storage unit.
[0160] Certain embodiments of the present application can realize automatic judgment on the randomness of each random number and the randomness of random numbers generated in different periods, effectively improving the reliability of random numbers. Certain embodiments of the present application can monitor whether each bit is suspected of being controlled, further improving the reliability of random numbers. Certain embodiments of the present application can monitor whether physical failures occur around the random number circuit or destructive chip attacks, further improving the reliability of random numbers. Certain embodiments of the present application can be used in combination with the above schemes to more completely protect the functional safety of the circuit that generates random numbers, thereby ensuring the safe operation and data protection of encryption and decryption and error correction operations such as the laser radar main control chip, thereby improving the personal safety and property safety of users.
[0161] Another aspect of the present application also provides a circuit for generating random numbers.
[0162] Specifically, the circuit for generating random numbers may include: a first random number generating unit and a circuit for detecting anomalies in random numbers.
[0163] The first random number generating unit is configured to output a first random number.
[0164] The circuit for detecting the abnormality of random numbers is connected to the first random number generating unit and is configured to output a signal corresponding to the abnormality detection result. The specific circuit and function of the circuit for detecting the abnormality of random numbers are referred to the above related content and will not be described in detail here.
[0165] The first random number generating unit may be a true random number generating unit or a pseudo random number generating unit.
[0166] Among them, the true random number generator (TRNG) can use random physical processes as the random number source and implement them using analog circuits, and then obtain true random numbers through digital post-processing. True random numbers have no regularity at all and are unpredictable. It is almost impossible for an attacker to predict what the next random number will be.
[0167] The pseudo-random number generator (PRNG) can use a fixed generation algorithm to obtain pseudo-random numbers. In order to increase the unpredictability of pseudo-random numbers, an initial seed can be set. However, pseudo-random numbers have the advantages of being easy to use and not requiring the introduction of additional hardware devices.
[0168] In some embodiments, in order to meet certain scenarios with high requirements on random number reliability (such as laser radar applied to automatic / assisted driving technology, etc.), a true random number generation unit can be used as the first random number generation unit.
[0169] For example, true random numbers can be obtained through physically unclonable function (PUF technology). PUF is a kind of manufacturing variation (ManufacturingVariation) that uses semiconductor chips to achieve physical unclonability. The random numbers generated by PUF technology are almost impossible to be copied (duplicate). Specifically, after multiple PUF storage cells are composed of a PUF storage cell array (PUF cell array), all PUF storage cells in the PUF storage cell array are registered, and a specific logic level will be stored in each PUF storage cell. For another example, random physical processes such as environmental noise, thermal noise of circuits, radioactive decay, etc. can be used as random number sources to obtain true random numbers.
[0170] In some embodiments, since random numbers are core data, their absence may cause the device to fail to operate (e.g., the first random number generating unit is stopped due to an abnormal first random number). For example, if a laser radar lacks random numbers, it may not be able to transmit point cloud data to an ECU, etc., which will have a serious impact on the assisted / autonomous driving function. In order to solve the above problems, at least one backup random number channel can be provided in this embodiment. When the first random number is abnormal, the second random number from the backup random number channel can be used to improve the overall reliability of the system.
[0171] Specifically, the circuit for generating random numbers may further include: a second random number generating unit and a random number path selecting unit.
[0172] The second random number generating unit is configured to output a second random number.
[0173] The random number path selection unit is connected to the first random number generating unit and the second random number generating unit respectively, and is configured to select the path corresponding to the first random number generating unit to output the first random number when the abnormality detection result is normal, or to select the path corresponding to the second random number generating unit to output the second random number when the abnormality detection result is abnormal.
[0174] For example, the second random number generating unit may be a true random number generating unit or a pseudo random number generating unit. In order to reduce hardware cost, the second random number generating unit may adopt a pseudo random number generating unit (PRNG).
[0175] The random number path selection unit may be a multiplexer, etc. For example, when the abnormality analysis unit inputs a failure signal to the random number path selection unit, the random number path selection unit may select and output: the second random number from the pseudo-random number generation unit.
[0176] Fig.14 It is a schematic diagram of the structure of a circuit for generating random numbers shown in an embodiment of the present application.
[0177] See also Fig.14 The output ends of the true random number generating unit, the pseudo random number generating unit and the abnormality analyzing unit are respectively connected to the input end of the random number path selecting unit, and the random number output by the random number path selecting unit is used as the output random number.
[0178] Another aspect of the present application also provides a method for detecting random number anomalies.
[0179] Fig.15 It is a flowchart of a method for detecting a random number anomaly according to an embodiment of the present application.
[0180] See also Fig.15 , the method for detecting random number anomalies may include operations S1510 to S1530.
[0181] In operation S1510, a first random number is obtained, the first random number being a data string generated by a first random number generating unit.
[0182] In this embodiment, the first random number, the first random number generating unit, etc. can refer to the above related contents and will not be described in detail here.
[0183] In operation S1520, an abnormality detection is performed on the first random number and / or the first random number generating unit to obtain an abnormality detection result.
[0184] In this embodiment, the anomaly detection process can refer to the relevant part of the anomaly detection module, such as by calculating the Hamming weight of the first random number, calculating the Hamming distance between two first random numbers, calculating the number of repeated bits between two first random numbers, etc.
[0185] In operation S1530, when the abnormality detection result is abnormal, a signal corresponding to the abnormality detection result is output. For details, please refer to the relevant part of the abnormality handling module, which will not be described in detail here.
[0186] In some embodiments, performing anomaly detection on the first random number and / or the first random number generating unit, and obtaining an anomaly detection result may include at least one of the following.
[0187] For example, an anomaly detection is performed on the numerical attribute of the first random number to obtain a first anomaly detection sub-result.
[0188] For example, an abnormality detection is performed on the physical property of the first random number generating unit to obtain a second abnormality detection sub-result.
[0189] In some embodiments, performing anomaly detection on the numerical attribute of the first random number to obtain a first anomaly detection sub-result may include the following operations.
[0190] First, the Hamming weight of the first random number is calculated, and then, when the Hamming weight exceeds a first threshold, a first signal is sent to an exception handling module.
[0191] In some embodiments, a shift register set, including a plurality of registers connected in series, is configured to store a first random number;
[0192] Accordingly, calculating the Hamming weight of the first random number may include the following operations: First, the first random number is stored, and then the positions and the number of the values 1 or 0 in the first random number are determined to determine the total number of bits of the value 1 in the first random number.
[0193] In some embodiments, the storage module includes at least two storage units, and each of the at least two storage units is configured to store the first random number output by the first random number generating unit in different cycles.
[0194] Accordingly, performing anomaly detection on the numerical attribute of the first random number to obtain a first anomaly detection sub-result may include the following operations.
[0195] First, the Hamming distance between the first random numbers output by the first random number generating unit in different periods is calculated, and then, when the Hamming distance exceeds a second threshold, a second signal is sent to the exception handling module.
[0196] In some embodiments, performing anomaly detection on the numerical attribute of the first random number to obtain the first anomaly detection sub-result may include the following operations: calculating the number of repeated bits between the first random numbers output by the first random number generating unit in different periods.
[0197] In some embodiments, the at least two storage units are two storage units, and each of the two storage units is configured to store the first random number output by the first random number generating unit in the first cycle and the second cycle, respectively.
[0198] Accordingly, calculating the Hamming weight of the first random number may include the following operations: first, compare the first value and the second value, if the first value and the second value are different, then output 1, the first value is the value of the i-th bit of the first random number corresponding to the first period, the second value is the value of the i-th bit of the first random number corresponding to the second period, i is an integer greater than or equal to 0, and N is the same as the number of bits of the first random number. Then, according to the number of bits corresponding to each of the N parallel XOR logic calculation circuits, the outputs of the N XOR logic calculation circuits are spliced to obtain a data string with different bits of 1, wherein the different bits are bits with different values in the first random number corresponding to the first period and the first random number corresponding to the second period. Next, determine the number of bits with a value of 1 or 0 in the data string to determine the total number of bits with different bits in the first random number corresponding to the first period and the first random number corresponding to the second period.
[0199] In some embodiments, the above method may further include at least one of the following operations.
[0200] For example, the temperature of the first random number generating unit is detected. Specifically, a temperature sensor may be disposed around the first random number generating unit and / or in the packaging layer of the first random number generating unit to detect the temperature of the first random number generating unit.
[0201] For example, the light intensity received by the circuit of the first random number generating unit is detected. Specifically, a photosensitive sensor can be arranged in the packaging layer of the first random number generating unit to detect the light intensity received by the circuit of the first random number generating unit.
[0202] In some embodiments, the above method may further include at least one of the following operations.
[0203] For example, a reset signal and / or an interrupt signal is output when the abnormality detection result is abnormal.
[0204] For example, based on the first abnormality detection sub-result and the second abnormality detection sub-result, the abnormality type is determined, and the abnormality type is output.
[0205] In some embodiments, the above method may further include the following operations: configuring a first threshold and / or a second threshold corresponding to the first abnormality detection sub-result.
[0206] Another aspect of the present application also provides a device for detecting random number anomalies.
[0207] Fig.16 It is a schematic diagram of the structure of a device for detecting random number anomalies according to an embodiment of the present application.
[0208] See also Fig.16The apparatus 1600 for detecting a random number anomaly may include a random number acquisition module 1610 , an anomaly detection module 1620 , and an anomaly handling module 1630 .
[0209] The random number acquisition module 1610 is used to obtain a first random number from a first random number generation unit.
[0210] The anomaly detection module 1620 is used to perform anomaly detection on the first random number and / or the first random number generating unit to obtain an anomaly detection result.
[0211] The exception handling module 1630 is used to output a signal corresponding to the exception detection result when the exception detection result is abnormal.
[0212] Since the random number generating unit may fail physically due to manufacturing or aging factors, or because hackers control and attack the random number generating unit, the security system of the entire chip may fail from the source. This embodiment takes into account that the random number generating circuit is rarely protected for security in the related art, or only the simplest judgment is made as to whether all zeros and / or all ones appear. This embodiment performs abnormal detection on the numerical attributes of the random number and / or the physical attributes of the random number generating unit from the randomness itself, effectively making up for the lack of security protection defense of the chip, improving the reliability of random numbers, and thus improving the personal safety and property safety of users.
[0213] Another aspect of the present application provides a radar.
[0214] Fig.17 It is a schematic diagram of the structure of a radar shown in an embodiment of the present application.
[0215] See also Fig.17 , the radar 1700 may include a circuit for generating random numbers as shown above. For example, the circuit for generating random numbers may include a circuit for detecting anomalies of random numbers as shown above. The circuit for generating random numbers may be provided on a circuit board 1710, and a plurality of chips, such as a central control chip, may be provided on the circuit board 1710. The circuit board 1710 may be provided in a housing 1720.
[0216] The radar may be a laser radar, a millimeter wave radar, an ultrasonic radar, etc. The radar may be a scanning radar or a non-scanning radar.
[0217] The following is an exemplary description using a scanning laser radar.
[0218] For example, MEMS-based LiDAR can dynamically adjust its scanning pattern to focus on specific objects, collect detailed information about smaller objects farther away, and identify them. MEMS-based LiDARs do not have a large moment of inertia and can move quickly, so fast that they can track a 2D scanning pattern in less than a second.
[0219] For example, Flash LiDAR can quickly record the entire scene, avoiding the trouble caused by the movement of the target or LiDAR during the scanning process. The radar system uses an array of micro sensors to collect laser beams reflected from different directions.
[0220] For example, a phased-array lidar uses a row of transmitters to change the direction of a laser beam by adjusting the relative phase of the signals.
[0221] For example, mechanical rotating laser radar is an early developed laser radar and the technology is relatively mature. However, the structure of the mechanical rotating laser radar system is very complex and the core components are quite expensive. These mainly include lasers, scanners, optical components, photodetectors, receiving ICs, and positioning and navigation devices.
[0222] Taking MEMS solid-state laser radar as an example, since MEMS solid-state laser radar is scanned by simple harmonic vibration of the galvanometer, its scanning path can be realized in spatial order, for example, a scanning field of view with a slow axis from top to bottom and a fast axis from left to right. Therefore, the detection range of MEMS solid-state laser radar is divided by the field of view angle corresponding to the slow axis. For example, the vertical field of view angle corresponding to the slow axis of MEMS solid-state laser radar is -13° to 13°.
[0223] Taking the mechanical laser radar in the scanning sensor as an example, since the mechanical laser radar uses a mechanical drive device to drive the optical system to rotate 360 degrees to achieve scanning, a cylindrical detection area with the laser radar as the center is formed. Therefore, the detection range corresponding to the rotation of the mechanical laser radar by 360 degrees is the detection range corresponding to the detection of one frame of data, so the division of the detection range of a mechanical laser radar cycle is generally divided by the degree of rotation.
[0224] For non-scanning LiDAR, the image is processed by the internal photosensitive component circuit and control component and converted into a digital signal that can be recognized by the computer. The digital signal is then input into the computer through a parallel port or USB connection, and the image is restored by the software.
[0225] Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment of the method, and will not be elaborated again here.
[0226] Another aspect of the present application provides an electronic device.
[0227] Fig.18 It is a schematic diagram of the structure of an electronic device shown in an embodiment of the present application.
[0228] See also Fig.18 The electronic device 1800 may include a memory 1810 and a processor 1820. In addition, the electronic device 1800 may be provided with at least one of a random number generating circuit, a random number detecting circuit or a radar.
[0229] The processor 1820 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
[0230] The memory 1810 may include various types of storage units, such as system memory, read-only memory (ROM), and permanent storage. Among them, ROM may store static data or instructions required by the processor 1820 or other modules of the computer. The permanent storage may be a readable and writable storage device. The permanent storage may be a non-volatile storage device that does not lose the stored instructions and data even after the computer is powered off. In some embodiments, the permanent storage device uses a large-capacity storage device (such as a magnetic or optical disk, flash memory) as a permanent storage device. In other embodiments, the permanent storage device may be a removable storage device (such as a floppy disk, optical drive). The system memory may be a readable and writable storage device or a volatile readable and writable storage device, such as a dynamic random access memory. The system memory may store some or all instructions and data required by the processor at run time. In addition, the memory 1810 may include any combination of computer-readable storage media, including various types of semiconductor memory chips (such as DRAM, SRAM, SDRAM, flash memory, programmable read-only memory), and disks and / or optical disks may also be used. In some embodiments, the memory 1810 may include a readable and / or writable removable storage device, such as a laser disc (CD), a read-only digital versatile disc (such as a DVD-ROM, a double-layer DVD-ROM), a read-only Blu-ray disc, an ultra-density optical disc, a flash memory card (such as an SD card, a mini SD card, a Micro-SD card, etc.), a magnetic floppy disk, etc. The computer-readable storage medium does not include carrier waves and transient electronic signals transmitted wirelessly or wired.
[0231] The memory 1810 stores executable codes, and when the executable codes are processed by the processor 1820 , the processor 1820 may execute part or all of the methods described above.
[0232] In addition, the method according to the present application may also be implemented as a computer program or a computer program product, which includes computer program code instructions for executing some or all of the steps in the above method of the present application.
[0233] Alternatively, the present application can also be implemented as a computer-readable storage medium (or non-transitory machine-readable storage medium or machine-readable storage medium) on which executable code (or computer program or computer instruction code) is stored. When the executable code (or computer program or computer instruction code) is executed by a processor of an electronic device (or server, etc.), the processor executes part or all of the steps of the above-mentioned method according to the present application.
[0234] The embodiments of the present application have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. A circuit for detecting anomalies in random numbers, characterized in that: include: A storage module, configured to store the first random number from the first random number generating unit; an abnormality detection module, connected to the storage module, and configured to perform abnormality detection on the first random number and the first random number generating unit to obtain an abnormality detection result; An exception handling module, connected to the exception detection module, and configured to output a signal corresponding to the exception detection result when the exception detection result is abnormal; The anomaly detection module comprises: A random number detection circuit is configured to perform anomaly detection on a numerical attribute of the first random number to obtain a first anomaly detection sub-result; wherein the numerical attribute includes a total number of bits having the same bits in the first random numbers output by the first random number generating unit in different periods; A first random number generating unit detection circuit is configured to perform an abnormality detection on a physical property of the first random number generating unit to obtain a second abnormality detection sub-result; wherein the physical property is used to characterize at least one of a working state and an environmental state of the first random number generating unit; The first random number generating unit detection circuit includes at least one of the following: a temperature sensor, disposed around the first random number generating unit and / or in a packaging layer of the first random number generating unit, and configured to detect a temperature of the first random number generating unit; a light-sensitive sensor, disposed in the encapsulation layer of the first random number generating unit, and configured to detect the light intensity to which the circuit of the first random number generating unit is exposed; The exception handling module includes: The abnormality analysis unit is configured to determine an abnormality type based on the first abnormality detection sub-result and the second abnormality detection sub-result, and output the abnormality type.
2. The circuit according to claim 1, characterized in that The random number detection circuit comprises: a Hamming weight calculation unit, configured to calculate the Hamming weight of the first random number; The first threshold comparison unit is configured to send a first signal to the exception processing module when the Hamming weight exceeds a first threshold.
3. The circuit according to claim 2, characterized in that The Hamming weight calculation unit comprises: a shift register group, comprising a plurality of registers connected in series, configured to store the first random number; The first counter is configured to determine the number of bits with a value of 1 or 0 in the first random number to determine the total number of bits with a value of 1 in the first random number.
4. The circuit according to claim 1, characterized in that The storage module comprises at least two storage units, and the at least two storage units are each configured to store the first random number output by the first random number generating unit in different cycles; The random number detection circuit comprises: a Hamming distance calculation unit, configured to calculate the Hamming distance between the first random numbers output by the first random number generation unit in different periods, A second threshold comparison unit, configured to send a second signal to the exception processing module when the Hamming distance exceeds a second threshold; and / or The repeated bit statistical unit is configured to calculate the position and number of repeated bits between the first random numbers output by the first random number generating unit in different periods.
5. The circuit according to claim 4, characterized in that The at least two storage units are two storage units, and each of the two storage units is configured to store the first random number output by the first random number generating unit in the first cycle and the second cycle respectively; The Hamming distance calculation unit comprises: N parallel XOR logic calculation circuits are configured to compare a first value and a second value, and output 1 if the first value and the second value are different, the first value is the value of the i-th bit of the first random number corresponding to the first period, the second value is the value of the i-th bit of the first random number corresponding to the second period, i is an integer greater than or equal to 0, and N is the same as the number of bits of the first random number; a numerical concatenation unit configured to concatenate the outputs of the N XOR logic calculation circuits according to the number of bits corresponding to the N XOR logic calculation circuits connected in parallel, to obtain a data string with different bits being 1, wherein the different bits are bits with different values in the first random number corresponding to the first period and the first random number corresponding to the second period; The second counter is configured to determine the number of bits with a value of 1 or 0 in the data string to determine the total number of bits of different bits in the first random number corresponding to the first period and the first random number corresponding to the second period.
6. The circuit according to claim 1, characterized in that The exception handling module also includes: The exception processing unit is configured to output a reset signal and / or an interrupt signal when the exception detection result is abnormal.
7. The circuit according to claim 1, characterized in that Also includes: A threshold configuration unit is configured to configure a first threshold and / or a second threshold corresponding to the first abnormality detection sub-result.
8. A circuit for generating random numbers, characterized in that: include: A first random number generating unit is configured to output a first random number; The circuit for detecting a random number anomaly according to any one of claims 1 to 7 is connected to the first random number generating unit and is configured to output a signal corresponding to an anomaly detection result.
9. The circuit for generating random numbers according to claim 8, characterized in that: Also includes: A second random number generating unit is configured to output a second random number; A random number path selection unit is connected to the first random number generating unit and the second random number generating unit, respectively, and is configured to select a path corresponding to the first random number generating unit to output the first random number when the abnormality detection result is normal, or to select a path corresponding to the second random number generating unit to output the second random number when the abnormality detection result is abnormal.
10. A radar comprising the circuit for generating random numbers according to claim 8 or 9.
11. A method for detecting anomalies in random numbers, characterized in that: include: Obtaining a first random number, where the first random number is a data string generated by a first random number generating unit; Performing anomaly detection on the first random number and the first random number generating unit to obtain an anomaly detection result; When the abnormality detection result is abnormal, outputting a signal corresponding to the abnormality detection result; The performing abnormality detection on the first random number and the first random number generating unit to obtain an abnormality detection result includes: Performing an anomaly detection on a numerical attribute of the first random number to obtain a first anomaly detection sub-result; wherein the numerical attribute includes a total number of bits having the same bits in the first random numbers output by the first random number generating unit in different periods; and, Performing an abnormality detection on a physical property of the first random number generating unit to obtain a second abnormality detection sub-result; wherein the physical property is used to characterize at least one of a working state and an environmental state of the first random number generating unit; The performing anomaly detection on the physical property of the first random number generating unit to obtain a second anomaly detection sub-result includes: The second abnormality detection sub-result is obtained by detecting the temperature of the first random number generating unit through a temperature sensor and / or detecting the light illumination received by the circuit of the first random number generating unit through a photosensor; wherein the temperature sensor is arranged around the first random number generating unit and / or in the packaging layer of the first random number generating unit, and the photosensor is arranged in the packaging layer of the first random number generating unit; The outputting a signal corresponding to the abnormality detection result includes: Based on the first abnormality detection sub-result and the second abnormality detection sub-result, an abnormality type is determined, and the abnormality type is output.
12. An electronic device, characterized in that: include: processor; as well as A memory having executable codes stored therein, which, when executed by the processor, causes the processor to execute the method according to claim 11.
Citation Information
Patent Citations
Resistant and intrusive attack true random number generator
CN106775584A
Test circuit for testing random number generator
CN107957543A
Circuit and method for integrity detection of multi-channel metal shield wiring layer
CN109100635A