Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
JP7032926B2 - Semiconductor device and encryption key control method - Google Patents
[go: Go Back, main page]

JP7032926B2 - Semiconductor device and encryption key control method - Google Patents

Semiconductor device and encryption key control method Download PDF

Info

Publication number
JP7032926B2
JP7032926B2 JP2017252235A JP2017252235A JP7032926B2 JP 7032926 B2 JP7032926 B2 JP 7032926B2 JP 2017252235 A JP2017252235 A JP 2017252235A JP 2017252235 A JP2017252235 A JP 2017252235A JP 7032926 B2 JP7032926 B2 JP 7032926B2
Authority
JP
Japan
Prior art keywords
encryption key
read request
random number
generation unit
data bus
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
Application number
JP2017252235A
Other languages
Japanese (ja)
Other versions
JP2019118064A (en
Inventor
大輔 熊木
佑典 秦
俊彦 中村
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Lapis Semiconductor Co Ltd
Original Assignee
Lapis Semiconductor Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Lapis Semiconductor Co Ltd filed Critical Lapis Semiconductor Co Ltd
Priority to JP2017252235A priority Critical patent/JP7032926B2/en
Publication of JP2019118064A publication Critical patent/JP2019118064A/en
Application granted granted Critical
Publication of JP7032926B2 publication Critical patent/JP7032926B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Description

本発明は、半導体装置、特に暗号鍵を用いたデータの暗号化機能を有する半導体装置、及び暗号鍵の制御方法に関する。 The present invention relates to a semiconductor device, particularly a semiconductor device having a data encryption function using an encryption key, and a method for controlling an encryption key.

現在、スクランブルキーを用いて平文データをスクランブルしたものをメモリに記憶し、当該平文データを用いたデータ処理を行うときに、このスクランブルされた平文データをデスクランブルして元の平文データを復元するデータ処理装置が提案されている(例えば、特許文献1参照)。 Currently, scrambled plain text data using a scramble key is stored in memory, and when data processing using the plain text data is performed, the scrambled plain text data is descrambled to restore the original plain text data. A data processing apparatus has been proposed (see, for example, Patent Document 1).

このデータ処理装置では、平文データをクランブルする場合、CPU(central processing unit)が、平文データをスクランブル回路にてスクランブルさせる。この際、スクランブル回路は、レジスタに保持されているスクランブルキーを読み出し、このスクランブルキーを用いて平文データをスクランブルする。 In this data processing device, when scrambling plaintext data, a CPU (central processing unit) scrambles the plaintext data with a scramble circuit. At this time, the scramble circuit reads out the scramble key held in the register and scrambles the plaintext data using this scramble key.

また、平文データを用いたデータ処理を行う場合には、このデータ処理装置では、CPUが、上記したようにスクランブルされた平文データを、スクランブル回路によってデスクランブルさせる。この際、スクランブル回路は、レジスタに保持されているスクランブルキーを読み出し、当該スクランブルキーを用いて、スクランブルされた平文データをデスクランブルすることにより元の平文データを復元する。CPUは、このように復元された平文データを用いて所定のデータ処理を実行する。 Further, when performing data processing using plaintext data, in this data processing device, the CPU descrambles the plaintext data scrambled as described above by a scramble circuit. At this time, the scramble circuit reads out the scramble key held in the register, and uses the scramble key to descramble the scrambled plaintext data to restore the original plaintext data. The CPU executes predetermined data processing using the plaintext data restored in this way.

更に、当該データ処理装置では、スクランブル及びデスクランブル処理で用いるスクランブルキーの漏洩を防止するために、CPUが上記したような所定のデータ処理を終了したら、スクランブルキーの値を他の値に変更する。つまり、上記したレジスタに保持されているスクランブルキーの値を変更した新たなスクランブルキーを、このレジスタに上書きする。 Further, in the data processing device, in order to prevent leakage of the scramble key used in the scramble and descramble processing, the scramble key value is changed to another value after the CPU finishes the predetermined data processing as described above. .. That is, a new scramble key whose value of the scramble key held in the above-mentioned register is changed is overwritten in this register.

特開2010-92117号公報Japanese Unexamined Patent Publication No. 2010-9217

ところで、上記したようなCPUを有するデータ処理装置には、CPUを介在することなく周辺回路とのデータ転送制御を行う、いわゆるDMAC(direct memory access controller)が搭載されている場合がある。 By the way, a data processing device having a CPU as described above may be equipped with a so-called DMAC (direct memory access controller) that controls data transfer with peripheral circuits without intervening a CPU.

この際、DMACによるデータ転送を行う場合にも、平文データの漏洩を防止するために、暗号鍵としてのスクランブルキーを用いた暗号化(スクランブル)又は復号化(デスクランブル)を実施する。 At this time, even when data is transferred by DMAC, encryption (scramble) or decryption (discramble) using a scramble key as an encryption key is performed in order to prevent leakage of plaintext data.

よって、CPUが、暗号鍵(スクランブルキー)によって復号化(デスクランブル)された平文データに基づくデータ処理の実行中に、DMACが、他の平文データを周辺回路に転送する場合が生じる。この際、DMACによるデータ転送時にも、上記した他の平文データを復元するために、レジスタから暗号鍵(スクランブルキー)を読み出す必要がある。 Therefore, while the CPU is executing data processing based on the plaintext data decrypted (declambled) by the encryption key (scramble key), the DMAC may transfer other plaintext data to the peripheral circuit. At this time, it is necessary to read the encryption key (scramble key) from the register in order to restore the other plaintext data described above even at the time of data transfer by DMAC.

したがって、このような場合、同一値の暗号鍵(スクランブルキー)が2回連続してレジスタから読み出されることになり、暗号鍵の漏洩を招く可能性が高くなる。よって、不正に取得した暗号鍵により上記した平文データが漏洩する虞があった。 Therefore, in such a case, the encryption key (scramble key) having the same value is read from the register twice in succession, and there is a high possibility that the encryption key will be leaked. Therefore, there is a risk that the above-mentioned plaintext data will be leaked by the illegally acquired encryption key.

そこで、本発明は、不正なアクセスによるデータの漏洩を防ぐことが可能な半導体装置、及び暗号鍵の制御方法を提供することを目的とする。 Therefore, an object of the present invention is to provide a semiconductor device capable of preventing data leakage due to unauthorized access, and a method for controlling an encryption key.

本発明に係る半導体装置は、データバスを介して受けた暗号鍵を用いて平文データを暗号化する暗号処理部と、前記暗号鍵を生成し、生成した前記暗号鍵を第1の読出要求又は第2の読出要求に応じて前記データバスに送出する暗号鍵生成部と、前記第1の読出要求を前記暗号鍵生成部に供給し、前記暗号鍵生成部から送出された前記暗号鍵を前記データバスを介して前記暗号処理部に転送する第1の転送制御部と、前記第2の読出要求を前記暗号鍵生成部に供給し、前記暗号鍵生成部から送出された前記暗号鍵を前記データバスを介して前記暗号処理部に転送する第2の転送制御部と、を含み、前記暗号鍵生成部は、前記第1の読出要求及び前記第2の読出要求のうちの一方の読出要求を受けた場合に、前記暗号鍵の値を他の値に変更する。 The semiconductor device according to the present invention has an encryption processing unit that encrypts plain text data using an encryption key received via a data bus, and a first read request or a first read request for the generated encryption key by generating the encryption key. The encryption key generation unit sent to the data bus in response to the second read request and the encryption key sent from the encryption key generation unit by supplying the first read request to the encryption key generation unit are used. The first transfer control unit that transfers to the encryption processing unit via the data bus and the encryption key that supplies the second read request to the encryption key generation unit and that is transmitted from the encryption key generation unit are used. The encryption key generation unit includes a second transfer control unit that transfers to the encryption processing unit via a data bus, and the encryption key generation unit is a read request of one of the first read request and the second read request. When received, the value of the encryption key is changed to another value.

また、本発明に係る半導体装置は、データバスを介して受けた暗号鍵を用いて平文データを暗号化する暗号処理部と、前記暗号鍵を生成し、生成した前記暗号鍵を第1の読出要求又は第2の読出要求に応じて前記データバスに送出する暗号鍵生成部と、前記第1の読出要求を前記暗号鍵生成部に供給し、前記暗号鍵生成部から送出された前記暗号鍵を前記データバスを介して前記暗号処理部に転送する第1の転送制御部と、前記第2の読出要求を前記暗号鍵生成部に供給し、前記暗号鍵生成部から送出された前記暗号鍵を前記データバスを介して前記暗号処理部に転送する第2の転送制御部と、を含み、前記暗号鍵生成部は、所定期間毎に、前記所定期間内において前記第1の読出要求を受けた後に前記第2の読出要求を受けた場合には、前記第2の読出要求に応じて前記暗号鍵に代えてエラー応答を前記データバスに送出する。 Further, the semiconductor device according to the present invention has an encryption processing unit that encrypts plain text data using an encryption key received via a data bus, a generation of the encryption key, and a first reading of the generated encryption key. An encryption key generation unit to be transmitted to the data bus in response to a request or a second read request, and the encryption key to be supplied to the encryption key generation unit and transmitted from the encryption key generation unit. The first transfer control unit that transfers the data to the encryption processing unit via the data bus, and the encryption key that supplies the second read request to the encryption key generation unit and is transmitted from the encryption key generation unit. The encryption key generation unit receives the first read request within the predetermined period at each predetermined period, including a second transfer control unit that transfers the data to the encryption processing unit via the data bus. After that, when the second read request is received, an error response is sent to the data bus in place of the encryption key in response to the second read request.

また、本発明に係る暗号鍵の制御方法は、データバスを介して受けた暗号鍵を用いて平文データを暗号化する際の前記暗号鍵を生成する暗号鍵生成装置が行う暗号鍵の制御方法であって、成した前記暗号鍵を第1の読出要求又は第2の読出要求に応じて前記データバスに送出すると共に、その送出後に前記暗号鍵の値を他の値に変更する。 Further, the method for controlling an encryption key according to the present invention is a method for controlling an encryption key performed by an encryption key generator that generates the encryption key when encrypting plain text data using an encryption key received via a data bus. The generated encryption key is sent to the data bus in response to the first read request or the second read request, and the value of the encryption key is changed to another value after the transmission .

また、本発明に係る暗号鍵の制御方法は、データバスを介して受けた暗号鍵を用いて平文データを暗号化する際の前記暗号鍵を生成する暗号鍵生成装置が行う暗号鍵の制御方法であって、所定期間毎に前記暗号鍵の値を変更しつつ当該暗号鍵を第1の読出要求又は第2の読出要求に応じて前記データバスに送出し、記所定期間の各々内において前記第1の読出要求を受けた後に前記第2の読出要求を受けた場合には、前記第2の読出要求に応じて前記暗号鍵に代えてエラー応答を前記データバスに送出する。 Further, the method for controlling an encryption key according to the present invention is a method for controlling an encryption key performed by an encryption key generator that generates the encryption key when encrypting plain text data using an encryption key received via a data bus. Therefore, the encryption key is sent to the data bus in response to the first read request or the second read request while changing the value of the encryption key every predetermined period, and within each of the predetermined periods. When the second read request is received after the first read request is received, an error response is sent to the data bus in place of the encryption key in response to the second read request.

本発明では、データバスを介して受けた暗号鍵を用いて平文データを暗号化するにあたり、生成した暗号鍵を第1又は第2の読出要求に応じてデータバスに送出すると共に、第1及び第2の読出要求のうちの一方を受けたときに暗号鍵の値を他の値に変更する。 In the present invention, when the plain text data is encrypted by using the encryption key received via the data bus, the generated encryption key is sent to the data bus in response to the first or second read request, and the first and second When one of the second read requests is received, the value of the encryption key is changed to the other value.

また、本発明では、所定期間毎に、この所定期間内において第1の読出要求を受けた後に第2の読出要求を受けた場合には、第2の読出要求に応じて、暗号鍵に代えてエラー応答をデータバスに送出する。 Further, in the present invention, if a second read request is received after receiving the first read request within the predetermined period every predetermined period, the encryption key is replaced in response to the second read request. And send an error response to the data bus.

これにより、例えばCPU(又はDMAC)から暗号鍵を取得する第1の読出要求が為され、引き続きDMAC(又はCPU)から暗号鍵を取得する第2の読出要求が為されても、同一値の暗号鍵が2回連続してデータバスに送出されることはない。 As a result, for example, even if a first read request for acquiring the encryption key is made from the CPU (or DMAC) and a second read request for acquiring the encryption key is subsequently made from the DMAC (or CPU), the same value is obtained. The encryption key is never sent to the data bus twice in a row.

よって、暗号鍵の漏洩を招く可能性が低くなるので、不正なアクセスによる平文データの漏洩を防ぐことが可能となる。 Therefore, the possibility of leaking the encryption key is reduced, and it is possible to prevent the leakage of plaintext data due to unauthorized access.

本発明に係る半導体装置の一例としてのマイクロコンピュータ100の構成を示すブロック図である。It is a block diagram which shows the structure of the microcomputer 100 as an example of the semiconductor device which concerns on this invention. 暗号鍵生成部13の内部構成の一例を示すブロック図である。It is a block diagram which shows an example of the internal structure of the encryption key generation unit 13. セキュアDMAC21による暗号鍵取得の為のデータ転送動作を表す図である。It is a figure which shows the data transfer operation for the encryption key acquisition by the secure DMAC21. CPU14による暗号鍵取得の為のデータ転送動作を表す図である。It is a figure which shows the data transfer operation for the encryption key acquisition by the CPU 14. 暗号鍵生成部13の内部動作の一例を表すタイムチャートである。It is a time chart which shows an example of the internal operation of the encryption key generation unit 13. 暗号鍵生成部13の内部動作の他の一例を表すタイムチャートである。It is a time chart which shows another example of the internal operation of the encryption key generation unit 13. 半導体装置の他の一例としてのマイクロコンピュータ100の構成を示すブロック図である。It is a block diagram which shows the structure of the microcomputer 100 as another example of a semiconductor device. 暗号鍵生成部13Aの内部構成の一例を示すブロック図である。It is a block diagram which shows an example of the internal structure of the encryption key generation unit 13A. 図7に示すマイクロコンピュータ100における、セキュアDMAC21による暗号鍵取得の為のデータ転送動作の一例を表す図である。FIG. 7 is a diagram showing an example of a data transfer operation for acquiring an encryption key by the secure DMAC 21 in the microcomputer 100 shown in FIG. 7. 図7に示すマイクロコンピュータ100における、CPU14による暗号鍵取得の為のデータ転送動作の一例を表す図である。FIG. 7 is a diagram showing an example of a data transfer operation for acquiring an encryption key by the CPU 14 in the microcomputer 100 shown in FIG. 7. 暗号鍵生成部13Aの内部動作の一例を表すタイムチャートである。It is a time chart which shows an example of the internal operation of the encryption key generation unit 13A. 図7に示すマイクロコンピュータ100における、CPU14による暗号鍵取得の為のデータ転送動作の他の一例を表す図である。FIG. 7 is a diagram showing another example of a data transfer operation for acquiring an encryption key by the CPU 14 in the microcomputer 100 shown in FIG. 7. 図7に示すマイクロコンピュータ100における、セキュアDMAC21による暗号鍵取得の為のデータ転送動作の他の一例を表す図である。FIG. 7 is a diagram showing another example of a data transfer operation for acquiring an encryption key by the secure DMAC 21 in the microcomputer 100 shown in FIG. 7. 暗号鍵生成部13Aの内部動作の他の一例を表すタイムチャートである。It is a time chart which shows another example of the internal operation of the encryption key generation unit 13A. 図7に示すマイクロコンピュータ100の変形例を示すブロック図である。It is a block diagram which shows the modification of the microcomputer 100 shown in FIG. 7. 図15に示すマイクロコンピュータ100における、セキュアDMAC21による暗号鍵取得の為のデータ転送動作の一例を表す図である。It is a figure which shows an example of the data transfer operation for the encryption key acquisition by the secure DMAC21 in the microcomputer 100 shown in FIG. 図15に示すマイクロコンピュータ100における、CPU14による暗号鍵取得の為のデータ転送動作の一例を表す図である。FIG. 15 is a diagram showing an example of a data transfer operation for acquiring an encryption key by the CPU 14 in the microcomputer 100 shown in FIG. 15. 図15に示すマイクロコンピュータ100における、CPU14による暗号鍵取得の為のデータ転送動作の他の一例を表す図である。FIG. 15 is a diagram showing another example of a data transfer operation for acquiring an encryption key by the CPU 14 in the microcomputer 100 shown in FIG. 15. 図15に示すマイクロコンピュータ100における、セキュアDMAC21による暗号鍵取得の為のデータ転送動作の他の一例を表す図である。FIG. 15 is a diagram showing another example of a data transfer operation for acquiring an encryption key by the secure DMAC 21 in the microcomputer 100 shown in FIG.

図1は、本発明に係る半導体装置に含まれるマイクロコンピュータ100の構成を示すブロック図である。 FIG. 1 is a block diagram showing a configuration of a microcomputer 100 included in the semiconductor device according to the present invention.

マイクロコンピュータ100は、暗号処理部12、暗号鍵生成部13、CPU(central processing unit)14、RAM(random access memory)15、ROM(read only memory)制御部16、ROM17、セキュアRAM19、セキュアROM20、セキュアDMAC(direct memory access controller)21、及びキーストレージ22を有する。 The microcomputer 100 includes an encryption processing unit 12, an encryption key generation unit 13, a CPU (central processing unit) 14, a RAM (random access memory) 15, a ROM (read only memory) control unit 16, ROM 17, a secure RAM 19, and a secure ROM 20. It has a secure DMAC (direct memory access controller) 21 and a key storage 22.

更に、マイクロコンピュータ100は、2系統のデータバスBS1及びBS8を含む。マイクロコンピュータ100は、外部接続された機器とのデータ通信が可能であり、当該データバスBS1を介して各種データの送信又は受信を行う。 Further, the microcomputer 100 includes two data buses BS1 and BS8. The microcomputer 100 is capable of data communication with an externally connected device, and transmits or receives various data via the data bus BS1.

データバスBS1には、暗号処理部12、暗号鍵生成部13、CPU14、RAM15、ROM制御部16、ROM17、セキュアRAM19、及びキーストレージ22が接続されている。 An encryption processing unit 12, an encryption key generation unit 13, a CPU 14, a RAM 15, a ROM control unit 16, a ROM 17, a secure RAM 19, and a key storage 22 are connected to the data bus BS1.

データバスBS8は、データバスBS1には接続されておらず、且つマイクロコンピュータ100の外部からのアクセス不可な独立したバスである。データバスBS8は、秘匿性を要求される暗号鍵生成部13、セキュアRAM19、セキュアROM20、セキュアDMAC21及びキーストレージ22、並びに暗号処理部12に接続されている。 The data bus BS8 is an independent bus that is not connected to the data bus BS1 and is inaccessible from the outside of the microcomputer 100. The data bus BS8 is connected to an encryption key generation unit 13, a secure RAM 19, a secure ROM 20, a secure DMAC 21, a key storage 22, and an encryption processing unit 12, which are required to be confidential.

暗号処理部12は、データバスBS1を介して受けた暗号化前の平文データ片を、暗号鍵を用いて暗号化することにより暗号化データ片を得て、これをデータバスBS1に送出する。また、暗号処理部12は、データバスBS1を介して受けた暗号化データ片を、この暗号鍵を用いて復号することにより、暗号化前の平文データ片を復元する。尚、暗号処理部12は、このような暗号化又は復号化処理を行うにあたり、その実行前に、キーストレージ22から暗号鍵を取得しておく。 The encryption processing unit 12 obtains an encrypted data piece by encrypting the unencrypted plaintext data piece received via the data bus BS1 with an encryption key, and sends the encrypted data piece to the data bus BS1. Further, the encryption processing unit 12 restores the plaintext data piece before encryption by decrypting the encrypted data piece received via the data bus BS1 using this encryption key. The encryption processing unit 12 acquires an encryption key from the key storage 22 before executing such an encryption or decryption process.

暗号鍵生成部13は、暗号鍵を生成しこれをデータバスBS1又はBS8に送出する。 The encryption key generation unit 13 generates an encryption key and sends it to the data bus BS1 or BS8.

図2は、暗号鍵生成部13の内部構成の一例を示すブロック図である。 FIG. 2 is a block diagram showing an example of the internal configuration of the encryption key generation unit 13.

図2に示す一例では、暗号鍵生成部13は、乱数生成部131、レジスタ132及び出力制御部133を含む。 In the example shown in FIG. 2, the encryption key generation unit 13 includes a random number generation unit 131, a register 132, and an output control unit 133.

乱数生成部131は、所定期間毎に乱数値が変化する乱数RNDを生成し、これをレジスタ132に供給する。尚、乱数生成部131は、乱数変更信号CHを受けた場合には、上記した所定期間の経過を待つことなく、当該乱数変更信号CHを受けた時点で、乱数RNDにて示される乱数値を他の乱数値に変更する。 The random number generation unit 131 generates a random number RND whose random number value changes every predetermined period, and supplies this to the register 132. When the random number generation unit 131 receives the random number change signal CH, the random number generation unit 131 generates the random number value indicated by the random number RND at the time of receiving the random number change signal CH without waiting for the elapse of the above-mentioned predetermined period. Change to another random number value.

レジスタ132は、乱数RNDを保持しつつ、当該乱数RNDにて表される乱数値を有する暗号鍵CRKを出力制御部133に供給する。 The register 132 supplies the encryption key CRK having the random number value represented by the random number RND to the output control unit 133 while holding the random number RND.

出力制御部133は、データバスBS1を介して暗号鍵読出要求RQ1を受けた場合には、レジスタ132から供給された暗号鍵CRKをデータバスBS1に送出し、引き続き、乱数変更信号CHを乱数生成部131に供給する。また、出力制御部133は、データバスBS8を介して暗号鍵読出要求RQ2を受けた場合には、レジスタ132から供給された暗号鍵CRKをデータバスBS8に送出する。 When the output control unit 133 receives the encryption key read request RQ1 via the data bus BS1, the output control unit 133 sends the encryption key CRK supplied from the register 132 to the data bus BS1 and subsequently generates a random number change signal CH. Supply to unit 131. Further, when the output control unit 133 receives the encryption key read request RQ2 via the data bus BS8, the output control unit 133 sends the encryption key CRK supplied from the register 132 to the data bus BS8.

図1に示すCPU14は、このマイクロコンピュータ100の中央演算処理装置であり、ROM17に格納されているプログラムに従った演算或いはデータ転送の為の各種制御を行う。 The CPU 14 shown in FIG. 1 is a central processing unit of the microcomputer 100, and performs various controls for calculation or data transfer according to a program stored in the ROM 17.

RAM15は、データ書き込みが可能な記憶素子であり、CPU14によってデータの書込又は読出が行われる。 The RAM 15 is a storage element capable of writing data, and the CPU 14 writes or reads data.

ROM制御部16は、ROM17に対して、データの書き込み、又はデータが正しく書き込まれたか否かを確認するベリファイ、或いは書き込まれたデータの消去等を行う。 The ROM control unit 16 writes data to the ROM 17, verifies whether or not the data is correctly written, erases the written data, and the like.

ROM17には、CPU14が実行するプログラムを表すプログラムデータが書き込まれている。 Program data representing a program executed by the CPU 14 is written in the ROM 17.

セキュアRAM19は、セキュアDMAC21からのデータ書込アクセスに応じて、データバスBS8を介して受けたデータを記憶する。また、セキュアRAM19は、セキュアDMAC21からのデータ読出アクセスに応じて、自身に記憶されているデータを読み出し、これをデータバスBS8に送出する。また、セキュアRAM19は、CPU14からのデータ書込アクセスに応じて、データバスBS1を介して受けたデータを記憶する。尚、セキュアRAM19は、CPU14からのデータ読出アクセスは受け付けない。 The secure RAM 19 stores data received via the data bus BS8 in response to a data write access from the secure DMAC21. Further, the secure RAM 19 reads the data stored in itself in response to the data read access from the secure DMAC 21, and sends the data to the data bus BS8. Further, the secure RAM 19 stores the data received via the data bus BS1 in response to the data write access from the CPU 14. The secure RAM 19 does not accept data read access from the CPU 14.

セキュアROM20は、セキュアDMAC21からのデータ読出アクセスに応じて、自身に格納されているデータを読み出し、これをデータバスBS8に送出する。また、セキュアROM20は、ROM制御部16又はセキュアDMAC21からのデータ書込アクセスに応じて、データバスBS8を介して受けたデータを書き込む。 The secure ROM 20 reads the data stored in the secure ROM 20 in response to the data read access from the secure DMAC 21, and sends the data to the data bus BS8. Further, the secure ROM 20 writes the data received via the data bus BS8 in response to the data write access from the ROM control unit 16 or the secure DMAC21.

セキュアDMAC21は、データバスBS8を介して、暗号処理部12、暗号鍵生成部13、セキュアRAM19、セキュアROM20、及びキーストレージ22間のデータ転送を行う。 The secure DMAC 21 transfers data between the encryption processing unit 12, the encryption key generation unit 13, the secure RAM 19, the secure ROM 20, and the key storage 22 via the data bus BS8.

キーストレージ22は、データバスBS8を介して受けた暗号鍵を保持する。また、キーストレージ22は、暗号鍵読出要求に応じて、保持されている暗号鍵を読み出し、データバスBS8に送出する。 The key storage 22 holds the encryption key received via the data bus BS8. Further, the key storage 22 reads the held encryption key in response to the encryption key read request and sends it to the data bus BS8.

上記した構成により、マイクロコンピュータ100は、ROM17に格納されているプログラムに従って、上記した暗号鍵を用いた平文データの暗号又は暗号化データの復号処理を含む各種のデータ処理を行う。 With the above configuration, the microcomputer 100 performs various data processing including encryption of plaintext data using the above-mentioned encryption key or decryption processing of encrypted data according to the program stored in the ROM 17.

以下に、データバスBS1上の平文データ片を暗号化する場合を例にとって、マイクロコンピュータ100内で行われるデータ転送動作について説明する。 Hereinafter, the data transfer operation performed in the microcomputer 100 will be described by taking the case of encrypting the plaintext data piece on the data bus BS1 as an example.

先ず、セキュアDMAC21が、暗号鍵を取得する為の暗号鍵読出要求RQ2を、図3の太線矢印に示すようにデータバスBS8を介して暗号鍵生成部13に供給する。暗号鍵読出要求RQ2に応じて、暗号鍵生成部13は、暗号鍵CRKを、図3の太線矢印に示すようにデータバスBS8を介してセキュアDMAC21に供給する。 First, the secure DMAC 21 supplies the encryption key read request RQ2 for acquiring the encryption key to the encryption key generation unit 13 via the data bus BS8 as shown by the thick line arrow in FIG. In response to the encryption key read request RQ2, the encryption key generation unit 13 supplies the encryption key CRK to the secure DMAC 21 via the data bus BS8 as shown by the thick line arrow in FIG.

セキュアDMAC21は、取得した暗号鍵CRKをデータバスBS8を介してキーストレージ22に転送し、当該暗号鍵CRKをキーストレージ22に保持させる。次に、セキュアDMAC21は、キーストレージ22に保持されている暗号鍵CRKをセキュアRAM19及びセキュアROM20の各々に転送し、当該暗号鍵CRKをこれらセキュアRAM19及びセキュアROM20に書き込ませる。そして、セキュアDMAC21は、セキュアRAM19に書き込まれた暗号鍵CRKを、データバスBS8を介して暗号処理部12に供給する。 The secure DMAC 21 transfers the acquired encryption key CRK to the key storage 22 via the data bus BS8, and holds the encryption key CRK in the key storage 22. Next, the secure DMAC 21 transfers the encryption key CRK held in the key storage 22 to each of the secure RAM 19 and the secure ROM 20, and causes the encryption key CRK to be written in the secure RAM 19 and the secure ROM 20. Then, the secure DMAC 21 supplies the encryption key CRK written in the secure RAM 19 to the encryption processing unit 12 via the data bus BS8.

これにより、暗号処理部12は、上記のようにデータバスBS8を介してセキュアDMAC21が取得した暗号鍵CRKを用いて、データバスBS1上の平文データ片を暗号化した暗号化データ片を生成し、これをデータバスBS1に送出する。この際、CPU14は、当該暗号化データ片をデータバスBS1を介してRAM15に供給し、この暗号化データ片をRAM15に書き込ませる。 As a result, the encryption processing unit 12 generates an encrypted data piece in which the plain text data piece on the data bus BS1 is encrypted by using the encryption key CRK acquired by the secure DMAC 21 via the data bus BS8 as described above. , This is sent to the data bus BS1. At this time, the CPU 14 supplies the encrypted data piece to the RAM 15 via the data bus BS1 and causes the RAM 15 to write the encrypted data piece.

よって、上記した一連の処理により、平文データ片を暗号化した暗号化データ片が生成される。 Therefore, by the series of processes described above, an encrypted data piece obtained by encrypting the plaintext data piece is generated.

ところで、マイクロコンピュータ100では、セキュアDMAC21のみならずCPU14でも、上述したような平文データの暗号化、又は暗号化データの復号化の為のデータ転送制御を行うことが可能である。 By the way, in the microcomputer 100, not only the secure DMAC 21 but also the CPU 14 can perform data transfer control for encrypting the plaintext data or decrypting the encrypted data as described above.

例えば、データバスBS1上の平文データ片を暗号化する場合、先ず、CPU14は、暗号鍵を取得する為の暗号鍵読出要求RQ1を、図4の太線矢印に示すようにデータバスBS1を介して暗号鍵生成部13に供給する。暗号鍵読出要求RQ1に応じて、暗号鍵生成部13は、暗号鍵CRKを、図4の太線矢印に示すようにデータバスBS1を介してCPU14に供給する。 For example, when encrypting a plain data piece on the data bus BS1, first, the CPU 14 sends an encryption key read request RQ1 for acquiring an encryption key via the data bus BS1 as shown by a thick line arrow in FIG. It is supplied to the encryption key generation unit 13. In response to the encryption key read request RQ1, the encryption key generation unit 13 supplies the encryption key CRK to the CPU 14 via the data bus BS1 as shown by the thick line arrow in FIG.

CPU14は、取得した暗号鍵CRKをデータバスBS1を介してキーストレージ22に転送し、当該暗号鍵CRKをキーストレージ22に保持させる。次に、CPU14は、キーストレージ22に保持されている暗号鍵CRKをRAM15に転送し、当該暗号鍵CRKをRAM15に書き込ませる。そして、CPU14は、RAM15に書き込まれた暗号鍵CRKを、データバスBS1を介して暗号処理部12に供給する。 The CPU 14 transfers the acquired encryption key CRK to the key storage 22 via the data bus BS1 and holds the encryption key CRK in the key storage 22. Next, the CPU 14 transfers the encryption key CRK held in the key storage 22 to the RAM 15, and causes the RAM 15 to write the encryption key CRK. Then, the CPU 14 supplies the encryption key CRK written in the RAM 15 to the encryption processing unit 12 via the data bus BS1.

これにより、暗号処理部12は、図4に示すようにデータバスBS1を介してCPU14が取得した暗号鍵CRKを用いて、データバスBS1上の平文データ片を暗号化した暗号化データ片を生成し、これをデータバスBS1に送出する。この際、CPU14は、当該暗号化データ片をデータバスBS1を介してRAM15に供給し、この暗号化データ片をRAM15に書き込ませる。 As a result, the encryption processing unit 12 generates an encrypted data piece in which the plaintext data piece on the data bus BS1 is encrypted by using the encryption key CRK acquired by the CPU 14 via the data bus BS1 as shown in FIG. Then, this is sent to the data bus BS1. At this time, the CPU 14 supplies the encrypted data piece to the RAM 15 via the data bus BS1 and causes the RAM 15 to write the encrypted data piece.

このように、マイクロコンピュータ100では、セキュアDMAC21及びCPU14の双方で、データの暗号化又は復号化の為のデータ転送を行うことが可能である。 As described above, in the microcomputer 100, both the secure DMAC 21 and the CPU 14 can perform data transfer for data encryption or decryption.

よって、セキュアDMAC21によって図3に示すような暗号鍵を取得する為のデータ転送が終了した後、当該暗号鍵を用いた暗号処理部12による暗号化処理が終了する前に、CPU14により図4に示すような暗号鍵取得の為のデータ転送が行われる場合がある。 Therefore, after the data transfer for acquiring the encryption key as shown in FIG. 3 is completed by the secure DMAC21 and before the encryption processing by the encryption processing unit 12 using the encryption key is completed, the CPU 14 shows the figure 4 in FIG. Data transfer for acquiring the encryption key as shown may be performed.

以下に、セキュアDMAC21による暗号鍵取得の為のデータ転送(図3)、及びCPU14による暗号鍵取得の為のデータ転送(図4)が連続した場合における暗号鍵生成部13の内部動作を、図5に示すタイムチャートを参照しつつ説明する。 The following shows the internal operation of the encryption key generation unit 13 when the data transfer for acquiring the encryption key by the secure DMAC21 (FIG. 3) and the data transfer for acquiring the encryption key by the CPU 14 (FIG. 4) are continuous. This will be described with reference to the time chart shown in 5.

尚、最初に暗号鍵生成部13の乱数生成部131が、図5に示すように乱数値Q1を示す乱数RNDを生成しているものとする。よって、レジスタ132は、当該乱数RNDを保持しつつ、この乱数RNDによって表される乱数値Q1を有する暗号鍵CRKを出力制御部133に供給する。 First, it is assumed that the random number generation unit 131 of the encryption key generation unit 13 generates a random number RND indicating the random number value Q1 as shown in FIG. Therefore, the register 132 supplies the encryption key CRK having the random number value Q1 represented by the random number RND to the output control unit 133 while holding the random number RND.

先ず、暗号鍵生成部13が、図3に示すようにセキュアDMAC21から送出された暗号鍵読出要求RQ2をデータバスBS8を介して受ける。すると、暗号鍵生成部13の出力制御部133は、図5に示すように、乱数値Q1を有する暗号鍵CRKをデータバスBS8に送出する。これにより、当該暗号鍵CRKが図3に示すようにデータバスBS8を介してセキュアDMAC21に供給される。 First, the encryption key generation unit 13 receives the encryption key read request RQ2 transmitted from the secure DMAC 21 via the data bus BS8 as shown in FIG. Then, as shown in FIG. 5, the output control unit 133 of the encryption key generation unit 13 sends the encryption key CRK having the random number value Q1 to the data bus BS8. As a result, the encryption key CRK is supplied to the secure DMAC 21 via the data bus BS8 as shown in FIG.

更に、出力制御部133は、当該暗号鍵読出要求RQ2に応答し、且つ暗号鍵CRKをデータバスBS8に送出した直後に、図5に示すように論理レベル0から論理レベル1の状態に遷移する2値の乱数変更信号CHを乱数生成部131に供給する。すなわち、出力制御部133は、暗号鍵の変更を促す乱数変更信号CHを乱数生成部131に供給する。 Further, the output control unit 133 responds to the encryption key read request RQ2, and immediately after transmitting the encryption key CRK to the data bus BS8, transitions from the logic level 0 to the logic level 1 state as shown in FIG. A binary random number change signal CH is supplied to the random number generation unit 131. That is, the output control unit 133 supplies the random number change signal CH for prompting the change of the encryption key to the random number generation unit 131.

当該乱数変更信号CHに応答して、乱数生成部131は、図5に示すように、現時点での乱数RNDの乱数値Q1を乱数値Q2に変更する。 In response to the random number change signal CH, the random number generation unit 131 changes the random number value Q1 of the current random number RND to the random number value Q2, as shown in FIG.

これにより、レジスタ132は、保持している内容を乱数値Q2で上書きする。つまり、レジスタ132は、その直前まで保持していた乱数値Q1を削除し、当該乱数値Q1に代えて乱数値Q2を保持する。よって、この際、レジスタ132は、図5に示す乱数値Q2を有する暗号鍵CPKを出力制御部133に供給する。 As a result, the register 132 overwrites the held contents with the random number value Q2. That is, the register 132 deletes the random number value Q1 held until immediately before that, and holds the random number value Q2 in place of the random number value Q1. Therefore, at this time, the register 132 supplies the encryption key CPK having the random number value Q2 shown in FIG. 5 to the output control unit 133.

その後、暗号鍵生成部13が、図4に示すようにCPU14から送出された暗号鍵読出要求RQ1をデータバスBS1を介して受ける。すると、暗号鍵生成部13の出力制御部133は、図5に示すように、乱数値Q2を有する暗号鍵CRKをデータバスBS1に送出する。これにより、当該暗号鍵CRKが図4に示すようにデータバスBS1を介してCPU14に供給される。 After that, the encryption key generation unit 13 receives the encryption key read request RQ1 sent from the CPU 14 via the data bus BS1 as shown in FIG. Then, as shown in FIG. 5, the output control unit 133 of the encryption key generation unit 13 sends the encryption key CRK having the random number value Q2 to the data bus BS1. As a result, the encryption key CRK is supplied to the CPU 14 via the data bus BS1 as shown in FIG.

よって、CPU14からの暗号鍵読出要求RQ1に応じて暗号鍵生成部13が送出した暗号鍵CRKの値(Q2)は、その直前に、セキュアDMAC21からの暗号鍵読出要求RQ2に応じて暗号鍵生成部13が送出した暗号鍵CRKの値(Q1)とは異なる。 Therefore, the value (Q2) of the encryption key CRK sent by the encryption key generation unit 13 in response to the encryption key read request RQ1 from the CPU 14 is immediately before that, the encryption key is generated in response to the encryption key read request RQ2 from the secure DMAC21. It is different from the value (Q1) of the encryption key CRK sent by the unit 13.

従って、図3に示すようなセキュアDMAC21からの暗号鍵読出要求RQ2に続き、図4に示すようなCPU14からの暗号鍵読出要求RQ1が行われても、同一値を有する暗号鍵CRKが2回連続して暗号鍵生成部13から送出されることはない。よって、暗号鍵CRKがマイクロコンピュータ100の外部へ漏洩される可能性が低くなり、平文データの漏洩を防ぐことが可能となる。 Therefore, even if the encryption key read request RQ2 from the secure DMAC21 as shown in FIG. 3 is followed by the encryption key read request RQ1 from the CPU 14 as shown in FIG. 4, the encryption key CRK having the same value is performed twice. It is not continuously transmitted from the encryption key generation unit 13. Therefore, the possibility that the encryption key CRK is leaked to the outside of the microcomputer 100 is reduced, and it is possible to prevent the leakage of plaintext data.

尚、上記した一例では、暗号鍵生成部13は、セキュアDMAC21からの暗号鍵読出要求RQ2に応じて、暗号鍵CRKの値(Q1)を他の値(Q2)に変更している。しかしながら、CPU14からの暗号鍵読出要求RQ1に応じて、暗号鍵CRKの値を他の値に変更しても良い。この際、暗号鍵生成部13としては、以下の動作を行う出力制御部133を採用する。 In the above example, the encryption key generation unit 13 changes the encryption key CRK value (Q1) to another value (Q2) in response to the encryption key read request RQ2 from the secure DMAC21. However, the value of the encryption key CRK may be changed to another value according to the encryption key read request RQ1 from the CPU 14. At this time, as the encryption key generation unit 13, an output control unit 133 that performs the following operations is adopted.

すなわち、出力制御部133は、データバスBS1を介してCPU14からの暗号鍵読出要求RQ1を受けた場合には、レジスタ132から供給された暗号鍵CRKをデータバスBS1に送出し、引き続き、乱数変更信号CHを乱数生成部131に供給する。また、出力制御部133は、データバスBS8を介してセキュアDMAC21からの暗号鍵読出要求RQ2を受けた場合には、レジスタ132から供給された暗号鍵CRKをデータバスBS8に送出する。 That is, when the output control unit 133 receives the encryption key read request RQ1 from the CPU 14 via the data bus BS1, the output control unit 133 sends the encryption key CRK supplied from the register 132 to the data bus BS1 and subsequently changes the random number. The signal CH is supplied to the random number generation unit 131. Further, when the output control unit 133 receives the encryption key read request RQ2 from the secure DMAC 21 via the data bus BS8, the output control unit 133 sends the encryption key CRK supplied from the register 132 to the data bus BS8.

図6は、CPU14による暗号鍵取得の為のデータ転送(図4)の直後に、セキュアDMAC21による暗号鍵取得の為のデータ転送(図3)が連続した場合における暗号鍵生成部13の内部動作を表すタイムチャートである。 FIG. 6 shows the internal operation of the encryption key generation unit 13 when the data transfer for the encryption key acquisition by the secure DMAC 21 (FIG. 3) is continuous immediately after the data transfer for the encryption key acquisition by the CPU 14 (FIG. 4). It is a time chart showing.

先ず、暗号鍵生成部13の出力制御部133は、図4に示すようにCPU14から送出された暗号鍵読出要求RQ1をデータバスBS1を介して受けると、図6に示すように、乱数値Q1を有する暗号鍵CRKをデータバスBS1に送出する。これにより、当該暗号鍵CRKが、図4に示すようにデータバスBS1を介してCPU14に供給される。 First, when the output control unit 133 of the encryption key generation unit 13 receives the encryption key read request RQ1 sent from the CPU 14 via the data bus BS1 as shown in FIG. 4, the random number value Q1 is as shown in FIG. The encryption key CRK having the above is sent to the data bus BS1. As a result, the encryption key CRK is supplied to the CPU 14 via the data bus BS1 as shown in FIG.

更に、出力制御部133は、当該暗号鍵読出要求RQ1に応答し、且つ暗号鍵CRKをデータバスBS1に送出した直後に、図6に示すように、論理レベル0から論理レベル1の状態に遷移する2値の乱数変更信号CHを乱数生成部131に供給する。当該乱数変更信号CHに応答して、乱数生成部131は、図6に示すように、現時点での乱数RNDの乱数値Q1を乱数値Q2に変更する。これにより、レジスタ132は、保持している内容を乱数値Q2で上書きする。つまり、レジスタ132は、その直前まで保持していた乱数値Q1を削除し、当該乱数値Q1に代えて乱数値Q2を保持する。よって、この際、レジスタ132は、図6に示すように乱数値Q2を有する暗号鍵CPKを出力制御部133に供給する。 Further, the output control unit 133 responds to the encryption key read request RQ1 and immediately after sending the encryption key CRK to the data bus BS1, transitions from the logic level 0 to the logic level 1 state as shown in FIG. The binary random number change signal CH is supplied to the random number generation unit 131. In response to the random number change signal CH, the random number generation unit 131 changes the random number value Q1 of the current random number RND to the random number value Q2, as shown in FIG. As a result, the register 132 overwrites the held contents with the random number value Q2. That is, the register 132 deletes the random number value Q1 held until immediately before that, and holds the random number value Q2 in place of the random number value Q1. Therefore, at this time, the register 132 supplies the encryption key CPK having the random number value Q2 to the output control unit 133 as shown in FIG.

その後、暗号鍵生成部13の出力制御部133は、図3に示すようにセキュアDMAC21から送出された暗号鍵読出要求RQ2をデータバスBS8を介して受けると、図6に示すように、乱数値Q2を有する暗号鍵CRKをデータバスBS8に送出する。これにより、当該暗号鍵CRKが、図3に示すようにデータバスBS8を介してセキュアDMAC21に供給される。 After that, when the output control unit 133 of the encryption key generation unit 13 receives the encryption key read request RQ2 sent from the secure DMAC 21 via the data bus BS8 as shown in FIG. 3, a random number value is obtained as shown in FIG. The encryption key CRK having Q2 is sent to the data bus BS8. As a result, the encryption key CRK is supplied to the secure DMAC 21 via the data bus BS8 as shown in FIG.

よって、セキュアDMAC21からの暗号鍵読出要求RQ2に応じて暗号鍵生成部13が送出した暗号鍵CRKの値(Q2)は、その直前に、CPU14からの暗号鍵読出要求RQ1に応じて暗号鍵生成部13が送出した暗号鍵CRKの値(Q1)とは異なる。 Therefore, the value (Q2) of the encryption key CRK sent by the encryption key generation unit 13 in response to the encryption key read request RQ2 from the secure DMAC 21 is immediately before that, the encryption key is generated in response to the encryption key read request RQ1 from the CPU 14. It is different from the value (Q1) of the encryption key CRK sent by the unit 13.

従って、図4に示すようなCPU14からの暗号鍵読出要求RQ1に続き、図3に示すようなセキュアDMAC21からの暗号鍵読出要求RQ2が行われても、同一値を有する暗号鍵CRKが2回連続して暗号鍵生成部13から送出されることはない。よって、暗号鍵CRKがマイクロコンピュータ100の外部へ漏洩される可能性が低くなり、平文データの漏洩を防ぐことが可能となる。 Therefore, even if the encryption key read request RQ1 from the CPU 14 as shown in FIG. 4 is followed by the encryption key read request RQ2 from the secure DMAC21 as shown in FIG. 3, the encryption key CRK having the same value is performed twice. It is not continuously transmitted from the encryption key generation unit 13. Therefore, the possibility that the encryption key CRK is leaked to the outside of the microcomputer 100 is reduced, and it is possible to prevent the leakage of plaintext data.

尚、上記した実施例では、暗号鍵生成部13で生成された暗号鍵CRKを読み出し、これをデータバス(BS1、BS8)を介して暗号処理部12に転送する転送制御部として、CPU14及びDMAC21を用いている。しかしながら、上記したような暗号鍵取得の為のデータ転送を行うことができるものであれば、転送制御部としてはCPUや、DMAC等に限定されない。 In the above embodiment, the CPU 14 and the DMAC 21 are transfer control units that read the encryption key CRK generated by the encryption key generation unit 13 and transfer it to the encryption processing unit 12 via the data bus (BS1, BS8). Is used. However, the transfer control unit is not limited to the CPU, DMAC, or the like as long as it can transfer data for acquiring the encryption key as described above.

また、図1及び図2に示す実施例では、暗号鍵取得の為のデータ転送を2つのデータバスBS1及びBS8を用いて行っているが、単一のデータバスによっても同様に実施することが可能である。 Further, in the embodiment shown in FIGS. 1 and 2, the data transfer for acquiring the encryption key is performed using the two data buses BS1 and BS8, but the same can be performed by a single data bus. It is possible.

要するに、図1に示すマイクロコンピュータ100としては、以下の暗号処理部、暗号鍵生成部、第1及び第2の転送制御部を含むものであれば良い。 In short, the microcomputer 100 shown in FIG. 1 may include the following encryption processing unit, encryption key generation unit, and first and second transfer control units.

つまり、暗号処理部(12)は、データバス(BS1、BS8)を介して受けた暗号鍵(CRK)を用いて平文データを暗号化する。暗号鍵生成部(13)は、暗号鍵(CRK)を生成し、生成した暗号鍵を第1の読出要求(RQ1又はRQ2)又は第2の読出要求(RQ2又はRQ1)に応じてデータバスに送出する。第1の転送制御部(14又は21)は、第1の読出要求を暗号鍵生成部に供給し、暗号鍵生成部から送出された暗号鍵をデータバスを介して暗号処理部に転送する。第2の転送制御部(21又は14)は、第2の読出要求を暗号鍵生成部に供給し、暗号鍵生成部から送出された暗号鍵をデータバスを介して暗号処理部に転送する。ここで、暗号鍵生成部は、第1の読出要求及び第2の読出要求のうちの一方の読出要求を受けた場合に、暗号鍵の値を他の値に変更する。 That is, the encryption processing unit (12) encrypts the plaintext data using the encryption key (CRK) received via the data bus (BS1, BS8). The encryption key generation unit (13) generates an encryption key (CRK), and the generated encryption key is sent to the data bus in response to a first read request (RQ1 or RQ2) or a second read request (RQ2 or RQ1). Send. The first transfer control unit (14 or 21) supplies the first read request to the encryption key generation unit, and transfers the encryption key sent from the encryption key generation unit to the encryption processing unit via the data bus. The second transfer control unit (21 or 14) supplies the second read request to the encryption key generation unit, and transfers the encryption key sent from the encryption key generation unit to the encryption processing unit via the data bus. Here, the encryption key generation unit changes the value of the encryption key to another value when one of the first read request and the second read request is received.

更に、図2に示す暗号鍵生成部13としては、以下の乱数生成部、レジスタ、及び出力制御部を含むものであれば良い。 Further, the encryption key generation unit 13 shown in FIG. 2 may include the following random number generation unit, register, and output control unit.

つまり、乱数生成部(131)は、所定期間毎に乱数値が変化する乱数(RND)を生成し、乱数変更信号(CH)を受けた場合に乱数値を他の乱数値に変更する。レジスタ(132)は、この乱数を保持し、保持した乱数を暗号鍵(CRK)として出力する。出力制御部(133)は、第1又は第2の読出要求を受けた場合にレジスタ(132)から出力された暗号鍵をデータバスに送出する。更に、出力制御部は、第1及び第2の読出要求のうちの一方の読出要求を受けた場合に乱数変更信号(CH)を乱数生成部に供給する。 That is, the random number generation unit (131) generates a random number (RND) whose random number value changes every predetermined period, and changes the random number value to another random number value when the random number change signal (CH) is received. The register (132) holds this random number and outputs the held random number as an encryption key (CRK). The output control unit (133) sends the encryption key output from the register (132) to the data bus when the first or second read request is received. Further, the output control unit supplies a random number change signal (CH) to the random number generation unit when one of the first and second read requests is received.

図7は、マイクロコンピュータ100の他の構成を示すブロック図である。尚、図7に示される構成では、暗号鍵生成部13に代えて暗号鍵生成部13Aを採用した点を除く他の構成は図1に示されるものと同一である。よって、以下に暗号鍵生成部13Aの構成を中心に、図7に示す構成におけるマイクロコンピュータ100の内部動作を説明する。 FIG. 7 is a block diagram showing another configuration of the microcomputer 100. The configuration shown in FIG. 7 is the same as that shown in FIG. 1 except that the encryption key generation unit 13A is used instead of the encryption key generation unit 13. Therefore, the internal operation of the microcomputer 100 in the configuration shown in FIG. 7 will be described below, focusing on the configuration of the encryption key generation unit 13A.

図8は、暗号鍵生成部13Aの内部構成を示すブロック図である。 FIG. 8 is a block diagram showing an internal configuration of the encryption key generation unit 13A.

図8に示すように、暗号鍵生成部13Aは、乱数生成部131A、レジスタ132、出力制御部133A、及びフラグレジスタ134を含む。 As shown in FIG. 8, the encryption key generation unit 13A includes a random number generation unit 131A, a register 132, an output control unit 133A, and a flag register 134.

乱数生成部131Aは、所定期間毎に乱数値が変化する乱数RNDを生成し、これをレジスタ132に供給する。尚、乱数生成部131Aは、乱数RNDの乱数値が変化するタイミングで、この乱数値が変化したことを表す乱数変化信号VAを出力制御部133Aに供給する。 The random number generation unit 131A generates a random number RND whose random number value changes every predetermined period, and supplies this to the register 132. The random number generation unit 131A supplies a random number change signal VA indicating that the random number value has changed to the output control unit 133A at the timing when the random number value of the random number RND changes.

レジスタ132は、乱数RNDを保持しつつ、当該乱数RNDにて表される乱数値を有する暗号鍵CRKを出力制御部133Aに供給する。 The register 132 supplies the encryption key CRK having the random number value represented by the random number RND to the output control unit 133A while holding the random number RND.

フラグレジスタ134には、上記した所定期間毎に、その所定期間内で暗号鍵読出要求を受けたか否かを表すフラグFGが保持されている。例えば、暗号鍵読出要求を受けた場合には論理レベル1、暗号鍵読出要求を受けていない場合には論理レベル0を有する2値のフラグFGがフラグレジスタ134に保持される。尚、電源投入時には、論理レベル0を有するフラグFGがフラグレジスタ134に保持される。 The flag register 134 holds a flag FG indicating whether or not an encryption key read request has been received within the predetermined period for each of the predetermined periods described above. For example, a binary flag FG having a logic level 1 when the encryption key read request is received and a logic level 0 when the encryption key read request is not received is held in the flag register 134. When the power is turned on, the flag FG having the logic level 0 is held in the flag register 134.

出力制御部133Aは、セキュアDMAC21からの暗号鍵読出要求RQ2をデータバスBS8を介して受けた場合には、レジスタ132から供給された暗号鍵CRKをデータバスBS8に送出する。更に、出力制御部133Aは、この暗号鍵読出要求RQ2に応じて、フラグレジスタ134に保持されているフラグFGを、暗号鍵読出要求を受けたことを表す論理レベル1に書き換える。 When the output control unit 133A receives the encryption key read request RQ2 from the secure DMAC 21 via the data bus BS8, the output control unit 133A sends the encryption key CRK supplied from the register 132 to the data bus BS8. Further, the output control unit 133A rewrites the flag FG held in the flag register 134 to the logic level 1 indicating that the encryption key read request has been received, in response to the encryption key read request RQ2.

また、出力制御部133Aは、CPU14からの暗号鍵読出要求RQ1をデータバスBS1を介して受けた場合には、先ず、フラグレジスタ134に保持されているフラグFGが論理レベル0であるか、或いは論理レベル1であるのかを判定する。 Further, when the output control unit 133A receives the encryption key read request RQ1 from the CPU 14 via the data bus BS1, first, the flag FG held in the flag register 134 is set to the logic level 0, or the flag FG is set to the logic level 0. It is determined whether the logic level is 1.

ここで、フラグFGが論理レベル0であると判定した場合、つまり暗号鍵読出要求を受けていないと判定した場合には、出力制御部133Aは、レジスタ132から供給された暗号鍵CRKをデータバスBS1に送出する。 Here, when it is determined that the flag FG is the logic level 0, that is, when it is determined that the encryption key read request has not been received, the output control unit 133A uses the encryption key CRK supplied from the register 132 as the data bus. Send to BS1.

一方、フラグFGが論理レベル1であると判定した場合、つまり暗号鍵読出要求を既に受けていると判定したら、出力制御部133Aは、暗号鍵CRKに代えて、暗号鍵の読出エラーを表すエラー応答ERRを、データバスBS1に送出する。この際、データバスBS1を介してエラー応答ERRがCPU14に供給される。 On the other hand, if it is determined that the flag FG is the logical level 1, that is, if it is determined that the encryption key read request has already been received, the output control unit 133A replaces the encryption key CRK with an error indicating an encryption key read error. The response ERR is sent to the data bus BS1. At this time, the error response ERR is supplied to the CPU 14 via the data bus BS1.

更に、出力制御部133Aは、乱数RNDの乱数値が変化したことを表す乱数変化信号VAを受けた場合には、フラグレジスタ134に保持されているフラグFGを論理レベル0の状態に初期化する。 Further, when the output control unit 133A receives the random number change signal VA indicating that the random number value of the random number RND has changed, the output control unit 133A initializes the flag FG held in the flag register 134 to the state of logic level 0. ..

以下に、図7及び図8に示される構成において、セキュアDMAC21による暗号鍵取得の為のデータ転送に引き続き、CPU14による暗号鍵取得の為のデータ転送が実施された場合での動作について、図9~図11を参照しつつ説明する。 Below, in the configuration shown in FIGS. 7 and 8, the operation when the data transfer for the encryption key acquisition by the CPU 14 is performed following the data transfer for the encryption key acquisition by the secure DMAC21 will be described in FIG. This description will be given with reference to FIG.

尚、図9は、セキュアDMAC21による暗号鍵取得の為のデータ転送動作を表し、図10は、図9に示すデータ転送の直後に行われる、CPU14による暗号鍵取得の為のデータ転送動作を表す図である。 Note that FIG. 9 shows a data transfer operation for acquiring the encryption key by the secure DMAC21, and FIG. 10 shows a data transfer operation for acquiring the encryption key by the CPU 14 performed immediately after the data transfer shown in FIG. It is a figure.

また、図11は、図9に示すデータ転送の直後に図10に示すデータ転送が行われた場合における、暗号鍵生成部13Aの内部動作を表すタイムチャートである。 Further, FIG. 11 is a time chart showing the internal operation of the encryption key generation unit 13A when the data transfer shown in FIG. 10 is performed immediately after the data transfer shown in FIG. 9.

尚、図11に示す一例では、暗号鍵生成部13Aの乱数生成部131Aが、先ず、乱数値Q1を示す乱数RNDを所定期間TUに亘りレジスタ132に供給し、当該所定期間TUの経過後に乱数値Q2を示す乱数RNDをレジスタ132に供給するものとする。よって、レジスタ132は、所定期間TUに亘り乱数値Q1を有する暗号鍵CRKを出力制御部133Aに供給し、所定期間TUの経過後に乱数値Q2を有する暗号鍵CRKを出力制御部133Aに供給する。更に、暗号鍵生成部131Aは、乱数RNDにて示される乱数値が変化する時点で、図11に示すように、論理レベル0の状態から論理レベル1の状態に遷移し、論理レベル0の状態に戻る2値の乱数変化信号VAを出力制御部133Aに供給する。 In the example shown in FIG. 11, the random number generation unit 131A of the encryption key generation unit 13A first supplies the random number RND indicating the random number value Q1 to the register 132 over a predetermined period TU, and is disturbed after the lapse of the predetermined period TU. It is assumed that a random number RND indicating the numerical value Q2 is supplied to the register 132. Therefore, the register 132 supplies the encryption key CRK having the random number value Q1 over the predetermined period TU to the output control unit 133A, and supplies the encryption key CRK having the random number value Q2 to the output control unit 133A after the elapse of the predetermined period TU. .. Further, the encryption key generation unit 131A transitions from the state of logic level 0 to the state of logic level 1 at the time when the random number value indicated by the random number RND changes, and is in the state of logic level 0, as shown in FIG. A binary random number change signal VA is supplied to the output control unit 133A.

先ず、暗号鍵生成部13Aが、図9の太線矢印に示すようにセキュアDMAC21から送出された暗号鍵読出要求RQ2をデータバスBS8を介して受ける。すると、暗号鍵生成部13Aの出力制御部133Aは、図11に示すように、乱数値Q1を有する暗号鍵CRKをデータバスBS8に送出する。これにより、当該暗号鍵CRKが図9の太線矢印に示すようにデータバスBS8を介してセキュアDMAC21に供給される。更に、出力制御部133Aは、暗号鍵読出要求RQ2に応じて、フラグレジスタ134に保持されているフラグFGを図11に示すように、暗号鍵読出要求を受けたことを表す論理レベル1に書き換える。 First, the encryption key generation unit 13A receives the encryption key read request RQ2 transmitted from the secure DMAC 21 via the data bus BS8 as shown by the thick line arrow in FIG. Then, as shown in FIG. 11, the output control unit 133A of the encryption key generation unit 13A sends the encryption key CRK having the random number value Q1 to the data bus BS8. As a result, the encryption key CRK is supplied to the secure DMAC 21 via the data bus BS8 as shown by the thick arrow in FIG. Further, the output control unit 133A rewrites the flag FG held in the flag register 134 to the logic level 1 indicating that the encryption key read request has been received, as shown in FIG. 11, in response to the encryption key read request RQ2. ..

その後、暗号鍵生成部13Aが、図10の太線矢印に示すようにCPU14から送出された暗号鍵読出要求RQ1をデータバスBS1を介して受ける。すると、暗号鍵生成部13Aの出力制御部133Aは、図11に示すように、暗号鍵読出要求RQ1を受けた時点でフラグFGが論理レベル1であることから、エラー応答ERRをデータバスBS1に送出する。この際、暗号鍵生成部13Aから送出されたエラー応答ERRは、図10の太線矢印に示すようにデータバスBS1を介してCPU14に供給される。エラー応答ERRを受けたCPU14は、暗号鍵生成部13Aからの暗号鍵の読出に失敗したと判断する。尚、上記したように暗号鍵読出要求RQ1を受けた時点でフラグFGが論理レベル1である場合には、出力制御部133Aは、その時点で暗号鍵の送出は行わない。 After that, the encryption key generation unit 13A receives the encryption key read request RQ1 sent from the CPU 14 via the data bus BS1 as shown by the thick line arrow in FIG. Then, as shown in FIG. 11, the output control unit 133A of the encryption key generation unit 13A sets the error response ERR to the data bus BS1 because the flag FG is at the logic level 1 when the encryption key read request RQ1 is received. Send out. At this time, the error response ERR sent from the encryption key generation unit 13A is supplied to the CPU 14 via the data bus BS1 as shown by the thick line arrow in FIG. Upon receiving the error response ERR, the CPU 14 determines that the reading of the encryption key from the encryption key generation unit 13A has failed. If the flag FG is at the logic level 1 when the encryption key read request RQ1 is received as described above, the output control unit 133A does not send the encryption key at that time.

このように、暗号鍵生成部13Aは、セキュアDMAC21からの暗号鍵読出要求RQ2に応じて暗号鍵CRKをデータバスBS8に送出する。この際、引き続きCPU14からの暗号鍵読出要求RQ1を受けた場合には、暗号鍵生成部13Aは、この暗号鍵読出要求RQ1に応じて、暗号鍵CRKに代えてエラー応答ERRをデータバスBS1に送出する。 In this way, the encryption key generation unit 13A sends the encryption key CRK to the data bus BS8 in response to the encryption key read request RQ2 from the secure DMAC21. At this time, if the encryption key read request RQ1 is continuously received from the CPU 14, the encryption key generation unit 13A sends an error response ERR to the data bus BS1 in place of the encryption key CRK in response to the encryption key read request RQ1. Send.

これにより、図9に示すようなセキュアDMAC21からの暗号鍵読出要求RQ2に続き、図10に示すようなCPU14からの暗号鍵読出要求RQ1が行われても、同一値を有する暗号鍵CRKが2回連続して暗号鍵生成部13Aから送出されることはない。よって、暗号鍵CRKがマイクロコンピュータ100の外部へ漏洩される可能性が低くなり、平文データの漏洩を防ぐことが可能となる。 As a result, even if the encryption key read request RQ2 from the secure DMAC 21 as shown in FIG. 9 is followed by the encryption key read request RQ1 from the CPU 14 as shown in FIG. 10, the encryption key CRK having the same value is 2. It is not continuously transmitted from the encryption key generation unit 13A. Therefore, the possibility that the encryption key CRK is leaked to the outside of the microcomputer 100 is reduced, and it is possible to prevent the leakage of plaintext data.

その後、乱数生成部131Aが乱数RNDにて示される乱数値を、図11に示すようにQ1からQ2に変更すると、出力制御部133Aは、フラグレジスタ134に保持されているフラグFGの内容を論理レベル1から論理レベル0に書き換える。 After that, when the random number generation unit 131A changes the random number value indicated by the random number RND from Q1 to Q2 as shown in FIG. 11, the output control unit 133A logics the contents of the flag FG held in the flag register 134. Rewrite from level 1 to logical level 0.

よって、その後、暗号鍵生成部13Aは、CPU14からの暗号鍵読出要求RQ1をデータバスBS1を介して受けると、図11に示すように暗号鍵読出要求RQ1を受けた時点でフラグFGが論理レベル0であることから、乱数値Q2を有する暗号鍵CRKをデータバスBS1に送出する。 Therefore, after that, when the encryption key generation unit 13A receives the encryption key read request RQ1 from the CPU 14 via the data bus BS1, the flag FG is set to the logical level when the encryption key read request RQ1 is received as shown in FIG. Since it is 0, the encryption key CRK having the random number value Q2 is sent to the data bus BS1.

この際、CPU14からの暗号鍵読出要求RQ1に応じて暗号鍵生成部13Aが送出した暗号鍵CRKの値(Q2)は、その直前に、セキュアDMAC21からの暗号鍵読出要求RQ2に応じて暗号鍵生成部13Aが送出した暗号鍵CRKの値(Q1)とは異なる。 At this time, the value (Q2) of the encryption key CRK sent by the encryption key generation unit 13A in response to the encryption key read request RQ1 from the CPU 14 is the encryption key in response to the encryption key read request RQ2 from the secure DMAC 21 immediately before that. It is different from the value (Q1) of the encryption key CRK sent by the generation unit 13A.

よって、同一の値を有する暗号鍵CRKが2回連続して暗号鍵生成部13Aから送出されることはないので、暗号鍵CRKがマイクロコンピュータ100の外部へ漏洩される可能性が低くなり、平文データの漏洩を防ぐことが可能となる。 Therefore, since the encryption key CRK having the same value is not transmitted from the encryption key generation unit 13A twice in a row, the possibility that the encryption key CRK is leaked to the outside of the microcomputer 100 is reduced, and the plaintext is written. It is possible to prevent data leakage.

ところで、図9及び図10に示す一例では、暗号鍵生成部13Aは、セキュアDMAC21からの暗号鍵読出要求を受けた直後に、CPU14からの暗号鍵読出要求を受けた場合にエラー応答ERRを行うようにしている。しかしながら、暗号鍵生成部13Aとしては、CPU14から暗号鍵読出要求を受けた直後に、セキュアDMAC21から暗号鍵読出要求を受けた場合にエラー応答ERRを行うようにしても良い。 By the way, in the example shown in FIGS. 9 and 10, the encryption key generation unit 13A performs an error response ERR when the encryption key read request from the CPU 14 is received immediately after receiving the encryption key read request from the secure DMAC21. I am doing it. However, the encryption key generation unit 13A may perform an error response ERR when an encryption key read request is received from the secure DMAC 21 immediately after receiving the encryption key read request from the CPU 14.

この際、暗号鍵生成部13Aとしては、以下のような出力制御部133Aを採用する。 At this time, as the encryption key generation unit 13A, the following output control unit 133A is adopted.

すなわち、出力制御部133Aは、CPU14からの暗号鍵読出要求RQ1を受けた場合には、暗号鍵CRKをデータバスBS1に送出する。更に、暗号鍵読出要求RQ1に応じて、出力制御部133Aは、フラグレジスタ134に保持されているフラグFGを、暗号鍵読出要求を受けたことを表す論理レベル1に書き換える。 That is, when the output control unit 133A receives the encryption key read request RQ1 from the CPU 14, the output control unit 133A sends the encryption key CRK to the data bus BS1. Further, in response to the encryption key read request RQ1, the output control unit 133A rewrites the flag FG held in the flag register 134 to the logic level 1 indicating that the encryption key read request has been received.

また、出力制御部133Aは、セキュアDMAC21からの暗号鍵読出要求RQ2を受けた場合には、先ず、フラグレジスタ134に保持されているフラグFGが論理レベル1であるか、或いは論理レベル0であるかを判定する。ここで、フラグFGが論理レベル0であると判定した場合、つまり、暗号鍵読出要求を受けていないと判定した場合、出力制御部133Aは、暗号鍵CRKをデータバスBS8に送出する。 Further, when the output control unit 133A receives the encryption key read request RQ2 from the secure DMAC21, first, the flag FG held in the flag register 134 is the logic level 1 or the logic level 0. Is determined. Here, when it is determined that the flag FG is the logic level 0, that is, when it is determined that the encryption key read request has not been received, the output control unit 133A sends the encryption key CRK to the data bus BS8.

一方、フラグFGが論理レベル1であると判定した場合、つまり暗号鍵読出要求を既に受けていると判定したら、出力制御部133Aは、暗号鍵の読出エラーを表すエラー応答ERRを、データバスBS8に送出する。この際、データバスBS8を介してエラー応答ERRがセキュアDMAC21に供給される。 On the other hand, if it is determined that the flag FG is at the logic level 1, that is, if it is determined that the encryption key read request has already been received, the output control unit 133A sets an error response ERR indicating an encryption key read error to the data bus BS8. Send to. At this time, the error response ERR is supplied to the secure DMAC 21 via the data bus BS8.

更に、出力制御部133Aは、乱数生成部131Aから、乱数RNDの乱数値が変化したことを表す乱数変化信号VAが供給された場合には、フラグレジスタ134に保持されているフラグFGを論理レベル0の状態に初期化する。 Further, when the random number change signal VA indicating that the random number value of the random number RND has changed is supplied from the random number generation unit 131A, the output control unit 133A sets the flag FG held in the flag register 134 to the logic level. Initialize to the state of 0.

以下に、CPU14による暗号鍵取得の為のデータ転送の直後に、セキュアDMAC21による暗号鍵取得の為のデータ転送が連続した場合での動作について、図12~図14を参照しつつ説明する。 Hereinafter, the operation in the case where the data transfer for the encryption key acquisition by the secure DMAC 21 is continuous immediately after the data transfer for the encryption key acquisition by the CPU 14 will be described with reference to FIGS. 12 to 14.

尚、図12は、CPU14による暗号鍵取得の為のデータ転送動作を表し、図13は、図12に示すデータ転送の直後に行われるセキュアDMAC21による暗号鍵取得の為のデータ転送動作を表す図である。 Note that FIG. 12 is a diagram showing a data transfer operation for acquiring an encryption key by the CPU 14, and FIG. 13 is a diagram showing a data transfer operation for acquiring an encryption key by the secure DMAC 21 performed immediately after the data transfer shown in FIG. Is.

また、図14は、図12に示すデータ転送の直後に図13に示すデータ転送が行われた場合における、暗号鍵生成部13Aの内部動作を表すタイムチャートである。 Further, FIG. 14 is a time chart showing the internal operation of the encryption key generation unit 13A when the data transfer shown in FIG. 13 is performed immediately after the data transfer shown in FIG. 12.

先ず、暗号鍵生成部13Aが、図12の太線矢印に示すようにCPU14から送出された暗号鍵読出要求RQ1をデータバスBS1を介して受ける。すると、暗号鍵生成部13Aの出力制御部133Aは、図14に示すように、乱数値Q1を有する暗号鍵CRKをデータバスBS1に送出する。これにより、当該暗号鍵CRKが図12の太線矢印に示すようにデータバスBS1を介してCPU14に供給される。更に、出力制御部133Aは、暗号鍵読出要求RQ1に応じて、フラグレジスタ134に保持されているフラグFGを図14に示すように、暗号鍵読出要求を受けたことを表す論理レベル1に書き換える。 First, the encryption key generation unit 13A receives the encryption key read request RQ1 sent from the CPU 14 via the data bus BS1 as shown by the thick line arrow in FIG. Then, as shown in FIG. 14, the output control unit 133A of the encryption key generation unit 13A sends the encryption key CRK having the random number value Q1 to the data bus BS1. As a result, the encryption key CRK is supplied to the CPU 14 via the data bus BS1 as shown by the thick arrow in FIG. Further, the output control unit 133A rewrites the flag FG held in the flag register 134 to the logic level 1 indicating that the encryption key read request has been received, as shown in FIG. 14, in response to the encryption key read request RQ1. ..

その後、暗号鍵生成部13Aが、図13の太線矢印に示すようにセキュアDMAC21から送出された暗号鍵読出要求RQ2をデータバスBS8を介して受ける。すると、暗号鍵生成部13Aの出力制御部133Aは、図14に示すように、暗号鍵読出要求RQ2を受けた時点でフラグFGが論理レベル1であることから、暗号鍵CRKに代えてエラー応答ERRをデータバスBS8に送出する。この際、暗号鍵生成部13Aから送出されたエラー応答ERRは、図13の太線矢印に示すようにデータバスBS8を介してセキュアDMAC21に供給される。このエラー応答ERRを受けたセキュアDMAC21は、暗号鍵生成部13Aからの暗号鍵の読出に失敗したと判断する。尚、上記したように暗号鍵読出要求RQ2を受けた時点でフラグFGが論理レベル1である場合には、出力制御部133Aは、その時点で暗号鍵の送出は行わない。 After that, the encryption key generation unit 13A receives the encryption key read request RQ2 transmitted from the secure DMAC 21 via the data bus BS8 as shown by the thick line arrow in FIG. Then, as shown in FIG. 14, the output control unit 133A of the encryption key generation unit 13A responds with an error instead of the encryption key CRK because the flag FG is at the logic level 1 when the encryption key read request RQ2 is received. ERR is sent to the data bus BS8. At this time, the error response ERR sent from the encryption key generation unit 13A is supplied to the secure DMAC 21 via the data bus BS8 as shown by the thick line arrow in FIG. Upon receiving this error response ERR, the secure DMAC 21 determines that the reading of the encryption key from the encryption key generation unit 13A has failed. If the flag FG is at the logic level 1 when the encryption key read request RQ2 is received as described above, the output control unit 133A does not send the encryption key at that time.

このように、暗号鍵生成部13Aは、CPU14からの暗号鍵読出要求に応じて暗号鍵CRKを送出した直後に、セキュアDMAC21からの暗号鍵読出要求を受けた場合には、暗号鍵CRKの送出は行わず、エラー応答ERRを送出する。 As described above, when the encryption key generation unit 13A receives the encryption key read request from the secure DMAC 21 immediately after transmitting the encryption key CRK in response to the encryption key read request from the CPU 14, the encryption key CRK is transmitted. Is not performed, and an error response ERR is sent.

これにより、図12に示すようなCPU14からの暗号鍵読出要求RQ1に続き、図13に示すようなセキュアDMAC21からの暗号鍵読出要求RQ2が行われても、同一値を有する暗号鍵CRKが2回連続して暗号鍵生成部13Aから送出されることはない。よって、暗号鍵CRKがマイクロコンピュータ100の外部へ漏洩される可能性が低くなり、平文データの漏洩を防ぐことが可能となる。 As a result, even if the encryption key read request RQ1 from the CPU 14 as shown in FIG. 12 is followed by the encryption key read request RQ2 from the secure DMAC21 as shown in FIG. 13, the encryption key CRK having the same value is 2. It is not continuously transmitted from the encryption key generation unit 13A. Therefore, the possibility that the encryption key CRK is leaked to the outside of the microcomputer 100 is reduced, and it is possible to prevent the leakage of plaintext data.

その後、乱数生成部131Aが乱数RNDにて示される乱数値を、図14に示すようにQ1からQ2に変更すると、出力制御部133Aは、フラグレジスタ134に保持されているフラグFGの内容を論理レベル1から論理レベル0に書き換える。 After that, when the random number generation unit 131A changes the random number value indicated by the random number RND from Q1 to Q2 as shown in FIG. 14, the output control unit 133A logics the contents of the flag FG held in the flag register 134. Rewrite from level 1 to logical level 0.

よって、引き続き、暗号鍵生成部13Aは、セキュアDMAC21からの暗号鍵読出要求RQ2をデータバスBS8を介して受けると、図14に示すように暗号鍵読出要求RQ2を受けた時点でフラグFGが論理レベル0であることから、乱数値Q2を有する暗号鍵CRKをデータバスBS8に送出する。 Therefore, when the encryption key generation unit 13A subsequently receives the encryption key read request RQ2 from the secure DMAC21 via the data bus BS8, the flag FG is logical when the encryption key read request RQ2 is received as shown in FIG. Since the level is 0, the encryption key CRK having the random number value Q2 is sent to the data bus BS8.

この際、セキュアDMAC21からの暗号鍵読出要求RQ2に応じて暗号鍵生成部13Aが送出した暗号鍵CRKの値(Q2)は、その直前に、CPU14からの暗号鍵読出要求RQ1に応じて暗号鍵生成部13Aが送出した暗号鍵CRKの値(Q1)とは異なる。 At this time, the value (Q2) of the encryption key CRK sent by the encryption key generation unit 13A in response to the encryption key read request RQ2 from the secure DMAC 21 is the encryption key in response to the encryption key read request RQ1 from the CPU 14 immediately before that. It is different from the value (Q1) of the encryption key CRK sent by the generation unit 13A.

よって、同一の値を有する暗号鍵CRKが2回連続して暗号鍵生成部13Aから送出されることはないので、暗号鍵CRKがマイクロコンピュータ100の外部へ漏洩される可能性が低くなり、平文データの漏洩を防ぐことが可能となる。 Therefore, since the encryption key CRK having the same value is not transmitted from the encryption key generation unit 13A twice in succession, the possibility that the encryption key CRK is leaked to the outside of the microcomputer 100 is reduced, and the plaintext is written. It is possible to prevent data leakage.

以上のように、図7に示すマイクロコンピュータ100では、図2に示される暗号鍵生成部13に代えて、図8に示される暗号鍵生成部13Aを採用している。当該暗号鍵生成部(13A)では、所定期間(TU)毎に、この所定期間内において第1の読出要求(RQ1又はRQ2)を受けた後に第2の読出要求(RQ2又はRQ1)を受けた場合には、この第2の読出要求に応じて暗号鍵(CRK)に代えてエラー応答(ERR)をデータバス(BS1、BS8)に送出する。 As described above, in the microcomputer 100 shown in FIG. 7, the encryption key generation unit 13A shown in FIG. 8 is adopted instead of the encryption key generation unit 13 shown in FIG. The encryption key generation unit (13A) receives a first read request (RQ1 or RQ2) and then a second read request (RQ2 or RQ1) for each predetermined period (TU). In this case, in response to this second read request, an error response (ERR) is sent to the data bus (BS1, BS8) instead of the encryption key (CRK).

更に、マイクロコンピュータ100では、図8に示す暗号鍵生成部13Aとして、以下の乱数生成部と、第1及び第2のレジスタと、出力制御部とを含むものを採用している。 Further, in the microcomputer 100, as the encryption key generation unit 13A shown in FIG. 8, a unit including the following random number generation unit, first and second registers, and an output control unit is adopted.

つまり、乱数生成部(131A)は、所定期間(TU)毎に乱数値が変化する乱数(RND)を生成する。第1のレジスタ(132)は、この乱数を保持し、保持した乱数を暗号鍵(CRK)として出力する。第2のレジスタ(134)は、読出要求(RQ1又はRQ2)を受けたか否かを表すフラグ(FG)が保持される。 That is, the random number generation unit (131A) generates a random number (RND) whose random number value changes every predetermined period (TU). The first register (132) holds this random number and outputs the held random number as an encryption key (CRK). The second register (134) holds a flag (FG) indicating whether or not a read request (RQ1 or RQ2) has been received.

出力制御部(133A)は、第1の読出要求又は前記第2の読出要求を受けた場合に第1のレジスタから出力された暗号鍵をデータバス(BS1、BS8)に送出すると共に、所定期間(TU)毎に第2のレジスタに保持されているフラグを読出要求を受けていないことを表す状態(例えば論理レベル0)に初期化する。ここで、出力制御部は、第1の読出要求を受けた場合には、第2のレジスタに保持されているフラグを読出要求を受けたことを表す状態(例えば論理レベル1)に書き換える。また、出力制御部は、第2の読出要求を受けた場合には、第2のレジスタに保持されているフラグが読出要求を受けたことを表す場合に、暗号鍵に代えてエラー応答(ERR)をデータバスに送出する。 The output control unit (133A) sends the encryption key output from the first register when the first read request or the second read request is received to the data bus (BS1, BS8), and at the same time, for a predetermined period. For each (TU), the flag held in the second register is initialized to a state (for example, logic level 0) indicating that a read request has not been received. Here, when the output control unit receives the first read request, the output control unit rewrites the flag held in the second register to a state (for example, logic level 1) indicating that the read request has been received. Further, when the output control unit receives the second read request, the output control unit responds with an error (ERR instead of the encryption key) when the flag held in the second register indicates that the read request has been received. ) Is sent to the data bus.

