JP7728068B2 - Control device and control method - Google Patents
Control device and control methodInfo
- Publication number
- JP7728068B2 JP7728068B2 JP2021158275A JP2021158275A JP7728068B2 JP 7728068 B2 JP7728068 B2 JP 7728068B2 JP 2021158275 A JP2021158275 A JP 2021158275A JP 2021158275 A JP2021158275 A JP 2021158275A JP 7728068 B2 JP7728068 B2 JP 7728068B2
- Authority
- JP
- Japan
- Prior art keywords
- control device
- update
- buffer
- random number
- communication data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Stored Programmes (AREA)
Description
本発明は、制御装置および制御方法に関する。 The present invention relates to a control device and a control method.
従来、制御装置が生成した乱数を用いて、制御装置が実行するプログラムを更新する機器の認証を行う技術がある。この種の制御装置には、例えば、タイマー値を断続的に取得して乱数生成用のバッファを更新する技術がある(例えば、特許文献1参照)。 Conventionally, there is technology that uses random numbers generated by a control device to authenticate a device that updates a program executed by the control device. For example, this type of control device has technology that intermittently obtains timer values and updates a buffer used to generate random numbers (see, for example, Patent Document 1).
しかしながら、従来技術では、高精度タイマーを使用した場合、生成される乱数のバラつきが小さくなることで認証精度が低下してしまい、プログラム更新時のセキュリティが低下するおそれがあった。 However, with conventional technology, when a high-precision timer is used, the variation in the generated random numbers decreases, reducing authentication accuracy and potentially reducing security during program updates.
本発明は、上記に鑑みてなされたものであって、乱数のバラつきを大きくすることができる制御装置および制御方法を提供することを目的とする。 The present invention has been made in consideration of the above, and aims to provide a control device and control method that can increase the variance of random numbers.
上述した課題を解決し、目的を達成するために、本発明に係る制御装置は、制御部を備える。前記制御部は、断続的にタイマー値を取得する毎に前記タイマー値に基づいて乱数生成用のバッファを更新するバッファ更新処理と、更新後の前記バッファに基づいて、プログラムの更新を制御する更新制御装置の認証に用いる乱数を生成する乱数生成処理とを行う。前記制御部は、前記バッファ更新処理が行われている期間において、外部装置へ通信データを送信する送信処理と、前記外部装置から受信する前記通信データの応答による割込処理とを行うことで前記バッファの更新タイミングを変更する。 To solve the above-mentioned problems and achieve the objectives, the control device according to the present invention includes a control unit. The control unit performs a buffer update process that updates a random number generation buffer based on a timer value each time the timer value is intermittently acquired, and a random number generation process that generates a random number used to authenticate the update control device that controls program updates, based on the updated buffer. During the period in which the buffer update process is being performed, the control unit changes the update timing of the buffer by performing a transmission process that transmits communication data to an external device and an interrupt process in response to the communication data received from the external device.
本発明によれば、乱数のバラつきを大きくすることができる。 This invention makes it possible to increase the variance of random numbers.
以下、添付図面を参照して、本願の開示する制御装置および制御方法の実施形態を詳細に説明する。なお、以下に示す実施形態により本発明が限定されるものではない。 Embodiments of the control device and control method disclosed herein are described in detail below with reference to the accompanying drawings. Note that the present invention is not limited to the embodiments described below.
図1は、実施形態に係る制御装置1を含むプログラム更新システムSの構成例を示す機能ブロック図である。図1に示すプログラム更新システムSは、制御装置1により認証を受けた更新制御装置100によって、制御装置1が実行するプログラムを更新する。 Figure 1 is a functional block diagram showing an example configuration of a program update system S including a control device 1 according to an embodiment. The program update system S shown in Figure 1 updates the program executed by the control device 1 using an update control device 100 authenticated by the control device 1.
図1に示すように、実施形態に係るプログラム更新システムSは、制御装置1と、エンジン10と、外部装置50と、更新制御装置100とを含む。 As shown in FIG. 1, the program update system S according to the embodiment includes a control device 1, an engine 10, an external device 50, and an update control device 100.
制御装置1は、車両Cに搭載されるECU(Electronic Control Unit)であり、実施形態に係る制御方法を実行する。また、制御装置1は、車両Cに関する制御を行う。本開示では、制御装置1は、エンジン10の制御プログラムを実行することで、車両Cに搭載されたエンジン10を制御する。 The control device 1 is an ECU (Electronic Control Unit) mounted on the vehicle C, and executes the control method according to the embodiment. The control device 1 also performs control related to the vehicle C. In this disclosure, the control device 1 controls the engine 10 mounted on the vehicle C by executing a control program for the engine 10.
また、制御装置1は、更新制御装置100と通信して、エンジン10の制御プログラムを更新する。また、制御装置1は、更新制御装置100の認証に関する処理を行う。具体的には、制御装置1は、更新制御装置100から乱数要求を受けた場合、更新制御装置100の認証に用いられる乱数を生成して更新制御装置100へ送信する。 The control device 1 also communicates with the update control device 100 to update the control program of the engine 10. The control device 1 also performs processing related to authentication of the update control device 100. Specifically, when the control device 1 receives a random number request from the update control device 100, it generates a random number to be used to authenticate the update control device 100 and transmits it to the update control device 100.
具体的には、制御装置1は、バッファ更新処理および乱数生成処理を行うことで乱数を生成する。バッファ更新処理は、断続的にタイマー値を取得する毎に記タイマー値に基づいて乱数生成用のバッファを更新する処理である。乱数生成処理は、バッファ更新処理による更新後のバッファに基づいて、更新制御装置100の認証に用いる乱数を生成する処理である。なお、バッファ更新処理や乱数生成処理の詳細については後述する。 Specifically, the control device 1 generates random numbers by performing a buffer update process and a random number generation process. The buffer update process is a process that updates the buffer used for random number generation based on the timer value each time the timer value is intermittently obtained. The random number generation process is a process that generates a random number used for authenticating the update control device 100 based on the buffer updated by the buffer update process. Details of the buffer update process and the random number generation process will be described later.
そして、制御装置1および更新制御装置100それぞれは、乱数を用いて認証キーを生成する。そして、制御装置1は、更新制御装置100が生成した認証キーを取得し、自身が生成した認証キーと比較することで認証を行う。 The control device 1 and the update control device 100 each generate an authentication key using a random number. The control device 1 then obtains the authentication key generated by the update control device 100 and performs authentication by comparing it with the authentication key it generated.
ここで、従来、バッファ更新処理を行う期間が固定であるため、高精度タイマーが使用された場合、バッファの更新タイミングのずれが小さくなってしまい、生成される乱数のバラつきが小さくなるおそれがあった。この結果、かかる乱数を用いると認証精度が低下してしまい、プログラム更新時のセキュリティが低下するおそれがあった。 Here, conventionally, the period during which buffer update processing is performed is fixed. Therefore, when a high-precision timer is used, the lag in the buffer update timing becomes small, which can lead to a decrease in the variance in the generated random numbers. As a result, using such random numbers can reduce authentication accuracy, potentially reducing security during program updates.
そこで、実施形態に係る制御装置1は、バッファ更新処理が行われている期間に割込処理を行うことでバッファの更新タイミングを変更する。 The control device 1 according to the embodiment therefore changes the buffer update timing by performing interrupt processing during the period in which the buffer update process is being performed.
具体的には、制御装置1は、バッファ更新処理が行われている期間において、外部装置50へ通信データを送信する送信処理と、外部装置50から受信した通信データの応答により割込処理とを行うことでバッファの更新タイミングを変更する。 Specifically, during the period when the buffer update process is being performed, the control device 1 changes the buffer update timing by performing a transmission process to send communication data to the external device 50 and an interrupt process in response to the communication data received from the external device 50.
つまり、実施形態に係る制御装置1は、一定の間隔で行われているバッファ更新処理を一時的に中断して別の処理を割り込ませることで、バッファ更新処理の更新タイミングを意図的にずらす。 In other words, the control device 1 according to the embodiment temporarily interrupts the buffer update process, which is performed at regular intervals, and interrupts it with another process, thereby intentionally shifting the update timing of the buffer update process.
また、通信データを送信してからその応答を受信するまでに要する時間は、外部装置50の処理状況に依存するため、毎回一定ではない。言い換えれば、割込処理を行うタイミングは、毎回同じにならない。 In addition, the time required from sending communication data to receiving a response depends on the processing status of the external device 50 and is therefore not constant each time. In other words, the timing of interrupt processing will not be the same each time.
このため、制御装置1は、割込処理が毎回異なるタイミングで行われることで、様々なタイミングで更新タイミングを変更するため、バッファのエントロピーをばらつかせることができる。すなわち、実施形態に係る制御装置1によれば、かかるバッファにより生成される乱数のばらつきを大きくすることができる。 As a result, the control device 1 performs interrupt processing at different times each time, changing the update timing at various times and thereby varying the entropy of the buffer. In other words, the control device 1 according to the embodiment can increase the variation in the random numbers generated by the buffer.
以下、図2以降を参照して、実施形態に係る制御装置1について詳細に説明する。 The control device 1 according to the embodiment will be described in detail below with reference to Figure 2 and subsequent figures.
次に、図2を用いて、実施形態に係る制御装置1の機能構成例について説明する。図2は、実施形態に係る制御装置1の構成例を示す機能ブロック図である。図2に示す制御装置1は、エンジン10、外部装置50および更新制御装置100に接続される。 Next, an example functional configuration of the control device 1 according to the embodiment will be described using Figure 2. Figure 2 is a functional block diagram showing an example configuration of the control device 1 according to the embodiment. The control device 1 shown in Figure 2 is connected to the engine 10, an external device 50, and an update control device 100.
エンジン10は、車両Cの動力源である。エンジン10は、制御装置1の制御に従って動力を発生させ、発生した動力から得られる回転力を車両Cの駆動輪に与える。 The engine 10 is the power source for the vehicle C. The engine 10 generates power under the control of the control device 1, and applies the rotational force obtained from the generated power to the drive wheels of the vehicle C.
外部装置50は、例えば、車両Cを制御するECUである。なお、外部装置50は、ECUに限らず、外部サーバ等であってもよい。つまり、外部装置50は、制御装置1と双方向通信が可能な装置であればよい。 The external device 50 is, for example, an ECU that controls the vehicle C. Note that the external device 50 is not limited to an ECU, and may also be an external server, etc. In other words, the external device 50 may be any device that is capable of two-way communication with the control device 1.
更新制御装置100は、例えば、更新作業を行う作業者が所有する端末装置であり、制御装置1と着脱可能に接続される。更新制御装置100は、スマートフォン、デスクトップ型PC、ノート型PC、タブレット型PC等の任意のタイプの端末装置を用いることができる。 The update control device 100 is, for example, a terminal device owned by the worker performing the update work, and is detachably connected to the control device 1. The update control device 100 can be any type of terminal device, such as a smartphone, desktop PC, laptop PC, or tablet PC.
図2に示すように、制御装置1は、制御部2と、記憶部3とを備える。制御部2は、車両制御部21と、更新制御部22と、クロック生成部23とを備える。記憶部3は、第1プログラム31と、第2プログラム32と、バッファ33とを記憶する。 As shown in FIG. 2, the control device 1 includes a control unit 2 and a memory unit 3. The control unit 2 includes a vehicle control unit 21, an update control unit 22, and a clock generation unit 23. The memory unit 3 stores a first program 31, a second program 32, and a buffer 33.
制御部2は、CPU(Central Processing Unit)、ROM(Read Only Memory)、RAM(Random Access Memory)などを有するマイクロコンピュータや各種の回路を含む。制御部2は、CPUがROMに記憶されたプログラムを、RAMを作業領域として使用して実行することにより、制御装置1の動作を制御する。なお、制御部2は、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)等のハードウェアで構成されてもよい。記憶部3は、例えば、不揮発性メモリやフラッシュメモリ、ハードディスクドライブといった記憶デバイスで構成される記憶部である。 The control unit 2 includes a microcomputer with a CPU (Central Processing Unit), ROM (Read Only Memory), RAM (Random Access Memory), and various other circuits. The control unit 2 controls the operation of the control device 1 by having the CPU execute programs stored in the ROM using the RAM as a working area. The control unit 2 may also be configured with hardware such as an ASIC (Application Specific Integrated Circuit) or FPGA (Field Programmable Gate Array). The memory unit 3 is configured with storage devices such as non-volatile memory, flash memory, or a hard disk drive.
第1プログラム31は、本開示では、エンジン10の制御プログラムであり、更新制御装置100による更新対象となるプログラムである。第1プログラム31は、車両制御部21によって実行される。 In this disclosure, the first program 31 is a control program for the engine 10 and is a program to be updated by the update control device 100. The first program 31 is executed by the vehicle control unit 21.
第2プログラム32は、第1プログラム31を更新するためのプログラムである。第2プログラム32は、更新制御部22によって実行される。 The second program 32 is a program for updating the first program 31. The second program 32 is executed by the update control unit 22.
バッファ33は、更新制御装置100の認証に用いられる乱数を生成するためのエントロピー331を格納する。 Buffer 33 stores entropy 331 for generating random numbers used to authenticate the update control device 100.
次に、制御部2の各機能(車両制御部21、更新制御部22およびクロック生成部23)について説明する。 Next, we will explain each function of the control unit 2 (vehicle control unit 21, update control unit 22, and clock generation unit 23).
車両制御部21は、記憶部3に記憶された第1プログラム31を実行して、エンジン10を制御する。 The vehicle control unit 21 executes the first program 31 stored in the memory unit 3 to control the engine 10.
更新制御部22は、記憶部3に記憶された第2プログラム32を実行して、記憶部3に記憶された第1プログラム31を更新する。なお、更新制御部22の機能構成については後述する。 The update control unit 22 executes the second program 32 stored in the memory unit 3 to update the first program 31 stored in the memory unit 3. The functional configuration of the update control unit 22 will be described later.
クロック生成部23は、周波数の異なる複数のクロック信号を生成する。クロック生成部23は、生成したクロック信号を車両制御部21および更新制御部22へ出力する。車両制御部21および更新制御部22は、クロック信号に同期して動作する。また、クロック信号は、更新制御部22のバッファ更新処理におけるタイマー値の生成に用いられる。 The clock generation unit 23 generates multiple clock signals with different frequencies. The clock generation unit 23 outputs the generated clock signals to the vehicle control unit 21 and the update control unit 22. The vehicle control unit 21 and the update control unit 22 operate in synchronization with the clock signals. The clock signals are also used to generate timer values in the buffer update process of the update control unit 22.
次に、更新制御部22の機能構成について具体的に説明する。図2に示すように、更新制御部22は、認証部221と、乱数生成部222と、認証キー生成部223と、タイミング変更部224とを備える。 Next, the functional configuration of the update control unit 22 will be described in detail. As shown in FIG. 2, the update control unit 22 includes an authentication unit 221, a random number generation unit 222, an authentication key generation unit 223, and a timing change unit 224.
認証部221は、更新制御装置100と通信して更新制御装置100を認証する。具体的には、認証部221は、乱数の送信を要求する乱数要求を更新制御装置100から受けた場合、後述する乱数生成部222によって生成された乱数を更新制御装置100へ送信する。 The authentication unit 221 communicates with the update control device 100 to authenticate the update control device 100. Specifically, when the authentication unit 221 receives a random number request from the update control device 100 requesting the transmission of a random number, it transmits a random number generated by the random number generation unit 222 (described below) to the update control device 100.
また、認証部221は、乱数を更新制御装置100へ送信後、更新制御装置100から乱数に基づいて生成された認証キーを取得するとともに、後述する認証キー生成部223によって生成された認証キーを取得する。 In addition, after transmitting the random number to the update control device 100, the authentication unit 221 obtains an authentication key generated based on the random number from the update control device 100, and also obtains an authentication key generated by the authentication key generation unit 223, which will be described later.
そして、認証部221は、更新制御装置100によって生成された認証キーと、認証キー生成部223によって生成された認証キーとに基づいて更新制御装置100を認証し、認証結果を更新制御装置100へ送信する。 Then, the authentication unit 221 authenticates the update control device 100 based on the authentication key generated by the update control device 100 and the authentication key generated by the authentication key generation unit 223, and transmits the authentication result to the update control device 100.
具体的には、認証部221は、更新制御装置100によって生成された認証キーと、認証キー生成部223によって生成された認証キーとが一致した場合、更新制御装置100を認証し、更新制御装置100へ認証されたことを通知する。 Specifically, if the authentication key generated by the update control device 100 matches the authentication key generated by the authentication key generation unit 223, the authentication unit 221 authenticates the update control device 100 and notifies the update control device 100 that it has been authenticated.
一方、認証部221は、更新制御装置100によって生成された認証キーと、認証キー生成部223によって生成された認証キーとが一致しない場合、更新制御装置100を認証できないことを更新制御装置100へ通知する。この時、認証部221は、更新制御装置100へ認証キーの再生成(あるいは再送信)を要求してもよい。 On the other hand, if the authentication key generated by the update control device 100 does not match the authentication key generated by the authentication key generation unit 223, the authentication unit 221 notifies the update control device 100 that the update control device 100 cannot be authenticated. At this time, the authentication unit 221 may request the update control device 100 to regenerate (or resend) the authentication key.
乱数生成部222は、図1で示したバッファ更新処理および乱数生成処理を実行する。乱数生成部222は、クロック生成部23から受けたクロック信号を用いてバッファ更新処理を行う。 The random number generation unit 222 executes the buffer update process and random number generation process shown in Figure 1. The random number generation unit 222 executes the buffer update process using the clock signal received from the clock generation unit 23.
まず、乱数生成部222は、バッファ更新処理において、クロック生成部23から受けた周波数が異なるクロック信号それぞれをカウントする。乱数生成部222は、クロック信号の各カウント値をタイマー値として取得し、各タイマー値に基づいてバッファ33に格納されたエントロピー331の各ビット値を更新する。なお、エントロピー331の更新方法については、図3を用いて後述する。 First, in the buffer update process, the random number generation unit 222 counts each clock signal with a different frequency received from the clock generation unit 23. The random number generation unit 222 obtains each count value of the clock signal as a timer value, and updates each bit value of the entropy 331 stored in the buffer 33 based on each timer value. The method for updating the entropy 331 will be described later using Figure 3.
乱数生成部222は、更新制御装置100から乱数要求を受けた場合、バッファ更新処理を終了し、乱数生成処理を行う。具体的には、乱数生成部222は、更新制御装置100から乱数要求を受けた場合、エントロピー331をバッファ33から読み出し、読み出したエントロピー331を乱数に変換する。 When the random number generation unit 222 receives a random number request from the update control device 100, it terminates the buffer update process and performs random number generation processing. Specifically, when the random number generation unit 222 receives a random number request from the update control device 100, it reads entropy 331 from buffer 33 and converts the read entropy 331 into a random number.
なお、乱数がエントロピー331に基づいて生成されるのであれば、乱数を生成するアルゴリズムは限定されない。また、乱数は、真正乱数であってもよく、疑似乱数であってもよい。 Note that the algorithm for generating random numbers is not limited as long as the random numbers are generated based on entropy 331. Furthermore, the random numbers may be true random numbers or pseudo-random numbers.
また、乱数生成部222は、後述するタイミング変更部224によって送信処理や割込処理が行われる場合には、バッファ更新処理を一時的に中断し、送信処理や割込処理が終了した後にバッファ更新処理を再開する。 In addition, when transmission processing or interrupt processing is performed by the timing change unit 224 (described later), the random number generation unit 222 temporarily suspends the buffer update processing and resumes the buffer update processing after the transmission processing or interrupt processing is completed.
また、乱数生成部222は、割込処理以外の制御部2が実行する他の処理よりもバッファ更新処理の処理優先度を低く設定することが好ましい。これにより、割込処理以外の他の処理をバッファ更新処理よりも優先できるため、エントロピー331をばらつかせることができる。 Furthermore, it is preferable that the random number generation unit 222 set the processing priority of the buffer update process lower than other processes executed by the control unit 2 other than interrupt processing. This allows processes other than interrupt processing to be given priority over the buffer update process, thereby making it possible to vary the entropy 331.
乱数生成部222は、生成した乱数を認証キー生成部223へ送信するとともに、認証部221を介して更新制御装置100へ送信する。 The random number generation unit 222 sends the generated random number to the authentication key generation unit 223 and also to the update control device 100 via the authentication unit 221.
認証キー生成部223は、乱数生成部222から受けた乱数を用いて、認証キーを生成する。認証キー生成部223は、生成した認証キーを認証部221へ出力する。なお、認証キーを生成するアルゴリズムは、特に限定されない。例えば、AES(Advanced Encryption Standard)が認証キーの生成に用いられる。認証キー生成部223における認証キーを生成するための暗号鍵は、更新制御装置100における認証キーを生成するための暗号鍵と同じであってもよく、異なっていてもよい。 The authentication key generation unit 223 generates an authentication key using the random number received from the random number generation unit 222. The authentication key generation unit 223 outputs the generated authentication key to the authentication unit 221. The algorithm used to generate the authentication key is not particularly limited. For example, the Advanced Encryption Standard (AES) is used to generate the authentication key. The encryption key used to generate the authentication key in the authentication key generation unit 223 may be the same as or different from the encryption key used to generate the authentication key in the update control device 100.
タイミング変更部224は、乱数生成部222によりバッファ更新処理が行われている期間において、外部装置50へ通信データを送信する送信処理と、外部装置50から受信した通信データの応答による割込処理とを行うことで、バッファ更新処理におけるバッファ33の更新タイミングを変更する。 The timing change unit 224 changes the update timing of the buffer 33 during the buffer update process by performing a transmission process to send communication data to the external device 50 and an interrupt process in response to communication data received from the external device 50 while the buffer update process is being performed by the random number generation unit 222.
例えば、タイミング変更部224は、バッファ更新処理が行われている期間において、予め定められたタイミングで送信処理を行う。送信処理を行うタイミングは、例えば、バッファ更新処理を開始してから所定時間後(例えば、1秒後)に行う等といったように、固定されたタイミングであってもよく、ランダムなタイミングであってもよい。 For example, the timing change unit 224 performs the transmission process at a predetermined timing during the period in which the buffer update process is being performed. The timing of the transmission process may be fixed, such as a predetermined time (e.g., one second) after the start of the buffer update process, or may be random.
あるいは、タイミング変更部224は、外部装置50から送信される通知をトリガーとして送信処理を行ってもよい。また、送信処理は、1回に限らず、複数回行われてもよいし、送信処理の回数が毎回異なってもよい。 Alternatively, the timing change unit 224 may perform the transmission process in response to a notification sent from the external device 50. Furthermore, the transmission process may be performed multiple times rather than just once, and the number of times the transmission process is performed may vary each time.
また、送信される通信データは、制御装置1への応答要求のみを含んだダミーデータである。つまり、外部装置50は、通信データを受けた場合に、制御装置1への応答以外の処理は行わない。これにより、外部装置50が行う処理を最小限に抑えることができる(制御装置1への応答のみ)。 Furthermore, the communication data sent is dummy data that includes only a response request to the control device 1. In other words, when the external device 50 receives the communication data, it does not perform any processing other than responding to the control device 1. This allows the processing performed by the external device 50 to be minimized (only responding to the control device 1).
なお、通信データは、外部装置50に所定の処理を行った後に応答するよう指示するデータであってもよい。これにより、通信データの応答を受信するタイミングがばらつくため、エントロピー331をよりばらつかせることができる。 The communication data may be data that instructs the external device 50 to respond after performing a specified process. This causes variation in the timing at which a response to the communication data is received, thereby making it possible to further vary the entropy 331.
そして、タイミング変更部224は、送信処理を行った後に、外部装置50から送信される通信データの応答を受信する割込処理を行う。この結果、乱数生成部222によるバッファ処理が一時的に中断されてタイミング変更部224による割込処理が行われるため、バッファ33におけるエントロピー331をばらつかせることができる。 Then, after performing the transmission process, the timing change unit 224 performs interrupt processing to receive a response to the communication data transmitted from the external device 50. As a result, the buffer processing by the random number generation unit 222 is temporarily suspended and the interrupt processing by the timing change unit 224 is performed, thereby varying the entropy 331 in the buffer 33.
なお、割込処理は、通信データの応答を単に受信する処理であり、通信データの応答に対して受信処理以外の他の処理を行なわないことが好ましい。これにより、更新制御部22の処理負荷を最小限に抑えつつ、エントロピー331をばらつかせることができる。 Note that the interrupt processing is a process that simply receives a response to the communication data, and it is preferable that no processing other than the reception processing is performed on the response to the communication data. This makes it possible to vary the entropy 331 while minimizing the processing load on the update control unit 22.
次に、図3を用いて、乱数生成部222によるエントロピー331の更新方法について説明する。図3は、乱数生成部222によるエントロピー331の更新方法を説明するための図である。図3では、周波数がそれぞれ異なる3つのクロック信号が得られた3つのタイマー値(第1タイマー値~第3タイマー値)を用いた更新方法について説明する。 Next, we will use Figure 3 to explain how the random number generation unit 222 updates entropy 331. Figure 3 is a diagram for explaining how the random number generation unit 222 updates entropy 331. Figure 3 explains an update method using three timer values (first timer value to third timer value) obtained from three clock signals with different frequencies.
図3に示すように、乱数生成部222は、まず、第1タイマー値~第3タイマー値のうち、任意の2つのタイマー値について論理演算を行う。図3に示す例では、乱数生成部222は、第1タイマー値および第3タイマー値それぞれの最下位ビット値(太枠)を抽出し、排他的論理和200を求める。図3では、第1タイマー値の最下位ビット値を「1」、第3タイマー値の最下位ビット値を「0」とした場合、排他的論理和200の出力ビット値として「1」を出力する。 As shown in FIG. 3, the random number generation unit 222 first performs a logical operation on any two of the first to third timer values. In the example shown in FIG. 3, the random number generation unit 222 extracts the least significant bit values (bold frames) of the first and third timer values and calculates the exclusive OR 200. In FIG. 3, if the least significant bit value of the first timer value is "1" and the least significant bit value of the third timer value is "0," the output bit value of the exclusive OR 200 is "1."
つづいて、乱数生成部222は、求めた排他的論理和200の出力ビット値と、第2タイマー値の最下位ビット値とについて論理演算を行う。図3に示す例では、乱数生成部222は、求めた排他的論理和200の出力ビット値と、第2タイマー値の最下位ビット値との排他的論理和201を求める。図3では、出力ビット値を「1」、第2タイマー値の最下位ビット値を「0」とした場合、排他的論理和201の出力ビット値として「1」を出力する。 Next, the random number generation unit 222 performs a logical operation on the output bit value of the obtained exclusive OR 200 and the least significant bit value of the second timer value. In the example shown in Figure 3, the random number generation unit 222 obtains the exclusive OR 201 of the output bit value of the obtained exclusive OR 200 and the least significant bit value of the second timer value. In Figure 3, when the output bit value is "1" and the least significant bit value of the second timer value is "0", the output bit value of the exclusive OR 201 is "1".
つづいて、乱数生成部222は、排他的論理和201の出力ビット値と、記憶部3に記憶されたバッファ33に格納された更新前のエントロピー331の最下位ビット値とについて論理演算を行う。図3に示す例では、求めた排他的論理和201の出力ビット値と、更新前のエントロピー331の最下位ビット値との排他的論理和202を求める。図3では、出力ビット値を「1」、更新前のエントロピー331の最下位ビット値を「1」とした場合、排他的論理和202の出力ビット値として「0」を出力する。 Next, the random number generation unit 222 performs a logical operation on the output bit value of the exclusive OR 201 and the least significant bit value of the pre-update entropy 331 stored in the buffer 33 stored in the memory unit 3. In the example shown in Figure 3, the exclusive OR 202 is calculated between the output bit value of the exclusive OR 201 and the least significant bit value of the pre-update entropy 331. In Figure 3, if the output bit value is "1" and the least significant bit value of the pre-update entropy 331 is "1", then "0" is output as the output bit value of the exclusive OR 202.
そして、乱数生成部222は、更新前のエントロピー331の最下位ビット値を排他的論理和202の出力ビット値に置換することでエントロピー331を更新する。図3に示す例では、更新前のエントロピー331の最下位ビット値「1」が、更新後においては、最下位ビット値「0」に更新される。 The random number generation unit 222 then updates the entropy 331 by replacing the least significant bit value of the entropy 331 before the update with the output bit value of the exclusive OR 202. In the example shown in Figure 3, the least significant bit value "1" of the entropy 331 before the update is updated to the least significant bit value "0" after the update.
つまり、乱数生成部222は、3つのタイマー値の論理演算結果の値と、更新前のエントロピー331との論理演算結果の値を用いてバッファ33のエントロピー331を更新する。このように、3つのタイマー値および更新前のエントロピー331の要素を含んだバッファ更新処理を行うことで、エントロピー331をばらつかせることができる。 In other words, the random number generation unit 222 updates the entropy 331 of the buffer 33 using the value resulting from the logical operation of the three timer values and the entropy 331 before the update. In this way, by performing a buffer update process that includes elements of the three timer values and the entropy 331 before the update, it is possible to vary the entropy 331.
また、周波数が異なる3つのタイマー値を用いることで、3つのタイマー値の論理演算結果のランダム性を増加させることができるため、エントロピー331をばらつかせることができる。 In addition, by using three timer values with different frequencies, the randomness of the results of the logical operation of the three timer values can be increased, thereby varying the entropy 331.
なお、図3では、エントロピー331の最下位ビット値を更新する例を示したが、最下位ビット値を更新した後は、1つ上位のビット値を図3に示した同様の更新方法により更新する。つまり、現在の更新位置のビット値を更新した後は、1つ上位のビット値を新たな更新位置としてバッファ更新処理を行う。そして、最上位ビット値の更新が完了した場合、最下位ビット値に戻ってバッファ更新処理を行う。 Note that Figure 3 shows an example of updating the least significant bit value of entropy 331, but after updating the least significant bit value, the bit value one level higher is updated using the same update method as shown in Figure 3. In other words, after updating the bit value at the current update position, the buffer update process is performed with the bit value one level higher as the new update position. Then, when the update of the most significant bit value is complete, the buffer update process returns to the least significant bit value and is performed again.
なお、バッファ更新処理は、排他的論理和に限らず、論理和や、論理積等であってもよく、あるいは、複数種類の論理演算を組み合わせてもよい。また、論理演算に用いるタイマー値は最下位ビット値に限らず、任意の位置のビット値であってもよい。 Note that the buffer update process is not limited to exclusive OR, but may also be logical OR, logical AND, or a combination of multiple types of logical operations. Furthermore, the timer value used in the logical operation is not limited to the least significant bit value, but may be a bit value at any position.
次に、図4を用いて、実施形態に係るプログラム更新システムSにおいて実行される認証処理の手順について説明する。図4は、実施形態に係るプログラム更新システムSにおいて実行される認証処理の処理手順を示すシーケンス図である。図4に示す認証処理は、車両Cの運転者(所有者)が車両Cの販売店へ移動させて行われる。販売店において、作業者は、更新制御装置100を制御装置1に接続することで、制御装置1との通信を開始することで、認証処理が行われる。 Next, the authentication process steps executed in the program update system S according to the embodiment will be described using Figure 4. Figure 4 is a sequence diagram showing the processing steps of the authentication process executed in the program update system S according to the embodiment. The authentication process shown in Figure 4 is performed by the driver (owner) of vehicle C when the vehicle C is brought to a dealer. At the dealer, an operator connects the update control device 100 to the control device 1 and starts communication with the control device 1, thereby performing the authentication process.
図4に示すように、まず、更新制御装置100は、リプロモード移行要求を送信する(ステップS1)。リプロモードとは、プログラムの更新を行う第2プログラムを実行するモードであり、リプロモード移行要求とは、更新制御部22の起動を制御装置1に指示するメッセージである。 As shown in FIG. 4, first, the update control device 100 sends a repro mode transition request (step S1). Repro mode is a mode in which a second program that updates a program is executed, and the repro mode transition request is a message instructing the control device 1 to start the update control unit 22.
つづいて、制御装置1は、リプロモード移行要求を更新制御装置100から受けた場合、リプロモード移行応答を更新制御装置100へ送信する(ステップS2)。リプロモード移行応答は、リプロモードへの移行を開始することを通知するメッセージである。 Next, when the control device 1 receives a repro mode transition request from the update control device 100, it sends a repro mode transition response to the update control device 100 (step S2). The repro mode transition response is a message notifying the start of the transition to repro mode.
なお、更新制御装置100は、リプロモード移行応答を制御装置1から受けた場合、予め設定された待機時間を経過するまで待機し、待機時間が経過した後に、後述するステップS10を実行することとなる。待機時間は、制御装置1が車両制御部21を停止し、更新制御部22を起動させるまでに要するリプロモード移行時間に基づいて決定される。具体的には、待機時間は、リプロモード移行時間よりも長ければよい。 When the update control device 100 receives a repro mode transition response from the control device 1, it waits until a preset waiting time has elapsed, and after the waiting time has elapsed, it executes step S10, which will be described later. The waiting time is determined based on the repro mode transition time required for the control device 1 to stop the vehicle control unit 21 and start the update control unit 22. Specifically, the waiting time should be longer than the repro mode transition time.
制御装置1は、リプロモード移行応答を送信した後に、リセット処理を実行する(ステップS3)。具体的には、リセット処理では、車両制御部21を停止(第1プログラム31の実行を停止)し、更新制御部22を起動(第2プログラム32の実行を開始)する処理が行われる。 After transmitting the reproduction mode transition response, the control device 1 executes a reset process (step S3). Specifically, the reset process stops the vehicle control unit 21 (stops execution of the first program 31) and starts the update control unit 22 (starts execution of the second program 32).
つづいて、制御装置1は、更新制御部22を起動後に、タイマー値を取得する(ステップS4)。つづいて、制御装置1は、取得したタイマー値に基づいてバッファ33のエントロピー331における各ビット値のうち、1ビットの値を更新する(ステップS5)。 Next, the control device 1 activates the update control unit 22 and acquires the timer value (step S4). Next, the control device 1 updates the value of one bit among the bit values in the entropy 331 of the buffer 33 based on the acquired timer value (step S5).
つづいて、制御装置1は、外部装置50へ通信データを送信する送信処理を実行する(ステップS6)。なお、送信処理は、待機時間(ステップS2からステップS10までの時間)において、任意のタイミングで行うことができる。また、図4では、送信処理が1回行われる例を示しているが、2回以上行われてもよい。 Next, the control device 1 executes a transmission process to transmit communication data to the external device 50 (step S6). Note that the transmission process can be performed at any timing during the standby time (the time from step S2 to step S10). Also, while Figure 4 shows an example in which the transmission process is performed once, it may be performed two or more times.
つづいて、制御装置1は、外部装置50から受信した通信データの応答による割込処理を実行する(ステップS7)。なお、制御装置1は、ステップS6とステップS7の間においてバッファ更新処理(タイマー値を取得してバッファ更新)を待機してもよく、ステップS7において通信データの応答を受信するまではバッファ更新処理を行ってもよい。 Next, the control device 1 executes interrupt processing in response to the communication data received from the external device 50 (step S7). Note that the control device 1 may wait for the buffer update processing (obtaining the timer value and updating the buffer) between steps S6 and S7, or may perform the buffer update processing until the communication data response is received in step S7.
つづいて、制御装置1は、制御装置1は、タイマー値を取得し(ステップS8)、取得したタイマー値に基づいてバッファ33のエントロピー331における各ビット値のうち、1ビットの値を更新する(ステップS9)。 Next, the control device 1 acquires the timer value (step S8) and updates the value of one bit among the bit values in the entropy 331 of the buffer 33 based on the acquired timer value (step S9).
つづいて、更新制御装置100は、待機時間が経過した後に、乱数の送信を要求する乱数要求を送信する(ステップS10)。乱数要求は、更新制御装置100の認証に用いられる乱数の送信を要求するメッセージである。 Next, after the waiting time has elapsed, the update control device 100 sends a random number request requesting the transmission of a random number (step S10). The random number request is a message requesting the transmission of a random number used to authenticate the update control device 100.
つづいて、制御装置1は、乱数要求を更新制御装置100から受けた場合、バッファ更新処理を終了するとともに、バッファ更新処理の更新後のバッファ33を取得する(ステップS11)。 Next, when the control device 1 receives a random number request from the update control device 100, it terminates the buffer update process and obtains the updated buffer 33 (step S11).
つづいて、制御装置1は、取得したバッファ33に格納されたエントロピー331を用いて乱数を生成する(ステップS12)。つづいて、制御装置1は、生成した乱数を含む乱数応答を更新制御装置100へ送信する(ステップS13)。 The control device 1 then generates a random number using the entropy 331 stored in the acquired buffer 33 (step S12). The control device 1 then transmits a random number response including the generated random number to the update control device 100 (step S13).
つづいて、制御装置1および更新制御装置100それぞれは、乱数を用いて認証キーを生成する(ステップS14)。つづいて、更新制御装置100は、生成した認証キーを制御装置1へ送信する(ステップS15)。 Next, the control device 1 and the update control device 100 each generate an authentication key using a random number (step S14). Next, the update control device 100 transmits the generated authentication key to the control device 1 (step S15).
つづいて、制御装置1は、自身が生成した認証キーと、更新制御装置100から受信した認証キーとを比較することで、更新制御装置100の認証処理を行う(ステップS16)。 Next, the control device 1 performs authentication processing for the update control device 100 by comparing the authentication key it generated with the authentication key received from the update control device 100 (step S16).
つづいて、制御装置1は、認証キーの比較結果に応じた認証結果を含む認証結果応答を更新制御装置100へ送信する(ステップS17)。例えば、制御装置1は、双方の認証キーが一致した場合には、更新制御装置100が認証されたことを示す認証結果応答を送信し、双方の認証キーが一致しない場合には、更新制御装置100を認証できないことを示す認証結果応答を送信する。 The control device 1 then transmits an authentication result response to the update control device 100, including an authentication result based on the comparison result of the authentication keys (step S17). For example, if the two authentication keys match, the control device 1 transmits an authentication result response indicating that the update control device 100 has been authenticated; if the two authentication keys do not match, the control device 1 transmits an authentication result response indicating that the update control device 100 cannot be authenticated.
上述してきたように、実施形態に係る制御装置1は、制御部2を備える。制御部2は、断続的にタイマー値を取得する毎にタイマー値に基づいて乱数生成用のバッファ33を更新するバッファ更新処理と、更新後のバッファ33に基づいて、プログラム(第1プログラム31)の更新を制御する更新制御装置100の認証に用いる乱数を生成する乱数生成処理とを行う。制御部2は、バッファ更新処理が行われている期間において、外部装置50へ通信データを送信する送信処理と、外部装置50から受信する通信データの応答による割込処理とを行うことでバッファ33の更新タイミングを変更する。これにより、乱数のバラつきを大きくすることができる。 As described above, the control device 1 according to the embodiment includes a control unit 2. The control unit 2 performs a buffer update process that updates the random number generation buffer 33 based on the timer value each time the timer value is intermittently acquired, and a random number generation process that generates a random number used to authenticate the update control device 100 that controls the update of the program (first program 31) based on the updated buffer 33. While the buffer update process is being performed, the control unit 2 changes the update timing of the buffer 33 by performing a transmission process that transmits communication data to the external device 50 and an interrupt process in response to communication data received from the external device 50. This allows for greater variation in the random numbers.
さらなる効果や変形例は、当業者によって容易に導き出すことができる。このため、本発明のより広範な態様は、以上のように表しかつ記述した特定の詳細および代表的な実施形態に限定されるものではない。したがって、添付の特許請求の範囲およびその均等物によって定義される総括的な発明の概念の精神または範囲から逸脱することなく、様々な変更が可能である。 Further advantages and modifications may readily occur to those skilled in the art. Therefore, the invention in its broader aspects is not limited to the specific details and representative embodiments shown and described above. Accordingly, various modifications may be made without departing from the spirit or scope of the general inventive concept as defined by the appended claims and their equivalents.
1 制御装置
2 制御部
3 記憶部
10 エンジン
21 車両制御部
22 更新制御部
23 クロック生成部
31 第1プログラム
32 第2プログラム
33 バッファ
50 外部装置
100 更新制御装置
221 認証部
222 乱数生成部
223 認証キー生成部
224 タイミング変更部
331 エントロピー
C 車両
S プログラム更新システム
REFERENCE SIGNS LIST 1 control device 2 control unit 3 storage unit 10 engine 21 vehicle control unit 22 update control unit 23 clock generation unit 31 first program 32 second program 33 buffer 50 external device 100 update control device 221 authentication unit 222 random number generation unit 223 authentication key generation unit 224 timing change unit 331 entropy C vehicle S program update system
Claims (7)
前記制御部は、
前記バッファ更新処理が行われている期間において、外部装置へ通信データを送信する送信処理と、前記外部装置から受信する前記通信データの応答による割込処理とを行うことで前記バッファの更新タイミングを変更すること
を特徴とする制御装置。 a control unit that performs a buffer update process that updates a buffer for random number generation based on a timer value every time the timer value is intermittently acquired, and a random number generation process that generates a random number used for authenticating an update control device that controls program updates based on the updated buffer,
The control unit
a control device that changes the update timing of the buffer by performing a transmission process for transmitting communication data to an external device and an interrupt process in response to the communication data received from the external device during the period in which the buffer update process is being performed.
周波数が異なるクロック信号に基づいて生成される複数の前記タイマー値の論理演算結果に基づいて前記バッファに格納されたエントロピーを更新する前記バッファ更新処理を行うこと
を特徴とする請求項1に記載の制御装置。 The control unit
2. The control device according to claim 1, wherein the buffer update process is performed to update the entropy stored in the buffer based on a logical operation result of a plurality of the timer values generated based on clock signals with different frequencies.
前記複数のタイマー値の論理演算結果と、更新前の前記エントロピーとの論理演算結果に基づいて前記更新前のエントロピーを更新すること
を特徴とする請求項2に記載の制御装置。 The control unit
3. The control device according to claim 2, wherein the entropy before update is updated based on a result of a logical operation between the plurality of timer values and the entropy before update.
前記割込処理以外の前記制御部が実行する他の処理よりも前記バッファ更新処理の処理優先度を低く設定すること
を特徴とする請求項1~3のいずれか1つに記載の制御装置。 The control unit
4. The control device according to claim 1, wherein the buffer update process is set to have a lower processing priority than other processes executed by the control unit other than the interrupt process.
前記通信データの応答を受信する処理であること
を特徴とする請求項1~4のいずれか1つに記載の制御装置。 The interrupt processing includes:
5. The control device according to claim 1, wherein the process is to receive a response to the communication data.
前記通信データの応答を要求する応答要求のみを含むこと
を特徴とする請求項1~5のいずれか1つに記載の制御装置。 The communication data is
6. The control device according to claim 1, wherein the control device includes only a response request for requesting a response to the communication data.
前記制御工程は、
前記バッファ更新処理が行われている期間において、外部装置へ通信データを送信する送信処理と、前記外部装置から受信する前記通信データの応答による割込処理とを行うことで前記バッファの更新タイミングを変更すること
を特徴とする制御方法。 a control step of performing a buffer update process for updating a buffer for random number generation based on a timer value every time the timer value is intermittently acquired, and a random number generation process for generating a random number to be used for authenticating an update control device that controls program updates based on the updated buffer,
The control step includes:
a control method characterized by changing the update timing of the buffer by performing a transmission process for transmitting communication data to an external device and an interrupt process in response to the communication data received from the external device during the period in which the buffer update process is being performed.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2021158275A JP7728068B2 (en) | 2021-09-28 | 2021-09-28 | Control device and control method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2021158275A JP7728068B2 (en) | 2021-09-28 | 2021-09-28 | Control device and control method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2023048774A JP2023048774A (en) | 2023-04-07 |
| JP7728068B2 true JP7728068B2 (en) | 2025-08-22 |
Family
ID=85780122
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2021158275A Active JP7728068B2 (en) | 2021-09-28 | 2021-09-28 | Control device and control method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7728068B2 (en) |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2001306302A (en) | 2000-04-17 | 2001-11-02 | Nippon Telegr & Teleph Corp <Ntt> | Random number generator |
| JP2020088458A (en) | 2018-11-16 | 2020-06-04 | 株式会社デンソーテン | Information processing apparatus |
| JP2021026290A (en) | 2019-07-31 | 2021-02-22 | 株式会社デンソーテン | Information processing device |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP3099081B2 (en) * | 1994-05-17 | 2000-10-16 | 日本電信電話株式会社 | Pseudo random number generator |
-
2021
- 2021-09-28 JP JP2021158275A patent/JP7728068B2/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2001306302A (en) | 2000-04-17 | 2001-11-02 | Nippon Telegr & Teleph Corp <Ntt> | Random number generator |
| JP2020088458A (en) | 2018-11-16 | 2020-06-04 | 株式会社デンソーテン | Information processing apparatus |
| JP2021026290A (en) | 2019-07-31 | 2021-02-22 | 株式会社デンソーテン | Information processing device |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2023048774A (en) | 2023-04-07 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US8438621B2 (en) | Method and apparatus for secure management of debugging processes within communication devices | |
| RU2432692C2 (en) | Systems and methods for determining time delay for sending key update request | |
| US11516194B2 (en) | Apparatus and method for in-vehicle network communication | |
| US20200119915A1 (en) | Key generation method and acquisition method, private key update method, chip, and server | |
| US11537717B2 (en) | Information processing apparatus | |
| US9940480B2 (en) | Securing delegated remote management with digital signature | |
| JP7728068B2 (en) | Control device and control method | |
| US20230071782A1 (en) | Electronic chip and a method for provisioning such an electronic chip | |
| US10999074B2 (en) | Dual-token authentication for electronic devices | |
| KR20250067605A (en) | Method and System for Certification and Acquisition of Vehicle's Data | |
| CN115065460B (en) | Power supply control method and device, electronic device and storage medium | |
| JP7845259B2 (en) | Electronic control unit and cryptographic key update program | |
| CN111970124B (en) | Computer factory mode control method, device, computer equipment and storage medium | |
| JP6597342B2 (en) | Verification method of electronic control device | |
| JP7842853B2 (en) | Communication systems, transmitters, and receivers | |
| CN118587801B (en) | Intelligent lock instruction operation method and system, intelligent lock and computer equipment | |
| CN114817909B (en) | A security defense method, device, equipment and storage medium | |
| JP7105894B2 (en) | Mutual authentication method and communication system | |
| TW202040947A (en) | Bluetooth pairing method and electronic system | |
| JP2023101193A (en) | Information processing device, vehicle, information processing method, and program | |
| CN119806554A (en) | Activation control system, method, device, burning device, equipment and storage medium | |
| US11843612B2 (en) | Communication device management device, system, method, and non-transitory computer-readable recording medium | |
| CN119150306A (en) | Method for realizing secure data communication | |
| JP2023160067A (en) | electronic control unit | |
| WO2023096539A1 (en) | Method and means for confirming identity of devices |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20240830 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20250729 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20250731 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20250809 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7728068 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |