JP2008217579A - Microcontroller - Google Patents

Microcontroller Download PDF

Info

Publication number
JP2008217579A
JP2008217579A JP2007055961A JP2007055961A JP2008217579A JP 2008217579 A JP2008217579 A JP 2008217579A JP 2007055961 A JP2007055961 A JP 2007055961A JP 2007055961 A JP2007055961 A JP 2007055961A JP 2008217579 A JP2008217579 A JP 2008217579A
Authority
JP
Japan
Prior art keywords
decoding
memory
information
cpu
decryption
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.)
Withdrawn
Application number
JP2007055961A
Other languages
Japanese (ja)
Inventor
Yutaka Fujimaki
裕 藤巻
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.)
Kawasaki Microelectronics Inc
Original Assignee
Kawasaki Microelectronics Inc
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 Kawasaki Microelectronics Inc filed Critical Kawasaki Microelectronics Inc
Priority to JP2007055961A priority Critical patent/JP2008217579A/en
Publication of JP2008217579A publication Critical patent/JP2008217579A/en
Withdrawn legal-status Critical Current

Links

Images

Abstract

<P>PROBLEM TO BE SOLVED: To provide a microcontroller capable of sufficiently securing secrecy of an encrypted program. <P>SOLUTION: The microcontroller is provided with a memory 12 for storing an encrypted program and a CPU 11 for executing the program read from the memory through a first route. It is provided with a decoding block 13 having a register for reading decoding information to be used to decode the encrypted program through a second route different from the first signal route and holding it so that it cannot be read physically from the CPU 11. The decoding block 13 uses the decoding information held in the register to decode the encrypted program read from the memory through the first route. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、プログラムの内容を第三者に知られないように、そのプログラムの少なくとも一部を暗号化してメモリ内に記憶させたマイクロコントローラに関するものである。   The present invention relates to a microcontroller in which at least a part of a program is encrypted and stored in a memory so that the contents of the program are not known to a third party.

所定のプログラムを実行するマイクロコントローラとして、プログラムの少なくとも一部を暗号化し、その暗号化プログラムの復号化に必要な鍵やその他数値情報(暗号化開始アドレス、終了アドレス等を含む)等の復号情報と共に、プログラム全体をメモリに格納する構成が提案されている。この場合、暗号化プログラムの領域がアクセスされた際には、同一のメモリに格納された復号情報を用いて復号化し、復号化プログラムデータをCPUに出力する(例えば、特許文献1参照)。このように、従来の秘匿機構では、CPUと同一チップ上にあるメモリに復号情報を予め記録して、使用していた。   As a microcontroller that executes a given program, at least a part of the program is encrypted, and decryption information such as a key and other numerical information (including encryption start address, end address, etc.) necessary for decrypting the encrypted program In addition, a configuration for storing the entire program in a memory has been proposed. In this case, when the encryption program area is accessed, decryption is performed using the decryption information stored in the same memory, and decryption program data is output to the CPU (see, for example, Patent Document 1). Thus, in the conventional concealment mechanism, the decryption information is recorded in advance in a memory on the same chip as the CPU and used.

また、プロセッサチップ内の鍵管理部に秘密鍵を格納しておき、外部メモリから外部バスインターフェースを介して、まず、プログラムの復号に必要な命令鍵を公開鍵で暗号化した配布鍵を受け取り、その配布鍵を前記秘密鍵で復号して得た命令鍵を、鍵管理部の鍵テーブルに保持する構成が提案されている。この場合、鍵登録の完了をプロセッサコアに通知した後に、前記外部バスインターフェースを介してプログラムを受け取り、前記命令鍵を用いて復号する(例えば、特許文献2参照)。
特開2004−023351号公報 特開2002−232417号公報
In addition, the secret key is stored in the key management unit in the processor chip, and first, the distribution key obtained by encrypting the instruction key necessary for decrypting the program with the public key is received from the external memory via the external bus interface. A configuration has been proposed in which an instruction key obtained by decrypting the distribution key with the secret key is held in a key table of a key management unit. In this case, after notifying the completion of key registration to the processor core, the program is received via the external bus interface and decrypted using the instruction key (see, for example, Patent Document 2).
JP 2004-023351 A JP 2002-232417 A