図15は、図7に示すマイクロコンピュータ100の変形例を示すブロック図である。尚、図15に示される構成では、リセット制御部23を追加した点を除く他の構成は図7に示すものと同一である。 FIG. 15 is a block diagram showing a modification of the microcomputer 100 shown in FIG. 7. In the configuration shown in FIG. 15, the configurations other than the addition of the reset control unit 23 are the same as those shown in FIG. 7.

図15において、リセット制御部23は、データバスBS1又はBS8を介して上記したエラー応答ERRを受けた場合に、リセット信号RSを暗号鍵生成部13A、CPU14、及びキーストレージ22に供給する。暗号鍵生成部13A、CPU14、及びキーストレージ22は、リセット信号RSに応じて自身の状態をリセットする。 In FIG. 15, when the reset control unit 23 receives the above-mentioned error response ERR via the data bus BS1 or BS8, the reset control unit 23 supplies the reset signal RS to the encryption key generation unit 13A, the CPU 14, and the key storage 22. The encryption key generation unit 13A, the CPU 14, and the key storage 22 reset their own states in response to the reset signal RS.

以下に、図15に示す構成において、セキュアDMAC21による暗号鍵取得の為のデータ転送に引き続き、CPU14による暗号鍵取得の為のデータ転送が実施された場合での動作について、図16、図17、並びに上記した図11を参照しつつ説明する。 Below, in the configuration shown in FIG. 15, the operation when the data transfer for the encryption key acquisition by the CPU 14 is performed following the data transfer for the encryption key acquisition by the secure DMAC21 will be described in FIGS. 16 and 17. In addition, it will be described with reference to FIG. 11 described above.

