JP2007310601A - Microcomputer and method for protecting its software - Google Patents

Microcomputer and method for protecting its software Download PDF

Info

Publication number
JP2007310601A
JP2007310601A JP2006138374A JP2006138374A JP2007310601A JP 2007310601 A JP2007310601 A JP 2007310601A JP 2006138374 A JP2006138374 A JP 2006138374A JP 2006138374 A JP2006138374 A JP 2006138374A JP 2007310601 A JP2007310601 A JP 2007310601A
Authority
JP
Japan
Prior art keywords
secure area
microcomputer
information
secure
register
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
JP2006138374A
Other languages
Japanese (ja)
Inventor
Takashi Matsumoto
貴士 松本
Toru Owada
徹 大和田
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.)
Renesas Technology Corp
Original Assignee
Renesas Technology Corp
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 Renesas Technology Corp filed Critical Renesas Technology Corp
Priority to JP2006138374A priority Critical patent/JP2007310601A/en
Publication of JP2007310601A publication Critical patent/JP2007310601A/en
Withdrawn legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a microcomputer that enables software being executed by the microcomputer or intermediate information created by the software to be safely saved in a memory area outside the microcomputer without having to modify the software and to be rewritten from the outside memory area. <P>SOLUTION: The microcomputer has a CPU, an internal memory, and a secure area determining part 101. The secure area determining part 101 has a secure area range setting register 111, a secure area validating register 110, an address determining part 113, and a secure area flag control part 115 for determining authority to access a secure area based on the result of the determination by the address determining part 113, a command from a bus, and the information of the secure area validating register and for outputting a secure area flag 120 reporting the result of the determination. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、マイクロコンピュータに関し、特に、マイクロコンピュータ上で実行中のソフトウェアやソフトウェアが使用している処理過程で生成された中間データを保護する技術に関するものである。   The present invention relates to a microcomputer, and more particularly to a technique for protecting software running on a microcomputer and intermediate data generated in a process used by the software.

近年、ネットワーク環境のブロードバンド化に伴い、多種多様な情報がネットワークから入手可能になり、また、デジタルコンテンツの視聴、入手が容易になるなど、ネットワーク上を流通する情報の重要性、および、利便性が増大している。   In recent years, as the network environment has become broadband, a wide variety of information has become available from the network, and it has become easier to view and obtain digital content, and the importance and convenience of information distributed on the network. Has increased.

また、ストレージの記録密度向上や小型化に伴い、ハードディスク(以下、HDDと呼ぶ)レコーダや携帯型音楽プレイヤ、携帯電話といったパーソナルコンピュータ(以下、PCと呼ぶ)以外の情報家電と呼ばれる組み込み機器にも大量のデジタルデータが保存できるようになった。   In addition, as storage recording density increases and miniaturization, embedded devices called information home appliances other than personal computers (hereinafter referred to as PCs) such as hard disk (hereinafter referred to as HDD) recorders, portable music players, and mobile phones are also included. A large amount of digital data can be saved.

一方、ノート型PCの紛失、盗難による個人情報流出、デジタルコンテンツの不正な複製などがマスメディアで大きく取り上げられ、情報セキュリティ技術の重要性が高まっている。情報セキュリティ技術の基盤となるのは暗号技術であり、ネットワークの世界では特定の相手と安全な通信の実現、および、情報の不正使用防止を主目的に利用される。   On the other hand, loss of notebook PCs, leakage of personal information due to theft, illegal duplication of digital contents, etc. are widely taken up by mass media, and the importance of information security technology is increasing. The basis of information security technology is cryptographic technology, which is used mainly in the network world for the realization of secure communication with specific parties and the prevention of unauthorized use of information.

前述のとおり、組み込み機器ではネットワーク機能やデジタルデータの処理機能の搭載が進展しており、それと共に、暗号処理をはじめとした情報セキュリティ技術への要求も高まっている。暗号処理を実現するためには、暗号処理専用のハードウェアによる実現とソフトウェアによる実現の二通りが大まかに考えられる。価格競争が激しい情報家電をはじめとする組み込み機器では製品開発、生産時の低コスト化が重要な要素であり、一般的に、暗号処理性能面ではハードウェアが優位であるが、チップサイズや適合するチップが世の中に存在しない場合の専用品開発に伴う投資額など製品コストが増加する傾向にあるため、ソフトウェア実装が採用される場合も多い。   As described above, built-in devices have been equipped with network functions and digital data processing functions, and at the same time, there has been an increasing demand for information security technologies including cryptographic processing. In order to realize the cryptographic processing, there are roughly two ways: realization by hardware dedicated to cryptographic processing and realization by software. For embedded devices such as information appliances where price competition is intense, product development and cost reduction during production are important factors. Generally, hardware is superior in terms of cryptographic processing performance. Since there is a tendency for product costs to increase, such as the amount of investment associated with the development of dedicated products when there is no chip to be used in the world, software implementation is often adopted.

しかしながら、ソフトウェアはハードウェアに比べてセキュリティ面での強度が低いとされる。これは、ハードウェアはチップ内で秘密裏に処理が実行可能であり解析には高価な装置や高度な知識が必要であるのに対し、ソフトウェアではマイクロコンピュータの主記憶として使用されるSDRAM等チップ外のメモリに情報が格納されるため、その情報が盗聴される危険性が高いこと、また、ソフトウェアのオブジェクトプログラム自身を逆アセンブラなどを用いてソースプログラムに逆変換するなど、エンドユーザにより比較的容易に実行可能な解析手法がハードウェアに比べて多数存在するためである。   However, software is considered less secure in terms of security than hardware. This is because hardware can be processed secretly in the chip and expensive equipment and advanced knowledge are required for analysis, whereas in software chips such as SDRAM used as the main memory of a microcomputer Since information is stored in an external memory, there is a high risk that the information will be wiretapped, and the software object program itself is converted back into a source program using a disassembler, etc. This is because there are many analysis methods that can be easily executed compared to hardware.

このような問題に対し、従来では、ソフトウェアプログラムの難読化と呼ばれる技術を適用し、例えばプログラムのロジックを複雑にすることで逆解析の難度を上げる、さらには、プログラム自身の暗号化により逆アセンブラ等の使用では解析できないようにする等、いわゆる、ソフトウェアの耐タンパ性の向上が図られている。   Conventionally, a technique called obfuscation of a software program is applied to such a problem, for example, the difficulty of reverse analysis is increased by complicating the logic of the program, and further, the disassembler is realized by encrypting the program itself. The so-called tamper resistance of software has been improved, for example, so that the analysis cannot be performed by using it.

また、特開2001−230770号公報(特許文献1)では、プログラム自身を暗号化すると共に、そのプログラムの実行時にはマイクロコンピュータ内部で復号し、復号して得られた情報はマイクロコンピュータ外部に出力しないような機構を具備することで、秘密情報がマイクロコンピュータ外部に暴露することを防いでいる。また、中央演算処理装置(以下、CPU)が実行中のプロセスを切り替える必要がある場合、CPUが演算に使用しているデータ(コンテキスト)は暗号化して外部メモリに出力する手段、そのコンテキストを書き戻す際の復号手段を備えることで、ソフトウェア実行時の秘密情報の安全な出力を実現している。
特開2001−230770号公報
Japanese Patent Laid-Open No. 2001-230770 (Patent Document 1) encrypts the program itself, decrypts it inside the microcomputer when the program is executed, and does not output the information obtained by the decryption outside the microcomputer. By providing such a mechanism, confidential information is prevented from being exposed outside the microcomputer. In addition, when it is necessary to switch the process being executed by the central processing unit (hereinafter referred to as CPU), the data (context) used by the CPU for encryption is encrypted and output to an external memory, and the context is written. By providing decryption means for returning, safe output of secret information during software execution is realized.
JP 2001-230770 A

組み込み機器に搭載されるマイクロコンピュータは、PC向けのプロセッサに比べて、演算性能、および、マイクロコンピュータ内部に搭載するメモリ容量が小さい。また、暗号処理ソフトウェアは一般的なソフトウェアと比較して多くの演算が必要なため、組み込み機器では暗号処理の高速化が重要となる。暗号処理性能向上のための一例としては、暗号処理の演算過程で生成した再利用可能な中間情報などは消去せずにメモリ上に保持しておくことで、再度演算するときに必要な時間を削減するという手法がある。   A microcomputer mounted on an embedded device has a smaller calculation performance and a memory capacity mounted inside the microcomputer than a processor for a PC. In addition, since cryptographic processing software requires more operations than general software, it is important to speed up cryptographic processing in embedded devices. As an example for improving the cryptographic processing performance, reusable intermediate information generated in the cryptographic processing calculation process is stored in the memory without being erased, so that the time required for the calculation can be reduced. There is a technique to reduce.