しかし、前者では、メモリに復号情報を予め記録しておくので、メモリチップ(若しくは、CPUおよびメモリをワンチップ化した場合はそのチップ)を入手すれば、その復号情報を解読可能であり、復号情報の秘匿性が失われやすい。一旦秘匿性が失われると、暗号化プログラムの内容が第三者に容易に知られることとなる。特に、そのメモリがマスクROMのように、顕微鏡を使用することで「0」、「1」が観測可能なデバイスの場合は、その解読が容易である。よって、ICカード等の個人情報などの重要情報が蓄積されるマイクロコンピュータシステムにおいては、データの改変等の不正行為につながる可能性がある。そこで、重要情報流出の際には、チップ自体を新しいものに交換する必要が生じ、時間とコストの損失が著しい。   However, in the former, since the decoding information is recorded in the memory in advance, if the memory chip (or the chip in the case where the CPU and the memory are made into one chip) is obtained, the decoding information can be decoded. Information confidentiality is easily lost. Once confidentiality is lost, the contents of the encryption program can be easily known to a third party. In particular, when the memory is a device that can observe “0” and “1” by using a microscope, such as a mask ROM, the decoding is easy. Therefore, in a microcomputer system in which important information such as personal information such as an IC card is accumulated, there is a possibility that it may lead to an illegal act such as data modification. Therefore, when important information is leaked, it is necessary to replace the chip itself with a new one, and the loss of time and cost is significant.

後者においても、暗号化プログラムと、その復号に必要な命令鍵を公開鍵で暗号化した配布鍵が同一のメモリ上にあるので、プロセッサチップとメモリチップとを(両者がワンチップ化されていれば、そのチップを)入手すれば、プロセッサチップから解読した秘密鍵を利用して、メモリチップ上の配布鍵を復号し、得られた命令鍵で、暗号化プログラムを復号することが可能となる。   Even in the latter, the encryption program and the distribution key obtained by encrypting the instruction key necessary for the decryption with the public key are on the same memory, so the processor chip and the memory chip (both are made into one chip). If the chip is obtained, the distribution key on the memory chip can be decrypted using the secret key decrypted from the processor chip, and the encrypted program can be decrypted with the obtained instruction key. .

本発明の目的は、暗号化プログラムを復号する際に必要とされる復号情報を外部から取り込む形式とし、且つ取り込んだ復号情報がCPUで読み込み不可能となるようにして、暗号化プログラムの秘匿性を十分確保できるようにしたマイクロコントローラを提供することである。   An object of the present invention is to provide a format for fetching decryption information necessary for decrypting an encryption program from the outside, and making the decryption information fetched unreadable by the CPU, so that the encryption program is confidential. It is an object of the present invention to provide a microcontroller that can sufficiently ensure the above.

上記目的を達成するために、請求項1にかかる発明のマイクロコントローラは、プログラムをその少なくとも一部は暗号化プログラムとして格納したメモリと、第1の経路を通じて前記メモリから読み出した前記プログラムを実行するCPUとを備えるマイクロコントローラにおいて、前記暗号化プログラムを復号するために利用する復号情報を、前記第1の信号経路とは異なる第2の経路を通じて読み込み、且つ前記CPUから物理的に読み出し不可能に保持する記憶手段を有する復号ブロックを備え、該復号ブロックは、前記第1の経路を通じて前記メモリから読み出した前記暗号化プログラムを、前記記憶手段に保持した前記復号情報を利用して復号し、前記CPUに供給することを特徴とする。
請求項2にかかる発明は、請求項1に記載のマイクロコントローラにおいて、前記記憶手段への前記復号情報の格納が完了したときに、前記CPUから読み出し可能な復号化準備完了信号を生成する通知回路をさらに備えることを特徴とする。
請求項3にかかる発明は、請求項1又は2に記載のマイクロコントローラにおいて、前記第2の経路を通じて接続されたホストに対して、前記復号情報の送信を要求するとともに、前記ホストから前記復号情報を受け取り、前記復号ブロックに送るインターフェース回路をさらに備え、該インターフェース回路内の前記復号情報は前記CPUから物理的に読み出し不可能であることを特徴とする。
請求項4にかかる発明は、請求項1乃至3のいずれか1つに記載のマイクロコントローラにおいて、前記暗号化プログラムは、前記メモリの複数の領域のそれぞれに分割して格納され、前記復号情報が、前記メモリの前記複数の領域のそれぞれに格納された前記暗号化プログラムを復号するために利用する領域復号情報と、該それぞれの領域を識別する領域識別情報とを含み、前記記憶手段は、前記複数の領域のそれぞれの前記領域復号情報を保持する領域復号情報記憶手段と、前記複数の領域のそれぞれを指定する前記領域識別情報を保持する領域識別情報記憶手段とを有することを特徴とする。
請求項5にかかる発明は、請求項1乃至4のいずれか1つに記載のマイクロコントローラにおいて、前記メモリは前記CPUと同一の半導体集積回路内に設けられており、前記第2の経路は、前記半導体集積回路外からの信号を受信する外部端子を通じた経路であることを特徴とする。
In order to achieve the above object, a microcontroller according to a first aspect of the present invention executes a memory in which at least a part of a program is stored as an encrypted program and the program read from the memory through a first path. In a microcontroller including a CPU, decryption information used for decrypting the encryption program is read through a second path different from the first signal path and cannot be physically read from the CPU. A decryption block having storage means for holding, the decryption block decrypting the encryption program read from the memory through the first path using the decryption information held in the storage means, It supplies to CPU.
According to a second aspect of the present invention, in the microcontroller according to the first aspect, when the storage of the decoding information in the storage means is completed, a notification circuit that generates a decoding preparation completion signal readable from the CPU Is further provided.
According to a third aspect of the invention, in the microcontroller according to the first or second aspect, the host connected through the second path is requested to transmit the decoding information, and the decoding information is sent from the host to the host. Is received and sent to the decoding block, and the decoding information in the interface circuit is physically unreadable from the CPU.
According to a fourth aspect of the present invention, in the microcontroller according to any one of the first to third aspects, the encryption program is divided and stored in each of a plurality of areas of the memory, and the decryption information is stored in the microcontroller. , Area decryption information used for decrypting the encrypted program stored in each of the plurality of areas of the memory, and area identification information for identifying each area, the storage means, An area decoding information storage unit that holds the area decoding information for each of a plurality of areas, and an area identification information storage unit that holds the area identification information for designating each of the plurality of areas.
According to a fifth aspect of the present invention, in the microcontroller according to any one of the first to fourth aspects, the memory is provided in the same semiconductor integrated circuit as the CPU, and the second path is It is a path through an external terminal for receiving a signal from outside the semiconductor integrated circuit.