尚、図16は、セキュアDMAC21による暗号鍵取得の為のデータ転送動作を表し、図17は、図16に示すデータ転送の直後に連続して行われる、CPU14による暗号鍵取得の為のデータ転送動作を表す図である。 Note that FIG. 16 shows a data transfer operation for acquiring an encryption key by the secure DMAC21, and FIG. 17 shows a data transfer for acquiring an encryption key by the CPU 14 which is continuously performed immediately after the data transfer shown in FIG. It is a figure which shows the operation.

先ず、暗号鍵生成部13Aが、図16の太線矢印に示すようにセキュアDMAC21から送出された暗号鍵読出要求RQ2をデータバスBS8を介して受ける。すると、暗号鍵生成部13Aの出力制御部133Aは、乱数値Q1を有する暗号鍵CRKをデータバスBS8に送出する。これにより、当該暗号鍵CRKが図16の太線矢印に示すようにデータバスBS8を介してセキュアDMAC21に供給される。更に、出力制御部133Aは、暗号鍵読出要求RQ2に応じて、フラグレジスタ134に保持されているフラグFGを図11に示すように、暗号鍵読出要求を受けたことを表す論理レベル1に書き換える。 First, the encryption key generation unit 13A receives the encryption key read request RQ2 transmitted from the secure DMAC 21 via the data bus BS8 as shown by the thick line arrow in FIG. Then, the output control unit 133A of the encryption key generation unit 13A sends the encryption key CRK having the random number value Q1 to the data bus BS8. As a result, the encryption key CRK is supplied to the secure DMAC 21 via the data bus BS8 as shown by the thick arrow in FIG. Further, the output control unit 133A rewrites the flag FG held in the flag register 134 to the logic level 1 indicating that the encryption key read request has been received, as shown in FIG. 11, in response to the encryption key read request RQ2. ..

