Electronic Control Unit
The electronic control device addresses memory inefficiencies by verifying control program rewriting through authentication codes and verification information, ensuring complete program activation and efficient memory use.
Patent Information
- Application Number
- JP2021121135
- Authority / Receiving Office
- JP · JP
- Patent Type
- Patents
- Current Assignee / Owner
- Filing Date
- 2021-07-23
- Publication Date
- 2024-11-26
- Estimated Expiration
- 2041-07-23
AI Technical Summary
Existing electronic control devices face inefficiencies in memory usage due to the need for separate areas to store progress stages of control program rewriting, which can lead to decreased memory efficiency and potential malfunctions from incomplete program activations.
The electronic control device includes a program area, a unique authentication code area, and a verification information area, with a calculation unit to verify the completion of control program rewriting by comparing authentication codes and verification information, allowing for efficient memory usage without separate storage for progress stages.
This approach enables determination of control program rewriting completion without separate memory areas, preventing incomplete program activations and enhancing memory efficiency by allowing simultaneous storage of control programs and verification information in the same area.
Smart Images

Figure 0007589657000001 
Figure 0007589657000002 
Figure 0007589657000003
Abstract
Description
[Technical field]
[0001] The present disclosure relates to an electronic control device that determines whether or not rewriting of a control program has been completed. [Background technology]
[0002] Patent Document 1 describes an electronic control device that operates according to a control program. When the control program is rewritten, the electronic control device stores in a memory a value indicating the progress of the rewriting of the control program. [Prior art documents] [Patent documents]
[0003] [Patent Document 1] Patent No. 5349104 Summary of the Invention [Problem to be solved by the invention]
[0004] The electronic control device described above needs to erase and write the value indicating the progress stage according to the progress stage of the rewrite of the control program. Therefore, the erasure and writing of the value indicating the progress stage are performed during the rewrite of the control program. Furthermore, the timing of writing and erasing into memory is different between the control program for rewriting and the value indicating the progress stage. For this reason, when the electronic control device stores the value indicating the progress stage of the rewrite, it must have a stage storage area in the memory to write the value according to the progress stage, separate from the program area in which the control program is written. Furthermore, the memory needs an area for the stage storage area equivalent to the data erasure unit.
[0005] Incidentally, some memories have a larger data erasure unit than a data write unit, and the value indicating the progress stage corresponds to the progress stage of the control program rewrite, so the size of the value is approximately the same as the data write unit.
[0006] For this reason, the electronic control device needs a stage storage area equal to the data erasure unit just to store values corresponding to the progress stage, which are smaller than the data erasure unit, and this may result in a decrease in memory usage efficiency.
[0007] In view of the above circumstances, an object of the present disclosure is to provide an electronic control device that can determine whether or not rewriting of a control program has been completed and can improve memory usage efficiency. [Means for solving the problem]
[0008] To achieve this object, an electronic control device according to one aspect of the present disclosure includes a storage unit (10) having a rewrite area (100) including a program area (101) into which a control program (111) is written, a unique authentication code area (102) into which a unique authentication code (112) unique to the control program is written, and a verification information area (103) into which verification information (113) is written that is obtained from a verification calculation for verifying whether or not rewriting of the control program has been completed, and that has a predetermined correspondence relationship with the unique authentication code if rewriting of the control program has been completed; A calculation unit (50) that calculates the information written in the memory unit, The calculation unit has a rewriting unit (S20 to S60) that rewrites the rewrite area, and a determination unit (S100 to S130) that determines whether or not the rewriting of the rewrite area has been completed at the time of startup, The rewriting unit erases the rewriting area, and includes an erasing unit (S20) that first erases the verification information; a writing unit (S30) that writes a rewrite control program into the program area and writes the unique authentication code into the unique authentication code area after the erasing unit has performed the erasing; a verification unit (S40) that performs a verification calculation after the writing unit has performed writing; a verification information writing unit (S60) that writes the verification information obtained by the verification unit into a verification information area; The judgment unit is an electronic control device that judges that the rewriting of the rewrite area is complete if the value stored in the unique authenticator area and the value stored in the verification information area have a specified correspondence relationship, and judges that the rewriting of the rewrite area is not complete if the specified correspondence relationship is not observed.
[0009] In the electronic control device of the present disclosure, the erasing unit first erases the verification information from among the control program, unique authenticator, and verification information before rewriting. Therefore, if the processing of the erasing unit has started, the verification information before rewriting is erased even if the rewriting of the rewriting area is interrupted before the unique authenticator before rewriting is erased. In other words, the unique authenticator area stores the value of the unique authenticator before rewriting, and the verification information area stores the value after erasure. Therefore, the value stored in the unique authenticator area and the value stored in the verification information area do not have a predetermined correspondence relationship. Therefore, the determination unit can determine that the rewriting of the control program has not been completed.
[0010] Furthermore, the verification unit performs a verification calculation after the writing unit performs writing, and the verification information writing unit writes the verification information obtained by the verification calculation into the verification information area. That is, while the writing unit is performing writing, the verification information writing unit does not operate. Therefore, the control program and the verification information can be stored in the same rewrite area.
[0011] Therefore, the electronic control device can determine whether the rewrite is complete even if it does not have an area for writing the progress of the rewrite of the control program, separate from the rewrite area. In other words, the memory unit does not need to have an area for a data erase unit in order to write only a value indicating the progress of the rewrite. Therefore, the electronic control device in the present disclosure can efficiently use the areas of the memory unit other than the rewrite area. [Brief description of the drawings]
[0012] [Figure 1] FIG. 2 is a block diagram illustrating the configuration of an electronic control device according to the first embodiment. [Diagram 2]4 is a flowchart illustrating a rewrite process of a rewrite area performed by the electronic control device of FIG. 1. [Diagram 3] 2 is a flowchart illustrating a verification calculation process performed by the electronic control device of FIG. 1. [Figure 4] 4 is a flowchart illustrating a rewrite completion determination process at the time of startup by the electronic control device of FIG. 1. [Diagram 5] FIG. 13 is a block diagram illustrating the configuration of an electronic control device according to a fourth embodiment. [Figure 6] 6 is a flowchart illustrating a rewrite completion determination process at the time of startup by the electronic control device of FIG. 5. [Figure 7] 13 is a flowchart illustrating a rewrite process of a rewrite area performed by an electronic control device in a fifth embodiment. DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] Hereinafter, a number of embodiments of the present disclosure will be described based on the drawings. In addition, by assigning the same reference numerals to corresponding components in each embodiment, duplicated descriptions may be omitted. When only a part of the configuration is described in each embodiment, the configuration of the other embodiment described above can be applied to the other parts of the configuration. In addition to the combination of configurations explicitly stated in the description of each embodiment, configurations of multiple embodiments can be partially combined even if not explicitly stated, as long as there is no particular problem with the combination. And, combinations of configurations described in multiple embodiments and modified examples that are not explicitly stated are also considered to be disclosed by the following description.
[0014] (First embodiment) 1. Configuration of Electronic Control Device 1 The configuration of an electronic control device 1 in this embodiment will be described with reference to Fig. 1 to Fig. 3. The electronic control device 1 in this embodiment can be applied to an on-board control device that is mounted on a vehicle and controls various systems within the vehicle. Examples of the various systems include driving-related systems such as an engine, a steering wheel, and brakes. Other examples of the various systems include body-related systems such as meters and power windows, and information-related systems such as a navigation device.
[0015] The electronic control device 1 can also be called an ECU (Electronic Control Unit). The present disclosure is not limited to an in-vehicle control device, and may be configured to control a device other than a vehicle.
[0016] The electronic control device 1 has a storage unit, a calculation unit, a RAM 30 (Random Access Memory), and a power source 40. Here, in this embodiment, the storage unit corresponds to a ROM 10 (Read Only Memory), and the calculation unit corresponds to a CPU 50 (Central Processing Unit). Therefore, hereinafter, the storage unit will be referred to as ROM 10, and the calculation unit will be referred to as CPU 50.
[0017] 1, the electronic control unit 1 is configured to be connectable to a rewriting tool 60. The rewriting tool 60 is provided outside the vehicle in which the electronic control unit 1 is installed. The rewriting tool 60 is a device for transmitting a control program 111 for rewriting, which will be described later.
[0018] ROM 10 is a memory from which stored information can be read. ROM 10 has a rewrite area 100 and a reprogramming software area 200. ECU software is written in the rewrite area 100. The ECU software is software that operates the electronic control unit 1. Reprogramming software is written in the reprogramming software area 200. The reprogramming software is software that rewrites the ECU software, i.e., performs reprogramming.
[0019] The rewrite area 100 has a program area 101, a unique authenticator area 102, and a verification information area 103. A control program 111 is written in the program area 101. A unique authenticator 112, which is a unique authenticator of the control program 111, is written in the unique authenticator area 102. Verification information 113 is written in the verification information area 103. Here, the control program 111 is a program required for the electronic control unit 1 to control various systems in the vehicle. The verification information 113 is obtained from a verification calculation for verifying whether or not the rewrite of the control program 111 has been completed. When the rewrite of the control program 111 has been completed, the verification information 113 has a predetermined correspondence relationship with the unique authenticator 112. Completion of the rewrite of the control program 111 means that the rewrite of the control program 111 has been completed without any abnormality or tampering.
[0020] The verification calculation in this embodiment uses a cipher mode called CBC (Cipher Block Chaining) mode. The CBC mode is a cipher mode in which the N+1th block is encrypted with a ciphertext obtained by encrypting the Nth block (N is an integer equal to or greater than 1, M≧N) out of M blocks (M is an integer equal to or greater than 2) obtained by dividing the control program 111.
[0021] The unique authenticator 112 is the ciphertext encrypted for the Mth or last block, where, as described above, the Mth block is encrypted using the ciphertext of the M-1th block, i.e., the ciphertext for the Mth block depends on all previous blocks.
[0022] In this embodiment, the verification information 113 is a ciphertext encrypted for a predetermined Lth block (L is an integer equal to or greater than 2, M>L). In the following, the ciphertext encrypted for the Lth block will be abbreviated to Lth ciphertext 113a.
[0023] In the reprogramming software area 200, a rewriting function 220, a start-up control function 230, an authentication function 240, a communication function 250, and a judgment function 260 are written as programs constituting the reprogramming software. The rewriting function 220 has an erasing function 221, a writing function 222, a verification function 223, and a verification information writing function 224. The judgment function 260 has a reverification function 261, a match judgment function 262, and a completion judgment function 263.
[0024] The CPU 50 reads each program contained in the reprogramming software and the ECU software stored in the ROM 10, and executes processing according to each of these programs. The CPU 50 also executes processing while temporarily storing the processing results in the RAM 30. As a result, when executing the reprogramming software, the CPU 50 executes processing based on each function of the reprogramming software. On the other hand, when executing the ECU software, the CPU 50 executes control of various systems within the vehicle based on the control program 111.
[0025] The RAM 30 temporarily stores the Nth ciphertext required for encrypting the N+1th block as an example of a processing result. When the encryption of the N+1th block is completed, the Nth ciphertext is overwritten with the N+1th ciphertext. However, the Lth ciphertext 113a used in the verification calculation is stored in the RAM 30 without being overwritten with the L+1th ciphertext until the verification calculation is completed and the Lth ciphertext is saved in the verification information area 103 in the ROM 10.
[0026] The power supply 40 supplies power to each component within the electronic control device 1 .
[0027] 2. Calculation processing by electronic control device 1 Various types of arithmetic processing performed by the electronic control unit 1 having the above-mentioned configuration will be described with reference to FIGS.
[0028] 2.1. Rewrite process of the rewrite area 100 First, the rewrite process will be described with reference to FIG.
[0029] The electronic control unit 1 starts the rewrite process by receiving a signal from the rewrite tool 60 arranged outside the vehicle. Specifically, the CPU 50 reads and executes the communication function 250. As a result, the CPU 50 communicates with the rewrite tool 60 and starts the rewrite process. The rewrite process is a process for rewriting the rewrite area 100. It can also be said to be a process for rewriting the control program 111. It can also be said to be a process for rewriting the ECU software.
[0030] S10 is an authentication unit. In S10, the CPU 50 reads and executes the authentication function 240. That is, the CPU 50 authenticates whether or not the rewrite tool to be communicated with is a genuine rewrite tool 60. This enables the CPU 50 to prevent the control program 111 from being rewritten by a program transmitted from an unauthorized rewrite tool.
[0031] S20 to S60 are the rewriting section. In S20 to S60, the CPU 50 reads and executes the rewriting function 220. As a result, the CPU 50 rewrites the rewriting area 100. The process of the rewriting section will be specifically described.
[0032] S20 is an erasing unit. In S20, the CPU 50 reads and executes the erasing function 221. This causes the CPU 50 to erase information stored in the rewrite area 100 of the ROM 10 in order for each erasure unit. As a result, the control program 111 before rewriting written in the program area 101, the unique authenticator 112 before rewriting written in the unique authenticator area 102, and the verification information 113 before rewriting written in the verification information area 103 are erased from the ROM 10. Here, the verification information 113 is erased first among the control program 111, the unique authenticator 112, and the verification information 113.
[0033] S30 is a writing unit. In S30, the CPU 50 reads and executes the writing function 222. As a result, the CPU 50 writes the rewrite control program 111 to the program area 101 from which data was erased in S20. The CPU 50 also writes the rewrite unique authenticator 112 to the unique authenticator area 102 from which data was erased in S20.
[0034] S40 and S50 are verification sections. In S40, the CPU 50 reads and executes the verification function 223. This causes the CPU 50 to perform verification calculations. The verification calculations in S40 will be described in detail later.
[0035] In S50, the CPU 50 reads and executes the verification function 223. This verifies whether or not the rewriting of the rewrite area 100 has been completed. Specifically, the CPU 50 compares the value of the unique authenticator 112 with the value of the verification authenticator 113b, which is the result of the verification calculation. The CPU 50 verifies whether or not the rewriting has been completed depending on whether or not these values match. If the value of the unique authenticator 112 matches the value of the verification authenticator 113b, the process proceeds to S60. If the value of the unique authenticator 112 does not match the value of the verification authenticator 113b, the process proceeds to S70.
[0036] S60 is a verification information writing unit. In S60, the CPU 50 reads and executes the verification information writing function 224. As a result, the CPU 50 writes the L-th ciphertext 113a stored in the RAM 30 to the verification information area 103 as the verification information 113. Here, the L-th ciphertext 113a is placed in the rewrite area 100 so as to be erased first among the control program 111, the unique authenticator 112, and the L-th ciphertext 113a. After writing the L-th ciphertext 113a to the verification information area 103, the CPU 50 ends the rewrite process.
[0037] In S70, the CPU 50 determines that the rewriting process has ended abnormally, notifies the rewriting tool 60 of the failure, and ends the rewriting process. Alternatively, the CPU 50 may set an abnormality flag so that the rewriting tool 60 can refer to it, and end the rewriting process.
[0038] Here, the verification calculation process of S40 will be described with reference to Fig. 3. As described above, the electronic control unit 1 in this embodiment uses the CBC mode for the verification calculation. The CPU 50 starts the verification calculation by reading the verification function 223. S200 indicates that the process starts from the first block.
[0039] In S210, if the block number N is equal to or less than the total number of blocks M, the CPU 50 proceeds to S220, otherwise the verification calculation is terminated.
[0040] In S220, the CPU 50 encrypts the Nth block using the (N-1)th ciphertext when N is equal to or greater than 2. Furthermore, when N=1, the CPU 50 encrypts the Nth block using an initialization vector instead of the ciphertext.
[0041] In S230, the CPU 50 moves the target of the verification calculation to the N+1th block. The CPU 50 repeats the processes of S210 to S230 until N>M. When N>M, the CPU 50 ends the verification calculation process. When N=M, that is, when the verification calculation is normally completed, the ciphertext for the Mth block last calculated in S220 becomes the verification authenticator 113b, which is the result of the verification calculation.
[0042] 2.2.Rewrite completion determination process at startup Next, the rewrite completion determination process will be described with reference to Fig. 4. When the electronic control device 1 is started, it starts the flowchart shown in Fig. 4. The rewrite completion determination process is a process for determining whether rewriting of the rewrite area 100 is complete. The rewrite completion determination process can also be considered as a process for determining whether rewriting of the control program 111 is complete. Furthermore, the rewrite completion determination process can also be considered as a process for determining whether the control program 111 is in a state in which it can be normally executed.
[0043] S100 to S120 are the judgment section. In S100 to S120, the CPU 50 reads out and executes the judgment function 260. As a result, the CPU 50 compares the value stored in the unique authenticator area 102 with the value stored in the verification information area 103. If the two values described above have a predetermined corresponding relationship, the CPU 50 judges that the rewriting of the rewrite area 100 is complete. If the two values described above do not have a predetermined corresponding relationship, the CPU 50 judges that the rewriting is not complete. Each process in the judgment section will be specifically described.
[0044] S100 is a re-verification unit. In S100, the CPU 50 reads and executes the re-verification function 261. As a result, the CPU 50 performs the above-mentioned verification calculation again using the value stored in the verification information area 103. In this embodiment, the Lth ciphertext 113a is stored in the verification information area 103 as the verification information 113. Therefore, in S100, the CPU 50 encrypts the L+1th to Mth blocks based on the Lth ciphertext 113a. The CPU 50 calculates the Mth ciphertext, which is the result of this verification calculation, as a re-verification authenticator. In other words, the CPU 50 does not encrypt the 1st to Mth blocks again. The CPU 50 encrypts the L+1th to Mth blocks, thereby encrypting the 1st to Mth blocks.
[0045] S110 is a match determination unit. In S110, the CPU 50 reads and executes the match determination function 262. As a result, the CPU 50 determines whether or not the value stored in the unique authenticator area 102 and the value stored in the verification information area 103 have a predetermined correspondence relationship. Here, in this embodiment, the predetermined correspondence relationship indicates a relationship in which the value of the unique authenticator 112 stored in the unique authenticator area 102 matches the value of the re-verification authenticator calculated based on the L-th ciphertext 113a stored in the verification information area 103.
[0046] Here, the case where the value of the unique authenticator 112 and the value of the re-verification authenticator are in a matching relationship indicates the following state: The rewriting of the control program 111 has been completed normally. Moreover, the control program 111 has not failed during the period from the rewriting to the start-up.
[0047] On the other hand, cases in which the value of the unique authenticator 112 and the value of the reverification authenticator do not match indicate the following states. One is a state in which the above-mentioned rewrite process is not completed, and the Lth ciphertext 113a is not stored in the verification information area 103. The other is a state in which the rewrite process is completed, but the L+1th or subsequent block of the control program 111 has failed between the completion and the determination of the completion of the rewrite at the time of startup. In other words, this is a state in which the rewritten control program 111 has failed and is abnormal.
[0048] If the value of the unique authenticator 112 and the value of the reverification authenticator match, the CPU 50 proceeds to S120. If they match, the CPU 50 determines that the rewriting of the rewrite area 100 is complete, and proceeds to S120. On the other hand, if they do not match, the CPU 50 proceeds to S130. If they do not match, the CPU 50 determines that the rewriting of the rewrite area 100 is not complete, and proceeds to S130. If they do not match, it can be assumed that the control program 111 is in the middle of being rewritten or that the control program 111 is corrupted.
[0049] S120 is a start-up control section. In S120, the CPU 50 reads and executes the start-up control function 230. That is, the CPU 50 executes the rewritten control program 111. By executing the control program 111, the CPU 50 controls various systems within the vehicle.
[0050] On the other hand, in S130, the CPU 50 reads and executes the start-up control function 230 and the rewriting function 220. That is, the CPU 50 starts the reprogramming software. The CPU 50 performs the above-mentioned reprogramming process again on the reprogramming area 100 where reprogramming has not been completed. It can also be said that the CPU 50 starts the reprogramming software and waits for a reprogramming instruction from the reprogramming tool 60.
[0051] In the present disclosure, if the determination in S110 is NO, a process different from S130 may be performed. For example, the electronic control unit 1 may reset itself, or may perform other abnormality processing.
[0052] The effects of the electronic control device 1 in this embodiment will be described.
[0053] In S20, the CPU 50 first erases the verification information 113 from among the control program 111, the unique authenticator 112, and the verification information 113 before the rewriting. Therefore, if the processing in S20 has started, even if the rewriting of the rewriting area 100 is interrupted before the unique authenticator 112 before the rewriting is erased, the verification information 113 before the rewriting is erased. That is, the unique authenticator area 102 stores the value of the unique authenticator 112 before the rewriting, and the verification information area 103 stores the value after erasure. Therefore, there is no predetermined correspondence between the value stored in the unique authenticator area 102 and the value stored in the verification information area 103. Therefore, the CPU 50 can determine that the rewriting of the control program 111 is not completed.
[0054] Furthermore, the CPU 50 writes the rewrite control program 111 and the unique authenticator 112 in S30. Thereafter, the CPU 50 performs a verification calculation to verify whether the rewrite is completed or not in S50. Furthermore, in S60, the CPU 50 writes the verification information 113 obtained by the verification calculation into the verification information area 103. That is, while the rewrite control program 111 and the unique authenticator 112 are being written, the verification information 113 is not written. Therefore, the electronic control device 1 can store the control program 111 and the verification information 113 in the same rewrite area 100.
[0055] Therefore, the electronic control unit 1 can determine whether the rewrite is complete even if it does not have an area for writing the progress of the rewrite of the control program 111, separate from the rewrite area 100. In other words, the ROM 10 does not need to have an area for a data erase unit, since only the value indicating the progress of the rewrite is written therein. Therefore, the electronic control unit 1 can efficiently use the areas of the ROM 10 other than the rewrite area 100.
[0056] Furthermore, if it is determined in S110 that there is a matching relationship, then in S120 the CPU 50 starts the control program 111. On the other hand, if it is determined that there is no matching relationship, then in S130 the above-mentioned rewrite process is performed again. This allows the electronic control unit 1 to prevent an incomplete control program 111, for which rewrite has not been completed, from being started. In other words, the electronic control unit 1 can prevent malfunctions caused by the start of an incomplete control program 111.
[0057] Furthermore, in this embodiment, in S100, the CPU 50 uses the Lth ciphertext 113a as the verification information 113. Specifically, in S100, the CPU 50 performs the verification calculation again using the Lth ciphertext 113a to calculate a re-verification authenticator. Therefore, the CPU 50 does not need to perform the verification calculation from the first block of the control program 111 in determining whether or not rewriting is complete at the time of startup. That is, the electronic control unit 1 can reduce the time required for determining whether or not rewriting is complete at the time of startup.
[0058] Furthermore, the CPU 50 performs verification calculations again for the L+1th and subsequent blocks at the time of startup. Therefore, if the L+1th and subsequent blocks of the control program 111 fail due to factors such as cosmic rays or tampering, the determination unit can determine that rewriting of the control program 111 has not been completed. In other words, even if a block after the L+1th block fails between the rewrite process and the rewrite completion determination process at startup, the determination unit can detect the failure. Therefore, the electronic control device 1 can suppress the startup of the control program 111 having an abnormality.
[0059] Second embodiment The electronic control device 1 in this embodiment will be described. Descriptions of configurations, processes, actions, and effects similar to those of the first embodiment will be omitted.
[0060] This embodiment differs from the first embodiment in the definition of the block number L. In this embodiment, the block number L is an integer of 2 or more, M≧L, and when M is an even number, L≦M / 2, and when M is an odd number, L≦(M+1) / 2.
[0061] The effect of the electronic control device 1 in this embodiment will be described. When the electronic control device 1 is started, in S100, if M is an even number, the CPU 50 performs verification calculation again using the L-th ciphertext 113a where L≦M / 2. On the other hand, if M is an odd number, in S100, the CPU 50 performs verification calculation again using the L-th ciphertext 113a where L≦(M+1) / 2. That is, the CPU 50 performs verification calculation using the ciphertext of the block located in the first half of the M blocks. As a result, when the CPU 50 calculates the re-verification authenticator, it always encrypts the block located in the second half. Therefore, the number of blocks on which verification calculation is performed at start-up is greater than when verification calculation is performed using the ciphertext of the block located in the second half of the M blocks. Therefore, for a fault in the control program 111 that occurs between the rewrite process and the rewrite completion determination process at start-up, the probability of fault detection is higher when the ciphertext of the block located in the first half is used. Therefore, the electronic control device 1 can further suppress the start-up of the control program 111 having an abnormality.
[0062] Third embodiment The electronic control device 1 in this embodiment will be described. Descriptions of configurations, processes, actions, and effects similar to those of the first embodiment will be omitted.
[0063] This embodiment differs from the first embodiment in the definition of the block number L. In this embodiment, the block number L is an integer equal to or greater than 2, M≧L, and L>M / 2 when M is an even number, and L>(M+1) / 2 when M is an odd number.
[0064] The effect of the electronic control device 1 in this embodiment will be described. When the electronic control device 1 is started, in S100, if M is an even number, the CPU 50 performs verification calculation again using the L-th ciphertext 113a where L>M / 2. On the other hand, if M is an odd number, the CPU 50 performs verification calculation again using the L-th ciphertext 113a where L>(M+1) / 2. That is, the CPU 50 performs verification calculation using the ciphertext of the block located in the latter half of the M blocks. Therefore, the number of blocks for which verification calculation is performed in S100 at the start of the electronic control device 1 is smaller than when verification calculation is performed using the ciphertext of the block located in the first half of the M blocks. In other words, the amount of calculation performed by the CPU 50 in S100 is smaller. Therefore, the electronic control device 1 can reduce the time required for the rewrite completion determination process at the start.
[0065] (Fourth embodiment) The electronic control device 1 in this embodiment will be described with reference to Fig. 5 and Fig. 6. Descriptions of configurations, processes, actions, and effects similar to those of the first embodiment will be omitted. Fig. 6 differs from Fig. 4 in that it does not include S100.
[0066] This embodiment differs from the first embodiment in the verification information 113. In this embodiment, as shown in Fig. 5, a verification authenticator 113b is used as the verification information 113. In addition, since the verification authenticator 113b is used, the CPU 50 does not need to read out the re-verification function 261 and calculate the re-verification authenticator in the rewrite completion determination process at the start-up of the electronic control device 1. In other words, the reprogramming software does not have the re-verification function 261.
[0067] The rewrite completion determination process will be described with reference to Fig. 6. S110 is a match determination section. In S110, the CPU 50 reads and executes the match determination function 262. This allows the CPU 50 to determine whether or not there is a predetermined correspondence between the value stored in the unique authenticator area 102 and the value stored in the verification information area 103. Here, in this embodiment, the predetermined correspondence indicates a relationship in which the value of the unique authenticator 112 stored in the unique authenticator area 102 matches the value of the verification authenticator 113b stored in the verification information area 103.
[0068] The CPU 50 judges whether or not the value of the unique authenticator 112 and the value of the verification authenticator 113b match. If they match, the CPU 50 proceeds to S120. If they do not match, the CPU 50 proceeds to S130.
[0069] The effect of the electronic control device 1 in this embodiment will be described. When the electronic control device 1 is started, in S100, if the value of the unique authenticator 112 matches the value of the verification authenticator 113b, the CPU 50 determines that the rewrite of the rewrite area 100 is complete. In other words, the CPU 50 does not need to perform verification calculation again when determining whether the rewrite is complete at the time of start-up. Therefore, the electronic control device 1 can reduce the time required to determine whether the rewrite is complete at the time of start-up.
[0070] Fifth embodiment The electronic control device 1 in this embodiment will be described with reference to Fig. 7. Descriptions of configurations, processes, actions, and effects similar to those in the first embodiment will be omitted.
[0071] This embodiment differs from the first embodiment in the way of determining the block number L of the ciphertext used as the verification information 113. In this embodiment, the block number L is a value designated by the rewriting tool 60.
[0072] Next, the rewrite process of the electronic control unit 1 will be described with reference to Fig. 7. The electronic control unit 1 starts the rewrite process by receiving the control program 111 for rewrite, the unique authenticator 112 of the control program 111, and the block number L from the rewrite tool 60.
[0073] S10 is an authentication unit. In S10, the CPU 50 reads and executes the authentication function 240. That is, the CPU 50 authenticates whether the rewrite tool to be communicated is a genuine rewrite tool 60 or not. In this embodiment, in addition to the verification information, the block number L is stored in step S60. In this case, the CPU 50 reads the block number L before step S100. The CPU 50 executes step S100 after reading the block number L.
[0074] In this embodiment, the block number L is a value designated by the rewriting tool 60. In other words, the electronic control device 1 can change the block number of the ciphertext used as the verification information 113 by designation by the rewriting tool 60. Therefore, the electronic control device 1 can change which block of the ciphertext to use as the verification information 113 in accordance with the control program 111 for rewriting.
[0075] Therefore, for example, when the capacity of the control program 111 is large, in S100, the CPU 50 performs calculations using the ciphertext of the latter block as the verification information 113. As a result, the time required for the rewrite completion determination process at startup can be shortened. In this way, the electronic control device 1 can adjust the amount of verification calculations performed by the CPU 50, such as reducing the amount of calculations, in accordance with the characteristics of the control program 111, such as the capacity.
[0076] (Other embodiments) Although the embodiments of the present disclosure have been described above, the present disclosure is not limited to the above-described embodiments, and the following embodiments are also included within the technical scope of the present disclosure. Furthermore, in addition to the embodiments described below, various modifications can be made without departing from the spirit of the present disclosure.
[0077] In the first embodiment, the verification information 113 is arranged in the rewrite area 100 so that it is the first to be deleted among the control program 111, the unique authenticator 112, and the verification information 113, but the present disclosure is not limited to this. It is sufficient that a part of the verification information 113 is arranged in the rewrite area 100 so that it is the first to be deleted by the CPU 50. [Explanation of symbols]
[0078] Electronic control device…1 10 memory unit, 100 rewrite area, 101 program area, 102 unique authenticator area, 103 verification information area, 111 control program, 112 unique authenticator, 113 verification information, 113a ciphertext for L-th block, 113b verification authenticator, 50 calculation unit, 60 rewrite tool
Claims
1. a storage unit (10) having a rewrite area (100) including a program area (101) in which a control program (111) is written, a unique authentication code area (102) in which a unique authentication code (112) unique to the control program is written, and a verification information area (103) in which verification information (113) is written, which is obtained from a verification calculation for verifying whether or not the rewrite of the control program has been completed when the rewrite of the control program has been completed, and has a predetermined correspondence with the unique authentication code if the rewrite of the control program has been completed; A calculation unit (50) that calculates the information written in the storage unit, The calculation unit has a rewriting unit (S20 to S60) that rewrites the rewrite area, and a determination unit (S100 to S130) that determines whether or not the rewriting of the rewrite area has been completed at the time of startup, The rewriting unit erases the rewriting area, and includes an erasing unit (S20) that first erases the verification information; a writing unit (S30) that writes the rewrite control program into the program area and writes the unique authentication code into the unique authentication code area after the erasing unit has performed the erasing; a verification unit (S40) that performs the verification calculation after the writing unit has performed the writing; a verification information writing unit (S60) that writes the verification information obtained by the verification unit into the verification information area; The judgment unit judges that the rewriting of the rewrite area has been completed if the value stored in the unique authentication code area and the value stored in the verification information area have a specified correspondence relationship, and judges that the rewriting of the rewrite area has not been completed if the specified correspondence relationship is not observed.
2. 2. The electronic control device according to claim 1, further comprising a startup control unit (S120, S130) that starts the rewritten control program when the determination unit determines that the rewriting of the rewrite area has been completed, and starts the rewriting of the control program when the determination unit determines that the rewriting of the rewrite area has not been completed.
3. The control program is divided into M blocks (M is an integer of 2 or more), In the verification calculation, each block is encrypted in order starting from the first block, and a cipher mode is used in which the Nth (N is an integer equal to or greater than 1, M≧N) block is encrypted with a ciphertext obtained by encrypting the N+1th block, The verification information is a ciphertext (113a) for a predetermined L-th block (L is an integer equal to or greater than 2, M>L), The determination unit has a re-verification unit (S100) that, at the time of startup, performs the encryption using the ciphertext of the L-th block and the verification calculation again, thereby encrypting the 1st to M-th blocks, and calculates the ciphertext of the M-th block as a re-verification authenticator; The electronic control device according to claim 2 , wherein the predetermined correspondence relationship is a relationship in which a value of the re-verification authenticator and a value of the unique authenticator match each other.
4. 4. The electronic control device according to claim 3, wherein the Lth number satisfies L≦M / 2 when M is an even number, and L≦(M+1) / 2 when M is an odd number.
5. 4. The electronic control device according to claim 3, wherein the Lth number satisfies L>M / 2 when M is an even number, and L>(M+1) / 2 when M is an odd number.
6. a cipher mode of operation is used for the verification calculation, in which an N+1-th block is encrypted with a ciphertext obtained by encrypting an N-th block (N is an integer of 1 or more, M≧N) among M blocks (M is an integer of 2 or more) obtained by dividing the control program; The verification information is a verification authenticator (113b) that is a result of the verification calculation, The electronic control device according to claim 2 , wherein the predetermined correspondence relationship is a relationship in which a value of the verification authenticator matches a value of the unique authenticator.
7. The control program for rewriting and the unique authentication code are transmitted from an external rewriting tool (60); The electronic control unit according to claim 3 , wherein the Lth is a number designated by the rewriting tool.
Citation Information
Patent Citations
Process for treating pulp drainage
JP1978049104A
Control device for controlling operation of electronic equipment and automatic document feeder
JP2004310216A
Memory rewriting control system
JP2008117404A
Software update device, and software update program
WO2015068220A1