本発明によれば、暗号化プログラムの復号に必要な復号情報を、マイクロコントローラの外部から、CPUとプログラムが格納されたメモリとの間の第1の信号経路とは別の第2の信号経路を介して取り込み、CPUから読み出し不可能な記憶手段に保持し、暗号化プログラムの復号に供するので、暗号化プログラムの秘匿性の確保が確実となる。   According to the present invention, the second signal path different from the first signal path between the CPU and the memory storing the program is sent from the outside of the microcontroller to the decryption information necessary for decrypting the encrypted program. Since the encrypted program is decrypted, the confidentiality of the encrypted program is ensured.

図1は本発明の1つの実施例のマイクロコントローラの構成を示すブロック図である。マイクロコントローラ10は、プログラムを実行するCPU11、一部が暗号化されたプログラム等が格納されるメモリ12、メモリ12内のプログラムの内の暗号化プログラムを復号する復号ブロック13、外部端子を通じて外部のホスト20との間で通信を行うインターフェース回路14、復号ブロック13における復号化準備が完了したときフラグを立てる復号化準備完了フラグ回路15を備える。ホスト20は、マイクロコントローラ10に対して復号化データを供給する外部接続のパーソナルコンピュータ等からなる。メモリ12には「復号化準備手順」のプログラムも格納されている。   FIG. 1 is a block diagram showing the configuration of a microcontroller according to one embodiment of the present invention. The microcontroller 10 includes a CPU 11 that executes a program, a memory 12 that stores a partially encrypted program, a decryption block 13 that decrypts an encrypted program in the program in the memory 12, and an external terminal through an external terminal. An interface circuit 14 that communicates with the host 20 and a decoding preparation completion flag circuit 15 that sets a flag when the decoding preparation in the decoding block 13 is completed are provided. The host 20 is composed of an externally connected personal computer or the like that supplies decoded data to the microcontroller 10. The memory 12 also stores a “decryption preparation procedure” program.

なお、CPU11とメモリ12との間の信号経路は請求項の「第1の信号経路」に対応し、インターフェース回路14とホスト回路20との間の信号経路は請求項の「第2の信号経路」に対応し、復号化準備完了フラグ回路15は請求項の「通知回路」に対応する。   The signal path between the CPU 11 and the memory 12 corresponds to the “first signal path” in the claims, and the signal path between the interface circuit 14 and the host circuit 20 is the “second signal path” in the claims. The decoding preparation completion flag circuit 15 corresponds to “notification circuit” in the claims.

CPU11は、メモリ12に対しては読出し信号RD、書込み信号WR、データ信号DATAO、アドレス信号ADR等を送信し、復号化準備完了フラグ回路15からの復号化準備完了フラグおよび復号ブロック13からの復号データを取り込むが、インターフェース回路14との間ではデータの通信は不可能となっている。   The CPU 11 transmits a read signal RD, a write signal WR, a data signal DATAO, an address signal ADR, and the like to the memory 12, and decodes the decoding preparation completion flag from the decoding preparation completion flag circuit 15 and the decoding block 13. Data is captured, but data communication with the interface circuit 14 is impossible.

メモリ12は、実行すべき所望プログラムの領域を含む。この領域は非暗号化プログラムの領域と暗号化プログラムの領域とに分かれ、暗号化プログラムの領域はm個に分かれている。   The memory 12 includes an area for a desired program to be executed. This area is divided into an unencrypted program area and an encrypted program area, and the encrypted program area is divided into m areas.