その後、暗号鍵生成部13Aが、図17の太線矢印に示すようにCPU14から送出された暗号鍵読出要求RQ1をデータバスBS1を介して受ける。すると、暗号鍵生成部13Aの出力制御部133Aは、図11に示すように、暗号鍵読出要求RQ1を受けた時点でフラグFGが論理レベル1であることから、エラー応答ERRをデータバスBS1に送出する。この際、暗号鍵生成部13Aから送出されたエラー応答ERRは、図17の太線矢印に示すようにデータバスBS1を介してリセット制御部23に供給される。 After that, the encryption key generation unit 13A receives the encryption key read request RQ1 sent from the CPU 14 via the data bus BS1 as shown by the thick line arrow in FIG. Then, as shown in FIG. 11, the output control unit 133A of the encryption key generation unit 13A sets the error response ERR to the data bus BS1 because the flag FG is at the logic level 1 when the encryption key read request RQ1 is received. Send. At this time, the error response ERR sent from the encryption key generation unit 13A is supplied to the reset control unit 23 via the data bus BS1 as shown by the thick line arrow in FIG.

エラー応答ERRを受けたリセット制御部23は、リセット信号RSを暗号鍵生成部13A、CPU14、及びキーストレージ22に供給する。暗号鍵生成部13A、CPU14、及びキーストレージ22は、リセット信号RSに応じて自身の状態をリセットする。 The reset control unit 23 that has received the error response ERR supplies the reset signal RS to the encryption key generation unit 13A, the CPU 14, and the key storage 22. The encryption key generation unit 13A, the CPU 14, and the key storage 22 reset their own states in response to the reset signal RS.

