Semiconductor Device
By integrating a proactive random number generation system within semiconductor devices, the delays associated with regenerating random numbers are mitigated, enhancing the efficiency and consistency of cryptographic processing.
Patent Information
- Application Number
- JP2021130994
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-08-10
- Publication Date
- 2024-11-14
- Estimated Expiration
- 2041-08-10
AI Technical Summary
Existing semiconductor devices with secure IPs face delays in cryptographic processing due to the need to regenerate random numbers, which can take time when the random number generator is exhausted.
Incorporating a first and second control unit, a random number generator, and dedicated memories for storing random numbers and generation information, allowing the secure IP to proactively generate random numbers based on stored settings, thereby reducing the time required for cryptographic processing.
This approach reduces the variability in cryptographic processing time by enabling the secure IP to initiate random number generation ahead of requests, ensuring consistent and efficient cryptographic operations.
Smart Images

Figure 0007583687000001 
Figure 0007583687000002 
Figure 0007583687000003
Abstract
Description
[Technical field]
[0001] The present disclosure relates to a semiconductor device and is applicable to, for example, a semiconductor device having a built-in security function. [Background technology]
[0002] 2. Description of the Related Art In recent years, in the field of ECUs (Electronic Control Units), which are an example of semiconductor devices, security requirements for preventing threats from malicious third parties in communications between ECUs have become increasingly important.
[0003] For example, JP2018-106628A discloses a semiconductor device configured as a microcontroller equipped with a secure intellectual property (IP) for automotive ECUs. The semiconductor device has a CPU (Central Processing Unit) and a secure IP. The secure IP provides security functions to the CPU in response to processing requests from the CPU using hardware resources that it manages. The hardware resources include an encryption engine and a random number generator. [Prior art documents] [Patent documents]
[0004] [Patent Document 1] JP 2018-106628 A Summary of the Invention [Problem to be solved by the invention]
[0005] Generally, a certain amount of random numbers generated by a random number generator is consumed each time a secure IP uses random numbers, and when the generated random numbers run out, the random numbers must be regenerated. If the secure IP requests the random number generator to generate random numbers after receiving a request for cryptographic processing from the CPU, it takes a long time to complete the cryptographic processing that uses random numbers.
[0006] Other objects and novel features will become apparent from the description of this specification and the accompanying drawings.
[0007] A representative embodiment of the present disclosure can be briefly outlined as follows. That is, the semiconductor device includes a first control unit, a second control unit, a random number generator, a first memory in which random numbers generated by the random number generator are stored, an encryption engine that performs encryption and decryption processes using the random numbers stored in the first memory, and a second memory in which information related to random number generation is stored. The second control unit is configured to generate random numbers using the random number generator based on the information related to random number generation. [Brief description of the drawings]
[0008] [Figure 1] FIG. 1 is a block diagram showing a concept of communication between two semiconductor devices according to an embodiment. [Diagram 2] FIG. 2 is a block diagram showing a configuration of the semiconductor device according to the embodiment. [Diagram 3] FIG. 3 is a block diagram showing the configuration of the secure IP shown in FIG. [Figure 4] FIG. 4 is a functional block diagram showing the processing of the secure CPU of the secure IP shown in FIG. [Diagram 5] FIG. 5 is a sequence diagram showing the flow of storing information regarding random number generation in the data flash. [Figure 6] FIG. 6 is a sequence diagram showing a process flow of the semiconductor device in the first embodiment. [Figure 7] FIG. 7 is a sequence diagram showing a process flow of the semiconductor device in the comparative example. [Figure 8] FIG. 8 is a sequence diagram showing a process flow of the semiconductor device in the second embodiment. [Figure 9] FIG. 9 is a sequence diagram showing a process flow of the semiconductor device in the third embodiment. [Figure 10] FIG. 10 is an image diagram showing an example of the transition of the random number in the random number holding area in the third embodiment. [Figure 11] FIG. 11 is an image diagram showing an example of the transition of the random number in the first case of the assumed operation of the CPU. [Figure 12] FIG. 12 is an image diagram showing an example of transition of the random number in the second case of the assumed operation of the CPU. [Figure 13] FIG. 13 is an image diagram showing an example of transition of the random number in the third case of the assumed operation of the CPU. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0009] Hereinafter, embodiments, examples, and modifications will be described with reference to the drawings. In the following description, the same components are designated by the same reference numerals, and repeated description may be omitted.
[0010] The communication between two semiconductor devices in this embodiment will be described with reference to FIG.
[0011] The semiconductor device 11 and the semiconductor device 12 are connected by a signal line 13 and can communicate data with each other. The semiconductor device 11 and the semiconductor device 12 can encrypt and decrypt data to be communicated using a predetermined encryption algorithm with a common key that is held in advance by both of them. The semiconductor device 11 and the semiconductor device 12 have the same functions and can be interchangeable as the sender and the receiver.
[0012] Specifically, the semiconductor device 11 and the semiconductor device 12 may be configured as a microcontroller equipped with a secure IP (Intellectual Property) for an ECU for an automobile. The semiconductor device 11 and the semiconductor device 12 may be mounted on the same or different automobiles. The semiconductor device 11 and the semiconductor device 12 may also be called a semiconductor chip.
[0013] For example, the semiconductor device 11 uses the common key to encrypt the plaintext to be sent and a random number to create a ciphertext. Then, the semiconductor device 11 sends the ciphertext to the semiconductor device 12. The semiconductor device 12 uses the common key to decrypt the received ciphertext and obtains the plaintext and the random number. If the position of the plaintext is shared at the same time as the common key, the semiconductor device 12 can extract only the plaintext that the semiconductor device 11 wants to send from the decryption result.
[0014] The semiconductor device 11 according to the embodiment will be described with reference to FIG.
[0015] The semiconductor device 11 includes a CPU 100, a secure IP 200, a data flash 300, a user RAM 400, and a communication interface (I / F) 500. In the semiconductor device 11, these elements are connected to each other via a bus 600. The semiconductor device 12 has a similar configuration to the semiconductor device 11.
[0016] The CPU 100 performs various processes according to a user program (user application). The secure IP 200 performs security processes such as encryption processes using random numbers. The CPU 100, for example, requests (instructs) the secure IP 200 to perform security processes. Then, when the secure IP 200 receives an instruction from the CPU 100, it performs the instructed security processes.
[0017] The secure IP 200 has a secure RAM 220 configured with a volatile memory, a static random access memory (SRAM). The secure RAM 220 serving as a first memory is accessible from the secure IP 200 but cannot be directly accessed from the CPU 100. The secure IP 200 stores random numbers generated by a random number generator, which will be described later, in the secure RAM 220. Note that the secure RAM 220 does not necessarily have to be built into the secure IP 200 as long as it is accessible only from the secure IP 200.
[0018] The data flash (DATA FLASH) 300 is composed of a flash memory, which is a non-volatile memory, and has a logically divided secure area 310 and a user area 320. The secure area 310 of the data flash 300 as a second memory is an area that can be accessed by the secure IP 200 but cannot be directly accessed by the CPU 100. The secure area 310 may be built into the secure IP 200. The user area 320 is accessible by both the CPU 100 and the secure IP 200. The secure area 310 stores information related to random number generation used in the secure IP 200, etc. The user area 320 stores, for example, a user program executed by the CPU 100 and data used in the user program, etc. The CPU 100 and the user area 320 of the data flash 300 configure a first control unit.
[0019] The user RAM 400 is a volatile memory, and the CPU 100 uses the user RAM 400 as a working area, for example, when performing various processes. The user RAM 400 is also a shared memory between the CPU 100 and the secure IP 200. For example, the CPU 100 stores in the user RAM 400 data that is the subject of security processing requested of the secure IP 200. The secure IP 200 also stores the data that has been security processed in the user RAM 400.
[0020] The communication I / F 500 is an interface for communicating with the outside of the semiconductor device 11, for example, with the semiconductor device 12 via the signal line 13.
[0021] The configuration of the secure IP 200 in the embodiment will be described with reference to FIG.
[0022] The secure IP 200 includes, for example, a secure CPU 210, a secure RAM 220, an encryption engine 230, a random number generator 240, a CPU interface (CPU I / F) 250, and a flash interface (FLASH I / F) 260. The CPU interface 250 is an interface that connects the secure IP 200 and the CPU 100 (see FIG. 2). The CPU interface 250 has, for example, a function of sending an interrupt request to the CPU 100 and a function of receiving an interrupt request from the CPU 100. The flash interface 260 is an interface that connects the secure IP 200 and the data flash 300.
[0023] The secure CPU 210 controls the implementation of various security processes. The encryption engine 230 performs encryption-related processes. The random number generator 240 generates random numbers. The secure CPU 210 performs various security processes including encryption processes, decryption processes, and random number generation using the encryption engine 230 and the random number generator 240. The secure CPU 210 performs security processes, for example, by reading and executing a program from the secure area 310 of the data flash 300.
[0024] The secure CPU 210 communicates with the CPU 100 through the CPU interface 250. The CPU 100 instructs (requests) the secure CPU 210 to store information related to random number generation in the secure area 310 of the data flash 300. When instructed by the CPU 100 to store information related to random number generation, the secure CPU 210 accesses the data flash 300 through the flash interface 260 and stores (saves) the specified information related to random number generation in the secure area 310.
[0025] Furthermore, CPU 100 instructs secure CPU 210 to perform security processing. When instructed by CPU 100 to perform security processing, secure CPU 210 performs the instructed security processing. At that time, secure CPU 210 performs random number generation using information related to random number generation stored in secure area 310 of data flash 300. The instruction to store the information related to random number generation in secure area 310 of data flash 300 is given, for example, before secure CPU 210 performs random number generation using the information related to random number generation.
[0026] The control unit that executes the functions of the secure IP 200 will be described with reference to FIG.
[0027] The control unit 211 has a transmitting / receiving unit (S / R_U) 212, an encryption processing unit (ENC_U) 213, a random number management unit (RNM_U) 214, a random number generation control unit (RGC_U) 215, a random number generation setting management unit (RSM_U) 216, and a data flash control unit (DFC_U) 217. Here, the control unit 211 as a second control unit includes a secure CPU 210 and a secure area 310 in which a program executed by the secure CPU 210 is stored. The transmitting / receiving unit (S / R_U) 212 communicates with the CPU 100. The encryption processing unit (ENC_U) 213 performs encryption processing using random numbers (hereinafter simply referred to as encryption processing). The random number management unit (RNM_U) 214 manages the generation of random numbers. The random number generation control unit (RGC_U) 215 controls the random number generator 240. A random number generation setting management unit (RSM_U) 216 manages the settings of information related to random number generation. A data flash control unit (DFC_U) 217 controls access to the secure area 310 of the data flash 300.
[0028] The storage of information related to random number generation in the data flash will be described with reference to FIG.
[0029] CPU 100 requests secure CPU 210 to store information (RGD) related to random number generation in data flash 300 (step S121). Upon receiving the request from CPU 100, transmitter / receiver unit (S / R_U) 212 requests random number generation setting manager unit (RSM_U) 216 to store information related to random number generation (step S122).
[0030] The random number generation setting management unit (RSM_U) 216 receives the request and performs authentication (step S123). The authentication is performed using a common key, for example. The encryption engine 230 and the random number generator 240 may be used for the authentication, if necessary.
[0031] If the authentication fails, the random number generation setting management unit (RSM_U) 216 ends the process at that point and notifies the transmission / reception unit (S / R_U) 212 that the authentication failed (step S124). Upon receiving the notification from the random number generation setting management unit (RSM_U) 216, the transmission / reception unit (S / R_U) 212 notifies the CPU 100 that the authentication failed (step S125).
[0032] If the authentication is successful, the random number generation setting management unit (RSM_U) 216 requests the data flash control unit (DFC_U) 217 to store information (RGD) related to random number generation in the secure area 310 of the data flash 300 (step S126). The data flash control unit (DFC_U) 217 stores the information (RGD) related to random number generation in the secure area 310 of the data flash 300 (step S127).
[0033] When the storage of the information (RGD) related to random number generation is completed, the data flash control unit (DFC_U) 217 notifies the random number generation setting management unit (RSM_U) 216 of the completion of storage (step S128). Upon receiving the notification from the data flash control unit (DFC_U) 217, the random number generation setting management unit (RSM_U) 216 notifies the transmission / reception unit (S / R_U) 212 of the completion of storage (step S129). Upon receiving the notification from the random number generation setting management unit (RSM_U) 216, the transmission / reception unit (S / R_U) 212 notifies the CPU 100 of the completion of storage (step S130).
[0034] Examples of information (RGD) related to random number generation in the embodiments will be described below using a first example, a second example, and a third example. EXAMPLES
[0035] The processing of the semiconductor device 11 in the first embodiment will be described with reference to FIG.
[0036] CPU 100 requests secure CPU 210 to perform encryption processing (step S101). Transmitting / receiving unit (S / R_U) 212 receives the request from CPU 100 and requests encryption processing unit (ENC_U) 213 to perform processing (step S102).
[0037] The cryptographic processing unit (ENC_U) 213 requests a random number from the random number management unit (RNM_U) 214 (step S103). The random number management unit (RNM_U) 214 obtains the random number from the secure RAM 220 (step S104). The random number management unit (RNM_U) 214 returns the random number to the cryptographic processing unit (ENC_U) 213 (step S105). For ease of explanation, it is assumed here that random number generation is completed in the random number generator 240 and stored in the secure RAM 220.
[0038] The encryption / decryption processing unit (ENC_U) 213 performs encryption processing based on the acquired random number (step S106). The encryption / decryption processing unit (ENC_U) 213 operates the encryption engine 230 as necessary.
[0039] When the encryption processing is completed, the encryption processing unit (ENC_U) 213 notifies the transmission / reception unit (S / R_U) 212 of the completion of the processing (step S107). Upon receiving the notification from the encryption processing unit (ENC_U) 213, the transmission / reception unit (S / R_U) 212 notifies the CPU 100 of the completion of the processing (step S108).
[0040] When the encryption processing unit (ENC_U) 213 completes the encryption processing, it notifies the random number management unit (RNM_U) 214 of the completion of the encryption processing (step S109). When the encryption processing unit (ENC_U) 213 uses a random number stored in the secure RAM 220, the random number management unit (RNM_U) 214 deletes the random number from the secure RAM 220.
[0041] The random number management unit (RNM_U) 214 requests information (RGD) related to random number generation from the random number generation setting management unit (RSM_U) 216 (step S110). The random number generation setting management unit (RSM_U) 216 receives the request from the random number management unit (RNM_U) 214 and requests information (RGD) related to random number generation from the data flash control unit (DFC_U) 217 (step S111). The data flash control unit (DFC_U) 217 receives the request from the random number generation setting management unit (RSM_U) 216 and reads the information (RGD) related to random number generation from the secure area 310 of the data flash 300 (step S112). The data flash control unit (DFC_U) 217 passes the information (RGD) related to random number generation to the random number generation setting management unit (RSM_U) 216 (step S113). The random number generation setting management unit (RSM_U) 216 returns information (RGD) related to random number generation to the random number management unit (RNM_U) 214 (step S114). Here, the information (RGD) related to random number generation in this embodiment is the remaining random number amount (RNDth) for starting random number generation.
[0042] The random number management unit (RNM_U) 214 determines whether random number generation is necessary (step S115). When the encryption processing unit (ENC_U) 213 performs encryption processing using random numbers, the random numbers stored in the secure RAM 220 are consumed and the random number quantity decreases. The random number management unit (RNM_U) 214 determines whether random number generation is necessary by comparing the random number quantity (remaining random number quantity) stored in the secure RAM 220 with RNDth. If the remaining random number quantity is equal to or less than RNDth and it is determined that random number generation is necessary, the random number management unit (RNM_U) 214 requests random number generation control unit (RGC_U) 215 to generate a random number (step S116). The random number generation control unit (RGC_U) 215 generates a random number using the random number generator 240 (step S117). The random number generation control unit (RGC_U) 215 passes the random number generated by the random number generator 240 to the random number management unit (RNM_U) 214 (step S118). The random number management unit (RNM_U) 214 stores the acquired random number in the secure RAM 220 (step S119).
[0043] The advantages of this embodiment will be described with reference to FIGS.
[0044] First, to clarify this embodiment, a comparative example will be described. As shown in Fig. 7, in the comparative example, after accepting a request for cryptographic processing from CPU 100, secure CPU 210 requests random number generation.
[0045] That is, CPU 100 requests secure CPU 210 to perform encryption processing (step S101). Transmitting / receiving unit (S / R_U) 212 receives the request from CPU 100 and requests encryption processing unit (ENC_U) 213 to perform processing (step S102). Encryption processing unit (ENC_U) 213 receives the request from transmitting / receiving unit (S / R_U) 212 and requests random number management unit (RNM_U) 214 to generate random numbers (step S103). Random number management unit (RNM_U) 214 receives the request from encryption processing unit (ENC_U) 213 and requests random number generation control unit (RGC_U) 215 to generate random numbers (step S116).
[0046] The random number generation control unit (RGC_U) 215 generates a random number using the random number generator 240 (step S117). The random number generation control unit (RGC_U) 215 passes the random number generated by the random number generator 240 to the random number management unit (RNM_U) 214 (step S118). The random number management unit (RNM_U) 214 returns the random number to the encryption processing unit (ENC_U) 213 (step S105).
[0047] In contrast, in this embodiment, as described above, after cryptographic processing, the secure CPU 210 judges whether or not to generate random numbers, and starts random number generation as necessary. That is, as shown in Fig. 6, after step S106, the random number management unit (RNM_U) 214 judges whether or not random number generation is necessary (step S115), and if necessary, requests random number generation control unit (RGC_U) 215 to generate random numbers (step S116).
[0048] By secure CPU 210 requesting random number generator 240 to generate random numbers without waiting for a request for random number generation from CPU 100, random number generation is started in advance from the viewpoint of CPU 100. This makes it possible to reduce the time required for the completion of cryptographic processing requested by CPU 100 (the time from the start of step S101 to the end of step S108). If the time from the start of step S101 to the end of step S108 shown in FIG. 6 is tA, and the time from the start of step S101 to the end of step S107 shown in FIG. 7 is tB, then tA <tBとなる。 EXAMPLES
[0049] Next, a second embodiment will be described. In this embodiment, the secure IP 200 stores in the secure area 310 of the data flash 300 trigger data (TRG) indicating whether it is the secure CPU 210 or the CPU 100 that requests the start of random number generation.
[0050] The processing of the semiconductor device in this embodiment will be described with reference to FIG.
[0051] In the secure IP 200 of this embodiment, it is possible to select whether the secure CPU 210 makes a decision to request random number generation to the random number generator 240 or whether it waits for a request from the CPU 100 before making the request. That is, the secure IP 200 is configured to be able to select between the operation of the first embodiment and the operation of the comparative example. Trigger data (TRG), which indicates whether it is the secure CPU 210 or the CPU 100 that requests the start of random number generation, is stored in the secure area 310 of the data flash 300. The secure CPU 210 reads the trigger data (TRG) from the secure area 310 of the data flash 300 and starts random number generation according to the trigger data (TRG). Here, the trigger data (TRG) is information (RGD) related to random number generation. The trigger data (TRG) is stored in the secure area 310 of the data flash 300 by the sequence shown in FIG. 5.
[0052] The processing of the semiconductor device in this embodiment will be described below, focusing on the differences from the first embodiment. Steps S101 and S102 in this embodiment are similar to steps S101 and S102 in the first embodiment.
[0053] In this embodiment, at the start of encryption processing, the encryption processing unit (ENC_U) 213 reads trigger data (TRG) from the secure area 310 of the data flash 300 via the random number generation setting management unit (RSM_U) 216 and the data flash control unit (DFC_U) 217. This causes the trigger data (TRG) to be set.
[0054] That is, the cryptographic processing unit (ENC_U) 213 requests the random number generation setting management unit (RSM_U) 216 to send trigger data (TRG) (step S131). The random number generation setting management unit (RSM_U) 216 receives the request from the cryptographic processing unit (ENC_U) 213 and requests the data flash control unit (DFC_U) 217 to send trigger data (TRG) (step S132). The data flash control unit (DFC_U) 217 receives the request from the random number generation setting management unit (RSM_U) 216 and reads the trigger data (TRG) from the secure area 310 of the data flash 300 (step S133). The data flash control unit (DFC_U) 217 passes the trigger data (TRG) to the random number generation setting management unit (RSM_U) 216 (step S134). The random number generation setting management unit (RSM_U) 216 receives the trigger data (TRG) and passes the trigger data (TRG) to the encryption processing unit (ENC_U) 213 (step S135).
[0055] When the trigger data (TRG) indicates that the CPU 100 will make a request for random number generation (TRG=CPU), the secure CPU 210 performs processing according to the sequence shown by the dashed and dotted line B in Fig. 7. When the trigger data (TRG) indicates that the secure CPU 210 will make a request for random number generation (TRG=SIP), the secure CPU 210 performs processing according to the sequence shown by the dashed and dotted line A in Fig. 6.
[0056] In the comparative example of the first embodiment, the problem is that it takes a long time to complete the encryption process. However, since random number generation is started within the encryption process, the time until the encryption process is completed is constant from the perspective of the CPU 100. In this way, when the response performance of a function is constant, it can be easier to design an application that uses the function.
[0057] In the first embodiment, the secure CPU 210 determines and requests random number generation, so that the completion time of the cryptographic process as viewed from the CPU 100 changes depending on the progress of the random number generation by the random number generator 240. That is, if the CPU 100 requests cryptographic process while the random number generator 240 is generating random numbers, and if the generated random number is less than the number required for the cryptographic process, the cryptographic process is not started until the random number generator completes the generation of random numbers. For this reason, the processing time differs depending on the timing at which the CPU 100 requests cryptographic process. Therefore, the completion time of the cryptographic process may change unintentionally as viewed from the CPU 100. On the other hand, the secure CPU 210 requests the random number generator 240 to generate random numbers without waiting for a request for random number generation from the CPU 100, so that the random number generation can be started in advance as viewed from the CPU 100. The time until the cryptographic process requested by the CPU 100 is completed can be shortened.
[0058] In the case of CPU 100 assuming a system in which an irregular response time to cryptographic processing is regarded as an anomaly, the user selects CPU 100 as the requester (trigger) of random number generation. In the case of CPU 100 assuming a system in which the response time to cryptographic processing is not fixed and the user expects a response as quickly as possible, the user selects secure CPU 210 as the requester of random number generation. That is, in this embodiment, CPU 100 can set a trigger for random number generator 240 to start generating random numbers. This allows the user to select whether the above-mentioned advantages or disadvantages are acceptable for the completion time of cryptographic processing depending on the situation. EXAMPLES
[0059] Next, a third embodiment will be described. In this embodiment, the CPU 100 is able to set the size of the area reserved for holding random numbers in the secure RAM 220 of the secure IP 200 and the remaining random quantity for starting random number generation. In the first embodiment, the processing time changes unintentionally due to the relationship between the time until random number generation, the consumption amount, and the frequency of processing requests. This is because the threshold (RNDth) for whether or not to start random number generation cannot handle cases where cryptographic processing using random numbers is requested continuously in a short time. The operating time of the random number generator 240 is generally 10 times longer than the cryptographic processing. For this reason, when cryptographic processing is requested continuously in a short time, it is necessary to hold random numbers in the secure RAM 220 and consume them from there. For this reason, it is necessary to set not only RNDth but also the size of the area reserved for holding random numbers in the secure RAM 220.
[0060] The processing of the semiconductor device in this embodiment will be described with reference to FIGS.
[0061] The secure CPU 210 is able to set the frequency at which random number generation is triggered in the random number generator 240 and the operation time of the random number generator 240. That is, the CPU 100 is able to set the size of the area reserved for holding random numbers in the secure RAM 220 (RNDmax) and the remaining random amount at which random number generation is to begin (RNDth), which were fixed in the first embodiment. Here, RNDmax and RNDth are information related to random number generation (RGD). The procedure for saving the information related to random number generation (RGD) in the secure area 310 of the data flash 300 is the same sequence as that of FIG. 5 in the first embodiment.
[0062] The processing of the semiconductor device in this embodiment will be described below, focusing on the differences from the first embodiment. Steps S101 to S119 in this embodiment are similar to steps S101 to S119 in the first embodiment. However, the information related to random number generation (RGD) stored in the secure area 310 of the data flash 300 is different.
[0063] The random number management unit (RNM_U) 214 judges whether random number generation is necessary (step S115). When the random number management unit (RNM_U) 214 judges that the random number quantity (remaining random number quantity) stored in the secure RAM 220 is equal to or less than RNDth and random number generation is necessary, the random number management unit (RNM_U) 214 requests random number generation control unit (RGC_U) 215 to generate random numbers (step S116). The random number generation control unit (RGC_U) 215 generates random numbers by the random number generator 240 (step S117). The random number generation control unit (RGC_U) 215 passes the random number generated by the random number generator 240 to the random number management unit (RNM_U) 214 (step S118). The random number management unit (RNM_U) stores the acquired random number in the secure RAM 220 (step S119).
[0064] As described above, the information (RGD) related to random number generation that can be changed by CPU 100 is RNDmax and RNDth. CPU 100 can control the timing at which secure CPU 210 requests random number generation and the operation time of random number generator 240 by changing the set values of RNDmax and RNDth.
[0065] At this time, the number of times cryptographic processing using random numbers is executed and the random number quantity in the random number holding area are as shown in Figure 10. As shown in Figure 10, state A is a state in which random number generator 240 has completed random number generation, and the random number quantity in the random number holding area of secure RAM 220 is RNDmax. State B is a state in which random numbers have been acquired (consumed) in cryptographic processing, and the random number quantity in the random number holding area of secure RAM 220 is less than RNDmax. State C is a state in which the random number quantity in the random number holding area of secure RAM 220 is equal to or less than RNDth, and random number management unit (RNM_U) 214 requests random number generator 240 to generate a random number.
[0066] This embodiment solves the problem of the first embodiment, that the time to complete cryptographic processing using random numbers may change unintentionally as viewed from the CPU 100, in a manner different from that of the second embodiment. In this embodiment, the CPU 100 sets the frequency and time of operation of the random number generator 240, and the secure CPU 210 determines whether to operate the random number generator 240 based on the settings. In other words, the CPU 100 can prepare random numbers when necessary based on the settings, and cryptographic processing can be processed without being kept waiting by the random number generator 240.
[0067] In this embodiment, the secure CPU 210 is able to provide cryptographic processing to the CPU 100 in a time optimal for the CPU 100 by allowing the CPU 100 to set the conditions under which the secure CPU 210 operates the random number generator.
[0068] A method for selecting random number generation settings by a user of the CPU 100 in this embodiment, and the setting selection criteria for RNDmax and RNDth assumed in the processing of the CPU 100 will be described below.
[0069] Other parameters assumed in the processing of the CPU 100 are as follows: Random number used in one encryption process: RNDdelta Time required for continuous encryption processing (RQS): Treq No encryption required period (NQS): Tnreq The interval between cycles during which encryption processing is required continuously: Tperi The time it takes for the random number generator 240 to generate random numbers for RNDdelta: Trnddelta
[0070] In this case, the condition for preventing the random numbers from running out in the section requiring cryptographic processing (RQS) is given by the following equation (1). Treq / Tperi * RNDdelta < RNDmax ···(1)
[0071] The condition for not operating the random number generator 240 in the section requiring cryptographic processing (RQS) is expressed by the following formula (2). Treq / Tperi * RNDdelta < (RNDmax - RNDth) ···(2)
[0072] The values of Treq, Tnreq, and Tperi are determined by operations assumed in the processing of CPU 100. The value of Trnddelta is determined by the performance of random number generator 240 of secure IP 200. In this way, the set values of RNDmax and RNDth can be determined from operations assumed in the processing of CPU 100.
[0073] Next, three types of cases for the processing of the CPU 100 will be assumed and setting examples for each will be described with reference to Figures 11 to 13. The black triangles (▲) shown in Figures 11 to 13 represent the execution timing of cryptographic processing that uses random numbers.
[0074] (First case) As shown in FIG. 11, the processing of the CPU 100 in the first case is assumed to alternate between intervals requiring cryptographic processing (RQS) and intervals not requiring cryptographic processing (NQS).
[0075] In the section requiring cryptographic processing (RQS), the condition for not operating the random number generator 240 and preventing random numbers from running out is expressed by the above formula (2).
[0076] The condition for random number generation to be completed in the section not requiring cryptographic processing (NQS) is given by the following formula (3). Trnddelta * (Treq / Tperi * RNDdelta) < Tnreq ···(3)
[0077] By adjusting RNDmax and RNDth so as to satisfy the conditions of formula (2) and formula (3), the CPU 100 can execute cryptographic processing without waiting for the time to generate random numbers. Furthermore, formula (3) is a relational expression between the performance of random number generation and the frequency of processing requests, and is therefore used to determine whether the performance of the secure IP 200 can satisfy the assumptions of the processing of the CPU 100.
[0078] (Second case) 12, it is assumed that the processing of the CPU 100 in the second case continues indefinitely during the period (RQS) requesting cryptographic processing. Since the request for cryptographic processing continues indefinitely, it is necessary to generate random numbers during the interval (Tperi) requesting cryptographic processing.
[0079] The condition for securing the random number used in cryptographic processing must satisfy the following formula (4). RNDmax > RNDdelta (4)
[0080] The number of cryptographic processes required before random number generation is performed is expressed by the following formula (5). Note that in Figure 12, the number of requests is expressed as 1. (RNDmax - RNDth) / RNDdelta ···(5)
[0081] Since random numbers need to be generated during the interval (Tperi) of requesting cryptographic processing, the condition of the following formula (6) is derived from formula (5). Trnddelta * (RNDmax - RNDth) / RNDdelta < Tperi ···(6)
[0082] By adjusting RNDmax and RNDth under the condition that formula (4) and formula (6) are satisfied, CPU 100 can execute cryptographic processing without waiting for the time to generate random numbers. In addition, formulas (4) and (6) include the performance of random number generation and the frequency of processing requests, so it is also determined whether the performance of secure IP 200 can satisfy the assumptions of processing in CPU 100.
[0083] (Third case) Finally, as shown in FIG. 13, it is assumed that the processing of the CPU 100 in the third case alternates between periods during which cryptographic processing is requested at long intervals (RQLS) and periods during which cryptographic processing is requested at short intervals (RQSS).
[0084] The time period during which encryption processing is requested at long intervals (RQLS) is Treq(long), and the time period during which encryption processing is requested at short intervals (RQSS) is Treq(short). The intervals during which encryption processing is requested in each interval are Tperi(long) and Tperi(short).
[0085] Also, RNDth is set differently in the section where encryption processing is requested at long intervals (RQLS) and the section where encryption processing is requested at short intervals (RQSS). The remaining random amount at which random number generation starts in the section where encryption processing is requested at long intervals (RQLS) is RNDth(long). And the remaining random amount at which random number generation starts in the section where encryption processing is requested at short intervals (RQSS) is RNDth(short). The switching time between the section where encryption processing is requested at long intervals (RQLS) and the section where encryption processing is requested at short intervals (RQSS) is Tchange. Tchange is the time from the last processing request in the section where encryption processing is requested at long intervals (RQLS) to the first processing request in the section where encryption processing is requested at short intervals (RQSS) and vice versa.
[0086] In the section requiring cryptographic processing at long intervals (RQLS), the conditions that RNDmax and RNDth should satisfy are the same as equations (4) and (6) in the second case described above.
[0087] In addition, in the section (RQSS) where cryptographic processing is requested at short intervals, processing requests come in a short time, so it is necessary to prevent the random numbers from running and depleting the random number generator 240. In addition, it is also necessary to complete the generation of random numbers consumed in the section (RQSS) where cryptographic processing is requested at short intervals within Tchange, which is the time until the next request.
[0088] In a section (RQSS) in which cryptographic processing is requested at short intervals, the conditions that RNDmax and RNDth should satisfy are given by the following equations (7) and (8). Treq(short) / Tperi(short) * RNDdelta < (RNDmax - RNDth(short)) ···(7) Treq(short) / Tperi(short) * Trnddelta < Tchange ···(8)
[0089] In the section (RQLS) where cryptographic processing is required at long intervals, RNDmax and RNDth are adjusted so that the conditions satisfying equations (4) and (6) are met. Then, in the section (RQSS) where cryptographic processing is required at short intervals, RNDmax and RNDth are adjusted so that the conditions satisfying equations (7) and (8) are met. This allows CPU 100 to execute cryptographic processing without waiting for the time it takes to generate random numbers. In addition, because equations (7) and (8) include the performance of random number generation and the frequency of processing requests, it is also determined whether the performance of secure IP 200 can satisfy the processing assumed by CPU 100.
[0090] The disclosure made by the present disclosure has been specifically described above based on embodiments and examples. However, the present disclosure is not limited to the above embodiments and examples, and it goes without saying that various modifications can be made without departing from the spirit of the present disclosure. [Explanation of symbols]
[0091] 11, 12 Semiconductor device 211... Control unit (second control unit) 220 Secure RAM (first memory) 230 Encryption Engine 240...Random Number Generator 310 Secure area (second memory)
Claims
1. a first control unit; a second control unit; a random number generator accessible to the second control unit but inaccessible to the first control unit; a first memory accessible from the second control unit but inaccessible from the first control unit, in which random numbers generated by the random number generator are stored; an encryption engine that performs encryption and decryption processes using the random numbers stored in the first memory; a second memory that is accessible from the second control unit but not from the first control unit and that stores information related to random number generation; Equipped with The second control unit is a semiconductor device configured to generate random numbers using the random number generator based on information related to the random number generation.
2. 2. The semiconductor device of claim 1, The second control unit is a semiconductor device configured to set information regarding random number generation in the second memory when the first control unit requests setting of information regarding random number generation in the second memory and authentication is successful.
3. 2. The semiconductor device of claim 1, The semiconductor device, wherein the second control unit is configured to request the random number generator to generate a random number based on an available random quantity stored in the first memory.
4. 4. The semiconductor device of claim 3, The information about random number generation is a remaining random number value that starts random number generation by the random number generator, The second control unit is configured to request the random number generator to generate a random number based on the available random number quantity stored in the first memory and information about the random number generation.
5. 4. The semiconductor device of claim 3, The second control unit is configured to select, based on information regarding the random number generation, whether to request the random number generator to generate a random number in response to a request from the first control unit, or to request the random number generator to generate a random number based on the available random number quantity stored in the first memory.
6. 4. The semiconductor device of claim 3, The second control unit is a semiconductor device configured to set a frequency at which the random number generator is triggered to generate random numbers and an operating time of the random number generator based on information related to the random number generation.
7. 7. The semiconductor device of claim 6, The information regarding random number generation is the size of the area reserved in the first memory for storing random numbers and the remaining random number quantity at which the random number generator starts generating random numbers.
8. 3. The semiconductor device of claim 2, the first control unit is configured with a first central processing unit and a third memory in which a program executed by the first central processing unit is stored; The second control unit is a semiconductor device configured by a second central processing unit and the second memory in which a program executed by the second central processing unit is stored.
Citation Information
Patent Citations
Data relay program for plant supervisory control and system
JP2003333023A
Method and apparatus for managing encryption key in private communication network
JP2008306633A
Semiconductor apparatus, security processing executing apparatus, and security processing executing method
JP2018106628A
Processing secure data
US20160092376A1
Semiconductor device and method of operating semiconductor device
US20190214102A1