耐タンパ性向上の観点から、暗号処理等秘密情報を扱うソフトウェアプログラム、および、そのプログラムが生成する秘密情報を含む中間情報は、マイクロコンピュータ内部のメモリ上に保持することが必要である。   From the viewpoint of improving tamper resistance, it is necessary to store a software program that handles secret information such as cryptographic processing and intermediate information including secret information generated by the program in a memory inside the microcomputer.

しかしながら、組み込み機器向けマイクロコンピュータはマイクロコンピュータ内部に搭載するメモリ容量が限られており、暗号処理過程で生成した中間情報を保持しておくことが難しい場合があり、結果、暗号処理性能の向上が困難になる場合があるという課題があった。   However, the microcomputer for embedded devices has a limited memory capacity mounted inside the microcomputer, and it may be difficult to retain intermediate information generated during the cryptographic process, resulting in improved cryptographic processing performance. There was a problem that it might be difficult.

そこで、本発明の目的は、マイクロコンピュータで実行中のソフトウェアおよびソフトウェアにより生成された中間情報を、ソフトウェアの改変なしに安全にマイクロコンピュータ外部のメモリ領域へ退避、および外部メモリ領域からの書き戻しすることができるマイクロコンピュータを提供することにある。   SUMMARY OF THE INVENTION Accordingly, an object of the present invention is to safely save software written in the microcomputer and intermediate information generated by the software to a memory area outside the microcomputer without modifying the software, and write back from the external memory area. An object of the present invention is to provide a microcomputer that can be used.

本願において開示される発明のうち、代表的なものの概要を簡単に説明すれば、次のとおりである。   Of the inventions disclosed in the present application, the outline of typical ones will be briefly described as follows.

本発明によるマイクロコンピュータは、中央演算処理装置と、情報格納用の内部メモリと、内部メモリ内に設定される秘密情報格納用のセキュア領域へのアクセスの判定を行うセキュア領域判定部とを備え、セキュア領域判定部は、セキュア領域のセキュア領域範囲を設定するセキュア領域範囲設定レジスタと、セキュア領域の有効または無効を設定するセキュア領域有効レジスタと、セキュア領域判定部が接続されたバスからアドレスを取得し、そのアドレスに基づいて、セキュア領域へのアクセスであるかを判定するアドレス判定部と、アドレス判定部による判定結果、バスからのコマンド、およびセキュア領域有効レジスタの情報に基づいて、セキュア領域へのアクセス権限を判定し、その判定結果を通知するセキュア領域フラグを出力するセキュア領域フラグ制御部とを有するものである。   A microcomputer according to the present invention includes a central processing unit, an internal memory for storing information, and a secure area determining unit that determines access to a secure area for storing secret information set in the internal memory, The secure area determination unit obtains an address from the secure area range setting register that sets the secure area range of the secure area, the secure area valid register that sets whether the secure area is valid or invalid, and the bus to which the secure area determination unit is connected Then, based on the address, the address determination unit that determines whether the access is to the secure area, the determination result by the address determination unit, the command from the bus, and the secure area valid register information to the secure area Determines the access authority of the user, and issues a secure area flag to notify the determination result. Those having a secure area flag control unit for.

また、本発明によるマイクロコンピュータのソフトウェア保護方法は、中央演算処理装置と、情報格納用の内部メモリとを備えたマイクロコンピュータのソフトウェア保護方法であって、セキュア領域範囲設定レジスタおよびセキュア領域有効レジスタにより、セキュア領域のセキュア領域範囲およびセキュア領域の有効または無効を設定し、マイクロコンピュータ内のバスからアドレスを取得し、そのアドレスに基づいて、セキュア領域へのアクセスであるかを判定し、その判定結果、バスからのコマンド、およびセキュア領域有効レジスタの情報に基づいて、セキュア領域へのアクセス権限を判定し、その判定結果を通知するセキュア領域フラグをセキュア領域信号として中央演算処理装置の外部に出力するものである。   A microcomputer software protection method according to the present invention is a microcomputer software protection method including a central processing unit and an internal memory for storing information, and includes a secure area range setting register and a secure area valid register. Set the secure area range of the secure area and the validity or invalidity of the secure area, obtain the address from the bus in the microcomputer, determine whether the access is to the secure area based on the address, and the determination result The access authority to the secure area is determined based on the command from the bus and the secure area valid register information, and the secure area flag for notifying the determination result is output as a secure area signal to the outside of the central processing unit. Is.

本願において開示される発明のうち、代表的なものによって得られる効果を簡単に説明すれば以下のとおりである。   Among the inventions disclosed in the present application, effects obtained by typical ones will be briefly described as follows.

本発明によれば、マイクロコンピュータで実行中のソフトウェアおよびソフトウェアにより生成された中間情報を、ソフトウェアの改変なしにハードウェアのみで安全にマイクロコンピュータ外部のメモリ領域へ退避、および外部メモリ領域からの書き戻しすることが可能となる。   According to the present invention, software running on a microcomputer and intermediate information generated by the software can be safely saved to a memory area outside the microcomputer only by hardware without modification of the software, and can be written from the external memory area. It can be returned.

また、外部メモリに出力する全データを暗号化するのではなく、暗号化が必要なデータのみを暗号化処理することにより、暗号処理によるマイクロコンピュータ−外部メモリ間の転送性能劣化を低減することが可能となる。   Also, it is possible to reduce deterioration in transfer performance between the microcomputer and the external memory due to the encryption process by encrypting only the data that needs to be encrypted instead of encrypting all the data output to the external memory. It becomes possible.

以下、本発明の実施の形態を図面に基づいて詳細に説明する。なお、実施の形態を説明するための全図において、同一の部材には原則として同一の符号を付し、その繰り返しの説明は省略する。   Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. Note that components having the same function are denoted by the same reference symbols throughout the drawings for describing the embodiment, and the repetitive description thereof will be omitted.

<マイクロコンピュータの構成>
図1〜図5により、本発明の一実施の形態に係るマイクロコンピュータの構成について説明する。図1は本発明の一実施の形態に係るマイクロコンピュータのCPU内のセキュア領域判定部の構成を示す図、図2は本発明の一実施の形態に係るマイクロコンピュータのメモリ領域を示す図、図3は本発明の一実施の形態に係るマイクロコンピュータの全体構成を示す図、図4は本発明の一実施の形態に係るマイクロコンピュータのバスブリッジの構成を示す図であり、バスブリッジ内のセキュア領域の制御に係わる部分、および、暗号処理部の構成を示したものである。図5は本発明の一実施の形態に係るマイクロコンピュータのバスブリッジ内のセキュア領域判定部の構成を示す図である。
<Microcomputer configuration>
A configuration of a microcomputer according to an embodiment of the present invention will be described with reference to FIGS. FIG. 1 is a diagram showing a configuration of a secure area determination unit in a CPU of a microcomputer according to an embodiment of the present invention. FIG. 2 is a diagram showing a memory area of the microcomputer according to an embodiment of the present invention. 3 is a diagram showing the overall configuration of the microcomputer according to the embodiment of the present invention, and FIG. 4 is a diagram showing the configuration of the bus bridge of the microcomputer according to the embodiment of the present invention. 2 shows a configuration relating to an area control and an encryption processing section. FIG. 5 is a diagram showing the configuration of the secure area determination unit in the bus bridge of the microcomputer according to the embodiment of the present invention.

図1において、セキュア領域判定部101は、セキュア領域へのアクセス判定、および、外部メモリ領域への転送時の暗号化処理の有無、外部メモリ領域からの転送時の復号処理の有無を判定するものであり、正論理(信号の有効時に1、無効時に0)で記載しており、以下全図を正論理で記載する。   In FIG. 1, a secure area determination unit 101 determines access to a secure area, presence / absence of encryption processing at the time of transfer to the external memory area, and presence / absence of decryption processing at the time of transfer from the external memory area. And is described in positive logic (1 when the signal is valid, 0 when the signal is invalid).