復号ブロック13は、図2に示すように、領域選択回路131と復号回路132からなり、インターフェース回路14から入力するセレクト信号CS1がイネーブルのときに動作する。領域選択回路131は、図3に示すように、メモリ12の暗号化プログラムのデータを復号するための復号化用データを格納するm個の「複合化用データレジスタ1」〜「複合化用データレジスタm」からなる複合化用データレジスタ群1311と、その複合化用データレジスタ群1311のデータとデータ「0」との内から1つの復号化用データを選択するマルチプレクサ1312と、メモリ12の暗号化プログラムのデータが格納されるm個の領域のアドレス範囲を示すm個の「領域識別アドレスレジスタ1」〜「領域識別アドレスレジスタm」からなる領域識別アドレスレジスタ群1313と、CPU11からメモリ12に入力する現在のアドレスADRが領域識別アドレスレジスタ群1313内のいずれの「領域識別アドレスレジスタ」のアドレスに含まれるかにより現在のアドレスADRの領域を判定する領域判定回路1314とを備える。   As shown in FIG. 2, the decoding block 13 includes a region selection circuit 131 and a decoding circuit 132, and operates when the select signal CS1 input from the interface circuit 14 is enabled. As shown in FIG. 3, the area selection circuit 131 includes m “decoding data registers 1” to “decoding data” for storing decryption data for decrypting the data of the encryption program in the memory 12. A data register group 1311 composed of the register m ”, a multiplexer 1312 for selecting one decryption data from the data“ 0 ”of the data register group 1311 and the encryption of the memory 12 Area identification address register group 1313 composed of m “area identification address register 1” to “area identification address register m” indicating the address range of m areas in which the data of the program is stored, and the CPU 11 to the memory 12 The current address ADR to be input is any “region identification address register” in the region identification address register group 1313. By either included in the address "and a determining area determination circuit 1314 the area of the current address ADR.

そして、マルチプレクサ1312は、領域判定回路1314で識別された領域に応じて、復号化用データレジスタ1311の内の1つのデータを復号化用データSEL_CODEとして選択する。一方、領域判定回路1314で領域が判定されなかった場合は、現在のアドレスADRは非暗号化プログラムのデータ領域のアドレスであるとして、データ「0」を復号化用データSEL_CODEとして選択する。   Then, the multiplexer 1312 selects one data in the decoding data register 1311 as the decoding data SEL_CODE in accordance with the area identified by the area determination circuit 1314. On the other hand, if the area is not determined by the area determination circuit 1314, the data “0” is selected as the decryption data SEL_CODE, assuming that the current address ADR is the address of the data area of the non-encrypted program.

復号ブロック13の復号回路132は、図4に示すように、前記した所望プログラムのデータのビット数に応じた数のXOR回路1321を備え、各ビットのXOR回路1321は、メモリ12から読み出されたプログラムデータDATAI(暗号化されれいるデータおよびされていないデータ)の各ビット値と、領域選択回路131から出力する復号化用データSEL_CODE(データ「0」も含む)の各ビット値を入力することにより復号して、CPU11に送信すべき復号データCPU_DATAIを生成する。   As shown in FIG. 4, the decoding circuit 132 of the decoding block 13 includes the number of XOR circuits 1321 corresponding to the number of bits of the data of the desired program, and the XOR circuits 1321 for each bit are read from the memory 12. Each bit value of the program data DATAI (encrypted data and non-encrypted data) and each bit value of the decryption data SEL_CODE (including data “0”) output from the area selection circuit 131 are input. Thus, decrypted data CPU_DATAI to be transmitted to the CPU 11 is generated.

インターフェース回路14は、RS232Cに代表されるUART等からなり、ホスト20との間において、メモリ12の暗号化プログラムのデータが格納された領域の情報の要求/取得、その暗号化プログラムのデータを復号するための復号化用データの要求/取得を行う。つまり、ホスト20に対する復号情報の要求/取得を行う。   The interface circuit 14 includes a UART represented by RS232C, and requests / acquires information on an area of the memory 12 in which the encrypted program data is stored, and decrypts the encrypted program data. Requesting / acquiring data for decryption. That is, the host 20 requests / acquires decryption information.

復号化準備完了フラグ回路15は、図5に示すように、マルチプレクサ151とフリップフロップ152とからなる。フリップフロップ152は、ハードウエアリセット信号HW_RESETNが「1」になってリセットが解除されているとき、インターフェース回路14から送信する書込み信号WRとセレクト信号CS2が「1」になる、つまりイネーブルになることにより、「1」がセットされ、フラグ「1」が立ち、CPU11に復号化準備完了を通知する。   As shown in FIG. 5, the decoding preparation completion flag circuit 15 includes a multiplexer 151 and a flip-flop 152. When the hardware reset signal HW_RESETN is “1” and the reset is released, the flip-flop 152 has the write signal WR and the select signal CS2 transmitted from the interface circuit 14 become “1”, that is, is enabled. As a result, “1” is set, the flag “1” is set, and the CPU 11 is notified of the completion of decoding preparation.