このように、暗号鍵生成部13Aは、セキュアDMAC21からの暗号鍵読出要求に応じて暗号鍵CRKを送出した直後に、CPU14からの暗号鍵読出要求を受けた場合には、暗号鍵CRKの送出は行わず、エラー応答ERRを送出する。この際、エラー応答ERRを受けたリセット制御部23は、暗号鍵生成部13A、CPU14、及びキーストレージ22各々の状態をリセットする。 As described above, when the encryption key generation unit 13A receives the encryption key read request from the CPU 14 immediately after transmitting the encryption key CRK in response to the encryption key read request from the secure DMAC 21, the encryption key CRK is transmitted. Is not performed, and an error response ERR is sent. At this time, the reset control unit 23 that has received the error response ERR resets the states of the encryption key generation unit 13A, the CPU 14, and the key storage 22.

これにより、図16に示すようなセキュアDMAC21からの暗号鍵読出要求RQ2に続き、図17に示すようなCPU14からの暗号鍵読出要求RQ1が行われても、同一値を有する暗号鍵CRKが2回連続して暗号鍵生成部13Aから送出されることはない。よって、暗号鍵CRKがマイクロコンピュータ100の外部へ漏洩される可能性が低くなり、平文データの漏洩を防ぐことが可能となる。 As a result, even if the encryption key read request RQ2 from the secure DMAC 21 as shown in FIG. 16 is followed by the encryption key read request RQ1 from the CPU 14 as shown in FIG. 17, the encryption key CRK having the same value is 2. It is not continuously transmitted from the encryption key generation unit 13A. Therefore, the possibility that the encryption key CRK is leaked to the outside of the microcomputer 100 is reduced, and it is possible to prevent the leakage of plaintext data.