セキュア領域有効レジスタ110はセキュア領域の有効/無効を示し、本設定が有効な場合のみセキュア領域が有効となり、セキュア領域フラグ制御部115が動作する。   The secure area valid register 110 indicates whether the secure area is valid / invalid. The secure area is valid only when this setting is valid, and the secure area flag control unit 115 operates.

このセキュア領域は、図2(a)に示すように、マイクロコンピュータの内部メモリ領域に設定され、内部メモリ内において、任意の容量を設定可能である。   As shown in FIG. 2A, the secure area is set in an internal memory area of the microcomputer, and an arbitrary capacity can be set in the internal memory.

また、セキュア領域内のデータは、CPU内部の演算器が演算時に使用するレジスタ、および、図2(b)に示すように、マイクロコンピュータに接続された外部メモリ領域へ暗号化して出力する場合のみセキュア領域からの転送を許可する設定とし、セキュア領域以外の内部メモリ領域への転送は許可しない。   The data in the secure area is only output when encrypted and output to the register used by the arithmetic unit in the CPU and the external memory area connected to the microcomputer as shown in FIG. 2B. It is set to permit transfer from the secure area, and transfer to an internal memory area other than the secure area is not permitted.

セキュア領域範囲設定レジスタ111は、内部メモリ内のセキュア領域を設定するレジスタであり、ユーザにより可変である。ただし、設定可能なセキュア領域は、アドレスマップ112に定義されているマイクロコンピュータでユーザが使用可能な内部メモリ領域を超えない範囲とする。   The secure area range setting register 111 is a register that sets a secure area in the internal memory, and is variable by the user. However, the secure area that can be set is a range that does not exceed the internal memory area that can be used by the user in the microcomputer defined in the address map 112.

アドレス判定部113は、セキュア領域判定部101が接続されたバスからアドレスを取得し、セキュア領域範囲設定レジスタ111、および、アドレスマップ112の値を参照して、セキュア領域、セキュア領域以外の内部メモリ領域、外部メモリ領域などその他領域のうちのどの領域であるかを判別してセキュア領域フラグ制御部115に対してその領域情報を送信する。   The address determination unit 113 acquires an address from the bus to which the secure area determination unit 101 is connected, refers to the values of the secure area range setting register 111 and the address map 112, and stores the internal memory other than the secure area and the secure area The other area such as the area and the external memory area is determined and the area information is transmitted to the secure area flag control unit 115.

セキュア領域フラグ制御部115は、セキュア領域有効レジスタ110の設定が有効な場合、アドレス判定部113からの領域情報、および、セキュア領域判定部101が接続されたバスからコマンド(リード/ライト)情報により、セキュア領域フラグの有効/無効、および、アクセス違反を判定する。セキュア領域へのアクセスが有効であればセキュア領域フラグ120を有効とし、アクセス違反があればエラーフラグ121を有効にする。   When the setting of the secure area valid register 110 is valid, the secure area flag control unit 115 uses the area information from the address determination unit 113 and the command (read / write) information from the bus to which the secure area determination unit 101 is connected. The validity / invalidity of the secure area flag and the access violation are determined. If the access to the secure area is valid, the secure area flag 120 is validated, and if there is an access violation, the error flag 121 is validated.

セキュア領域フラグレジスタ116は、セキュア領域フラグを元信号とする信号で、CPU内部の演算器が使用するレジスタにフラグとして追加する。セキュア領域フラグレジスタは、CPU内の演算器が使用するデータがセキュア領域内のデータであるか否かを示す。セキュア領域フラグレジスタが有効である場合、同レジスタ内に格納されたデータは、セキュア領域内に格納されたデータと同じ扱いを受ける。   The secure area flag register 116 is a signal having the secure area flag as an original signal, and is added as a flag to a register used by an arithmetic unit inside the CPU. The secure area flag register indicates whether the data used by the arithmetic unit in the CPU is data in the secure area. When the secure area flag register is valid, the data stored in the register is treated the same as the data stored in the secure area.

セキュア領域フラグクリア114は、セキュア領域フラグに係わる処理が終了したときに有効となり、セキュア領域フラグ制御部の内部状態をクリアする。すなわち、セキュア領域フラグクリアにより、セキュア領域フラグはクリアされる。   The secure area flag clear 114 becomes effective when processing related to the secure area flag is completed, and clears the internal state of the secure area flag control unit. That is, the secure area flag is cleared by clearing the secure area flag.

また、図3において、マイクロコンピュータ201は、CPU212、キャッシュ213、バスブリッジ214、内部メモリ215、外部バスコントローラ221、DMAコントローラ222、周辺バスコントローラ223、クロック生成器224、タイマ225、割り込みコントローラ226、I/Oコントローラ227、CPUバス211、内部バス220などから構成されている。また、マイクロコンピュータ201は、外部バス230を介して、外部メモリ231、外部デバイス232と接続されている。   In FIG. 3, the microcomputer 201 includes a CPU 212, a cache 213, a bus bridge 214, an internal memory 215, an external bus controller 221, a DMA controller 222, a peripheral bus controller 223, a clock generator 224, a timer 225, an interrupt controller 226, It is composed of an I / O controller 227, a CPU bus 211, an internal bus 220, and the like. The microcomputer 201 is connected to the external memory 231 and the external device 232 via the external bus 230.

図1に示すセキュア領域判定部101はCPU212に内蔵され、CPUバス211上のアドレス、コマンドを取得可能な位置(例えば、CPU212内部のCPUバス211とのインタフェース部)に接続され、CPU212から内部メモリ215に確保されたセキュア領域へのアクセス制御を行う。   A secure area determination unit 101 shown in FIG. 1 is built in the CPU 212 and is connected to an address on the CPU bus 211 and a position where a command can be acquired (for example, an interface unit with the CPU bus 211 in the CPU 212). Access control to the secure area secured in 215 is performed.

セキュア領域判定部101から出力されるセキュア領域信号130はCPU212とバスブリッジ214、DMA用セキュア領域信号240はバスブリッジ214とDMA(ダイレクトメモリアクセス)コントローラ222との間に接続する。   The secure area signal 130 output from the secure area determination unit 101 is connected between the CPU 212 and the bus bridge 214, and the DMA secure area signal 240 is connected between the bus bridge 214 and the DMA (direct memory access) controller 222.

この接続は、専用のバスなどを使用して接続し、セキュア領域信号130およびDMA用セキュア領域信号240は、他の信号とは別に独立してやり取りできるようにしている。なお、専用のバスなどではなく、通常使用されるCPUバス211や内部バス220を使用してセキュア領域信号130およびDMA用セキュア領域信号240をやり取りすることも可能である。   This connection is made by using a dedicated bus or the like, and the secure area signal 130 and the DMA secure area signal 240 can be exchanged independently of other signals. It is also possible to exchange the secure area signal 130 and the DMA secure area signal 240 using the CPU bus 211 and the internal bus 220 that are normally used instead of a dedicated bus or the like.

バスブリッジ214は、CPUバス211と内部バス220の通信プロトコル変換、およびアクセス権の調整等の機能を持つ。   The bus bridge 214 has functions such as communication protocol conversion between the CPU bus 211 and the internal bus 220, and access right adjustment.

また、図4において、セキュア領域判定部301は、図1に示すセキュア領域判定部101と同等の機能を有するが、CPU212内の演算用レジスタとは無関係であるため、図5に示すように図1の機能を削減したしたものを搭載する。   4, the secure area determination unit 301 has a function equivalent to that of the secure area determination unit 101 illustrated in FIG. 1, but is not related to the calculation register in the CPU 212. It is equipped with a reduced version of function 1.

セキュア領域信号入出力制御部302は、CPUバス211側からの転送時にセキュア領域信号130を入力して暗号化指示信号320へ伝送し、内部バス側からの転送時には、復号指示信号321の情報をセキュア領域信号130へ伝送する。   The secure area signal input / output control unit 302 inputs the secure area signal 130 at the time of transfer from the CPU bus 211 side and transmits it to the encryption instruction signal 320, and at the time of transfer from the internal bus side, the information of the decryption instruction signal 321 is received. Transmit to the secure area signal 130.

暗号処理部304はセキュア領域信号130を元信号とする暗号化指示信号有効時に暗号化、復号指示信号321が有効時に復号処理を行う。   The encryption processing unit 304 performs encryption when the encryption instruction signal based on the secure area signal 130 is valid, and performs decryption processing when the decryption instruction signal 321 is valid.