次に、図6の「復号化準備手順」のフローチャートに従って、本実施例のマイクロコントローラ10のプログラム実行のための前準備手順動作を説明する。本実施例では、IF回路14がCPU11とは独立に「復号化準備手順」を実行する。   Next, the pre-preparation procedure operation for program execution of the microcontroller 10 of this embodiment will be described according to the flowchart of “decoding preparation procedure” of FIG. In this embodiment, the IF circuit 14 executes a “decoding preparation procedure” independently of the CPU 11.

ハードウェア・リセットが解除されると、インターフェース回路14は接続されたホスト20に対して、「領域情報の要求」を行う(ステップS1)。ただし、この時、CPU11は、リセットが入ったままとするか、「復号化準備完了フラグ」がセットされるのを常にポーリングしているように構成する。   When the hardware reset is released, the interface circuit 14 makes a “region information request” to the connected host 20 (step S1). However, at this time, the CPU 11 is configured to keep resetting or to always poll for the “decoding preparation completion flag” being set.

ホスト20は、インターフェース回路14からの「領域情報の要求」を受けて、メモリ12内のいくつの領域を使用するかを示す領域数mを送信する(ステップS2)。インターフェース回路14は、これを受信し、領域数mを領域選択回路131内の「領域数レジスタ」(図示せず)にセットし、「領域識別アドレス設定手順」に移行する。この「領域識別アドレス設定手順」および後記する「復号化用デ−タ設定手順」の間、書込み信号WRとセレクト信号CS1はイネーブルに、つまり「1」となる。   In response to the “area information request” from the interface circuit 14, the host 20 transmits the number m of areas indicating how many areas in the memory 12 are to be used (step S2). The interface circuit 14 receives this, sets the area number m in the “area number register” (not shown) in the area selection circuit 131, and shifts to “area identification address setting procedure”. During the “area identification address setting procedure” and the “decoding data setting procedure” described later, the write signal WR and the select signal CS1 are enabled, that is, “1”.

インターフェース回路14は、領域識別アドレスをi=0にセットして(ステップS3)から、「領域識別アドレス1」の要求をホスト20に対して行う(ステップS4)。ここでは、例えば、アドレスの上位数ビットを指定することである範囲の領域指定を行う。ホスト20は「領域識別アドレス1」を送信し(ステップS5)、これをインターフェース回路14が受け取ると、上位数ビットのアドレス値を領域選択回路131内の領域識別アドレスレジスタ群1313の「領域識別アドレスレジスタ1」にセットする。この後に、この領域識別アドレスレジスタ群1313へのアドレス値の設定手順を先に受信した領域数mだけ繰り返す(ステップS6,S7)。例えば、領域数mが2であれば、領域識別アドレスレジスタ群1313の設定手順は2回行い終了する。   The interface circuit 14 sets the area identification address to i = 0 (step S3), and then makes a request for “area identification address 1” to the host 20 (step S4). Here, for example, a range of areas is designated by designating the upper few bits of the address. The host 20 transmits “region identification address 1” (step S5). When the interface circuit 14 receives this, the host circuit 14 receives the address value of the upper several bits as “region identification address” of the region identification address register group 1313 in the region selection circuit 131. Set to register 1 ". Thereafter, the procedure for setting the address value in the area identification address register group 1313 is repeated for the number m of areas received in advance (steps S6 and S7). For example, if the number of areas m is 2, the setting procedure of the area identification address register group 1313 is performed twice and is finished.

その後、インターフェース回路14は「復号化用デ−タ設定手順」に移行する。インターフェース回路14は、復号化用データをi=0にセットして(ステップS8)から、ホスト20に対し、復号化用データの要求を行う(ステップS9)。ホスト20はこの要求を受けて復号化用データ1を送信し(ステップS10)、インターフェース回路20はこれを受け取り、復号化用データレジスタ1311内の「復号化用データレジスタ1」にその値を設定する。この手順を先に設定した「領域数m」の数だけ繰り返し(ステップS11,S12)、この「復号化データ設定手順」が完了したところで、セレクト信号CS2を「1」にし、復号化準備完了フラグ回路15のフラグを「1」にセットする(ステップS13)。   Thereafter, the interface circuit 14 proceeds to “decoding data setting procedure”. The interface circuit 14 sets the decryption data to i = 0 (step S8), and then requests the decryption data from the host 20 (step S9). In response to this request, the host 20 transmits the decryption data 1 (step S10). The interface circuit 20 receives the request and sets the value in the “decryption data register 1” in the decryption data register 1311. To do. This procedure is repeated for the number of “areas m” set in advance (steps S11 and S12). When this “decoded data setting procedure” is completed, the select signal CS2 is set to “1”, and a decoding preparation completion flag is set. The flag of the circuit 15 is set to “1” (step S13).