尚、図16及び図17に示す一例では、暗号鍵生成部13Aは、セキュアDMAC21からの暗号鍵読出要求を受けた直後に、CPU14からの暗号鍵読出要求を受けた場合に、リセット制御部23にエラー応答ERRを行うようにしている。しかしながら、暗号鍵生成部13Aとしては、CPU14から暗号鍵読出要求を受けた直後に、セキュアDMAC21から暗号鍵読出要求を受けた場合に、リセット制御部23に対してエラー応答ERRを行うようにしても良い。 In the example shown in FIGS. 16 and 17, when the encryption key generation unit 13A receives the encryption key read request from the CPU 14 immediately after receiving the encryption key read request from the secure DMAC 21, the reset control unit 23 The error response ERR is performed. However, the encryption key generation unit 13A performs an error response ERR to the reset control unit 23 when the encryption key read request is received from the secure DMAC 21 immediately after receiving the encryption key read request from the CPU 14. Is also good.

この際、暗号鍵生成部13Aとしては、以下の動作を行う出力制御部133Aを採用する。 At this time, as the encryption key generation unit 13A, an output control unit 133A that performs the following operations is adopted.

すなわち、出力制御部133Aは、CPU14からの暗号鍵読出要求RQ1を受けた場合には、暗号鍵CRKをデータバスBS1に送出する。更に、暗号鍵読出要求RQ1に応じて、出力制御部133Aは、フラグレジスタ134に保持されているフラグFGを、暗号鍵読出要求を受けたことを表す論理レベル1に書き換える。 That is, when the output control unit 133A receives the encryption key read request RQ1 from the CPU 14, the output control unit 133A sends the encryption key CRK to the data bus BS1. Further, in response to the encryption key read request RQ1, the output control unit 133A rewrites the flag FG held in the flag register 134 to the logic level 1 indicating that the encryption key read request has been received.