スイッチ305は暗号化指示信号320が有効の場合には暗号処理部からの暗号化データを内部バス側へ転送し、復号指示信号321が有効の場合には内部バス側から暗号処理部へデータを転送する。暗号化指示信号320、復号指示信号321がともに無効の場合には、暗号処理部を通過しない経路でデータを転送する。   The switch 305 transfers the encrypted data from the encryption processing unit to the internal bus side when the encryption instruction signal 320 is valid, and transfers the data from the internal bus side to the encryption processing unit when the decryption instruction signal 321 is valid. Forward. When both the encryption instruction signal 320 and the decryption instruction signal 321 are invalid, the data is transferred through a path that does not pass through the encryption processing unit.

暗号化データ転送先判定部307および暗号化データ転送先記憶部308は、暗号化したデータの転送先アドレスを記憶しておき、暗号化データをCPU演算用レジスタ、および、セキュア領域への書き戻す場合の復号処理の有無の判定に使用する。   The encrypted data transfer destination determination unit 307 and the encrypted data transfer destination storage unit 308 store the transfer destination address of the encrypted data, and write the encrypted data back to the CPU arithmetic register and secure area. It is used to determine whether or not there is a decoding process.

また、暗号化データ転送先判定部307および暗号化データ転送先記憶部308は、常にアドレスの判定を行い、暗号化データ転送先記憶部に格納されているアドレスに対して、暗号化を施さない通常の書き込み、すなわちセキュア領域内に格納していたデータが破棄された場合には、暗号化データ転送先記憶部に記載された該当アドレスを消去する。   In addition, the encrypted data transfer destination determination unit 307 and the encrypted data transfer destination storage unit 308 always determine an address, and do not perform encryption on the address stored in the encrypted data transfer destination storage unit. When normal writing, that is, when data stored in the secure area is discarded, the corresponding address written in the encrypted data transfer destination storage unit is erased.

<マイクロコンピュータの動作>
次に、図6〜10により、本発明の一実施の形態に係るマイクロコンピュータの動作について説明する。図6〜図8は本発明の一実施の形態に係るマイクロコンピュータのCPUによるデータ転送時の制御動作を示すフローチャート、図9および図10は本発明の一実施の形態に係るマイクロコンピュータのダイレクトメモリアクセスコントローラによるデータ転送時の制御動作を示すフローチャートである。
<Operation of microcomputer>
Next, the operation of the microcomputer according to the embodiment of the present invention will be described with reference to FIGS. 6 to 8 are flowcharts showing the control operation during data transfer by the CPU of the microcomputer according to the embodiment of the present invention. FIGS. 9 and 10 are direct memories of the microcomputer according to the embodiment of the present invention. It is a flowchart which shows the control action at the time of the data transfer by an access controller.

まず、CPU212による内部メモリ領域からCPU演算用レジスタへのリード時の制御動作としては、図6に示すように、CPU212によるCPU演算用レジスタへのリード要求が発生した場合(ステップ501)、セキュア領域フラグ制御部115はセキュア領域からのリードであるかを判定する(ステップ502)。   First, as a control operation when the CPU 212 reads from the internal memory area to the CPU calculation register, as shown in FIG. 6, when a read request to the CPU calculation register is generated by the CPU 212 (step 501), the secure area The flag control unit 115 determines whether the read is from the secure area (step 502).

そして、セキュア領域以外からのリード要求であれば通常のリード処理を実行し(ステップ503)、セキュア領域からのリード要求である場合にはセキュア領域フラグを有効にし(ステップ504)、その結果、リードしたデータが格納される演算用レジスタのセキュア領域フラグレジスタ116が有効になる(ステップ505)。   If the read request is from a non-secure area, normal read processing is executed (step 503). If the read request is from the secure area, the secure area flag is validated (step 504). The secure area flag register 116 of the operation register in which the processed data is stored is validated (step 505).

その後、セキュア領域からのリードデータが演算用レジスタに格納され(ステップ506)、そのリードデータに対して演算が発生する場合には(ステップ507)、演算結果の格納先レジスタに対しても、セキュア領域フラグレジスタを有効にする。   Thereafter, the read data from the secure area is stored in the calculation register (step 506), and when an operation occurs on the read data (step 507), the calculation result storage destination register is also secured. Enable the region flag register.

演算終了後、セキュア領域フラグクリア114を有効にすることでセキュア領域フラグ制御部115の内部状態が初期化される(ステップ508)。   After the calculation, the secure area flag control unit 115 is initialized by enabling the secure area flag clear 114 (step 508).

このとき、セキュア領域フラグレジスタ116の値はクリアされず、演算用レジスタに格納されたデータが破棄、もしくは、上書きされるまで保持される。   At this time, the value of the secure area flag register 116 is not cleared, and is retained until the data stored in the arithmetic register is discarded or overwritten.

このように、本実施の形態では、セキュア領域内に格納されたデータには、データが破棄されるまでセキュア領域内のデータであることを示す情報を付加することで、セキュア領域内のデータの保護を実現する。   As described above, in this embodiment, the data stored in the secure area is appended with information indicating that the data is in the secure area until the data is discarded. Realize protection.

また、CPU212によるCPU演算用レジスタに格納したデータのライト時の制御動作としては、図7に示すように、CPU212によるCPU演算用レジスタ格納データのライト要求が発生した場合(ステップ601)、セキュア領域フラグ制御部115はライトするデータが格納された演算用レジスタのセキュア領域フラグレジスタ116をチェックする(ステップ602)。   Further, as a control operation at the time of writing data stored in the CPU calculation register by the CPU 212, as shown in FIG. 7, when a write request for the CPU calculation register storage data is generated by the CPU 212 (step 601), the secure area The flag control unit 115 checks the secure area flag register 116 of the calculation register in which the data to be written is stored (step 602).

そして、セキュア領域フラグレジスタ116が無効であれば、通常ライトとして処理し(ステップ603)、セキュア領域フラグレジスタ116が有効であれば、ライト先アドレスが内部アドレス領域であるかを判定する(ステップ604)。   If the secure area flag register 116 is invalid, it is processed as a normal write (step 603). If the secure area flag register 116 is valid, it is determined whether the write destination address is an internal address area (step 604). ).

ライト先アドレスが内部アドレス領域である場合には、セキュア領域であるかを判定し(ステップ605)、セキュア領域である場合には、セキュア領域フラグを有効にする(ステップ607)。   If the write destination address is an internal address area, it is determined whether it is a secure area (step 605), and if it is a secure area, the secure area flag is validated (step 607).

セキュア領域でない場合には、セキュア領域フラグレジスタが有効のデータ、すなわち、セキュア領域内のデータはセキュア領域以外の内部メモリ領域へのアクセスは禁止であるため、エラーフラグ121を有効にしてエラー処理を実行する(ステップ606)。   If it is not a secure area, data for which the secure area flag register is valid, that is, data in the secure area is prohibited to access an internal memory area other than the secure area. Execute (step 606).

ここで述べたエラー処理とは、アクセス権のないメモリ領域へのアクセス違反、存在しないメモリ領域を指定したことによる違反など、通常のマイクロコンピュータが実行可能な処理でよい。   The error processing described here may be processing that can be executed by a normal microcomputer, such as an access violation to a memory area without access right or a violation caused by specifying a memory area that does not exist.

ステップ604の判定で内部アドレス空間でない場合には、セキュア領域フラグを有効にする(ステップ607)。ステップ607によりセキュア領域信号130が有効となり(ステップ608)、CPU212はCPU演算用レジスタに格納したデータをバスブリッジ214に対してライト処理を行う(ステップ609)。バスブリッジ214よりデータの受信完了、すなわちCPU212によるライト処理の完了を示す信号を受信すると(ステップ610)、セキュア領域フラグクリア114を有効にすることでセキュア領域フラグ制御部115の内部状態が初期化し(ステップ611)、セキュア領域信号130を無効にする(ステップ612)。   If the internal address space is not determined in step 604, the secure area flag is validated (step 607). In step 607, the secure area signal 130 is validated (step 608), and the CPU 212 writes the data stored in the CPU calculation register to the bus bridge 214 (step 609). When a signal indicating completion of data reception, that is, completion of write processing by the CPU 212 is received from the bus bridge 214 (step 610), the secure area flag clear unit 114 is enabled to initialize the internal state of the secure area flag control unit 115. (Step 611), the secure area signal 130 is invalidated (Step 612).