以上の手順で設定された復号ブロック13の復号化用データレジスタ群1311内のレジスタの内容および領域識別アドレスレジスタ群1313内のレジスタの内容は、CPU11から読み出すことができない。復号化準備完了フラグ回路15のフラグは、CPU11から読み出すことができる。   The contents of the registers in the decoding data register group 1311 of the decoding block 13 and the contents of the registers in the area identification address register group 1313 set by the above procedure cannot be read from the CPU 11. The flag of the decryption preparation completion flag circuit 15 can be read from the CPU 11.

CPU11が復号化準備完了フラグ回路15にフラグ「1」が立ったことを確認すると、メモリ12内の非暗号化プログラムは復号ブロック13をそのまま通過し、暗号化プログラムは復号ブロック13で復号され、それぞれCPU11に取り込まれ、プログラムが実行される。   When the CPU 11 confirms that the flag “1” is set in the decryption preparation completion flag circuit 15, the unencrypted program in the memory 12 passes through the decryption block 13 as it is, and the encrypted program is decrypted by the decryption block 13. Each is loaded into the CPU 11 and the program is executed.

すなわち、プログラムが実行される際は、メモリ12のアドレスADRの指定により、その上位アドレスと先に設定された領域識別アドレスレジスタ群1313のアドレスの値との一致性の確認が、領域選択回路131内の領域判定回路1314で実施される。上位アドレスが「領域識別アドレスレジスタ1」のアドレス値に一致するときは、領域判定回路1314によって、マルチプレクサ1314は、復号化用データレジスタ群1311内の「復号化用データレジスタ1」を選択し、そこに格納されている復号化用データを復号回路132に出力する。同様に、上位アドレスが「領域識別アドレスレジスタ2」のアドレス値に一致するときは、「復号化用データレジスタ2」を選択し、そこに格納されている復号化用データを復号回路132に出力する。また、上位アドレスが領域識別アドレスレジスタ群1313内の「領域識別アドレスレジスタ1」〜「領域識別アドレスレジスタm」のいずれのアドレス値とも一致しないときは、データ「0」を選択し、これを復号回路132に出力する。以上により、CPU11には、メモリ12から読み出されたプログラムのデータについて、暗号化されたものは復号回路132で復号化されて取り込まれ、暗号化されていないものはそのまま取り込まれ、プログラマの想定していた動作を行うことが可能となる。   In other words, when the program is executed, according to the designation of the address ADR of the memory 12, the confirmation of the coincidence between the upper address and the value of the address of the area identification address register group 1313 set in advance is performed. The area determination circuit 1314 in FIG. When the upper address matches the address value of “area identification address register 1”, the area determination circuit 1314 causes the multiplexer 1314 to select “decoding data register 1” in the decoding data register group 1311. The decoding data stored there is output to the decoding circuit 132. Similarly, when the upper address matches the address value of “region identification address register 2”, “decoding data register 2” is selected and the decoding data stored therein is output to decoding circuit 132. To do. If the upper address does not match any of the address values of “area identification address register 1” to “area identification address register m” in area identification address register group 1313, data “0” is selected and decoded. Output to the circuit 132. As described above, the program data read from the memory 12 is stored in the CPU 11 by being decrypted and fetched by the decryption circuit 132, and unencrypted by the programmer 11 as it is. It is possible to perform the operation that has been performed.

以上から、本実施例のマイクロコントローラによれば、復号ブロック13は、復号情報(復号化用データや領域識別アドレス)をCPU11から物理的に読み出し不可能に保持する。すなわち、CPU11が復号ブロック13に保持された復号情報を読み出すことができる経路が物理的に存在しない。具体的には、CPU11と復号ブロック13との間には、復号回路132によって復号されたプログラムデータをCPU11が取り込むための経路は存在するものの、復号ブロック13に保持された復号情報を読み出すことができる経路は存在しない。同様に、インターフェース回路14内に一時的に存在する復号情報についても、CPU11は、物理的に読み出し不可能である。このため、ソフトウェアデバッグ装置をマイクロコントローラ10に接続したとしても、これらのインターフェース回路14や復号ブロック13内に存在する復号化用データや領域識別アドレス、つまり復号情報を外部に読み出すことができず、その復号情報の秘匿性が高くなる。   From the above, according to the microcontroller of this embodiment, the decoding block 13 holds the decoding information (decoding data and area identification address) so that it cannot be physically read from the CPU 11. That is, there is no physical path through which the CPU 11 can read the decryption information held in the decryption block 13. Specifically, although there is a path for the CPU 11 to fetch the program data decoded by the decoding circuit 132 between the CPU 11 and the decoding block 13, the decoding information held in the decoding block 13 can be read out. There is no possible route. Similarly, the decryption information temporarily existing in the interface circuit 14 cannot be physically read by the CPU 11. For this reason, even if the software debugging device is connected to the microcontroller 10, the decoding data and the area identification address existing in the interface circuit 14 and the decoding block 13, that is, the decoding information cannot be read out to the outside. The confidentiality of the decryption information is increased.

