JP2005209108A - Microcomputer with external memory - Google Patents

Microcomputer with external memory Download PDF

Info

Publication number
JP2005209108A
JP2005209108A JP2004017421A JP2004017421A JP2005209108A JP 2005209108 A JP2005209108 A JP 2005209108A JP 2004017421 A JP2004017421 A JP 2004017421A JP 2004017421 A JP2004017421 A JP 2004017421A JP 2005209108 A JP2005209108 A JP 2005209108A
Authority
JP
Japan
Prior art keywords
memory
data
external
program
flash memory
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.)
Granted
Application number
JP2004017421A
Other languages
Japanese (ja)
Other versions
JP4574994B2 (en
Inventor
Kazuhiko Ohashi
一彦 大橋
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.)
Toshiba Corp
Kioxia Systems Co Ltd
Original Assignee
Toshiba Corp
Toshiba Memory Systems Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp, Toshiba Memory Systems Co Ltd filed Critical Toshiba Corp
Priority to JP2004017421A priority Critical patent/JP4574994B2/en
Publication of JP2005209108A publication Critical patent/JP2005209108A/en
Application granted granted Critical
Publication of JP4574994B2 publication Critical patent/JP4574994B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Images

Landscapes

  • Storage Device Security (AREA)
  • Microcomputers (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a microcomputer with an external memory, wherein security for the external memory is enhanced. <P>SOLUTION: In a boot mode, a CPU 21 reads security code written in a register 321 and selects an encryption program designated by the security code, from a plurality of encryption programs preliminarily stored in a boot memory 25 and uses this selected encryption program to encrypt an address and data in a flash memory 3, which are inputted from a serial I/O 23 and transfers the encrypted address and data to the flash memory 3 through a flash memory I/F 22. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明は、外付けメモリに対するセキュリティ機能を有するメモリ外付けマイコンに関する。   The present invention relates to a memory external microcomputer having a security function for an external memory.

近年、プログラムの大規模化およびプログラムの書き換え要求に対応するため、フラッシュメモリをMCU(マイクロコントローラユニット)チップに外付けして用いるメモリ外付けマイコンが使用されている。   2. Description of the Related Art In recent years, in order to respond to an increase in the size of a program and a request for rewriting a program, a memory external microcomputer that uses a flash memory externally attached to an MCU (microcontroller unit) chip is used.

ただし、このようなフラッシュメモリはアクセス速度が遅く、直接フラッシュメモリからプログラムを読み出してマイコンを動作させると、マイコンの動作速度が低下する。そこで、MCUチップにアクセス速度の速いメモリを内蔵し、マイコンの動作に先立って、その動作に必要なプログラムをフラッシュメモリから内蔵メモリに転送して使用することが行われている。   However, such a flash memory has a low access speed, and when the microcomputer is operated by directly reading a program from the flash memory, the operation speed of the microcomputer decreases. Therefore, a memory having a high access speed is built in the MCU chip, and a program necessary for the operation is transferred from the flash memory to the built-in memory and used before the operation of the microcomputer.

しかし、このようなフラッシュメモリを外付けしたマイコンでは、フラッシュメモリのデータを第三者に覗かれてプログラム内容を解読される恐れがあり、マイコンのセキュリティが低下する。   However, in such a microcomputer with an external flash memory, there is a risk that the contents of the program may be decoded by a third party looking into the data in the flash memory, and the security of the microcomputer is reduced.

そこで、マイコンシステムのセキュリティを高めるため、排他的論理和回路のような信号変換手段を用いて、外付けメモリのデータ信号およびアドレス信号を暗号化することが行われている。(例えば、特許文献1参照。)。
特開2000−29790号公報 (第4ページ、図1)
Therefore, in order to enhance the security of the microcomputer system, the data signal and the address signal of the external memory are encrypted using a signal conversion means such as an exclusive OR circuit. (For example, refer to Patent Document 1).
JP 2000-29790 A (Page 4, FIG. 1)

しかし、上述の排他的論理和回路のようなハードウェアによる暗号化では、常に同じ暗号化しかできず、マイコンの動作解析等により暗号が見破られる可能性が高くなるという問題があった。   However, in the case of hardware encryption such as the above-described exclusive OR circuit, there is always a problem that only the same encryption can be performed, and there is a high possibility that the encryption is forgotten by the operation analysis of the microcomputer.

そこで、本発明の目的は、外付けメモリに対するセキュリティを強化したメモリ外付けマイコンを提供することにある。   Accordingly, an object of the present invention is to provide a memory external microcomputer with enhanced security for the external memory.

本発明の一態様によれば、MCUチップと、前記MCUチップに外付けされて前記MCUチップとの間で相互にデータの受け渡しを行うメモリとを備えるメモリ外付けマイコンであって、前記MCUチップが、CPUと、ブートモード時に読み出される暗号化プログラムおよび復号化プログラムを格納したブートメモリと、前記外付けメモリから転送されるデータを格納するバッファメモリとを具備し、前記MCUチップから前記外付けメモリへデータを転送するときは、前記CPUが前記暗号化プログラムを用いて前記外付けメモリへ与えるアドレスおよびデータを暗号化して転送し、前記外付けメモリから前記バッファメモリへデータを転送するときは、前記外付けメモリのアドレスおよびデータを前記CPUが前記復号化プログラムを用いて復号化して転送することを特徴とするメモリ外付けマイコンが提供される。   According to an aspect of the present invention, there is provided a memory external microcomputer including an MCU chip and a memory that is externally attached to the MCU chip and exchanges data with the MCU chip. Comprises a CPU, a boot memory storing an encryption program and a decryption program read in the boot mode, and a buffer memory storing data transferred from the external memory, and the external connection from the MCU chip When transferring data to the memory, the CPU encrypts and transfers the address and data given to the external memory using the encryption program, and when transferring data from the external memory to the buffer memory The CPU stores the decryption program for the address and data of the external memory. Memory external microcomputer, which comprises transferring decrypts There is provided.

本発明によれば、外付けメモリへ転送するデータの暗号化をプログラムにより行うので暗号化方式を随時変更することができ、外付けメモリに対するセキュリティを強化することができる。   According to the present invention, since the data to be transferred to the external memory is encrypted by the program, the encryption method can be changed at any time, and the security for the external memory can be enhanced.

以下、本発明の実施例を図面を参照して説明する。   Embodiments of the present invention will be described below with reference to the drawings.

図1は、本発明の実施例に係るメモリ外付けマイコンの構成を示すブロック図である。   FIG. 1 is a block diagram showing a configuration of a memory external microcomputer according to an embodiment of the present invention.

メモリ外付けマイコン1は、MCUチップ2と、MCUチップ2との間でデータの受け渡しを行う外付けのメモリであるフラッシュメモリ3を有する。なお、外付けメモリはフラッシュメモリに限るものではなく、データの書き換えが可能なメモリであれば他の種類のものでもよい。   The memory external microcomputer 1 has an MCU chip 2 and a flash memory 3 which is an external memory for transferring data between the MCU chip 2. Note that the external memory is not limited to the flash memory, but may be other types as long as the data can be rewritten.

MCUチップ2は、CPU21と、フラッシュメモリ3とのデータの受け渡しのインターフェイス(I/F)を行うフラッシュメモリI/F22と、フラッシュメモリ3へ転送するデータが外部からシリアルに入力されるシリアルI/O23と、フラッシュメモリ3から転送されるデータを格納するバッファメモリ24と、ブートモード時に読み出されるプログラムが格納されているブートメモリ25と、上記各メモリへ与えるアドレスを生成するアドレスコントローラ26とを有する。   The MCU chip 2 includes a flash memory I / F 22 that performs an interface (I / F) for data transfer between the CPU 21 and the flash memory 3, and a serial I / F that serially inputs data to be transferred to the flash memory 3. O23, a buffer memory 24 for storing data transferred from the flash memory 3, a boot memory 25 for storing a program read in the boot mode, and an address controller 26 for generating addresses to be given to the respective memories. .

また、フラッシュメモリI/F22には、後述する3wordのセキュリティコードを格納するための3wordのレジスタ(Reg0、Reg1、Reg2と表わす。)であるレジスタ221が設けられている。このレジスタ221のアドレスもアドレスコントローラ26により与えられる。   The flash memory I / F 22 is provided with a register 221 that is a 3-word register (represented as Reg0, Reg1, Reg2) for storing a 3-word security code, which will be described later. The address of the register 221 is also given by the address controller 26.

図2に、本実施例におけるメモリのアドレスマップの例を示す。   FIG. 2 shows an example of a memory address map in the present embodiment.

ここでは、16進数表記のアドレス000H〜3FFHをバッファメモリ24の領域、アドレス400H〜402Hをレジスタ221の領域、アドレス402H〜7FFHをフラッシュメモリ3の領域としている。したがって、フラッシュメモリ3に格納されたデータをバッファメモリ24へ転送するときは、フラッシュメモリ3のアドレスから400Hを引いてアドレスをシフトさせればよい。   Here, addresses 000H to 3FFH in hexadecimal notation are used as an area of the buffer memory 24, addresses 400H to 402H are used as an area of the register 221, and addresses 402H to 7FFH are used as an area of the flash memory 3. Therefore, when transferring the data stored in the flash memory 3 to the buffer memory 24, the address may be shifted by subtracting 400H from the address of the flash memory 3.

次に、本実施例におけるMCUチップ2とフラッシュメモリ3との間のデータの受け渡しのときに実行されるデータの暗号化/復号化について説明する。   Next, data encryption / decryption executed when data is transferred between the MCU chip 2 and the flash memory 3 in this embodiment will be described.

本実施例においては、MCUチップ2からフラッシュメモリ3へデータを転送するときに、フラッシュメモリ3へ書き込むデータの暗号化だけでなく、フラッシュメモリ3のアドレスも暗号化している。したがって、フラッシュメモリ3からMCUチップ2へデータを転送するときにデータの復号化とアドレスの復号化を行う。このとき、アドレスの復号化は、上述したアドレスマップ上でのフラッシュメモリ3のアドレス領域からバッファメモリ24のアドレス領域へのアドレスのシフトを行った後に実行する。   In the present embodiment, when data is transferred from the MCU chip 2 to the flash memory 3, not only the data to be written to the flash memory 3 is encrypted, but also the address of the flash memory 3 is encrypted. Therefore, when data is transferred from the flash memory 3 to the MCU chip 2, data decoding and address decoding are performed. At this time, the address decoding is performed after the address is shifted from the address area of the flash memory 3 to the address area of the buffer memory 24 on the address map.

本実施例における暗号化および復号化は総てプログラム化されており、このプログラムをCPU21が実行することにより暗号化および復号化が行われる。   Encryption and decryption in the present embodiment are all programmed, and encryption and decryption are performed by the CPU 21 executing this program.

また、暗号化方式は複数用意されており、それぞれの方式に応じた暗号化プログラムと復号化プログラムの対が用意されている。これらの複数の暗号化プログラムと復号化プログラムの対は、ブートメモリ25に格納されている。   A plurality of encryption methods are prepared, and a pair of encryption program and decryption program corresponding to each method is prepared. A plurality of pairs of the encryption program and the decryption program are stored in the boot memory 25.

この複数の暗号化プログラムと復号化プログラムの中のどのプログラムを使用するかは、シリアルI/Oを介してレジスタ221に格納されるセキュリティコードの値によって決定される。本実施例においては3wordのセキュリティコードxyzを用いるものとする。なお、セキュリティコードは3wordに限るものではなく、任意に増減させてよい。ただし、セキュリティコードのword数に応じてレジスタ221のword数も変更する必要がある。   Which of the plurality of encryption programs and decryption programs is used is determined by the value of the security code stored in the register 221 via the serial I / O. In the present embodiment, a 3-word security code xyz is used. Note that the security code is not limited to 3 words, and may be arbitrarily increased or decreased. However, the number of words in the register 221 needs to be changed according to the number of words in the security code.

図3は、暗号化方法および復号化方法の例とセキュリティコードとの関係の例を示す図である。ここでは、3種類の暗号化方法および復号化方法に対して3通りのセキュリティコードx1y1z1、x2y2z2、x3y3z3が対応している例を示している。   FIG. 3 is a diagram illustrating an example of a relationship between an example of an encryption method and a decryption method and a security code. Here, an example is shown in which three types of security codes x1y1z1, x2y2z2, and x3y3z3 correspond to three types of encryption methods and decryption methods.

例えば、セキュリティコードx1y1z1に対して、アドレスの暗号化/復号化方法は「奇数と偶数の入れ替え」が対応し、データの暗号化/復号化方法は「各ビットの反転」が対応する。また、セキュリティコードx2y2z2に対して、アドレスの暗号化/復号化方法は「MSBとLSBの入れ替え」が対応し、データの暗号化/復号化方法は「2の補数をとる」が対応する。また、セキュリティコードx3y3z3に対して、アドレスの暗号化/復号化方法は「各ビットの反転」が対応し、データにの暗号化方法は「アドレス値を加算」すること、復号化方法は「アドレス値を減算」することが対応する。   For example, for the security code x1y1z1, the address encryption / decryption method corresponds to “swapping odd and even”, and the data encryption / decryption method corresponds to “inversion of each bit”. Further, for the security code x2y2z2, the address encryption / decryption method corresponds to “exchange MSB and LSB”, and the data encryption / decryption method corresponds to “take 2's complement”. For the security code x3y3z3, the address encryption / decryption method corresponds to “inversion of each bit”, the data encryption method is “add address value”, and the decryption method is “address Subtracting the value corresponds.

また、本実施例においては、暗号化方式の決定やデータの転送の実行もプログラム化されており、これらのプログラムもブートメモリ25に格納されている。図4にこれらのプログラムの例を示す。   In the present embodiment, the determination of the encryption method and the execution of data transfer are also programmed, and these programs are also stored in the boot memory 25. FIG. 4 shows examples of these programs.

図4(a)は、暗号化方式決定用プログラムの例である。本プログラムには次のような実行ステップが含まれる。   FIG. 4A is an example of an encryption method determination program. This program includes the following execution steps.

すなわち、(ステップ1)シリアルI/Oからセキュリティコードを受信、(ステップ2)セキュリティコードをレジスタへ保存、(ステップ3)セキュリティコードをレジスタから読み出し、(ステップ4)セキュリティコードの解読、(ステップ5)暗号化方式の決定、(ステップ6)暗号化プログラムの選択、(ステップ7)復号化プログラムの選択、の各ステップである。   (Step 1) Receive security code from serial I / O, (Step 2) Save security code in register, (Step 3) Read security code from register, (Step 4) Decrypt security code (Step 5) These are the steps of determining the encryption method, (step 6) selecting the encryption program, and (step 7) selecting the decryption program.

このプログラムの実行により、外部から入力したセキュリティコードに応じた暗号化プログラムおよび復号化プログラムが選択される。   By executing this program, an encryption program and a decryption program corresponding to the security code input from the outside are selected.

図4(b)は、シリアルI/O23で受信したデータをフラッシュメモリ3へ転送するときに用いるプログラムの例である。本プログラムには次のような実行ステップが含まれる。   FIG. 4B is an example of a program used when data received by the serial I / O 23 is transferred to the flash memory 3. This program includes the following execution steps.

すなわち、(ステップ1)シリアルI/Oから1word分のデータを受信、(ステップ2)暗号化プログラムの実行、(ステップ3)フラッシュメモリへの書き込み、の各ステップである。   That is, (Step 1) receiving 1 word of data from the serial I / O, (Step 2) executing the encryption program, and (Step 3) writing to the flash memory.

このプログラムの実行により、シリアルI/O23で受信したフラッシュメモリ3のアドレスおよびデータが暗号化されてフラッシュメモリ3へ転送される。   By executing this program, the address and data of the flash memory 3 received by the serial I / O 23 are encrypted and transferred to the flash memory 3.

図4(c)は、フラッシュメモリ3から読み出したデータをバッファメモリ24へ転送するときに用いるプログラムの例である。本プログラムには次のような実行ステップが含まれる。   FIG. 4C shows an example of a program used when data read from the flash memory 3 is transferred to the buffer memory 24. This program includes the following execution steps.

すなわち、(ステップ1)フラッシュメモリから1word分のデータを受信、(ステップ2)復号化プログラムの実行、(ステップ3)バッファメモリへの書き込み、の各ステップである。   That is, (Step 1) receiving 1 word of data from the flash memory, (Step 2) executing the decoding program, and (Step 3) writing to the buffer memory.

このプログラムの実行により、フラッシュメモリ3のアドレスおよびデータが復号化されてバッファメモリ24へ転送される。   By executing this program, the address and data in the flash memory 3 are decoded and transferred to the buffer memory 24.

図5は、上述したプログラムを用いて、MCUチップ2からフラッシュメモリ3へデータを転送するときの動作のフローを示すフロー図である。なお、本実施例におけるMCUチップ2からフラッシュメモリ3へのデータの転送は、メモリ外付けマイコン1のブートモード時に実行される。   FIG. 5 is a flowchart showing an operation flow when data is transferred from the MCU chip 2 to the flash memory 3 using the above-described program. In this embodiment, the data transfer from the MCU chip 2 to the flash memory 3 is executed when the memory external microcomputer 1 is in the boot mode.

ブートモードが開始されると(ステップS1)、ブートメモリ25の読み出しが行われる(ステップS2)。ブートメモリ25の読み出しにより、ブートメモリ25に格納されている暗号化方式決定用プログラム、シリアルI/Oからフラッシュメモリへの転送プログラム、フラッシュメモリからバッファメモリへの転送プログラム、暗号化プログラム、復号化プログラムなどが読み出される。   When the boot mode is started (step S1), the boot memory 25 is read (step S2). By reading the boot memory 25, the encryption method determination program stored in the boot memory 25, the transfer program from the serial I / O to the flash memory, the transfer program from the flash memory to the buffer memory, the encryption program, and the decryption A program or the like is read out.

次いで、外部からシリアルI/O23を介して入力されるセキュリティコードを受信する(ステップS3)。このセキュリティコードを用いて、暗号化方式決定用プログラムがどの暗号化プログラムと復号プログラムを使用するかを決定する(ステップS4)。   Next, a security code input from the outside via the serial I / O 23 is received (step S3). Using this security code, it is determined which encryption program and decryption program the encryption method determination program uses (step S4).

その後、シリアルI/O23からフラッシュメモリ3へ格納するデータの入力が始まると、シリアルI/Oからフラッシュメモリへの転送プログラムを用いて、1word分ずつデータを受信し(ステップS5)、暗号化プログラムにより暗号化し(ステップS6)、フラッシュメモリ3へ書き込む(ステップS7)。総てのデータの書き込みが終わるまで、暗号化とフラッシュメモリ3への書き込みを繰り返し(ステップS8)、フラッシュメモリ3へのデータの転送が終了する(ステップS9)。ブート動作が総て終了するとブートモードは終了する(ステップS10)。   Thereafter, when the input of data to be stored in the flash memory 3 is started from the serial I / O 23, data is received one word at a time using a transfer program from the serial I / O to the flash memory (step S5), and the encryption program Is encrypted (step S6) and written to the flash memory 3 (step S7). The encryption and writing to the flash memory 3 are repeated until all the data has been written (step S8), and the transfer of the data to the flash memory 3 is completed (step S9). When all the boot operations are finished, the boot mode is finished (step S10).

図6は、フラッシュメモリ3からバッファメモリ24へデータを転送するときの動作のフローを示すフロー図である。なお、本実施例におけるフラッシュメモリ3からバッファメモリ24へのデータの転送は、メモリ外付けマイコン1へ外部からのリセット要求があったときに実行される。   FIG. 6 is a flowchart showing an operation flow when data is transferred from the flash memory 3 to the buffer memory 24. In this embodiment, data transfer from the flash memory 3 to the buffer memory 24 is executed when an external reset request is made to the microcomputer 1 attached to the memory.

フラッシュメモリ3からバッファメモリ24へのデータの転送が開始されると(ステップS51)、ブートモード時にブートメモリからの読み出されたフラッシュメモリからバッファメモリへの転送プログラムを用いて、フラッシュメモリ3から1word分ずつデータを読み出し(ステップS52)、復号化プログラムにより復号化し(ステップS53)、バッファメモリ24へ書き込む(ステップS54)。総てのデータの書き込みが終わるまで、復号化とバッファメモリ24への書き込みを繰り返し(ステップS55)、バッファメモリ24へのデータの転送が終了する(ステップS56)。   When the transfer of data from the flash memory 3 to the buffer memory 24 is started (step S51), the flash memory 3 is read from the flash memory 3 read from the boot memory in the boot mode using the transfer program to the buffer memory. Data is read one word at a time (step S52), decoded by a decoding program (step S53), and written to the buffer memory 24 (step S54). Decoding and writing to the buffer memory 24 are repeated until all data has been written (step S55), and data transfer to the buffer memory 24 is completed (step S56).

図7は、MCUチップ2からフラッシュメモリ3へデータを転送するときの動作波形図である。ここでは、セキュリティコードとして図3に示すx1y1z1が与えられるものとし、このセキュリティコードに対応した暗号化方法に基づく暗号化プログラムが実行されるときの動作を例に示している。この場合、アドレスに対しては「奇数と偶数の入れ替え」、すなわち前後のアドレスの交換が行われ、データに対しては「各ビットの反転」が行われる。なお、ここでは、元のデータに対して各ビットの反転が行われたデータを“!”を付けて表記する。また、各動作はクロックに同期して実行される。   FIG. 7 is an operation waveform diagram when data is transferred from the MCU chip 2 to the flash memory 3. Here, x1y1z1 shown in FIG. 3 is given as a security code, and an operation when an encryption program based on an encryption method corresponding to this security code is executed is shown as an example. In this case, “odd and even switching” is performed for the addresses, that is, the addresses before and after are replaced, and “inversion of each bit” is performed for the data. Here, the data in which each bit is inverted with respect to the original data is denoted by “!”. Each operation is executed in synchronization with the clock.

ブートモード時に、シリアルI/O23からセキュリティコードx1、y1、z1がアドレス値400H、401H,402Hとともに順次入力されると、レジスタ221のレジスタReg0、Reg1、Reg2にセキュリティコードx1、y1、z1がそれぞれ格納される。このレジスタ221に格納されたセキュリティコードx1、y1、z1をCPU21が読み取って暗号化方法が選択され、使用する暗号化プログラムが決定する。   In the boot mode, when the security codes x1, y1, and z1 are sequentially input from the serial I / O 23 together with the address values 400H, 401H, and 402H, the security codes x1, y1, and z1 are respectively stored in the registers Reg0, Reg1, and Reg2 of the register 221. Stored. The CPU 21 reads the security codes x1, y1, and z1 stored in the register 221 to select an encryption method, and an encryption program to be used is determined.

続いて、シリアルI/O23からフラッシュメモリ3へ書き込むデータがフラッシュメモリ3のアドレス値とともに順次入力される。ここで、暗号化プログラムが実行されて、最初に入力されたアドレス値403Hは404Hに変換され、データaは!aに変換されてフラッシュメモリ3へ転送される。また、続いてシリアルI/O23から入力されたアドレス値404Hは403Hに変換され、データbは!bに変換される。以下、最終のデータまで上述の暗号化が繰り返される。   Subsequently, data to be written to the flash memory 3 from the serial I / O 23 is sequentially input together with the address value of the flash memory 3. Here, when the encryption program is executed, the address value 403H input first is converted into 404H, and the data a is! It is converted to a and transferred to the flash memory 3. Subsequently, the address value 404H input from the serial I / O 23 is converted into 403H, and the data b is! converted to b. Thereafter, the above encryption is repeated until the final data.

図8は、フラッシュメモリ3からバッファメモリ24へデータを転送するときの動作波形図である。ここでは、図7で示した動作でフラッシュメモリ3へ書き込まれたデータをバッファメモリ24へ転送するときの動作を例に示している。   FIG. 8 is an operation waveform diagram when data is transferred from the flash memory 3 to the buffer memory 24. Here, the operation when the data written to the flash memory 3 by the operation shown in FIG. 7 is transferred to the buffer memory 24 is shown as an example.

外部リセット要求(Hレベル)が入力され、フラッシュメモリ3からのデータの読み出しが始まると、暗号化と対になっている復号化を実行する復号化プログラムが実行される。すなわち、アドレスの「奇数と偶数の入れ替え」、およびデータの「各ビットの反転」が行われる。ただし、アドレスについては、フラッシュメモリ3のアドレス領域からバッファメモリ24のアドレス領域へのシフト(400H分の引き算)も併せて行われる。   When an external reset request (H level) is input and reading of data from the flash memory 3 is started, a decryption program that executes decryption paired with encryption is executed. In other words, “odd and even switching” of addresses and “inversion of each bit” of data are performed. However, for the address, a shift (subtraction for 400H) from the address area of the flash memory 3 to the address area of the buffer memory 24 is also performed.

これにより、フラッシュメモリ3のアドレス値403Hは004Hへ、404Hは003Hへと順次変換され、また、データは!bがbへ、!aがaへと順次変換されてバッファメモリ24へと転送される。   As a result, the address value 403H of the flash memory 3 is sequentially converted into 004H, 404H is converted into 003H, and the data is! b goes to b! a is sequentially converted to a and transferred to the buffer memory 24.

図9に、上述したセキュリティコードx1y1z1におけるフラッシュメモリ3に対する暗号化、復号化の様子を示す。   FIG. 9 shows how the above-described security code x1y1z1 is encrypted and decrypted with respect to the flash memory 3.

シリアルI/Oへ入力されるフラッシュメモリ3のアドレスおよびデータは暗号化されて、フラッシュメモリ3へ転送される。したがって、フラッシュメモリ3に格納されたデータは、元のシリアルI/Oから入力されたデータとは異なっており、アドレスの並び順もシリアルI/Oから入力された順番とは異なっている。   The address and data of the flash memory 3 input to the serial I / O are encrypted and transferred to the flash memory 3. Therefore, the data stored in the flash memory 3 is different from the data input from the original serial I / O, and the order of addresses is different from the order input from the serial I / O.

一方、フラッシュメモリ3からバッファメモリ22への転送のときは、フラッシュメモリ3のアドレスおよびデータが復号化される。したがって、バッファメモリ22に格納されたデータは、元のシリアルI/Oから入力されたデータと同じであり、アドレスの並び順もシリアルI/Oから入力された順番のとおりである。   On the other hand, when transferring from the flash memory 3 to the buffer memory 22, the address and data of the flash memory 3 are decoded. Therefore, the data stored in the buffer memory 22 is the same as the data input from the original serial I / O, and the order of the addresses is the same as the order input from the serial I / O.

このような本実施例では、暗号化プログラムを複数のプログラムの中から選択することができるので暗号化方式を随時変更することができ、暗号化方式が画一的になることを防ぐことができる。また、暗号化をハードウェアによらずプログラムで行うため、チップの分解等によるハードウェアの解析で暗号化方式が解析されることを防ぐことができる。さらに、外付けメモリへ格納するデータの暗号化のみならず、外付けメモリのアドレスも暗号化するため、外付けメモリに対するセキュリティをより高めることができる。   In this embodiment, since the encryption program can be selected from a plurality of programs, the encryption method can be changed at any time, and the encryption method can be prevented from becoming uniform. . Further, since encryption is performed by a program regardless of hardware, it is possible to prevent the encryption method from being analyzed by hardware analysis such as chip disassembly. Furthermore, since not only the data stored in the external memory is encrypted, but also the address of the external memory is encrypted, security for the external memory can be further enhanced.

本発明の実施例に係るメモリ外付けマイコンの構成を示すブロック図。The block diagram which shows the structure of the memory external microcomputer which concerns on the Example of this invention. 本発明の実施例に係るメモリ外付けマイコンのメモリのアドレスマップの例を示す図。The figure which shows the example of the address map of the memory of the memory external microcomputer which concerns on the Example of this invention. 本発明の実施例に係るメモリ外付けマイコンにおける暗号化方法および復号化方法の例を示す図。The figure which shows the example of the encryption method in the memory external microcomputer which concerns on the Example of this invention, and a decoding method. 本発明の実施例に係るメモリ外付けマイコンのブートメモリに格納されるプログラムの例を示す図。The figure which shows the example of the program stored in the boot memory of the memory external microcomputer which concerns on the Example of this invention. 本発明の実施例に係るメモリ外付けマイコンにおける外付けメモリへのデータ転送動作のフローを示すフロー図。The flowchart which shows the flow of the data transfer operation | movement to the external memory in the memory external microcomputer which concerns on the Example of this invention. 本発明の実施例に係るメモリ外付けマイコンにおける外付けメモリからのデータ転送動作のフローを示すフロー図。The flowchart which shows the flow of the data transfer operation | movement from the external memory in the memory external microcomputer which concerns on the Example of this invention. 本発明の実施例に係るメモリ外付けマイコンにおける外付けメモリへのデータ転送動作の様子を示す波形図。FIG. 4 is a waveform diagram showing a state of data transfer operation to an external memory in the memory external microcomputer according to the embodiment of the present invention. 本発明の実施例に係るメモリ外付けマイコンにおける外付けメモリからのデータ転送動作の様子を示す波形図。FIG. 4 is a waveform diagram showing a state of data transfer operation from an external memory in a memory external microcomputer according to an embodiment of the present invention. 本発明の実施例に係るメモリ外付けマイコンにおける暗号化/復号化の様子を示す図。The figure which shows the mode of encryption / decryption in the memory external microcomputer which concerns on the Example of this invention.

符号の説明Explanation of symbols

1 メモリ外付けマイコン
2 MCUチップ
3 フラッシュメモリ
21 CPU
22 フラッシュメモリI/F
23 シリアルI/O
24 バッファメモリ
25 ブートメモリ
26 アドレスコントローラ
221 レジスタ
1 Memory external microcomputer 2 MCU chip 3 Flash memory 21 CPU
22 Flash memory I / F
23 Serial I / O
24 buffer memory 25 boot memory 26 address controller 221 register

Claims (5)

MCUチップと、前記MCUチップに外付けされて前記MCUチップとの間で相互にデータの受け渡しを行うメモリとを備えるメモリ外付けマイコンであって、
前記MCUチップが、CPUと、
ブートモード時に読み出される暗号化プログラムおよび復号化プログラムを格納したブートメモリと、
前記外付けメモリから転送されるデータを格納するバッファメモリと
を具備し、
前記MCUチップから前記外付けメモリへデータを転送するときは、前記CPUが前記暗号化プログラムを用いて前記外付けメモリへ与えるアドレスおよびデータを暗号化して転送し、前記外付けメモリから前記バッファメモリへデータを転送するときは、前記外付けメモリのアドレスおよびデータを前記CPUが前記復号化プログラムを用いて復号化して転送することを特徴とするメモリ外付けマイコン。
A memory external microcomputer comprising: an MCU chip; and a memory externally attached to the MCU chip to exchange data with the MCU chip,
The MCU chip includes a CPU;
A boot memory storing an encryption program and a decryption program read in the boot mode;
A buffer memory for storing data transferred from the external memory,
When transferring data from the MCU chip to the external memory, the CPU encrypts and transfers the address and data given to the external memory using the encryption program, and transfers the data from the external memory to the buffer memory. An external memory microcomputer characterized in that when transferring data to the external memory, the CPU decodes and transfers the address and data of the external memory using the decryption program.
前記ブートメモリには、暗号化プログラムと復号化プログラムの対が複数格納されており、ブートモード時にそのうちの1対が選択されることを特徴とする請求項1に記載のメモリ外付けマイコン。   2. The memory external microcomputer according to claim 1, wherein a plurality of pairs of an encryption program and a decryption program are stored in the boot memory, and one of the pairs is selected in the boot mode. 前記1対の暗号化プログラムと復号化プログラムの選択が、外部から入力されるセキュリティコードの値に従って行われることを特徴とする請求項2に記載のメモリ外付けマイコン。   3. The memory external microcomputer according to claim 2, wherein the selection of the pair of encryption program and decryption program is performed according to a value of a security code input from the outside. 前記MCUチップから前記外付けメモリへのデータの転送が、ブートモード時に行われることを特徴とする請求項1に記載のメモリ外付けマイコン。   2. The memory external microcomputer according to claim 1, wherein data transfer from the MCU chip to the external memory is performed in a boot mode. 前記外付けメモリから前記バッファメモリへのデータの転送が、外部からのリセット要求時に行われることを特徴とする請求項1に記載のメモリ外付けマイコン。   2. The memory external microcomputer according to claim 1, wherein data transfer from the external memory to the buffer memory is performed when an external reset request is made.
JP2004017421A 2004-01-26 2004-01-26 Microcomputer with external memory Expired - Lifetime JP4574994B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2004017421A JP4574994B2 (en) 2004-01-26 2004-01-26 Microcomputer with external memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2004017421A JP4574994B2 (en) 2004-01-26 2004-01-26 Microcomputer with external memory

Publications (2)

Publication Number Publication Date
JP2005209108A true JP2005209108A (en) 2005-08-04
JP4574994B2 JP4574994B2 (en) 2010-11-04

Family

ID=34902251

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2004017421A Expired - Lifetime JP4574994B2 (en) 2004-01-26 2004-01-26 Microcomputer with external memory

Country Status (1)

Country Link
JP (1) JP4574994B2 (en)

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070277024A1 (en) * 2006-05-25 2007-11-29 Red. Hat, Inc. Methods and systems for secure address handling in a processor
JP2008109655A (en) * 2006-10-23 2008-05-08 Beijing Feitian Technologies Co Ltd Intelligent key device with external storage, and the using method thereof
JP2009163284A (en) * 2007-12-28 2009-07-23 Oki Semiconductor Co Ltd Processor apparatus
JP2012070846A (en) * 2010-09-28 2012-04-12 Kyoraku Sangyo Kk Game machine
JP2012070847A (en) * 2010-09-28 2012-04-12 Kyoraku Sangyo Kk Game machine
JP2012070844A (en) * 2010-09-28 2012-04-12 Kyoraku Sangyo Kk Game machine
JP2012070848A (en) * 2010-09-28 2012-04-12 Kyoraku Sangyo Kk Game machine
JP2012070845A (en) * 2010-09-28 2012-04-12 Kyoraku Sangyo Kk Game machine
JP2012070843A (en) * 2010-09-28 2012-04-12 Kyoraku Sangyo Kk Game machine
JP2013101442A (en) * 2011-11-08 2013-05-23 Renesas Electronics Corp Microcomputer and data processing apparatus
US9183414B2 (en) 2008-02-29 2015-11-10 Samsung Electronics Co., Ltd. Memory controller and memory device including the memory controller
US9569371B2 (en) 2014-06-13 2017-02-14 Samsung Electronics Co., Ltd. Memory device, memory system, and operating method of memory system
JP6221014B1 (en) * 2014-10-06 2017-10-25 マイクロン テクノロジー, インク. Secure shared key sharing system and method
WO2023162075A1 (en) * 2022-02-24 2023-08-31 三菱電機株式会社 Software update system and software update method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003051819A (en) * 2001-08-08 2003-02-21 Toshiba Corp Microprocessor
JP2003203013A (en) * 2002-01-08 2003-07-18 Matsushita Electric Ind Co Ltd Microprocessor, and program forming device and program debugging device therefor
JP2003280989A (en) * 2002-03-20 2003-10-03 Toshiba Corp Internal memory type tamper-resistant processor and secrecy protection method
JP2005523537A (en) * 2002-04-18 2005-08-04 インターナショナル・ビジネス・マシーンズ・コーポレーション Initializing, maintaining, updating, and recovering secure operations within an integrated system using data access control functions

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2003051819A (en) * 2001-08-08 2003-02-21 Toshiba Corp Microprocessor
JP2003203013A (en) * 2002-01-08 2003-07-18 Matsushita Electric Ind Co Ltd Microprocessor, and program forming device and program debugging device therefor
JP2003280989A (en) * 2002-03-20 2003-10-03 Toshiba Corp Internal memory type tamper-resistant processor and secrecy protection method
JP2005523537A (en) * 2002-04-18 2005-08-04 インターナショナル・ビジネス・マシーンズ・コーポレーション Initializing, maintaining, updating, and recovering secure operations within an integrated system using data access control functions

Cited By (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070277024A1 (en) * 2006-05-25 2007-11-29 Red. Hat, Inc. Methods and systems for secure address handling in a processor
JP2008109655A (en) * 2006-10-23 2008-05-08 Beijing Feitian Technologies Co Ltd Intelligent key device with external storage, and the using method thereof
JP2009163284A (en) * 2007-12-28 2009-07-23 Oki Semiconductor Co Ltd Processor apparatus
US9183414B2 (en) 2008-02-29 2015-11-10 Samsung Electronics Co., Ltd. Memory controller and memory device including the memory controller
JP2012070848A (en) * 2010-09-28 2012-04-12 Kyoraku Sangyo Kk Game machine
JP2012070844A (en) * 2010-09-28 2012-04-12 Kyoraku Sangyo Kk Game machine
JP2012070847A (en) * 2010-09-28 2012-04-12 Kyoraku Sangyo Kk Game machine
JP2012070845A (en) * 2010-09-28 2012-04-12 Kyoraku Sangyo Kk Game machine
JP2012070843A (en) * 2010-09-28 2012-04-12 Kyoraku Sangyo Kk Game machine
JP2012070846A (en) * 2010-09-28 2012-04-12 Kyoraku Sangyo Kk Game machine
JP2013101442A (en) * 2011-11-08 2013-05-23 Renesas Electronics Corp Microcomputer and data processing apparatus
US9569371B2 (en) 2014-06-13 2017-02-14 Samsung Electronics Co., Ltd. Memory device, memory system, and operating method of memory system
JP6221014B1 (en) * 2014-10-06 2017-10-25 マイクロン テクノロジー, インク. Secure shared key sharing system and method
JP2017536729A (en) * 2014-10-06 2017-12-07 マイクロン テクノロジー, インク. Secure shared key sharing system and method
WO2023162075A1 (en) * 2022-02-24 2023-08-31 三菱電機株式会社 Software update system and software update method

Also Published As

Publication number Publication date
JP4574994B2 (en) 2010-11-04

Similar Documents

Publication Publication Date Title
JP4574994B2 (en) Microcomputer with external memory
EP0137995B1 (en) Single-chip microcomputer with encryptable function on program memory
US10872642B2 (en) System comprising a memory capable of implementing calculation operations
JP6088655B2 (en) System, apparatus and method for performing rotation and XOR in response to a single instruction
JP2006227777A (en) Data processor
KR20110012804A (en) Data mask system and data mask method
JPWO2008068937A1 (en) Data transfer control device and computer system
JPH1185507A (en) Central processor and microcomputer system
JP2008140104A (en) Memory system and memory access method
US7783691B2 (en) Sharing of a logic operator having a work register
US20070153133A1 (en) Address generation for video processing
JP2000029790A (en) Data security system
JP4723334B2 (en) DMA transfer system
JP3251447B2 (en) Encoding device and method, and decoding device and method
US6820191B2 (en) Apparatus and method for executing an instruction with a register bit mask for transferring data between a plurality of registers and memory inside a processor
JPS59206968A (en) Eprom mounted type microcomputer
JP2002207707A (en) Simd type micro-processor having function for selecting constant
KR100468615B1 (en) Apparatus for protecting internal program
CN113608785A (en) Processor core, processor and instruction processing method
JP2006178829A (en) Microcomputer
JP2010140132A (en) Memory system and memory controller
JP2000132491A (en) Method and system for device control
JP2006164163A (en) Unauthorized rom use prevention device
JP2008003867A (en) Microcomputer
JPH11232092A (en) Controller for microprocessor

Legal Events

Date Code Title Description
RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20050428

RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20050606

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20061222

A711 Notification of change in applicant

Free format text: JAPANESE INTERMEDIATE CODE: A712

Effective date: 20081226

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20090210

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20100416

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20100614

RD03 Notification of appointment of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7423

Effective date: 20100614

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A821

Effective date: 20100614

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20100722

A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20100819

R150 Certificate of patent or registration of utility model

Ref document number: 4574994

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130827

Year of fee payment: 3

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313115

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

EXPY Cancellation because of completion of term