バスブリッジ214は、セキュア領域フラグが有効な状態でデータを受信したため、そのデータを暗号処理部304で暗号化して内部バス側に転送するとともに、暗号化データ転送先記憶部308に暗号化データの転送先アドレスを記憶する。   Since the bus bridge 214 received the data with the secure area flag being valid, the data is encrypted by the encryption processing unit 304 and transferred to the internal bus side, and the encrypted data transfer destination storage unit 308 stores the encrypted data. Store the forwarding address.

また、CPU212による外部メモリ空間からCPU演算用レジスタへのリード時の制御動作としては、図8に示すように、CPU212からのリード要求は、図6に示すステップ502で前述したようにCPU内のセキュア領域判定部101はセキュア領域からのリード要求以外は通常リードとして処理する。この時、セキュア領域に係わる処理は図4に示したバスブリッジ214内で実行される。   In addition, as shown in FIG. 8, as a control operation when the CPU 212 reads from the external memory space to the CPU calculation register, the read request from the CPU 212 is performed in the CPU as described above in step 502 shown in FIG. The secure area determination unit 101 processes a read request other than a read request from the secure area. At this time, the processing related to the secure area is executed in the bus bridge 214 shown in FIG.

CPU212からバスブリッジ214に対して外部メモリからCPU演算用レジスタへのリード要求が発生すると(ステップ701)、暗号化データ転送先判定部307および暗号化データ転送先記憶部308はCPU212が要求しているリード元アドレスが暗号処理部304により暗号化後転送したデータであるかを判定する(ステップ702)。   When a read request from the external memory to the CPU calculation register is generated from the CPU 212 to the bus bridge 214 (step 701), the CPU 212 requests the encrypted data transfer destination determination unit 307 and the encrypted data transfer destination storage unit 308. It is determined whether the read source address is the data transferred after encryption by the encryption processing unit 304 (step 702).

ステップ702での判定の結果、暗号化データ転送先記憶部308に格納していないアドレスである、すなわち、セキュア領域以外の領域のデータであれば通常のリード処理として実行する(ステップ703)。   If the result of determination in step 702 is an address that is not stored in the encrypted data transfer destination storage unit 308, that is, data in an area other than the secure area, it is executed as normal read processing (step 703).

暗号化データ転送先記憶部308に格納したデータ、すなわち、セキュア領域内に格納していたデータであれば、復号指示信号321を有効にし(ステップ704)、セキュア領域信号130を有効にして(ステップ705)、暗号処理部304により復号後(ステップ706)、復号したデータをCPU212に転送する(ステップ707)。   If the data is stored in the encrypted data transfer destination storage unit 308, that is, the data stored in the secure area, the decryption instruction signal 321 is validated (step 704) and the secure area signal 130 is validated (step 705) After decryption by the encryption processing unit 304 (step 706), the decrypted data is transferred to the CPU 212 (step 707).

CPU212は、セキュア領域信号130が有効な状態でデータを受信すると、格納先レジスタのセキュア領域フラグレジスタ116を有効にして、セキュア領域内に格納されたデータとして処理を実行する(ステップ708)。   When the CPU 212 receives data in a state where the secure area signal 130 is valid, the CPU 212 validates the secure area flag register 116 of the storage destination register, and executes processing as data stored in the secure area (step 708).

バスブリッジ214は、CPU212によるリード完了信号を受信すると(ステップ709)、セキュア領域信号入出力制御部302によりセキュア領域信号130を無効状態とする(ステップ710)。   When the bus bridge 214 receives the read completion signal from the CPU 212 (step 709), the secure area signal input / output control unit 302 disables the secure area signal 130 (step 710).

また、ダイレクトメモリアクセス(以下、DMA)コントローラ222によるセキュア領域から転送要求時の制御動作としては、図9に示すように、バスブリッジ214は、DMAコントローラ222による転送要求を受信すると(ステップ801)、セキュア領域判定部301によりセキュア領域からの転送要求であるかを判定する(ステップ802)。   As a control operation at the time of a transfer request from a secure area by the direct memory access (hereinafter referred to as DMA) controller 222, as shown in FIG. 9, the bus bridge 214 receives a transfer request from the DMA controller 222 (step 801). The secure area determination unit 301 determines whether the transfer request is from the secure area (step 802).

ステップ802での判定の結果、セキュア領域からの転送要求でない場合、通常のDMA転送を実施し(ステップ803)、セキュア領域からの転送要求の場合、セキュア領域信号入出力制御部302により、暗号化指示信号320、およびDMA用セキュア領域信号240を有効にする(ステップ804、ステップ805)。   If the result of determination in step 802 is not a transfer request from the secure area, normal DMA transfer is performed (step 803). If the transfer request is from the secure area, the secure area signal input / output control unit 302 performs encryption. The instruction signal 320 and the DMA secure area signal 240 are validated (steps 804 and 805).

バスブリッジ214は、セキュア領域からデータを受信すると(ステップ806)、暗号処理部304により受信データの暗号化を実行する(ステップ807)。   When the bus bridge 214 receives data from the secure area (step 806), the encryption processing unit 304 encrypts the received data (step 807).

暗号化したセキュア領域からの受信データは、DMAコントローラ222へ転送される(ステップ808)。   Received data from the encrypted secure area is transferred to the DMA controller 222 (step 808).

この時、バスブリッジ214は、DMAコントローラ222が暗号化したデータをどのアドレスへ転送するかは分からないため、暗号化データ転送先記憶部への転送先アドレス格納は実施しない。暗号化データ転送先記憶部は、バスブリッジ214とDMAコントローラ222で共用、もしくは一元管理可能な方式で実装し、DMAコントローラ222が暗号化されたセキュア領域内のデータを転送する際に転送先アドレスを格納する。   At this time, the bus bridge 214 does not know the address to which the data encrypted by the DMA controller 222 is transferred, and therefore does not store the transfer destination address in the encrypted data transfer destination storage unit. The encrypted data transfer destination storage unit is shared by the bus bridge 214 and the DMA controller 222 or implemented in a system that can be managed in a unified manner, and the transfer destination address when the DMA controller 222 transfers the encrypted data in the secure area. Is stored.

これにより、DMAコントローラ222により外部メモリ231に転送されたセキュア領域内に格納されていたデータをCPU212がリードすること、もしくは、その逆のCPU212が外部メモリ231に転送したセキュア領域内に格納されていたデータをDMAコントローラ222が読み込むことが可能となる。   As a result, the CPU 212 reads the data stored in the secure area transferred to the external memory 231 by the DMA controller 222, or vice versa, the data is stored in the secure area transferred to the external memory 231 by the CPU 212. The data can be read by the DMA controller 222.

バスブリッジ214は、DMAコントローラ222への転送が完了すると(ステップ809)、暗号化指示信号320を無効にし(ステップ810)、DMA用セキュア領域信号240を無効にする(ステップ811)。   When the transfer to the DMA controller 222 is completed (step 809), the bus bridge 214 invalidates the encryption instruction signal 320 (step 810) and invalidates the DMA secure area signal 240 (step 811).

DMAコントローラ222は、DMA用セキュア領域信号240をバスブリッジ214からの受信データとともに受信すると、外部メモリ231に対して受信データを転送する際、バスブリッジ214と共用している暗号化データ転送先記憶部308に対して、転送先アドレスを記憶する。   When the DMA controller 222 receives the DMA secure area signal 240 together with the received data from the bus bridge 214, the DMA controller 222 transfers the received data to the external memory 231 and stores the encrypted data transfer destination memory shared with the bus bridge 214. The transfer destination address is stored in the unit 308.

また、DMAコントローラ222がセキュア領域へ転送する際の制御動作としては、図10に示すように、バスブリッジ214は、DMAコントローラ222による転送要求を受信すると(ステップ901)、暗号化データ転送先判定部307および暗号化データ転送先記憶部308は転送元アドレスが暗号処理を行ったデータであるかを判定する(ステップ902)。暗号処理を行っていないデータであれば、通常のDMA転送として処理する(ステップ903)。   As a control operation when the DMA controller 222 transfers to the secure area, as shown in FIG. 10, when the bus bridge 214 receives a transfer request from the DMA controller 222 (step 901), the encrypted data transfer destination determination is performed. The unit 307 and the encrypted data transfer destination storage unit 308 determine whether the transfer source address is data subjected to encryption processing (step 902). If the data is not encrypted, it is processed as a normal DMA transfer (step 903).