なお、以上の実施例において、外部のホスト20から受け取る復号情報として、復号化用データの代わりに、鍵データを受け取り、復号ブロック13がこれを用いて別途復号化アルゴリズムにより処理を行い、最終的に前記の復号化用データに相当するデータを生成し、これを使用して復号を行うようにしてもよい。   In the above embodiment, as decryption information received from the external host 20, key data is received instead of decryption data, and the decryption block 13 uses this to separately perform processing by a decryption algorithm, and finally Alternatively, data corresponding to the decoding data may be generated and used for decoding.

また、領域選択回路131内の各レジスタは、不揮発性メモリ等のその他の記憶手段でも代用できる。不揮発性メモリを使用するときは、電源投入時に毎回「復号化準備手順」の実行を行う必要がなくなり有益である。   Each register in the area selection circuit 131 can be replaced by other storage means such as a nonvolatile memory. When using a non-volatile memory, it is beneficial that the “decryption preparation procedure” need not be executed every time the power is turned on.

また、領域識別アドレスレジスタ群1313は、上位アドレスを指定する代わりに、開始アドレスと終了アドレスを指定して各領域を指定すれば、より細かく領域を分割することができ、復号情報の秘匿性がより高度となる。また、「復号化準備手順」の実行にCPU11を介在させても良い。但し、CPU11はIF回路14から復号情報を物理的に読み出せないように構成する。   Further, the area identification address register group 1313 can divide the area more finely by designating each area by designating the start address and the end address instead of designating the upper address, and the confidentiality of the decryption information is improved. Become more advanced. Further, the CPU 11 may be interposed in the execution of the “decoding preparation procedure”. However, the CPU 11 is configured so that the decoding information cannot be physically read from the IF circuit 14.

本発明の実施例のマイクロコントローラの構成を示すブロック図である。It is a block diagram which shows the structure of the microcontroller of the Example of this invention. 図1のマイクロコントローラ内の復号ブロックの構成を示すブロック図である。It is a block diagram which shows the structure of the decoding block in the microcontroller of FIG. 図2の復号ブロック内の領域選択回路の構成を示すブロック図である。FIG. 3 is a block diagram showing a configuration of a region selection circuit in the decoding block of FIG. 2. 図2の復号ブロック内の復号回路の構成を示すブロック図である。FIG. 3 is a block diagram showing a configuration of a decoding circuit in the decoding block of FIG. 2. 図1のマイクロコントローラ内の復号化準備完了フラグ回路の構成を示すブロック図である。FIG. 2 is a block diagram showing a configuration of a decoding preparation completion flag circuit in the microcontroller of FIG. 1. 復号化準備手順の処理のフローチャートである。It is a flowchart of a process of a decoding preparation procedure.

符号の説明Explanation of symbols

10:マイクロコントローラ
11:CPU
12:メモリ
13:復号ブロック、131:領域選択回路、132:復号回路
14:インターフェース回路
15:復号化準備完了フラグ回路
20:ホスト
10: Microcontroller 11: CPU
12: Memory 13: Decoding block 131: Region selection circuit 132: Decoding circuit 14: Interface circuit 15: Decoding preparation completion flag circuit 20: Host

Claims (5)