また、出力制御部133Aは、セキュアDMAC21からの暗号鍵読出要求RQ2を受けた場合には、先ず、フラグレジスタ134に保持されているフラグFGが論理レベル0であるか、或いは論理レベル1であるのかを判定する。ここで、フラグFGが論理レベル0であると判定した場合、つまり暗号鍵読出要求を受けていないと判定した場合に、出力制御部133Aは、暗号鍵CRKをデータバスBS8に送出する。 Further, when the output control unit 133A receives the encryption key read request RQ2 from the secure DMAC21, first, the flag FG held in the flag register 134 is the logic level 0 or the logic level 1. Is determined. Here, when it is determined that the flag FG is the logic level 0, that is, when it is determined that the encryption key read request has not been received, the output control unit 133A sends the encryption key CRK to the data bus BS8.

一方、フラグFGが論理レベル1であると判定した場合、つまり暗号鍵読出要求を既に受けていると判定したら、出力制御部133Aは、暗号鍵CRKに代えて、暗号鍵の読出エラーを表すエラー応答ERRをデータバスBS8に送出する。この際、データバスBS8を介してエラー応答ERRがリセット制御部23に供給される。 On the other hand, if it is determined that the flag FG is the logic level 1, that is, if it is determined that the encryption key read request has already been received, the output control unit 133A replaces the encryption key CRK with an error indicating an encryption key read error. The response ERR is sent to the data bus BS8. At this time, the error response ERR is supplied to the reset control unit 23 via the data bus BS8.

以下に、図15に示す構成において、CPU14による暗号鍵取得の為のデータ転送に引き続き、セキュアDMAC21による暗号鍵取得の為のデータ転送が実施された場合での動作について、図18、図19、並びに上記した図14を参照しつつ説明する。 Below, in the configuration shown in FIG. 15, the operation when the data transfer for the encryption key acquisition by the CPU 14 is followed by the data transfer for the encryption key acquisition by the secure DMAC21 is described in FIGS. 18 and 19. In addition, it will be described with reference to FIG. 14 described above.

尚、図18は、CPU14による暗号鍵取得の為のデータ転送動作を表し、図19は、図18に示すデータ転送の直後に行われる、セキュアDMAC21による暗号鍵取得の為のデータ転送動作を表す図である。 Note that FIG. 18 shows a data transfer operation for acquiring the encryption key by the CPU 14, and FIG. 19 shows a data transfer operation for acquiring the encryption key by the secure DMAC21, which is performed immediately after the data transfer shown in FIG. It is a figure.

先ず、暗号鍵生成部13Aが、図18の太線矢印に示すようにCPU14から送出された暗号鍵読出要求RQ1をデータバスBS1を介して受ける。すると、暗号鍵生成部13Aの出力制御部133Aは、乱数値Q1を有する暗号鍵CRKをデータバスBS1に送出する。これにより、当該暗号鍵CRKが図18の太線矢印に示すようにデータバスBS1を介してCPU14に供給される。更に、出力制御部133Aは、この暗号鍵読出要求RQ1に応じて、フラグレジスタ134に保持されているフラグFGを図14に示すように、暗号鍵読出要求を受けたことを表す論理レベル1に書き換える。 First, the encryption key generation unit 13A receives the encryption key read request RQ1 sent from the CPU 14 via the data bus BS1 as shown by the thick line arrow in FIG. Then, the output control unit 133A of the encryption key generation unit 13A sends the encryption key CRK having the random number value Q1 to the data bus BS1. As a result, the encryption key CRK is supplied to the CPU 14 via the data bus BS1 as shown by the thick arrow in FIG. Further, the output control unit 133A sets the flag FG held in the flag register 134 to the logic level 1 indicating that the encryption key read request has been received, as shown in FIG. 14, in response to the encryption key read request RQ1. rewrite.

その後、暗号鍵生成部13Aが、図19の太線矢印に示すようにセキュアDMAC21から送出された暗号鍵読出要求RQ2をデータバスBS8を介して受ける。すると、暗号鍵生成部13Aの出力制御部133Aは、図14に示すように、この暗号鍵読出要求RQ2を受けた時点でフラグFGが論理レベル1であることから、エラー応答ERRをデータバスBS8に送出する。この際、暗号鍵生成部13Aから送出されたエラー応答ERRは、図19の太線矢印に示すようにデータバスBS8を介してリセット制御部23に供給される。 After that, the encryption key generation unit 13A receives the encryption key read request RQ2 transmitted from the secure DMAC 21 via the data bus BS8 as shown by the thick line arrow in FIG. Then, as shown in FIG. 14, the output control unit 133A of the encryption key generation unit 13A sets the error response ERR to the data bus BS8 because the flag FG is at the logic level 1 when the encryption key read request RQ2 is received. Send to. At this time, the error response ERR sent from the encryption key generation unit 13A is supplied to the reset control unit 23 via the data bus BS8 as shown by the thick line arrow in FIG.

エラー応答ERRを受けたリセット制御部23は、リセット信号RSを暗号鍵生成部13A、CPU14、及びキーストレージ22に供給する。暗号鍵生成部13A、CPU14、及びキーストレージ22は、リセット信号RSに応じて自身の状態をリセットする。 The reset control unit 23 that has received the error response ERR supplies the reset signal RS to the encryption key generation unit 13A, the CPU 14, and the key storage 22. The encryption key generation unit 13A, the CPU 14, and the key storage 22 reset their own states in response to the reset signal RS.