暗号処理を行ったデータであれば、セキュア領域判定部301によりセキュア領域への転送であるかを判定する(ステップ904)。   If the data has been subjected to encryption processing, the secure area determination unit 301 determines whether the data is transferred to the secure area (step 904).

セキュア領域への転送でない場合、セキュア領域に格納されていたデータのセキュア領域外への転送は禁止なのでエラー処理を実行する(ステップ905)。セキュア領域への転送の場合、復号指示信号321を有効にする(ステップ906)。   If the data is not transferred to the secure area, the data stored in the secure area is prohibited from being transferred outside the secure area, and error processing is executed (step 905). In the case of transfer to the secure area, the decryption instruction signal 321 is validated (step 906).

復号処理後(ステップ907)、セキュア領域への転送を実施する(ステップ908)。転送完了後(ステップ909)、復号指示信号321を無効にする(ステップ910)。   After the decryption process (step 907), transfer to the secure area is performed (step 908). After the transfer is completed (step 909), the decoding instruction signal 321 is invalidated (step 910).

CPU212内部で秘匿すべきデータが存在する箇所として、内部メモリ以外では、CPU演算レジスタ内のデータとキャッシュ213内のデータがある。   There are data in the CPU operation register and data in the cache 213 as locations where there is data to be kept secret inside the CPU 212 other than the internal memory.

割り込みやプロセススイッチ等によりCPU演算レジスタのデータを退避する場合があるが、別途退避用のレジスタをCPU内部に具備するマイクロコンピュータが存在するため、それを利用することで回避可能である。   The CPU operation register data may be saved by an interrupt, a process switch, or the like, but there is a microcomputer that has a separate save register inside the CPU, and this can be avoided by using it.

キャッシュ213内のデータについてはマイクロコンピュータ外部への出力を禁止する設定とする。キャッシュ213内のデータ出力を可能な構成にする場合には、キャッシュ213内の各エントリに対してセキュア領域フラグレジスタ116相当の情報を付加できる構成とし、キャッシュ213でもセキュア領域信号130の制御が可能な構成とすることで、セキュア領域内に格納されているデータについてはマイクロコンピュータ外部への暗号化出力が実現可能である。   The data in the cache 213 is set to be prohibited from being output to the outside of the microcomputer. In a configuration that enables data output in the cache 213, information equivalent to the secure area flag register 116 can be added to each entry in the cache 213, and the secure area signal 130 can also be controlled in the cache 213. With this configuration, the data stored in the secure area can be encrypted and output to the outside of the microcomputer.

以上では、実施の形態として、図4に示すようにバスブリッジ214内に暗号処理部304と暗号処理部304、および、セキュア領域信号130、DMA用セキュア領域信号240を制御するための機構を設けたが、本実施の形態では、この構成に限らず、一般的にCPUコアと呼ばれるCPU212、キャッシュ213、バスブリッジ214、内部メモリ215を始めとする部分と、その外部にあるモジュール間を接続するような、内部メモリ215、および、CPU212へのアクセスがすべて通過するような箇所に設置することが望ましい。   As described above, as an embodiment, a mechanism for controlling the encryption processing unit 304, the encryption processing unit 304, the secure area signal 130, and the DMA secure area signal 240 is provided in the bus bridge 214 as shown in FIG. However, in the present embodiment, the configuration is not limited to this configuration, and a portion including a CPU 212, a cache 213, a bus bridge 214, and an internal memory 215 generally called a CPU core is connected to an external module. It is desirable to install in a location where all accesses to the internal memory 215 and the CPU 212 pass.

また、本実施の形態の説明ではバス上を流れる物理アドレスによりチェックを行うよう記載した。また、マイクロコンピュータを制御するオペレーティングシステムは、通常仮想アドレスを使用する。   In the description of the present embodiment, it is described that the check is performed based on the physical address flowing on the bus. The operating system that controls the microcomputer usually uses virtual addresses.

本実施の形態は、仮想アドレスを扱うシステムにおいても適用可能である。仮想空間と物理空間の変換を行うハードウェアをメモリマネジメントユニット内部にセキュア領域判定部101、301とセキュア領域信号130を具備し、物理空間への変換後のアドレスをセキュア領域判定部101で判定することで、前述の実施の形態と同様の効果を得ることができる。   This embodiment can also be applied to a system that handles virtual addresses. The hardware for converting the virtual space and the physical space includes secure area determination units 101 and 301 and a secure area signal 130 inside the memory management unit, and the secure area determination unit 101 determines an address after conversion to the physical space. As a result, the same effects as those of the above-described embodiment can be obtained.

以上、本実施の形態により、マイクロコンピュータで実行中のソフトウェア、および、ソフトウェアにより生成された中間情報を、ソフトウェアの改変なしにハードウェアのみで安全にマイクロコンピュータ外部のメモリ領域へ退避、および、外部メモリ領域からの書き戻しすることが可能となる。   As described above, according to the present embodiment, software being executed in the microcomputer and intermediate information generated by the software can be safely saved to a memory area outside the microcomputer only by hardware without modification of the software, and externally It is possible to write back from the memory area.

また、外部メモリに出力する全データを暗号化するのではなく、暗号化が必要なデータのみを暗号化処理することにより、暗号処理によるマイクロコンピュータ−外部メモリ間の転送性能劣化を低減することが可能となる。   Also, it is possible to reduce deterioration in transfer performance between the microcomputer and the external memory due to the encryption process by encrypting only the data that needs to be encrypted instead of encrypting all the data output to the external memory. It becomes possible.

以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は前記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることはいうまでもない。   As mentioned above, the invention made by the present inventor has been specifically described based on the embodiment. However, the present invention is not limited to the embodiment, and various modifications can be made without departing from the scope of the invention. Needless to say.

本発明は、マイクロコンピュータに関し、マイクロコンピュータ上で実行中のソフトウェアやソフトウェアが使用している処理過程で生成された中間データを保護する組込用マイコンなどに適用可能である。   The present invention relates to a microcomputer and can be applied to software being executed on the microcomputer and an embedded microcomputer that protects intermediate data generated in the process used by the software.

本発明の一実施の形態に係るマイクロコンピュータのCPU内のセキュア領域判定部の構成を示す図である。It is a figure which shows the structure of the secure area | region determination part in CPU of the microcomputer which concerns on one embodiment of this invention. 本発明の一実施の形態に係るマイクロコンピュータのメモリ領域を示す図である。It is a figure which shows the memory area of the microcomputer which concerns on one embodiment of this invention. 本発明の一実施の形態に係るマイクロコンピュータの全体構成を示す図である。It is a figure which shows the whole structure of the microcomputer which concerns on one embodiment of this invention. 本発明の一実施の形態に係るマイクロコンピュータのバスブリッジの構成を示す図である。It is a figure which shows the structure of the bus bridge of the microcomputer based on one embodiment of this invention. 本発明の一実施の形態に係るマイクロコンピュータのバスブリッジ内のセキュア領域判定部の構成を示す図である。It is a figure which shows the structure of the secure area | region determination part in the bus bridge of the microcomputer which concerns on one embodiment of this invention. 本発明の一実施の形態に係るマイクロコンピュータのCPUによるデータ転送時の制御動作を示すフローチャートである。It is a flowchart which shows the control action at the time of the data transfer by CPU of the microcomputer which concerns on one embodiment of this invention. 本発明の一実施の形態に係るマイクロコンピュータのCPUによるデータ転送時の制御動作を示すフローチャートである。It is a flowchart which shows the control action at the time of the data transfer by CPU of the microcomputer which concerns on one embodiment of this invention. 本発明の一実施の形態に係るマイクロコンピュータのCPUによるデータ転送時の制御動作を示すフローチャートである。It is a flowchart which shows the control action at the time of the data transfer by CPU of the microcomputer which concerns on one embodiment of this invention. 本発明の一実施の形態に係るマイクロコンピュータのダイレクトメモリアクセスコントローラによるデータ転送時の制御動作を示すフローチャートである。It is a flowchart which shows the control operation at the time of the data transfer by the direct memory access controller of the microcomputer which concerns on one embodiment of this invention. 本発明の一実施の形態に係るマイクロコンピュータのダイレクトメモリアクセスコントローラによるデータ転送時の制御動作を示すフローチャートである。It is a flowchart which shows the control operation at the time of the data transfer by the direct memory access controller of the microcomputer which concerns on one embodiment of this invention.