プログラムをその少なくとも一部は暗号化プログラムとして格納したメモリと、第1の経路を通じて前記メモリから読み出した前記プログラムを実行するCPUとを備えるマイクロコントローラにおいて、
前記暗号化プログラムを復号するために利用する復号情報を、前記第1の信号経路とは異なる第2の経路を通じて読み込み、且つ前記CPUから物理的に読み出し不可能に保持する記憶手段を有する復号ブロックを備え、該復号ブロックは、前記第1の経路を通じて前記メモリから読み出した前記暗号化プログラムを、前記記憶手段に保持した前記復号情報を利用して復号し、前記CPUに供給することを特徴とするマイクロコントローラ。
In a microcontroller comprising a memory in which at least a part of the program is stored as an encrypted program, and a CPU that executes the program read from the memory through a first path,
A decryption block having storage means for reading decryption information used for decrypting the encryption program through a second path different from the first signal path and physically retaining the decryption information from the CPU. The decryption block decrypts the encrypted program read from the memory through the first path using the decryption information held in the storage means, and supplies the decrypted program to the CPU. A microcontroller to do.
前記記憶手段への前記復号情報の格納が完了したときに、前記CPUから読み出し可能な復号化準備完了信号を生成する通知回路をさらに備えることを特徴とする請求項1に記載のマイクロコントローラ。   2. The microcontroller according to claim 1, further comprising a notification circuit that generates a decoding preparation completion signal readable from the CPU when the storage of the decoding information in the storage unit is completed. 前記第2の経路を通じて接続されたホストに対して、前記復号情報の送信を要求するとともに、前記ホストから前記復号情報を受け取り、前記復号ブロックに送るインターフェース回路をさらに備え、該インターフェース回路内の前記復号情報は前記CPUから物理的に読み出し不可能であることを特徴とする請求項1又は2に記載のマイクロコントローラ。   An interface circuit that requests the host connected through the second path to transmit the decoding information, receives the decoding information from the host, and sends the decoding information to the decoding block; 3. The microcontroller according to claim 1, wherein the decryption information is not physically readable from the CPU. 前記暗号化プログラムは、前記メモリの複数の領域のそれぞれに分割して格納され、
前記復号情報が、前記メモリの前記複数の領域のそれぞれに格納された前記暗号化プログラムを復号するために利用する領域復号情報と、該それぞれの領域を識別する領域識別情報とを含み、
前記記憶手段は、前記複数の領域のそれぞれの前記領域復号情報を保持する領域復号情報記憶手段と、前記複数の領域のそれぞれを指定する前記領域識別情報を保持する領域識別情報記憶手段とを有することを特徴とする請求項1乃至3のいずれか1つに記載のマイクロコントローラ。
The encryption program is divided and stored in each of the plurality of areas of the memory,
The decryption information includes region decryption information used for decrypting the encryption program stored in each of the plurality of regions of the memory, and region identification information for identifying the respective regions;
The storage means includes area decoding information storage means for holding the area decoding information for each of the plurality of areas, and area identification information storage means for holding the area identification information for designating each of the plurality of areas. The microcontroller according to any one of claims 1 to 3.
前記メモリは前記CPUと同一の半導体集積回路内に設けられており、前記第2の経路は、前記半導体集積回路外からの信号を受信する外部端子を通じた経路であることを特徴とする請求項1乃至4のいずれか1つに記載のマイクロコントローラ。   The memory is provided in the same semiconductor integrated circuit as the CPU, and the second path is a path through an external terminal for receiving a signal from outside the semiconductor integrated circuit. The microcontroller according to any one of 1 to 4.
JP2007055961A 2007-03-06 2007-03-06 Microcontroller Withdrawn JP2008217579A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2007055961A JP2008217579A (en) 2007-03-06 2007-03-06 Microcontroller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2007055961A JP2008217579A (en) 2007-03-06 2007-03-06 Microcontroller

Publications (1)

Publication Number Publication Date
JP2008217579A true JP2008217579A (en) 2008-09-18

Family

ID=39837527

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2007055961A Withdrawn JP2008217579A (en) 2007-03-06 2007-03-06 Microcontroller

Country Status (1)

Country Link
JP (1) JP2008217579A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9846788B2 (en) 2013-06-28 2017-12-19 Renesas Electronics Corporation Semiconductor integrated circuit and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9846788B2 (en) 2013-06-28 2017-12-19 Renesas Electronics Corporation Semiconductor integrated circuit and system
US10216964B2 (en) 2013-06-28 2019-02-26 Renesas Electronics Corporation Semiconductor integrated circuit and system

Similar Documents

Publication Publication Date Title
JP5984625B2 (en) Semiconductor device and encryption key writing method
TWI715619B (en) Processor, method and system for hardware enforced one-way cryptography
US9100187B2 (en) Authenticator
JP2008530663A (en) Microprocessor data security method and system
JP2005316284A (en) Portable terminal and data security system
US7076667B1 (en) Storage device having secure test process
JPH08305558A (en) Ciphering program arithmetic unit
US9727755B2 (en) Processing information
JP2006085676A (en) Encryption instruction processing apparatus
TWI662474B (en) Method and apparatus for performing firmware programming on microcontroller chip, and associated microcontroller chip
JP4591163B2 (en) Bus access control device
CN112384922B (en) Encryption key distribution
US20100031088A1 (en) Method and system for processing information
JP2007072957A (en) Read/write device and debugging system
JP2006146608A (en) Memory information protection system and method
JP2008217579A (en) Microcontroller
JP4592337B2 (en) Data storage
CN110909318B (en) Operating system anti-theft method and device for user equipment and terminal
JP2008181375A (en) Semiconductor storage device
JP2003091240A (en) Method for managing enciphered information
JP2004326335A (en) Ic card and encryption processing system
US20030233560A1 (en) Method for protecting program in microcomputer
KR20150145870A (en) Semiconductor device for protecting data per channel
JP2007043345A (en) Communication device and processing method in it
CN117852105A (en) Chip security management method, device, terminal and medium based on hardware enhancement

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20100511