このように、暗号鍵生成部13Aは、CPU14からの暗号鍵読出要求に応じて暗号鍵CRKを送出した直後に、セキュアDMAC21からの暗号鍵読出要求を受けた場合には、暗号鍵CRKの送出は行わず、エラー応答ERRを送出する。この際、エラー応答ERRを受けたリセット制御部23は、暗号鍵生成部13A、CPU14、及びキーストレージ22各々の状態をリセットする。 As described above, when the encryption key generation unit 13A receives the encryption key read request from the secure DMAC 21 immediately after transmitting the encryption key CRK in response to the encryption key read request from the CPU 14, the encryption key CRK is transmitted. Is not performed, and an error response ERR is sent. At this time, the reset control unit 23 that has received the error response ERR resets the states of the encryption key generation unit 13A, the CPU 14, and the key storage 22.

これにより、図18に示すようなCPU14からの暗号鍵読出要求RQ1に続き、図19に示すようなセキュアDMAC21からの暗号鍵読出要求RQ2が行われても、同一値を有する暗号鍵CRKが2回連続して暗号鍵生成部13Aから送出されることはない。よって、暗号鍵CRKがマイクロコンピュータ100の外部へ漏洩される可能性が低くなり、平文データの漏洩を防ぐことが可能となる。 As a result, even if the encryption key read request RQ1 from the CPU 14 as shown in FIG. 18 is followed by the encryption key read request RQ2 from the secure DMAC21 as shown in FIG. 19, the encryption key CRK having the same value is 2. It is not continuously transmitted from the encryption key generation unit 13A. Therefore, the possibility that the encryption key CRK is leaked to the outside of the microcomputer 100 is reduced, and it is possible to prevent the leakage of plaintext data.

12 暗号処理部
13、13A 暗号鍵生成部
14 CPU
21 セキュアDMAC
131 乱数生成部
133 出力制御部
12 Cryptographic processing unit 13, 13A Cryptographic key generation unit 14 CPU
21 Secure DMAC
131 Random number generator 133 Output control unit

Claims (7)

データバスを介して受けた暗号鍵を用いて平文データを暗号化する暗号処理部と、
前記暗号鍵を生成し、生成した前記暗号鍵を第1の読出要求又は第2の読出要求に応じて前記データバスに送出する暗号鍵生成部と、
前記第1の読出要求を前記暗号鍵生成部に供給し、前記暗号鍵生成部から送出された前記暗号鍵を前記データバスを介して前記暗号処理部に転送する第1の転送制御部と、
前記第2の読出要求を前記暗号鍵生成部に供給し、前記暗号鍵生成部から送出された前記暗号鍵を前記データバスを介して前記暗号処理部に転送する第2の転送制御部と、を含み、
前記暗号鍵生成部は、前記第1の読出要求及び前記第2の読出要求のうちの一方の読出要求を受けた場合に、前記暗号鍵の値を他の値に変更することを特徴とする半導体装置。
An encryption processing unit that encrypts plaintext data using the encryption key received via the data bus,
An encryption key generation unit that generates the encryption key and sends the generated encryption key to the data bus in response to a first read request or a second read request.
A first transfer control unit that supplies the first read request to the encryption key generation unit and transfers the encryption key sent from the encryption key generation unit to the encryption processing unit via the data bus.
A second transfer control unit that supplies the second read request to the encryption key generation unit and transfers the encryption key sent from the encryption key generation unit to the encryption processing unit via the data bus. Including
The encryption key generation unit is characterized in that when one of the first read request and the second read request is received, the value of the encryption key is changed to another value. Semiconductor device.
前記暗号鍵生成部は、
所定期間毎に乱数値が変化する乱数を生成し、乱数変更信号に応答して前記乱数値を他の乱数値に変更する乱数生成部と、
前記乱数を保持し、保持した前記乱数を暗号鍵として出力するレジスタと、
前記第1の読出要求又は前記第2の読出要求を受けた場合に前記レジスタから出力された前記暗号鍵を前記データバスに送出すると共に、前記第1の読出要求及び前記第2の読出要求のうちの一方の読出要求を受けた場合に前記乱数変更信号を前記乱数生成部に供給する出力制御部と、を含むことを特徴とする請求項1に記載の半導体装置。
The encryption key generator is
A random number generator that generates a random number whose random number value changes every predetermined period and changes the random number value to another random number value in response to a random number change signal.
A register that holds the random number and outputs the held random number as an encryption key,
When the first read request or the second read request is received, the encryption key output from the register is sent to the data bus, and the first read request and the second read request are sent. The semiconductor device according to claim 1, further comprising an output control unit that supplies the random number change signal to the random number generation unit when one of the read requests is received.
前記第1の転送制御部はCPUであり、前記第2の転送制御部はDMAC(direct memory access controller)であることを特徴とする請求項1又は2に記載の半導体装置。 The semiconductor device according to claim 1 or 2, wherein the first transfer control unit is a CPU, and the second transfer control unit is a DMAC (direct memory access controller). データバスを介して受けた暗号鍵を用いて平文データを暗号化する暗号処理部と、
前記暗号鍵を生成し、生成した前記暗号鍵を第1の読出要求又は第2の読出要求に応じて前記データバスに送出する暗号鍵生成部と、
前記第1の読出要求を前記暗号鍵生成部に供給し、前記暗号鍵生成部から送出された前記暗号鍵を前記データバスを介して前記暗号処理部に転送する第1の転送制御部と、
前記第2の読出要求を前記暗号鍵生成部に供給し、前記暗号鍵生成部から送出された前記暗号鍵を前記データバスを介して前記暗号処理部に転送する第2の転送制御部と、を含み、
前記暗号鍵生成部は、所定期間毎に、前記所定期間内において前記第1の読出要求を受けた後に前記第2の読出要求を受けた場合には、前記第2の読出要求に応じて前記暗号鍵に代えてエラー応答を前記データバスに送出することを特徴とする半導体装置。
An encryption processing unit that encrypts plaintext data using the encryption key received via the data bus,
An encryption key generation unit that generates the encryption key and sends the generated encryption key to the data bus in response to a first read request or a second read request.
A first transfer control unit that supplies the first read request to the encryption key generation unit and transfers the encryption key sent from the encryption key generation unit to the encryption processing unit via the data bus.
A second transfer control unit that supplies the second read request to the encryption key generation unit and transfers the encryption key sent from the encryption key generation unit to the encryption processing unit via the data bus. Including
When the encryption key generation unit receives the second read request after receiving the first read request within the predetermined period, the encryption key generation unit responds to the second read request. A semiconductor device characterized in that an error response is sent to the data bus instead of an encryption key.
前記暗号鍵生成部は、
前記所定期間毎に乱数値が変化する乱数を生成する乱数生成部と、
前記乱数を保持し、保持した前記乱数を暗号鍵として出力する第1のレジスタと、
前記第1の読出要求又は前記第2の読出要求を受けたか否かを表すフラグが保持される第2のレジスタと、
前記第1の読出要求又は前記第2の読出要求を受けた場合に前記第1のレジスタから出力された前記暗号鍵を前記データバスに送出すると共に、前記所定期間毎に前記第2のレジスタに保持されている前記フラグを前記第1の読出要求及び前記第2の読出要求のいずれも受けていないことを表す状態に初期化する出力制御部と、を含み、
前記出力制御部は、
前記第1の読出要求を受けた場合には、前記第2のレジスタに保持されている前記フラグを前記第1の読出要求又は前記第2の読出要求を受けたことを表す状態に書き換え、
前記第2の読出要求を受けた場合には、前記第2のレジスタに保持されている前記フラグが前記第1の読出要求又は前記第2の読出要求を受けたことを表す場合に、前記暗号鍵に代えて前記エラー応答を前記データバスに送出することを特徴とする請求項4に記載の半導体装置。
The encryption key generator is
A random number generator that generates a random number whose random number value changes every predetermined period, and a random number generator.
A first register that holds the random number and outputs the held random number as an encryption key,
A second register holding a flag indicating whether or not the first read request or the second read request has been received, and
When the first read request or the second read request is received, the encryption key output from the first register is sent to the data bus, and the encryption key is sent to the second register every predetermined period. Includes an output control unit that initializes the held flag to a state indicating that neither the first read request nor the second read request has been received.
The output control unit
When the first read request is received, the flag held in the second register is rewritten to a state indicating that the first read request or the second read request has been received.
When the second read request is received, the cipher is used when the flag held in the second register indicates that the first read request or the second read request has been received. The semiconductor device according to claim 4, wherein the error response is sent to the data bus instead of the key.
前記データバスに送出された前記暗号鍵を保持する鍵保持部と、
前記データバスを介して前記エラー応答を受けたときに、前記鍵保持部、前記第1の転送制御部及び前記第2の転送制御部をリセットするリセット制御部と、を含むことを特徴とする請求項4又は5に記載の半導体装置。
A key holder that holds the encryption key sent to the data bus,
It is characterized by including a key holding unit, a first transfer control unit, and a reset control unit that resets the second transfer control unit when the error response is received via the data bus. The semiconductor device according to claim 4 or 5.
前記第1の転送制御部及び前記第2の転送制御部のうちの一方はCPUであり、他方はDMAC(direct memory access controller)であることを特徴とする請求項4~6のいずれか1に記載の半導体装置 The present invention according to any one of claims 4 to 6, wherein one of the first transfer control unit and the second transfer control unit is a CPU and the other is a DMAC (direct memory access controller). The semiconductor device described .
JP2017252235A 2017-12-27 2017-12-27 Semiconductor device and encryption key control method Active JP7032926B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2017252235A JP7032926B2 (en) 2017-12-27 2017-12-27 Semiconductor device and encryption key control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2017252235A JP7032926B2 (en) 2017-12-27 2017-12-27 Semiconductor device and encryption key control method

Publications (2)

Publication Number Publication Date
JP2019118064A JP2019118064A (en) 2019-07-18
JP7032926B2 true JP7032926B2 (en) 2022-03-09

Family

ID=67304688

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2017252235A Active JP7032926B2 (en) 2017-12-27 2017-12-27 Semiconductor device and encryption key control method

Country Status (1)

Country Link
JP (1) JP7032926B2 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001508893A (en) 1996-12-12 2001-07-03 インテル・コーポレーション Paging system protected by cryptography
JP2002328845A (en) 2001-05-07 2002-11-15 Fujitsu Ltd Semiconductor integrated circuit and IC card security protection method
JP2007281994A (en) 2006-04-10 2007-10-25 Renesas Technology Corp Semiconductor integrated circuit
JP2011087249A (en) 2009-10-19 2011-04-28 Ricoh Co Ltd Communication device and communication control method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2001508893A (en) 1996-12-12 2001-07-03 インテル・コーポレーション Paging system protected by cryptography
JP2002328845A (en) 2001-05-07 2002-11-15 Fujitsu Ltd Semiconductor integrated circuit and IC card security protection method
JP2007281994A (en) 2006-04-10 2007-10-25 Renesas Technology Corp Semiconductor integrated circuit
JP2011087249A (en) 2009-10-19 2011-04-28 Ricoh Co Ltd Communication device and communication control method

Also Published As

Publication number Publication date
JP2019118064A (en) 2019-07-18

Similar Documents

Publication Publication Date Title
JP3848573B2 (en) Microprocessor system
US7925013B1 (en) System for data encryption and decryption of digital data entering and leaving memory
EP3322119B1 (en) Data processing method and apparatus
JP4865694B2 (en) Processor device
US11387980B2 (en) Hardware multiple cipher engine
WO2019109967A1 (en) Storage apparatus and method for address scrambling
KR101303278B1 (en) FPGA apparatus and method for protecting bitstream
WO2016042287A1 (en) Puf and address dependent data encryption
JPH05210560A (en) Method and device using split key encipherment/ decipher
CN111814212B (en) Bus data protection method, device, storage medium and chip
JP2006277411A (en) Processor, memory, computer system, and data transfer method
JP2015170952A (en) Encryption / decryption system, control method therefor, and program
US20190294826A1 (en) Information processing apparatus, information processing system, and information processing method
CN113890728A (en) Key processing method, system, equipment and medium based on FPGA encryption card
KR20220000537A (en) System and method for transmitting and receiving data based on vehicle network
CN113536331B (en) Data security for memory and computing systems
JP7057675B2 (en) Semiconductor device and encryption key generation method
JP4758904B2 (en) Confidential information processing method
CN114327255B (en) Memory interface controller and memory
JP7032926B2 (en) Semiconductor device and encryption key control method
CN112329074B (en) System-on-a-Chip
JP2007336446A (en) Data encryption device
JP6203532B2 (en) Semiconductor memory device and data processing system
JP6636006B2 (en) Encryption / decryption system, control method thereof, and program
CN119519932B (en) Cipher chip and scrambling method thereof

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20201029

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20210610

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20210615

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20210816

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20211012

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20220106

C60 Trial request (containing other claim documents, opposition documents)

Free format text: JAPANESE INTERMEDIATE CODE: C60

Effective date: 20220106

A911 Transfer to examiner for re-examination before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20220117

C21 Notice of transfer of a case for reconsideration by examiners before appeal proceedings

Free format text: JAPANESE INTERMEDIATE CODE: C21

Effective date: 20220118

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: 20220201

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20220225

R150 Certificate of patent or registration of utility model

Ref document number: 7032926

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250