符号の説明Explanation of symbols

101…セキュア領域判定部、110…セキュア領域有効レジスタ、111…セキュア領域範囲設定レジスタ、112…アドレスマップ、113…アドレス判定部、114…セキュア領域フラグクリア、115…セキュア領域フラグ制御部、116…セキュア領域フラグレジスタ、120…セキュア領域フラグ、121…エラーフラグ、130…セキュア領域信号、201…マイクロコンピュータ、211…CPUバス、212…CPU、213…キャッシュ、214…バスブリッジ、215…内部メモリ、220…内部バス、221…外部バスコントローラ、222…DMAコントローラ、223…周辺バスコントローラ、224…クロック生成器、225…タイマ、226…割り込みコントローラ、227…I/Oコントローラ、230…外部バス、231…外部メモリ、232…外部デバイス、240…DMA用セキュア領域信号、301…セキュア領域判定部、302…セキュア領域信号入出力制御部、304…暗号処理部、305…スイッチ、307…暗号化データ転送先判定部、308…暗号化データ転送先記憶部、320…暗号化指示信号、321…復号指示信号。   DESCRIPTION OF SYMBOLS 101 ... Secure area | region determination part, 110 ... Secure area | region effective register, 111 ... Secure area | region range setting register, 112 ... Address map, 113 ... Address determination part, 114 ... Secure area flag clear, 115 ... Secure area flag control part, 116 ... Secure area flag register, 120 ... Secure area flag, 121 ... Error flag, 130 ... Secure area signal, 201 ... Microcomputer, 211 ... CPU bus, 212 ... CPU, 213 ... Cache, 214 ... Bus bridge, 215 ... Internal memory, 220 ... Internal bus, 221 ... External bus controller, 222 ... DMA controller, 223 ... Peripheral bus controller, 224 ... Clock generator, 225 ... Timer, 226 ... Interrupt controller, 227 ... I / O controller, 230 External bus, 231 ... external memory, 232 ... external device, 240 ... secure area signal for DMA, 301 ... secure area determination section, 302 ... secure area signal input / output control section, 304 ... encryption processing section, 305 ... switch, 307 ... Encrypted data transfer destination determination unit, 308... Encrypted data transfer destination storage unit, 320... Encryption instruction signal, 321.

Claims (10)

中央演算処理装置と、
情報格納用の内部メモリと、
前記内部メモリ内に設定される秘密情報格納用のセキュア領域へのアクセスの判定を行うセキュア領域判定部とを備え、
前記セキュア領域判定部は、
前記セキュア領域のセキュア領域範囲を設定するセキュア領域範囲設定レジスタと、
前記セキュア領域の有効または無効を設定するセキュア領域有効レジスタと、
前記セキュア領域判定部が接続されたバスからアドレスを取得し、そのアドレスに基づいて、前記セキュア領域へのアクセスであるかを判定するアドレス判定部と、
前記アドレス判定部による判定結果、前記バスからのコマンド、および前記セキュア領域有効レジスタの情報に基づいて、前記セキュア領域へのアクセス権限を判定し、その判定結果を通知するセキュア領域フラグを出力するセキュア領域フラグ制御部とを有することを特徴とするマイクロコンピュータ。
A central processing unit;
Internal memory for storing information,
A secure area determination unit that determines access to a secure area for storing confidential information set in the internal memory,
The secure area determination unit
A secure area range setting register for setting a secure area range of the secure area;
A secure area valid register for setting valid or invalid of the secure area; and
An address determination unit that acquires an address from the bus to which the secure area determination unit is connected, and determines whether the access is to the secure area based on the address;
Based on the determination result by the address determination unit, the command from the bus, and the information of the secure area valid register, the access authority to the secure area is determined, and the secure area flag that notifies the determination result is output. And a region flag control unit.
請求項1記載のマイクロコンピュータにおいて、
前記セキュア領域フラグ制御部は、前記セキュア領域へのアクセス違反を判定し、その判定結果を通知するエラーフラグを出力することを特徴とするマイクロコンピュータ。
The microcomputer according to claim 1.
The microcomputer, wherein the secure area flag control unit determines an access violation to the secure area and outputs an error flag notifying the determination result.
請求項1または2記載のマイクロコンピュータにおいて、
前記中央演算処理装置が演算時に使用する演算用レジスタに、前記セキュア領域フラグを保持するレジスタを設け、
前記中央演算処理装置は、前記セキュア領域フラグをセキュア領域信号として外部に出力することを特徴とするマイクロコンピュータ。
The microcomputer according to claim 1 or 2,
A register for holding the secure area flag is provided in a calculation register used by the central processing unit for calculation,
The microcomputer is characterized in that the central processing unit outputs the secure area flag to the outside as a secure area signal.
請求項3記載のマイクロコンピュータにおいて、
前記セキュア領域信号を受信し、前記セキュア領域信号の指示により暗号化処理、復号処理を実行する暗号処理部と、
前記暗号化した情報を前記マイクロコンピュータに付属する外部メモリに転送する際に、前記外部メモリへの転送先を記憶する第1の暗号化情報転送先記憶部と、
前記外部メモリから情報が転送されてきた際、転送元と前記第1の暗号化情報転送先記憶部に記憶された情報の照合を行う暗号化情報転送先判定部とを備え、
前記暗号化情報転送先判定部の照合の結果、一致すれば前記外部メモリから転送された情報を前記暗号処理部で復号し、復号したデータを前記中央演算処理装置に転送する際に、前記セキュア領域信号を有効に設定することを特徴とするマイクロコンピュータ。
The microcomputer according to claim 3.
An encryption processing unit that receives the secure area signal and executes an encryption process and a decryption process according to an instruction of the secure area signal;
A first encrypted information transfer destination storage unit for storing a transfer destination to the external memory when transferring the encrypted information to an external memory attached to the microcomputer;
An encryption information transfer destination determination unit that performs verification of information stored in the transfer source and the first encrypted information transfer destination storage unit when information is transferred from the external memory;
As a result of the verification by the encrypted information transfer destination determination unit, if the two match, the information transferred from the external memory is decrypted by the encryption processing unit, and when the decrypted data is transferred to the central processing unit, the secure processing is performed. A microcomputer characterized by effectively setting a region signal.
請求項4記載のマイクロコンピュータにおいて、
前記マイクロコンピュータ内のダイレクトメモリアクセスコントローラが読み出す領域を判定する領域判定部を備え、
前記暗号処理部は、前記セキュア領域フラグにより前記セキュア領域から読み出した情報の暗号化を実行し、
前記暗号処理部により前記暗号化された情報を前記ダイレクトメモリアクセスコントローラへ転送する際に、前記セキュア領域信号を有効にする設定することを特徴とするマイクロコンピュータ。
The microcomputer according to claim 4.
An area determination unit for determining an area to be read by the direct memory access controller in the microcomputer;
The encryption processing unit executes encryption of information read from the secure area by the secure area flag,
A microcomputer, wherein the secure area signal is set to be valid when the encrypted information is transferred to the direct memory access controller by the encryption processing unit.
請求項5記載のマイクロコンピュータにおいて、
前記ダイレクトメモリアクセスコントローラは、前記暗号化された情報と共に前記セキュア領域信号を受信すると、前記暗号化された情報の転送先を格納する第2の暗号化情報転送先記憶部を有することを特徴とするマイクロコンピュータ。
The microcomputer according to claim 5, wherein
The direct memory access controller includes a second encrypted information transfer destination storage unit that stores a transfer destination of the encrypted information when the secure area signal is received together with the encrypted information. A microcomputer.
請求項6記載のマイクロコンピュータにおいて、
前記第1の暗号化情報転送先記憶部と前記第2の暗号化情報転送先記憶部は、共用されることを特徴とするマイクロコンピュータ。
The microcomputer according to claim 6, wherein
The microcomputer according to claim 1, wherein the first encrypted information transfer destination storage unit and the second encrypted information transfer destination storage unit are shared.
中央演算処理装置と、情報格納用の内部メモリとを備えたマイクロコンピュータのソフトウェア保護方法であって、
セキュア領域範囲設定レジスタおよびセキュア領域有効レジスタにより、前記セキュア領域のセキュア領域範囲および前記セキュア領域の有効または無効を設定し、
前記マイクロコンピュータ内のバスからアドレスを取得し、そのアドレスに基づいて、前記セキュア領域へのアクセスであるかを判定し、その判定結果、前記バスからのコマンド、および前記セキュア領域有効レジスタの情報に基づいて、前記セキュア領域へのアクセス権限を判定し、その判定結果を通知するセキュア領域フラグをセキュア領域信号として前記中央演算処理装置の外部に出力することを特徴とするマイクロコンピュータのソフトウェア保護方法。
A microcomputer software protection method comprising a central processing unit and an internal memory for storing information,
The secure area range setting register and the secure area valid register are used to set the secure area range of the secure area and the validity or invalidity of the secure area,
An address is obtained from the bus in the microcomputer, and based on the address, it is determined whether the access is to the secure area, and the determination result, the command from the bus, and the information of the secure area valid register are included. A microcomputer software protection method comprising: determining a right of access to the secure area based on the result; and outputting a secure area flag notifying the determination result to the outside of the central processing unit as a secure area signal.
請求項8記載のマイクロコンピュータのソフトウェア保護方法において、
前記セキュア領域信号を受信し、前記セキュア領域信号の指示により暗号化処理、復号処理を実行し、前記暗号化した情報を前記マイクロコンピュータに付属する外部メモリに転送する際に、前記外部メモリへの転送先を記憶し、前記外部メモリから情報が転送されてきた際、転送元と前記記憶した転送先の情報の照合を行い、その照合の結果、一致すれば前記外部メモリから転送された情報を復号し、復号したデータを前記中央演算処理装置に転送する際に、前記セキュア領域信号を有効に設定することを特徴とするマイクロコンピュータのソフトウェア保護方法。
9. The microcomputer software protection method according to claim 8,
When the secure area signal is received, an encryption process and a decryption process are executed according to an instruction of the secure area signal, and when the encrypted information is transferred to an external memory attached to the microcomputer, When the transfer destination is stored and information is transferred from the external memory, the information of the transfer source and the stored transfer destination are collated. If the result of the collation is the same, the information transferred from the external memory is A microcomputer software protection method, wherein the secure area signal is set valid when decrypted and the decrypted data is transferred to the central processing unit.
請求項9記載のマイクロコンピュータのソフトウェア保護方法において、
前記マイクロコンピュータ内のダイレクトメモリアクセスコントローラが読み出す領域を判定し、前記セキュア領域フラグにより前記セキュア領域から読み出した情報の暗号化を実行し、前記暗号化された情報を前記ダイレクトメモリアクセスコントローラへ転送する際に、前記セキュア領域信号を有効にする設定することを特徴とするマイクロコンピュータのソフトウェア保護方法。
The microcomputer software protection method according to claim 9,
The area read by the direct memory access controller in the microcomputer is determined, the information read from the secure area is encrypted by the secure area flag, and the encrypted information is transferred to the direct memory access controller. In this case, the microcomputer software protection method is characterized in that the secure area signal is set to be valid.
JP2006138374A 2006-05-18 2006-05-18 Microcomputer and method for protecting its software Withdrawn JP2007310601A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006138374A JP2007310601A (en) 2006-05-18 2006-05-18 Microcomputer and method for protecting its software

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006138374A JP2007310601A (en) 2006-05-18 2006-05-18 Microcomputer and method for protecting its software

Publications (1)

Publication Number Publication Date
JP2007310601A true JP2007310601A (en) 2007-11-29

Family

ID=38843404

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006138374A Withdrawn JP2007310601A (en) 2006-05-18 2006-05-18 Microcomputer and method for protecting its software

Country Status (1)

Country Link
JP (1) JP2007310601A (en)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2013001721A1 (en) * 2011-06-29 2013-01-03 パナソニック株式会社 Computer control method
JP2013179453A (en) * 2012-02-28 2013-09-09 Nippon Telegr & Teleph Corp <Ntt> Computer system and computing method
JP2014519089A (en) * 2011-05-10 2014-08-07 クアルコム,インコーポレイテッド Apparatus and method for hardware-based secure data processing using buffer memory address range rules
JP2015528596A (en) * 2012-08-10 2015-09-28 クアルコム,インコーポレイテッド Method and device for selective RAM scrambling
JP2016525839A (en) * 2013-07-24 2016-08-25 マーベル ワールド トレード リミテッド Key cycling for memory controllers
JP2019160302A (en) * 2018-03-06 2019-09-19 ライン プラス コーポレーションLINE Plus Corporation Method and system for providing secure message
JP7158826B2 (en) 2017-03-21 2022-10-24 株式会社リコー COMMUNICATION CONTROL DEVICE, COMMUNICATION CONTROL SYSTEM AND COMMUNICATION CONTROL METHOD

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2014519089A (en) * 2011-05-10 2014-08-07 クアルコム,インコーポレイテッド Apparatus and method for hardware-based secure data processing using buffer memory address range rules
KR101618940B1 (en) 2011-05-10 2016-05-09 퀄컴 인코포레이티드 Apparatus and method for hardware-based secure data processing using buffer memory address range rules
US9836414B2 (en) 2011-05-10 2017-12-05 Qualcomm, Incorporated Apparatus and method for hardware-based secure data processing using buffer memory address range rules
WO2013001721A1 (en) * 2011-06-29 2013-01-03 パナソニック株式会社 Computer control method
JP2013179453A (en) * 2012-02-28 2013-09-09 Nippon Telegr & Teleph Corp <Ntt> Computer system and computing method
JP2015528596A (en) * 2012-08-10 2015-09-28 クアルコム,インコーポレイテッド Method and device for selective RAM scrambling
JP2016525839A (en) * 2013-07-24 2016-08-25 マーベル ワールド トレード リミテッド Key cycling for memory controllers
JP7158826B2 (en) 2017-03-21 2022-10-24 株式会社リコー COMMUNICATION CONTROL DEVICE, COMMUNICATION CONTROL SYSTEM AND COMMUNICATION CONTROL METHOD
JP2019160302A (en) * 2018-03-06 2019-09-19 ライン プラス コーポレーションLINE Plus Corporation Method and system for providing secure message
US11881940B2 (en) 2018-03-06 2024-01-23 LINE Plus Corporation Method and system for providing secure message
JP7422490B2 (en) 2018-03-06 2024-01-26 ライン プラス コーポレーション Secure message provision method and system

Similar Documents

Publication Publication Date Title
JP4738068B2 (en) Processor and system
US7266842B2 (en) Control function implementing selective transparent data authentication within an integrated system
US6158004A (en) Information storage medium and security method thereof
US8473754B2 (en) Hardware-facilitated secure software execution environment
KR101735023B1 (en) Method and apparatus including architecture for protecting sensitive code and data
JP4660188B2 (en) Protection from attacks in sleep
US8838950B2 (en) Security architecture for system on chip
JP4299679B2 (en) Control function that restricts data access in the integrated system using the requesting master ID and data address
EP2803012B1 (en) Using storage controller bus interfaces to secure data transfer between storage devices and hosts
US20070101158A1 (en) Security region in a non-volatile memory
US8799673B2 (en) Seamlessly encrypting memory regions to protect against hardware-based attacks
JP2005521942A (en) System and method for providing domain granular, hardware controlled memory encryption
JP3804670B2 (en) Semiconductor device, electronic device, and access control method for semiconductor device
US20100293392A1 (en) Semiconductor device having secure memory controller
JPH08305558A (en) Ciphering program arithmetic unit
CN105320895B (en) High-performance autonomic hardware engine for on-line encryption processing
US20130166922A1 (en) Method and system for frame buffer protection
JP2007310601A (en) Microcomputer and method for protecting its software
TW200816767A (en) System and method for trusted data processing
JP4591163B2 (en) Bus access control device
EP1073051B1 (en) Signal processing apparatus and method and information recording medium to be used therein
JP6696352B2 (en) Programmable logic device, information processing device, processing method, and processing program
JP2007072957A (en) Read/write device and debugging system
KR101475821B1 (en) Apparatus and method for encryption in system on chip
JP2008310678A (en) Storage device, information apparatus, and content conversion method

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20090119

A761 Written withdrawal of application

Free format text: JAPANESE INTERMEDIATE CODE: A761

Effective date: 20100108