JP2015173497A - Electronic apparatus - Google Patents

Electronic apparatus Download PDF

Info

Publication number
JP2015173497A
JP2015173497A JP2015107434A JP2015107434A JP2015173497A JP 2015173497 A JP2015173497 A JP 2015173497A JP 2015107434 A JP2015107434 A JP 2015107434A JP 2015107434 A JP2015107434 A JP 2015107434A JP 2015173497 A JP2015173497 A JP 2015173497A
Authority
JP
Japan
Prior art keywords
arithmetic processing
arithmetic
address
data
storage device
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.)
Pending
Application number
JP2015107434A
Other languages
Japanese (ja)
Inventor
清水 秀夫
Hideo Shimizu
秀夫 清水
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
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP2015107434A priority Critical patent/JP2015173497A/en
Publication of JP2015173497A publication Critical patent/JP2015173497A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To provide an electronic apparatus that downsizes an arithmetic unit.SOLUTION: An electronic apparatus is constituted by: a storage unit: an arithmetic unit; and an interface unit electrically connected to an external apparatus. The arithmetic unit comprises: an arithmetic section for executing first arithmetic processing and second arithmetic processing used in an encryption method on data to be target data of the first arithmetic processing and the second arithmetic processing; a control section 111 which controls the arithmetic section so that the first arithmetic processing and the second arithmetic processing are executed in order specified by the encryption method and outputs specific information showing a work region of the storage unit or a data type to be used by the first arithmetic processing and the second arithmetic processing; and a generation section 114 for generating an address in the storage unit to be used by the first arithmetic processing and the second arithmetic processing, on the basis of a first counter value of the first arithmetic processing and a second counter value of the second arithmetic processing whose number of times of update agrees with that of the first counter value and the specific information.

Description

本発明の実施形態は、電子機器に関する。   Embodiments described herein relate generally to an electronic apparatus.

AES(Advanced Encryption Standard)は米国標準の暗号方式であり、様々な分野
に採用されている。AESを実行する回路(AES演算回路)の小型化(ハードウェアの
回路規模縮小)は色々な研究が行われている。
AES (Advanced Encryption Standard) is an American standard encryption method and is used in various fields. Various studies have been conducted on the downsizing (reducing the circuit scale of hardware) of a circuit (AES arithmetic circuit) that executes AES.

M. Feldhofer,J. Wolkerstorfer,and V. Rijmen,"AES Implem entation on a Grain of Sand",IEE Proceedings Information Security,vo l. 152,pp. 13-20,2005.M. Feldhofer, J. Wolkerstorfer, and V. Rijmen, "AES Implem entation on a Grain of Sand", IEE Proceedings Information Security, vol. 152, pp. 13-20, 2005.

従来技術の方法では小型化が不十分な場合がある。   There are cases in which miniaturization is insufficient with the methods of the prior art.

実施形態の電子機器は、記憶装置と、暗号方式で用いられる第一の演算処理及び第二の
演算処理を該第一の演算処理及び該第二の演算処理の対象となるデータに対して実行する
演算部と、前記第一の演算処理及び前記第二の演算処理が前記暗号方式で定められた順序
で実行されるように前記演算部を制御するとともに、前記第一の演算処理及び前記第二の
演算処理に用いられる前記記憶装置の作業領域又は前記データの種類を示す特定情報を出
力する制御部と、前記第一の演算処理の第一カウンタ値及び該第一カウンタ値と更新回数
が一致する前記第二の演算処理の第二カウンタ値と前記特定情報とに基づいて、前記第一
の演算処理及び前記第二の演算処理に用いられる前記記憶装置内のアドレスを生成する生
成部と、を備えた演算装置と、外部機器と電気的に接続されるインタフェース部と、を有
する。
The electronic device according to the embodiment executes the first arithmetic processing and the second arithmetic processing used in the storage device and the encryption method on the data that is the target of the first arithmetic processing and the second arithmetic processing. And controlling the arithmetic unit so that the first arithmetic processing and the second arithmetic processing are executed in the order determined by the encryption method, and the first arithmetic processing and the second arithmetic processing A control unit for outputting specific information indicating the work area of the storage device or the type of data used for the second arithmetic processing, the first counter value of the first arithmetic processing, the first counter value, and the number of updates. A generating unit configured to generate an address in the storage device used for the first calculation process and the second calculation process based on the matching second counter value of the second calculation process and the specific information; A computing device comprising: Having an interface unit which is part device electrically connected, the.

第1の実施形態にかかる暗号化装置を含む電子機器のブロック図。The block diagram of the electronic device containing the encryption apparatus concerning 1st Embodiment. 第1の実施形態にかかる暗号化装置のブロック図。1 is a block diagram of an encryption device according to a first embodiment. 擬似コード内の各命令の意味を説明するための図。The figure for demonstrating the meaning of each command in a pseudo code. 第1の実施形態にかかるALUのブロック図。The block diagram of ALU concerning a 1st embodiment. ld命令の処理例を示す図。The figure which shows the example of a process of ld instruction | indication. st命令の処理例を示す図。The figure which shows the process example of st instruction. xor命令の処理例を示す図。The figure which shows the process example of a xor instruction. sboxおよびxtime命令の処理例を示す図。The figure which shows the process example of a sbox and xtime instruction | indication. 第1の実施形態にかかる暗号化処理部のブロック図。The block diagram of the encryption process part concerning 1st Embodiment. 第1の実施形態で用いるアドレス空間を示す図。The figure which shows the address space used in 1st Embodiment. 第1の実施形態にかかるアドレス生成部のブロック図。FIG. 3 is a block diagram of an address generation unit according to the first embodiment. 図11の各回路に相当する関数の入出力を示す図。The figure which shows the input / output of the function corresponded to each circuit of FIG. 第1の実施形態における暗号化処理のフローチャート。The flowchart of the encryption process in 1st Embodiment. 詳細版擬似コードを状態遷移表として書き直した図。The detailed version of pseudo code is rewritten as a state transition table. 状態遷移表の各項目の読み方を表す図。The figure showing how to read each item of a state transition table. 第1の実施形態の変形例にかかるアドレス生成部のブロック図。The block diagram of the address generation part concerning the modification of 1st Embodiment. 図16の各回路に相当する関数の入出力を示す図。The figure which shows the input / output of the function corresponded to each circuit of FIG. 第2の実施形態にかかる復号装置のブロック図。The block diagram of the decoding apparatus concerning 2nd Embodiment. 第2の実施形態にかかるALUのブロック図。The block diagram of ALU concerning a 2nd embodiment. 第2の実施形態における復号処理のフローチャート。The flowchart of the decoding process in 2nd Embodiment.

以下に添付図面を参照して、この発明にかかる演算装置の好適な実施形態を詳細に説明
する。以下では、演算装置をAES暗号方式の暗号化装置(第1の実施形態)および復号
装置(第2の実施形態)に適用した例を説明する。なお、適用可能な装置はこれに限られ
るものではない。
Exemplary embodiments of an arithmetic device according to the present invention will be described below in detail with reference to the accompanying drawings. Below, the example which applied the arithmetic unit to the encryption apparatus (1st Embodiment) and decryption apparatus (2nd Embodiment) of an AES encryption system is demonstrated. Note that applicable apparatuses are not limited to this.

(第1の実施形態)
これまでのAES演算回路の小型化の研究では、記憶素子も含めたAES演算回路全体
のサイズを小さくすることに主眼が置かれていた。AES演算回路単体で利用されるので
あれば、AES演算回路全体のサイズを小型化する意味はある。現実にはAES演算回路
は何らかの装置(電子機器)に組み込まれて使用される。このため、このような使用状況
を考慮してAES演算回路のサイズを小さくする必要がある。しかし、これまでは、AE
S演算回路が他の機器(システム)に組み込まれて使用されるということを考慮した小型
化の研究は行われていない。
(First embodiment)
So far, research on downsizing the AES arithmetic circuit has focused on reducing the size of the entire AES arithmetic circuit including the memory element. If the AES arithmetic circuit is used alone, it is meaningful to reduce the size of the entire AES arithmetic circuit. In reality, the AES arithmetic circuit is used by being incorporated in some device (electronic device). For this reason, it is necessary to reduce the size of the AES arithmetic circuit in consideration of such a use situation. But until now, AE
There has been no research on downsizing considering that the S arithmetic circuit is incorporated in another device (system).

一般に、システムには、他の用途で使うことを目的とした記憶装置、例えば通信用のバ
ッファ(RAM(Random Access Memory)など)が存在する。そこで、第1の実施形態
の暗号化装置は、このような記憶装置を、AES演算回路を使用するときに転用する。こ
れにより、AES演算回路内に記憶装置を備える必要がなくなり、さらなる小型化が実現
できる。
In general, a system includes a storage device intended to be used for other purposes, for example, a communication buffer (RAM (Random Access Memory) or the like). Therefore, the encryption device according to the first embodiment diverts such a storage device when using the AES arithmetic circuit. Thereby, it is not necessary to provide a storage device in the AES arithmetic circuit, and further miniaturization can be realized.

このように、AES演算回路を組み込むシステム内の記憶装置を転用すれば、システム
全体で考えると、記憶素子を除いたAES演算回路のサイズを小さくすることが意味を持
つ。このような観点に基づいてAES演算回路の小型化を考えた例は今までに存在しない
In this way, if the storage device in the system in which the AES arithmetic circuit is incorporated is diverted, it is meaningful to reduce the size of the AES arithmetic circuit excluding the storage element in view of the entire system. There has never been an example considering miniaturization of the AES arithmetic circuit based on such a viewpoint.

次に、本実施形態の暗号化装置の構成の概要について説明する。AES暗号は、基本的
にバイト単位で演算処理が実行される。ShiftRowsは16バイトのバイト単位の
並び替えである。ShiftRowsにより実際に並び替えるためには、16バイトの他
にバッファとなる記憶装置が必要になる。また、MixColumnsは4バイト単位の
変換であるが、入力の4バイトが揃わないと変換が実行できない。
Next, an outline of the configuration of the encryption apparatus according to this embodiment will be described. In the AES cipher, operation processing is basically executed in units of bytes. ShiftRows is a 16-byte rearrangement. In order to actually rearrange with ShiftRows, a storage device as a buffer is required in addition to 16 bytes. MixColumns is conversion in units of 4 bytes. However, conversion cannot be executed unless 4 bytes of input are prepared.

本実施形態では、最低限必要な5種類の命令(擬似命令)のみでAESを実現する。5
種類の命令には、3種類の演算処理の命令(sbox、xtime、および、xor)と
、2種類のメモリアクセスの命令(ld(ロード)およびst(ストア))とが含まれる
。また、演算結果を記憶するためのレジスタとして8ビットのアキュムレータを設ける。
また、これらの命令によりAES暗号をハードウェアで実行する順序機械である制御部を
備える。命令や各構成部の詳細は後述する。
In the present embodiment, AES is realized with only five types of necessary instructions (pseudo instructions). 5
The types of instructions include three types of arithmetic processing instructions (sbox, xtime, and xor) and two types of memory access instructions (ld (load) and st (store)). An 8-bit accumulator is provided as a register for storing the operation result.
In addition, a control unit that is a sequential machine that executes the AES cipher with hardware according to these instructions is provided. Details of the command and each component will be described later.

図1は、第1の実施形態にかかる暗号化装置100を含む電子機器10の構成の一例を
示すブロック図である。図1に示すように、電子機器10は、暗号化装置100と、入出
力インタフェース(入出力IF)200と、記憶装置300と、鍵記憶装置400と、を
備えている。
FIG. 1 is a block diagram illustrating an example of a configuration of an electronic device 10 including an encryption device 100 according to the first embodiment. As shown in FIG. 1, the electronic device 10 includes an encryption device 100, an input / output interface (input / output IF) 200, a storage device 300, and a key storage device 400.

記憶装置300は、電子機器10で扱う各種データを記憶する。記憶装置300は、デ
ータを記憶するアドレスを指定することにより当該データにアクセス可能とする記憶媒体
である。記憶装置300は、例えばRAMにより構成できる。
The storage device 300 stores various data handled by the electronic device 10. The storage device 300 is a storage medium that can access the data by designating an address for storing the data. The storage device 300 can be constituted by a RAM, for example.

入出力IFは、図示しない制御回路からの指示に従い、外部との間でデータを送受信す
るためのインタフェースである。鍵記憶装置400は、暗号化処理で用いる鍵情報を記憶
する。暗号化装置100は、記憶装置300と接続され、AES暗号方式の演算を実行す
る。記憶装置300は、ページバッファ用のRAMを用いてもよい。鍵記憶装置400は
、NANDフラッシュを用いても良い。記憶装置300は、揮発性メモリまたは不揮発性
メモリである。鍵記憶装置400は、不揮発性メモリである。また、記憶装置300と鍵
記憶装置400は物理的に同一のメモリを用いても良い。
The input / output IF is an interface for transmitting / receiving data to / from the outside in accordance with an instruction from a control circuit (not shown). The key storage device 400 stores key information used in the encryption process. The encryption device 100 is connected to the storage device 300 and executes an AES encryption method. The storage device 300 may use a page buffer RAM. The key storage device 400 may use a NAND flash. The storage device 300 is a volatile memory or a nonvolatile memory. The key storage device 400 is a nonvolatile memory. Further, the storage device 300 and the key storage device 400 may use physically the same memory.

制御回路は、例えば、以下のようにしてAES暗号を実行する。   For example, the control circuit executes AES encryption as follows.

(1)入出力IFを介して暗号化するデータ(メッセージ)を読み出し、記憶装置300
に書き込む。
(1) Data to be encrypted (message) is read via the input / output IF, and the storage device 300
Write to.

(2)鍵記憶装置400から鍵情報を読み出し、記憶装置300に書き込む。 (2) Read key information from the key storage device 400 and write it to the storage device 300.

(3)暗号化装置100に演算を指示する。これにより、演算の処理結果である暗号文が
記憶装置300に書き込まれる。
(3) Instruct the encryption apparatus 100 to perform computation. As a result, the ciphertext that is the processing result of the operation is written in the storage device 300.

図2は、第1の実施形態にかかる暗号化装置100の構成の一例を示すブロック図であ
る。図2に示すように、暗号化装置100は、暗号化処理部110と、演算部としてのA
LU(Arithmetic Logic Unit)120と、アキュムレータ130と、を備えている。
FIG. 2 is a block diagram illustrating an example of the configuration of the encryption device 100 according to the first embodiment. As illustrated in FIG. 2, the encryption device 100 includes an encryption processing unit 110 and an arithmetic unit A.
An LU (Arithmetic Logic Unit) 120 and an accumulator 130 are provided.

暗号化処理部110は、図1で説明した電子機器10の制御回路からの制御信号に従っ
てAES暗号の暗号化処理の演算を制御し、演算の状態を表すステータス信号を出力する
。暗号化処理部110の詳細は後述する。
The encryption processing unit 110 controls the operation of the AES encryption processing according to the control signal from the control circuit of the electronic device 10 described with reference to FIG. 1, and outputs a status signal indicating the state of the operation. Details of the encryption processing unit 110 will be described later.

ALU120は、暗号化処理部110により選択された機能を表す情報(図2の「機能
選択」)に従って演算を実行する。ALU120は、必要に応じて、暗号化処理部110
により指定されたアドレスのデータに対して演算を実行する。
The ALU 120 performs an operation in accordance with information indicating the function selected by the encryption processing unit 110 (“function selection” in FIG. 2). The ALU 120 encrypts the encryption processing unit 110 as necessary.
The operation is performed on the data at the address specified by.

アキュムレータ130は、ALU120による演算結果を記憶するためのレジスタであ
る。アキュムレータ130に記憶されたデータは、暗号化処理部110からの指示に応じ
て記憶装置300に書き込まれる。
The accumulator 130 is a register for storing the calculation result by the ALU 120. Data stored in the accumulator 130 is written into the storage device 300 in response to an instruction from the encryption processing unit 110.

なお、暗号化装置100は、記憶装置300のうち、一部の記憶領域を使用してAES
暗号の演算を実行する。記憶装置300内に必要な記憶領域の内訳は以下のとおりである
The encryption device 100 uses a part of the storage area of the storage device 300 to perform AES.
Perform cryptographic operations. The breakdown of the storage area required in the storage device 300 is as follows.

・使用する記憶領域全体のサイズ=49バイト
・入力となるメッセージm=16バイト
・入力となる鍵k=16バイト
・作業領域w=16バイト
・ラウンド定数rc=1バイト
なお、演算結果である暗号文はメッセージmに上書きされる。
The size of the entire storage area to be used = 49 bytes. Input message m = 16 bytes. Input key k = 16 bytes. Work area w = 16 bytes. Round constant rc = 1 byte. The sentence is overwritten on message m.

図2の暗号化装置100の使用方法は以下のようになる。   The usage method of the encryption apparatus 100 of FIG. 2 is as follows.

・記憶装置300に入力データ(メッセージm(16バイト)および鍵k(16バイト)
を書き込む
・暗号化装置100を実行開始する
・暗号化装置100の実行終了を待つ
・演算結果は記憶装置300に書き込まれているので、演算結果を記憶装置300から読
み出す
ここで、本実施形態によるAES暗号方式の暗号化処理の擬似コードについて説明する
。最初に、簡略化した擬似コード(簡易版擬似コード)を記載する。
-Input data (message m (16 bytes) and key k (16 bytes) in the storage device 300
The execution of the encryption device 100 is started. The execution of the encryption device 100 is awaited. The calculation result is written in the storage device 300, so the calculation result is read from the storage device 300. Here, according to the present embodiment A pseudo code of the encryption process of the AES encryption method will be described. First, a simplified pseudo code (simplified pseudo code) is described.

//m=AES(m,k)
//入力 m:メッセージ、k:鍵
round=0
rc=0x01
m=AK(m,k)//AddRoundKey
while(1){
k=KS(k)//KeyExpansion
m=SB(m)//SubBytes
w=SR(m)//ShiftRows
round=round+1
if(round==10) break;//exit while loop
m=MC(w)//MixColumns
m=AK(m,k)//AddRoundKey
rc=xtime(rc)//rc update

m=AK(w,k)//AddRoundKey
擬似コード内の各関数は、それぞれAES暗号で定められる関数と以下のように対応す
る。各AES暗号で定められる関数は各々FIPS197(Federal Information Processing Sta
ndards Publication 197, the National Institute of Standards and Technology (NIST
))で定義される関数である。
// m = AES (m, k)
// input m: message, k: key
round = 0
rc = 0x01
m = AK (m, k) // AddRoundKey
while (1) {
k = KS (k) // KeyExpansion
m = SB (m) // SubBytes
w = SR (m) // ShiftRows
round = round + 1
if (round == 10) break; // exit while loop
m = MC (w) // MixColumns
m = AK (m, k) // AddRoundKey
rc = xtime (rc) // rc update
}
m = AK (w, k) // AddRoundKey
Each function in the pseudo code corresponds to a function defined by the AES cipher as follows. The functions defined in each AES cipher are each FIPS197 (Federal Information Processing Sta
ndards Publication 197, the National Institute of Standards and Technology (NIST
)) Is a function defined.

AK:AddRoundKey
KS:KeyExpansion
MC:MixColumns
SB:SubBytes
SR:ShiftRows
次に、詳細なAES擬似コード(詳細版擬似コード)を記載する。詳細版擬似コードは
、上記簡易版擬似コードの各関数(AK、KS、SB、SR、MCなど)を具体化したコ
ードを含む。
AK: AddRoundKey
KS: KeyExpansion
MC: MixColumns
SB: SubBytes
SR: ShiftRows
Next, detailed AES pseudo code (detailed version pseudo code) is described. The detailed version pseudo code includes a code that embodies each function (AK, KS, SB, SR, MC, etc.) of the simplified version pseudo code.

round=0
rc=0x01
//AddRoundKey:m=AK(m,k)
for(i=0; i<16; i++){
ld m[i]
xor k[i]
st m[i]

while(1){
//KeyExpansion:k=KS(k)
for(i=0; i<16; i++){
ld k[kp(i)]
if(i<4){
sbox
if(i==0) xor rc

xor k[i]
st k[i]

//SubBytes:m=SB(m)
for(i=0; i<16; i++){
ld m[i]
sbox
st m[i]

//ShiftRows:w=SR(m)
for(i=0; i<16; i++){
ld m[sr(i)]
st w[i]

//loop control
round=round+1
if(round==10) break;//exit while loop
//MixColumns:m=MC(w)
for(i=0; i<16; i++){
ld w[i]
xor w[ofs1(i)]
xtime
xor w[ofs1(i)]
xor w[ofs2(i)]
xor w[ofs3(i)]
st m[i]

//AddRoundKey:m=AK(m,k)
for(i=0; i<16; i++){
ld m[i]
xor k[i]
st m[i]

//rc update:rc=xtime(rc)
ld rc
xtime
st rc

//AddRoundKey:m=AK(w,k)
for(i=0; i<16; i++){
ld w[i]
xor k[i]
st m[i]

//end
図3は、擬似コード内の各命令の意味を説明するための図である。図3は、各命令を別
の表現で表した式(別表現)と、命令の内容を表す説明とを記載する。図3のAccはア
キュムレータ130に対応する。図3のmemは記憶装置300の指定されたアドレスの
データに対応する。
round = 0
rc = 0x01
// AddRoundKey: m = AK (m, k)
for (i = 0; i <16; i ++) {
ld m [i]
xor k [i]
st m [i]
}
while (1) {
// KeyExpansion: k = KS (k)
for (i = 0; i <16; i ++) {
ld k [kp (i)]
if (i <4) {
sbox
if (i == 0) xor rc
}
xor k [i]
st k [i]
}
// SubBytes: m = SB (m)
for (i = 0; i <16; i ++) {
ld m [i]
sbox
st m [i]
}
// ShiftRows: w = SR (m)
for (i = 0; i <16; i ++) {
ld m [sr (i)]
st w [i]
}
// loop control
round = round + 1
if (round == 10) break; // exit while loop
// MixColumns: m = MC (w)
for (i = 0; i <16; i ++) {
ld w [i]
xor w [ofs1 (i)]
xtime
xor w [ofs1 (i)]
xor w [ofs2 (i)]
xor w [ofs3 (i)]
st m [i]
}
// AddRoundKey: m = AK (m, k)
for (i = 0; i <16; i ++) {
ld m [i]
xor k [i]
st m [i]
}
// rc update: rc = xtime (rc)
ld rc
xtime
st rc
}
// AddRoundKey: m = AK (w, k)
for (i = 0; i <16; i ++) {
ld w [i]
xor k [i]
st m [i]
}
// end
FIG. 3 is a diagram for explaining the meaning of each instruction in the pseudo code. FIG. 3 describes an expression (separate expression) representing each instruction in a different expression, and an explanation representing the contents of the instruction. Acc in FIG. 3 corresponds to the accumulator 130. 3 corresponds to the data of the designated address in the storage device 300.

XTIME関数は、例えば、8ビット入出力の関数であり、以下の(1)式のように表
される。msb(x)はxの最上位ビットを表す。
The XTIME function is an 8-bit input / output function, for example, and is represented by the following equation (1). msb (x) represents the most significant bit of x.

(msb(x)==0)?(x<<1):(x<<1)^0x1b (1)
このようにして、本実施形態では、5種類の命令であるsbox、xtime、xor
、ldおよびstでAESを実現している。
(Msb (x) == 0)? (X << 1): (x << 1) ^ 0x1b (1)
Thus, in this embodiment, five types of instructions, sbox, xtime, and xor
, Ld, and st realize AES.

図4は、第1の実施形態にかかるALU120の構成の一例を示すブロック図である。
図4に示すように、ALU120は、XTIME121と、SBOX122と、XOR1
23と、セレクタ124と、を備えている。XTIME121、SBOX122、および
、XOR123は、それぞれ上述の3種類の演算処理(sbox、xtime、および、
xor)を実行する回路である。セレクタ124は、記憶装置300から読み出したデー
タ(LD)、XTIME121の演算結果、SBOX122の演算結果、および、XOR
123の演算結果のいずれかを選択して出力する。このようにして、ALU120は、暗
号化処理部110による機能選択の指定に従い、ld、xtime、sbox、および、
xorの4つの演算処理のいずれかを実行する。
FIG. 4 is a block diagram illustrating an example of the configuration of the ALU 120 according to the first embodiment.
As shown in FIG. 4, the ALU 120 includes an XTIME 121, an SBOX 122, and an XOR1.
23 and a selector 124. XTIME 121, SBOX 122, and XOR 123 are the above-described three types of arithmetic processing (sbox, xtime, and
xor). The selector 124 selects the data (LD) read from the storage device 300, the calculation result of the XTIME 121, the calculation result of the SBOX 122, and the XOR.
One of the operation results of 123 is selected and output. In this way, the ALU 120 follows the designation of function selection by the encryption processing unit 110, and ld, xtime, sbox, and
One of the four arithmetic processes of xor is executed.

次に、5種類の命令が実行されたときの暗号化装置100内の処理の流れについて図5
から図8を用いて説明する。図5は、ld命令が実行されたときの暗号化装置100内の
処理例を示す図である。
Next, a flow of processing in the encryption device 100 when five types of instructions are executed is shown in FIG.
Will be described with reference to FIG. FIG. 5 is a diagram illustrating a processing example in the encryption device 100 when the ld instruction is executed.

ld命令では、暗号化処理部110からアドレスが指定(出力)され、記憶装置300
の指定されたアドレスのデータが読み出され、ALU120を経由してアキュムレータ1
30に書き込まれる。図5の「acc−we」はアキュムレータ130への書き込みを指
示する信号を表す。図5の「read」は記憶装置300からのデータの読み出しを指示
する信号を表す。
In the ld instruction, an address is specified (output) from the encryption processing unit 110, and the storage device 300
The data at the designated address is read out, and the accumulator 1 is transmitted via the ALU 120.
30 is written. “Acc-we” in FIG. 5 represents a signal instructing writing to the accumulator 130. “Read” in FIG. 5 represents a signal instructing reading of data from the storage device 300.

図6は、st命令が実行されたときの暗号化装置100内の処理例を示す図である。s
t命令では、暗号化処理部110からアドレスが指定(出力)され、アキュムレータ13
0に記憶されているデータが、記憶装置300の指定されたアドレスに書き込まれる。ア
キュムレータ130に記憶されているデータは変更しないことを示すため、図5ではac
c−we信号に否定を示す上線が付されている。「write」は記憶装置300へのデ
ータの書き込みを指示する信号を表す。
FIG. 6 is a diagram illustrating a processing example in the encryption device 100 when the st instruction is executed. s
In the t instruction, an address is designated (output) from the encryption processing unit 110, and the accumulator 13
Data stored in 0 is written to a specified address in the storage device 300. In order to show that the data stored in the accumulator 130 is not changed, in FIG.
The c-we signal is overlined to indicate negation. “Write” represents a signal instructing data writing to the storage device 300.

図7は、xor命令が実行されたときの暗号化装置100内の処理例を示す図である。
xor命令では、暗号化処理部110からアドレスが指定(出力)され、アキュムレータ
130に記憶されているデータと、記憶装置300の指定されたアドレスのデータとの排
他的論理和の演算結果が、アキュムレータ130に書き込まれる。
FIG. 7 is a diagram illustrating a processing example in the encryption device 100 when the xor instruction is executed.
In the xor instruction, an address is designated (output) from the encryption processing unit 110, and the result of the exclusive OR operation between the data stored in the accumulator 130 and the data at the designated address in the storage device 300 is the accumulator. 130 is written.

図8は、sboxおよびxtime命令が実行されたときの暗号化装置100内の処理
例を示す図である。sboxおよびxtimeでは用いる関数が異なるが、動作は同様で
あるため同じ図にまとめて記載している。sbox命令(xtime命令)では、アキュ
ムレータ130に記憶されているデータに、SBOX関数(XTIME関数)を適用した
結果がアキュムレータ130に書き戻される。
FIG. 8 is a diagram illustrating a processing example in the encryption device 100 when the sbox and xtime instructions are executed. Although the functions used in sbox and xtime are different, the operations are the same, and are therefore collectively shown in the same figure. In the sbox instruction (xtime instruction), the result of applying the SBOX function (XTIME function) to the data stored in the accumulator 130 is written back to the accumulator 130.

図9は、第1の実施形態にかかる暗号化処理部110の構成の一例を示すブロック図で
ある。図9に示すように、暗号化処理部110は、制御部111と、ラウンドカウンタ1
12と、インデックスレジスタ113と、アドレス生成部114と、を備えている。
FIG. 9 is a block diagram illustrating an example of the configuration of the encryption processing unit 110 according to the first embodiment. As shown in FIG. 9, the encryption processing unit 110 includes a control unit 111, a round counter 1
12, an index register 113, and an address generation unit 114.

制御部111は、電子機器10の制御回路(図示せず)などの外部装置からの制御信号
に従い、各種制御信号を出力して、AES暗号化方式に応じて定められた手順に従って暗
号化処理の演算を制御する。図9の点線は、制御部111から各部に制御信号を出力する
ことを表している。この制御信号の詳細については後述する。
The control unit 111 outputs various control signals in accordance with control signals from an external device such as a control circuit (not shown) of the electronic device 10, and performs encryption processing according to a procedure determined according to the AES encryption method. Control operations. A dotted line in FIG. 9 represents that a control signal is output from the control unit 111 to each unit. Details of this control signal will be described later.

制御部111には、例えば、AES暗号の演算をリセットする信号、および、演算の開
始を指示する信号などの制御信号が入力される。制御部111は、処理状態を表すステー
タス信号(ビジー、完了など)を、例えば制御信号の入力元に出力する。
For example, a control signal such as a signal for resetting the calculation of the AES encryption and a signal for instructing the start of the calculation is input to the control unit 111. The control unit 111 outputs a status signal (busy, completion, etc.) indicating the processing state to, for example, a control signal input source.

ALU機能選択は、ALU120に対していずれの機能(演算)を実行するかを示す信
号を表す。Acc書き込みは、アキュムレータ130にデータを書き込むか否かを指定す
るための信号を表す。メモリR/Wは、記憶装置300からデータを読み出すか(R)、
記憶装置300にデータを書き込むか(W)を指定するための信号を表す。
The ALU function selection represents a signal indicating which function (calculation) is to be executed on the ALU 120. Acc writing represents a signal for designating whether or not to write data to the accumulator 130. The memory R / W reads data from the storage device 300 (R),
It represents a signal for designating whether to write data to the storage device 300 (W).

ラウンドカウンタ112は、AES暗号のラウンド数(round)を数えるためのカ
ウンタである。ラウンドカウンタ112は、例えばフリップフロップにより構成できる。
The round counter 112 is a counter for counting the number of rounds of AES encryption. The round counter 112 can be configured by a flip-flop, for example.

インデックスレジスタ113は、アドレス生成部114がアドレスを生成するために用
いるカウンタ値(ix)を記憶するレジスタである。本実施形態では、インデックスレジ
スタ113は、4ビットのカウンタ値を記憶する。
The index register 113 is a register that stores a counter value (ix) used by the address generation unit 114 to generate an address. In the present embodiment, the index register 113 stores a 4-bit counter value.

アドレス生成部114は、制御部111が出力する2ビットの値(ページ)と、インデ
ックスレジスタ113の4ビットのカウンタ値ixとから、6ビットのアドレスを生成し
て出力する。
The address generation unit 114 generates and outputs a 6-bit address from the 2-bit value (page) output from the control unit 111 and the 4-bit counter value ix of the index register 113.

ここで、本実施形態の暗号化装置100で使用する記憶装置300内の記憶領域のアド
レス空間について説明する。図10は、第1の実施形態で用いるアドレス空間の一例を示
す図である。
Here, the address space of the storage area in the storage device 300 used in the encryption device 100 of this embodiment will be described. FIG. 10 is a diagram illustrating an example of an address space used in the first embodiment.

図10では、メッセージm、鍵k、作業領域wおよびラウンド定数rcの順に連続する
アドレスを用いる例が示されている。アドレスの並び順はこれに限られるものではない。
例えば、16バイトのデータ(メッセージm、鍵k)または16バイトの作業領域wの各
バイトのアドレスが連続していれば、各データまたは作業領域のアドレスは連続していな
くてもよい。
FIG. 10 shows an example in which addresses that are consecutive in the order of message m, key k, work area w, and round constant rc are used. The order of addresses is not limited to this.
For example, if the address of each byte of 16-byte data (message m, key k) or 16-byte work area w is continuous, the address of each data or work area may not be continuous.

図11は、第1の実施形態にかかるアドレス生成部114の構成の一例を示すブロック
図である。図11に示すように、アドレス生成部114は、kp1001と、sr100
2と、ofs1(1011)(以下、単にofs1という)と、ofs2(1012)(
以下、単にofs2という)と、ofs3(1013)(以下、単にofs3という)と
、セレクタ1021と、を備えている。
FIG. 11 is a block diagram illustrating an example of the configuration of the address generation unit 114 according to the first embodiment. As shown in FIG. 11, the address generation unit 114 includes kp1001 and sr100.
2, ofs1 (1011) (hereinafter simply referred to as ofs1), ofs2 (1012) (
Hereinafter, it is simply referred to as ofs2), ofs3 (1013) (hereinafter simply referred to as ofs3), and a selector 1021.

kp1001、sr1002、ofs1、ofs2、および、ofs3は、それぞれイ
ンデックスレジスタから入力される4ビットのカウンタ値ixを変換する回路である。図
12は、図11の各回路に相当する関数の入出力の一例を示す図である。
kp1001, sr1002, ofs1, ofs2, and ofs3 are circuits that respectively convert a 4-bit counter value ix input from the index register. FIG. 12 is a diagram illustrating an example of input / output of a function corresponding to each circuit of FIG.

例えばkp(x)は、カウンタ値ix(図12の表のxに相当)が「0」の場合、「1
3」を出力する関数である。関数kp(x)は、鍵拡大処理(KeyExpansion)でのデータ
のアクセス順が13,14,15,12,0,1,2,3,4,5,6,7,8,9,10,1
1であることを反映している。sr(x)は、16バイトの並び替えを行うShiftRowsの
処理内容を反映している。
For example, kp (x) is “1” when the counter value ix (corresponding to x in the table of FIG. 12) is “0”.
3 "is output. In the function kp (x), the data access order in the key expansion process (KeyExpansion) is 13, 14, 15, 12, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 1
1 is reflected. sr (x) reflects the processing contents of ShiftRows for rearranging 16 bytes.

ofs1(x)〜ofs3(x)は、xの下位2ビットに、2ビットの1〜3を加算す
るが、xの上位2ビットは不変となる関数である。
ofs1 (x) to ofs3 (x) are functions in which 2 bits 1 to 3 are added to the lower 2 bits of x, but the upper 2 bits of x are unchanged.

セレクタ1021は、制御部111からの指示(図9の点線)に従い、0、カウント値
ix、kp1001の出力、sr1002の出力、ofs1の出力、ofs2の出力、お
よび、ofs3の出力、のいずれかを選択して出力する。
The selector 1021 selects any one of 0, the count value ix, the output of kp1001, the output of sr1002, the output of ofs1, the output of ofs2, and the output of ofs3 according to the instruction from the control unit 111 (dotted line in FIG. 9). Select and output.

図11の右上に示すように、アドレス生成部114は、制御部111から入力される2
ビットのページと、セレクタ1021から出力される4ビットの値(オフセットに相当)
とを結合したアドレスを出力する。このように、ページがアドレスの上位2ビットになり
、例えば、インデックスレジスタを各関数で変形した結果がアドレスの下位4ビットにな
る。ページは、演算処理に用いられるデータの種類および演算処理に用いられる記憶装置
300内の作業領域を特定するための特定情報として用いられる。例えば、ページは、メ
ッセージm、鍵k、作業領域w、および、ラウンド定数rcの4つを特定するために4値
をとる。このため、本実施形態ではページを2ビットで表している。
As shown in the upper right of FIG. 11, the address generation unit 114 receives 2 input from the control unit 111.
Bit page and 4-bit value output from selector 1021 (corresponding to offset)
The address that is combined with is output. In this way, the page becomes the upper 2 bits of the address. For example, the result of transforming the index register with each function becomes the lower 4 bits of the address. The page is used as identification information for identifying the type of data used for the arithmetic processing and the work area in the storage device 300 used for the arithmetic processing. For example, a page takes four values to specify four: message m, key k, work area w, and round constant rc. For this reason, in this embodiment, a page is represented by 2 bits.

次に、このように構成された第1の実施形態にかかる暗号化装置100による暗号化処
理について図13を用いて説明する。図13は、第1の実施形態における暗号化処理の全
体の流れを示すフローチャートである。図13は、上述のAESの簡易版擬似コードをフ
ローチャートとして記載した図に相当する。
Next, an encryption process performed by the encryption apparatus 100 according to the first embodiment configured as described above will be described with reference to FIG. FIG. 13 is a flowchart showing the overall flow of the encryption processing in the first embodiment. FIG. 13 corresponds to a diagram in which the simplified pseudo code of the AES is described as a flowchart.

まず、ラウンド数のカウンタ(round)およびラウンド定数(rc)がそれぞれ0
および1に初期化される(ステップS101)。次に、AddRoundKeyが実行され、メッセ
ージmが更新される(ステップS102)。次に、KeyExpansion(ステップS103)、
SubBytes(ステップS104)、ShiftRows(ステップS105)が順次実行され、ラウ
ンド数に1加算される(ステップS106)。
First, the round number counter (round) and the round constant (rc) are each 0.
And 1 are initialized (step S101). Next, AddRoundKey is executed and the message m is updated (step S102). Next, KeyExpansion (step S103),
SubBytes (step S104) and ShiftRows (step S105) are sequentially executed, and 1 is added to the number of rounds (step S106).

ラウンド数が10に達しない場合(ステップS107:No)、さらにMixColumns(ス
テップS108)、AddRoundKey(ステップS109)、およびxtime(ステップS110
)が実行される。その後、ステップS103に戻り処理が繰り返される。ラウンド数が1
0に達した場合(ステップS107:Yes)、AddRoundKeyが実行され(ステップS1
11)、暗号化処理が終了する。
When the number of rounds does not reach 10 (step S107: No), MixColumns (step S108), AddRoundKey (step S109), and xtime (step S110)
) Is executed. Thereafter, the process returns to step S103 and is repeated. 1 round
When the value reaches 0 (step S107: Yes), AddRoundKey is executed (step S1).
11) The encryption process ends.

SR(ShiftRows)は16バイトの並び替えだが、上書きすると元の値が消えるので、別
な領域である作業領域wにコピーしながら並び替えている(ステップS105)。この処
理(ステップS105)をC言語で記載すると次のようなコードになる。
SR (Shift Rows) is a 16-byte rearrangement, but if overwritten, the original value disappears, so the rearrangement is performed while copying to a work area w which is another area (step S105). When this process (step S105) is described in C language, the following code is obtained.

for(i=0; i<16; i++){
w[i]=m[sr[i]];

上記コード内の変数srは、
int sr[16]={0,5,10,15,4,9,14,3,8,13,2,7,12,1,6,11};
であるため、上記コードは、
w[0]=m[0]
w[1]=m[5]
w[2]=m[10]
w[3]=m[15]
w[4]=m[4]
w[5]=m[9]
w[6]=m[14]
w[7]=m[3]
w[8]=m[8]
w[9]=m[13]
w[10]=m[2]
w[11]=m[7]
w[12]=m[12]
w[13]=m[1]
w[14]=m[6]
w[15]=m[11]
という代入をしているのと同じことになる。
for (i = 0; i <16; i ++) {
w [i] = m [sr [i]];
}
The variable sr in the above code is
int sr [16] = {0,5,10,15,4,9,14,3,8,13,2,7,12,1,6,11};
Therefore, the above code is
w [0] = m [0]
w [1] = m [5]
w [2] = m [10]
w [3] = m [15]
w [4] = m [4]
w [5] = m [9]
w [6] = m [14]
w [7] = m [3]
w [8] = m [8]
w [9] = m [13]
w [10] = m [2]
w [11] = m [7]
w [12] = m [12]
w [13] = m [1]
w [14] = m [6]
w [15] = m [11]
Is the same as substituting.

1変数だけで逐次的に実行しようとすると、これから先に必要な値が上書きされて消さ
れてしまうので、別な変数にコピーしながら順番を入れ替えている。
If you try to execute sequentially with only one variable, the necessary value will be overwritten and deleted, so the order is changed while copying to another variable.

MC(MixColumns)も、値が上書される問題が生じるので、別の変数にコピーしながら変
換している(ステップS108)。
MC (MixColumns) is also converted while being copied to another variable because there is a problem that the value is overwritten (step S108).

AES暗号の規格(FIPS−197)では、
m[0]=xtime(w[0])^xtime(w[1])^w[1]^w[2]^w[3]
のように計算することが定められている。一方、xtime(a)^xtime(b)=xtime(a^b)で
あるため、次のようにxtimeをまとめて計算することもできる。
In the AES encryption standard (FIPS-197),
m [0] = xtime (w [0]) ^ xtime (w [1]) ^ w [1] ^ w [2] ^ w [3]
It is stipulated to calculate as follows. On the other hand, since xtime (a) ^ xtime (b) = xtime (a ^ b), xtime can be calculated as follows.

m[0]=xtime(w[0]^w[1])^w[1]^w[2]^w[3]
MC全体では以下のような計算をすることになる。
m [0] = xtime (w [0] ^ w [1]) ^ w [1] ^ w [2] ^ w [3]
The whole MC will calculate as follows.

m[0]=xtime(w[0]^w[1])^w[1]^w[2]^w[3]
m[1]=xtime(w[1]^w[2])^w[2]^w[3]^w[0]
m[2]=xtime(w[2]^w[3])^w[3]^w[0]^w[1]
m[3]=xtime(w[3]^w[0])^w[0]^w[1]^w[2]
m[4]=xtime(w[4]^w[5])^w[5]^w[6]^w[7]
m[5]=xtime(w[5]^w[6])^w[6]^w[7]^w[4]
m[6]=xtime(w[6]^w[7])^w[7]^w[4]^w[5]
m[7]=xtime(w[7]^w[4])^w[4]^w[5]^w[6]
m[8]=xtime(w[8]^w[9])^w[9]^w[10]^w[11]
m[9]=xtime(w[9]^w[10])^w[10]^w[11]^w[8]
m[10]=xtime(w[10]^w[11])^w[11]^w[8]^w[9]
m[11]=xtime(w[11]^w[8])^w[8]^w[9]^w[10]
m[12]=xtime(w[12]^w[13])^w[13]^w[14]^w[15]
m[13]=xtime(w[13]^w[14])^w[14]^w[15]^w[12]
m[14]=xtime(w[14]^w[15])^w[15]^w[12]^w[13]
m[15]=xtime(w[15]^w[12])^w[12]^w[13]^w[14]
添え字の並びを考慮し、本実施形態では以下のようにxtimeを計算する。
m [0] = xtime (w [0] ^ w [1]) ^ w [1] ^ w [2] ^ w [3]
m [1] = xtime (w [1] ^ w [2]) ^ w [2] ^ w [3] ^ w [0]
m [2] = xtime (w [2] ^ w [3]) ^ w [3] ^ w [0] ^ w [1]
m [3] = xtime (w [3] ^ w [0]) ^ w [0] ^ w [1] ^ w [2]
m [4] = xtime (w [4] ^ w [5]) ^ w [5] ^ w [6] ^ w [7]
m [5] = xtime (w [5] ^ w [6]) ^ w [6] ^ w [7] ^ w [4]
m [6] = xtime (w [6] ^ w [7]) ^ w [7] ^ w [4] ^ w [5]
m [7] = xtime (w [7] ^ w [4]) ^ w [4] ^ w [5] ^ w [6]
m [8] = xtime (w [8] ^ w [9]) ^ w [9] ^ w [10] ^ w [11]
m [9] = xtime (w [9] ^ w [10]) ^ w [10] ^ w [11] ^ w [8]
m [10] = xtime (w [10] ^ w [11]) ^ w [11] ^ w [8] ^ w [9]
m [11] = xtime (w [11] ^ w [8]) ^ w [8] ^ w [9] ^ w [10]
m [12] = xtime (w [12] ^ w [13]) ^ w [13] ^ w [14] ^ w [15]
m [13] = xtime (w [13] ^ w [14]) ^ w [14] ^ w [15] ^ w [12]
m [14] = xtime (w [14] ^ w [15]) ^ w [15] ^ w [12] ^ w [13]
m [15] = xtime (w [15] ^ w [12]) ^ w [12] ^ w [13] ^ w [14]
In consideration of the subscript sequence, the present embodiment calculates xtime as follows.

m[i]=xtime(w[i]^w[ofs1(i)])^w[ofs1(i)]^w[ofs2(i)]^w[ofs3(i)]
図14は、詳細版擬似コードを状態遷移表として書き直した図である。図15は、状態
遷移表の各項目の読み方を表す図である。codeは、5種類の命令のうち各状態で実行
される機能(命令)のコードである。readは、記憶装置300からデータを読み出す
ときに1が設定され、読み出さない場合は0が設定される。writeは、記憶装置30
0にデータを書き込むときに1が設定され、書き込まない場合は0が設定される。fun
cは、LD、XTIME、SBOX、XOR、および、任意(ALU120による演算は
実行しない)のいずれかが設定される。acc−weは、アキュムレータ130にデータ
を書き込むときに1が設定され、書き込まない場合は0が設定される。
m [i] = xtime (w [i] ^ w [ofs1 (i)]) ^ w [ofs1 (i)] ^ w [ofs2 (i)] ^ w [ofs3 (i)]
FIG. 14 is a diagram in which the detailed version pseudo code is rewritten as a state transition table. FIG. 15 is a diagram illustrating how to read each item of the state transition table. The code is a code of a function (instruction) executed in each state among five kinds of instructions. “read” is set to 1 when data is read from the storage device 300, and is set to 0 when data is not read. write is the storage device 30.
1 is set when data is written to 0, and 0 is set when data is not written. fun
For c, any one of LD, XTIME, SBOX, XOR, and arbitrary (the operation by the ALU 120 is not executed) is set. acc-we is set to 1 when data is written to the accumulator 130, and is set to 0 when data is not written.

例えば、state=S01では、ld m[i]というコードを実行する。その際に、read信号を1
に設定し、write信号を0に設定し、funcをLDに設定し、acc_weを1に設定する。またア
ドレス生成部114の出力はページがPMでoffsetがixである。ix欄とround欄は空白なの
で何も実行されない。制御欄は「↓」なので次の状態であるS02に遷移する。
For example, in state = S01, the code ld m [i] is executed. At that time, read signal is 1
, Set the write signal to 0, set func to LD, and set acc_we to 1. The output of the address generation unit 114 is that the page is PM and the offset is ix. Since the ix and round fields are blank, nothing is done. Since the control column is “↓”, the process proceeds to the next state S02.

S03ではix欄がix+1、制御はif(ix!=15) S01となっている。これはixの値を1増やし
てix+1に更新することと、ixの更新前の値が15でない場合はS01へ遷移することを意味
している。またixが15である場合は次の状態S04へ遷移する。図14に示されるように
、ixは、各演算処理の対象となるデータを変更するタイミングで更新される。
In S03, the ix column is ix + 1, and the control is if (ix! = 15) S01. This means that the value of ix is incremented by 1 and updated to ix + 1, and if the value before the update of ix is not 15, transition is made to S01. If ix is 15, the process proceeds to the next state S04. As illustrated in FIG. 14, ix is updated at a timing at which data to be subjected to each arithmetic processing is changed.

(変形例)
図16は、第1の実施形態の変形例にかかるアドレス生成部114−2の構成の一例を
示すブロック図である。図16に示すように、アドレス生成部114−2は、kp100
1と、sr1002と、ofs1010と、セレクタ1021−2と、を備えている。
(Modification)
FIG. 16 is a block diagram illustrating an example of the configuration of the address generation unit 114-2 according to the modification of the first embodiment. As illustrated in FIG. 16, the address generation unit 114-2 includes the kp100.
1, sr 1002, ofs 1010, and selector 1021-2.

本変形例では、オフセットを出力する3つの回路であるofs1、ofs2、および、
ofs3の代わりに、1つのofs1010を備えている。ofs1010は、カウンタ
値ixを3つの関数ofs(x,1)、ofs(x,2)、ofs(x,3)のいずれか
を用いて変換する回路である。3つの関数ofs(x,1)、ofs(x,2)、ofs
(x,3)のいずれを用いるかを指定する信号(図16の「1〜3」)は、例えば制御部
111から指定する。図17は、図16の各回路に相当する関数の入出力の一例を示す図
である。
In this modification, three circuits that output offsets, ofs1, ofs2, and
Instead of ofs3, a single ofs1010 is provided. The ofs 1010 is a circuit that converts the counter value ix using one of the three functions ofs (x, 1), ofs (x, 2), and ofs (x, 3). Three functions ofs (x, 1), ofs (x, 2), ofs
A signal (“1 to 3” in FIG. 16) that designates which of (x, 3) to use is designated from the control unit 111, for example. FIG. 17 is a diagram illustrating an example of input / output of a function corresponding to each circuit of FIG.

セレクタ1021−2は、制御部111からの指示に従い、0、カウント値ix、kp
1001の出力、sr1002の出力、ofs1010の出力、のいずれかを選択して出
力する。このような構成でも、図11と同様の機能を実現できる。
In accordance with an instruction from the control unit 111, the selector 1021-2 is 0, the count value ix, kp
One of the output of 1001, the output of sr1002, and the output of ofs1010 is selected and output. Even with such a configuration, the same function as in FIG. 11 can be realized.

このように、第1の実施形態にかかる演算装置(暗号化装置)では、装置外部の記憶装
置を利用し、演算で用いるデータを当該記憶装置に記憶するように制御する。これにより
、AES演算回路内に記憶装置を備える必要がなくなり、さらなる小型化が可能となる。
また、本実施形態では、ALU内には暗号化で用いる演算処理を実行する最小限の回路(
XTIME、SBOX、XOR)のみを備えるため、この点でも装置の小型化が可能とな
っている。また、本実施形態では、暗号化で用いる各演算処理を所定の回数単位で実行し
ている。例えばインデックスレジスタのカウント値が15に達するごとに、すなわち、1
6回単位で各演算を実行している。このため、回数が不一致となる場合に必要となる制御
回路が不要になり、さらに小型化が実現できる。
As described above, the arithmetic device (encryption device) according to the first embodiment uses the storage device outside the device, and controls to store the data used in the calculation in the storage device. Thereby, it is not necessary to provide a storage device in the AES arithmetic circuit, and further miniaturization becomes possible.
In the present embodiment, the ALU has a minimum circuit (a circuit for performing arithmetic processing used for encryption) (
Since only XTIME, SBOX, and XOR) are provided, the apparatus can be downsized in this respect as well. In the present embodiment, each calculation process used for encryption is executed in a predetermined number of times. For example, every time the count value of the index register reaches 15, that is, 1
Each calculation is executed in units of 6 times. For this reason, the control circuit required when the number of times does not match is not required, and further miniaturization can be realized.

(第2の実施形態)
第2の実施形態では、AES暗号方式の復号装置に演算装置を適用した例を説明する。
図18は、第2の実施形態にかかる復号装置100−2の構成の一例を示すブロック図で
ある。図18に示すように、復号装置100−2は、復号処理部110−2と、演算部と
してのALU(Arithmetic Logic Unit)120−2と、アキュムレータ130と、を
備えている。
(Second Embodiment)
In the second embodiment, an example in which an arithmetic device is applied to a decryption device of the AES encryption method will be described.
FIG. 18 is a block diagram illustrating an example of the configuration of the decoding device 100-2 according to the second embodiment. As illustrated in FIG. 18, the decoding device 100-2 includes a decoding processing unit 110-2, an ALU (Arithmetic Logic Unit) 120-2 as an arithmetic unit, and an accumulator 130.

復号処理部110−2は、AES暗号の復号処理の演算を制御し、演算の状態を表すス
テータス信号を出力する。アキュムレータ130は、ALU120による演算結果を記憶
するためのレジスタである。
The decryption processing unit 110-2 controls the operation of the AES encryption decryption process and outputs a status signal indicating the state of the operation. The accumulator 130 is a register for storing the calculation result by the ALU 120.

ALU120−2は、復号処理部110−2により選択された機能を表す情報に従って
演算を実行する。ALU120−2は、必要に応じて、復号処理部110−2により指定
されたアドレスのデータに対して演算を実行する。
The ALU 120-2 performs an operation according to information representing the function selected by the decryption processing unit 110-2. The ALU 120-2 performs an operation on the data at the address specified by the decryption processing unit 110-2 as necessary.

本実施形態によるAES暗号方式の復号処理の擬似コードについて説明する。以下に、
復号処理を簡略化した擬似コード(簡易版擬似コード)を記載する。
A pseudo code of the decryption process of the AES encryption method according to the present embodiment will be described. less than,
A pseudo code (simplified pseudo code) that simplifies the decoding process is described.

//m=invAES(m,k)
//入力 m:暗号文 k:復号鍵
round=0;
rc=0x36;
m=AK(m,k)//AddRoundKey
while(1){
k=iKS(k)//invKeyExpansion
m=iSB(m)//invSubBytes
w=iSR(m)//invShiftRows
round=round+1
if(round==10) break;//exit while loop
w=AK(w,k)//AddRoundKey
m=iMC(w)//invMixColumns
rc=ixtime(rc)//rc update

m=AK(w,k)//AddRoundKey
暗号化処理で用いる関数の先頭に「i」が付加された関数は、暗号化処理で用いる関数
の逆関数であることを意味する。例えば、iSBはSBの逆関数である。
// m = invAES (m, k)
// input m: ciphertext k: decryption key
round = 0;
rc = 0x36;
m = AK (m, k) // AddRoundKey
while (1) {
k = iKS (k) // invKeyExpansion
m = iSB (m) // invSubBytes
w = iSR (m) // invShiftRows
round = round + 1
if (round == 10) break; // exit while loop
w = AK (w, k) // AddRoundKey
m = iMC (w) // invMixColumns
rc = ixtime (rc) // rc update
}
m = AK (w, k) // AddRoundKey
A function with “i” added to the head of a function used in the encryption process means an inverse function of the function used in the encryption process. For example, iSB is an inverse function of SB.

iKSはsboxとxorにより作成できる。iSBはsboxの逆関数(isbox)が必要である。iMCはx
timeにより作成できる。ixtimeはxtimeにより作成できる。従って、ALU120−2は
、以下の5つ演算を実行できる回路を備えていればよい。
iKS can be created with sbox and xor. iSB requires the inverse of sbox (isbox). iMC x
Can be created by time. ixtime can be created by xtime. Therefore, the ALU 120-2 only needs to include a circuit that can execute the following five operations.

(1)LD
(2)XTIME
(3)SBOX
(4)ISBOX
(5)XOR
図19は、このように構成される第2の実施形態にかかるALU120−2の構成の一
例を示すブロック図である。図19に示すように、ALU120−2は、XTIME12
1と、SBOX122と、XOR123と、セレクタ124−2と、ISBOX125と
、を備えている。ISBOX125は、SBOX122の逆関数に相当する演算を実行す
る回路である。
(1) LD
(2) XTIME
(3) SBOX
(4) ISBOX
(5) XOR
FIG. 19 is a block diagram showing an example of the configuration of the ALU 120-2 according to the second embodiment configured as described above. As shown in FIG. 19, ALU 120-2 is XTIME 12.
1, SBOX 122, XOR 123, selector 124-2, and ISBOX 125. The ISBOX 125 is a circuit that executes an operation corresponding to the inverse function of the SBOX 122.

復号処理部110−2は、上記擬似コードの復号処理を実現するようにALU120−
2の演算を制御する。復号処理部110−2は、暗号化処理部110と同様の制御部11
1、ラウンドカウンタ112、インデックスレジスタ113、および、アドレス生成部1
14を備える。復号処理部110−2は、暗号化処理部110が暗号化処理を実行するの
と同様の手法で、AES暗号の復号処理を実行すればよい。なお、図19に示すALU1
2−2の構成で暗号化処理を行うことも可能である。この場合、図4で説明したような動
作を行い、ISBOXの機能選択の指定はなされない。
The decoding processing unit 110-2 is configured so that the pseudo code decoding process is realized by the ALU 120-
2 operations are controlled. The decryption processing unit 110-2 is the same control unit 11 as the encryption processing unit 110.
1, round counter 112, index register 113, and address generation unit 1
14. The decryption processing unit 110-2 may perform the AES cipher decryption process in the same manner as the encryption processing unit 110 performs the encryption process. Note that ALU1 shown in FIG.
It is also possible to perform encryption processing with the configuration of 2-2. In this case, the operation described with reference to FIG. 4 is performed, and ISBOX function selection is not designated.

次に、このように構成された第2の実施形態にかかる復号装置100−2による復号処
理について図20を用いて説明する。図20は、第2の実施形態における復号処理の全体
の流れを示すフローチャートである。
Next, the decoding process performed by the decoding apparatus 100-2 according to the second embodiment configured as described above will be described with reference to FIG. FIG. 20 is a flowchart illustrating an overall flow of the decoding process according to the second embodiment.

まず、ラウンド数のカウンタ(round)およびラウンド定数(rc)がそれぞれ0
および0x36(16進数の36)に初期化される(ステップS201)。次に、逆AddRou
ndKey(iAK)が実行され、メッセージmが更新される(ステップS202)。次に、逆Ke
yExpansion(iKS)(ステップS203)、逆SubBytes(iSB)(ステップS204)、逆S
hiftRows(iSR)(ステップS205)が順次実行され、ラウンド数に1加算される(ステ
ップS206)。
First, the round number counter (round) and the round constant (rc) are each 0.
And 0x36 (hexadecimal 36) (step S201). Then reverse AddRou
The ndKey (iAK) is executed and the message m is updated (step S202). Then reverse Ke
yExpansion (iKS) (step S203), inverse SubBytes (iSB) (step S204), inverse S
hiftRows (iSR) (step S205) is sequentially executed, and 1 is added to the number of rounds (step S206).

ラウンド数が10に達しない場合(ステップS207:No)、さらにAddRoundKey(
ステップS208)、逆MixColumns(iMC)(ステップS209)、および逆xtime(ixti
me)(ステップS210)が実行される。その後、ステップS203に戻り処理が繰り返
される。ラウンド数が10に達した場合(ステップS207:Yes)、AddRoundKeyが
実行され(ステップS211)、復号処理が終了する。
If the number of rounds does not reach 10 (step S207: No), AddRoundKey (
Step S208), inverse MixColumns (iMC) (Step S209), and inverse xtime (ixti)
me) (step S210) is executed. Thereafter, the process returns to step S203 and is repeated. When the number of rounds reaches 10 (step S207: Yes), AddRoundKey is executed (step S211), and the decoding process ends.

以上説明したとおり、第1および第2の実施形態によれば、演算処理に用いるデータを
記憶する記憶装置を演算装置内に備える必要がなくなり装置の小型化が実現できる。例え
ば、メモリカード内にAES演算回路を備える場合に、さらなるAES演算回路の小型化
が実現できる。
As described above, according to the first and second embodiments, it is not necessary to provide a storage device for storing data used for arithmetic processing in the arithmetic device, and the device can be downsized. For example, when the AES arithmetic circuit is provided in the memory card, further downsizing of the AES arithmetic circuit can be realized.

本発明のいくつかの実施形態を説明したが、これらの実施形態は、例として提示したも
のであり、発明の範囲を限定することは意図していない。これら新規な実施形態は、その
他の様々な形態で実施されることが可能であり、発明の要旨を逸脱しない範囲で、種々の
省略、置き換え、変更を行うことができる。これら実施形態やその変形は、発明の範囲や
要旨に含まれるとともに、特許請求の範囲に記載された発明とその均等の範囲に含まれる
Although several embodiments of the present invention have been described, these embodiments are presented by way of example and are not intended to limit the scope of the invention. These novel embodiments can be implemented in various other forms, and various omissions, replacements, and changes can be made without departing from the scope of the invention. These embodiments and modifications thereof are included in the scope and gist of the invention, and are included in the invention described in the claims and the equivalents thereof.

10 電子機器
100 暗号化装置
100−2 復号装置
110 暗号化処理部
110−2 復号処理部
111 制御部
112 ラウンドカウンタ
113 インデックスレジスタ
114 アドレス生成部
120、120−2 ALU
130 アキュムレータ
300 記憶装置
400 鍵記憶装置
DESCRIPTION OF SYMBOLS 10 Electronic device 100 Encryption apparatus 100-2 Decryption apparatus 110 Encryption processing part 110-2 Decryption processing part 111 Control part 112 Round counter 113 Index register 114 Address generation part 120, 120-2 ALU
130 accumulator 300 storage device 400 key storage device

Claims (6)

記憶装置と、
暗号方式で用いられる第一の演算処理及び第二の演算処理を該第一の演算処理及び該第
二の演算処理の対象となるデータに対して実行する演算部と、前記第一の演算処理及び前
記第二の演算処理が前記暗号方式で定められた順序で実行されるように前記演算部を制御
するとともに、前記第一の演算処理及び前記第二の演算処理に用いられる前記記憶装置の
作業領域又は前記データの種類を示す特定情報を出力する制御部と、前記第一の演算処理
の第一カウンタ値及び該第一カウンタ値と更新回数が一致する前記第二の演算処理の第二
カウンタ値と前記特定情報とに基づいて、前記第一の演算処理及び前記第二の演算処理に
用いられる前記記憶装置内のアドレスを生成する生成部と、を備えた演算装置と、
外部機器と電気的に接続されるインタフェース部と、
を有した電子機器。
A storage device;
An arithmetic unit that executes the first arithmetic processing and the second arithmetic processing used in the encryption method on the data that is the target of the first arithmetic processing and the second arithmetic processing, and the first arithmetic processing And the control unit is controlled so that the second calculation process is executed in the order determined by the encryption method, and the storage device used for the first calculation process and the second calculation process A control unit that outputs specific information indicating a work area or the type of the data, a first counter value of the first calculation process, and a second of the second calculation process in which the first counter value matches the number of updates. An arithmetic device comprising: a generation unit that generates an address in the storage device used for the first arithmetic processing and the second arithmetic processing based on the counter value and the specific information;
An interface unit electrically connected to an external device;
With electronic equipment.
前記記憶装置は、通信用バッファに用いられる第一領域と、該第一領域とは異なり前記
作業領域及び前記データと、該データの暗号化に用いられる鍵情報と、が記憶される第二
領域と、を含み、
前記生成部は、前記第二領域内の前記アドレスを生成することを特徴とする請求項1に
記載の電子機器。
The storage device stores a first area used for a communication buffer, a second area in which the work area and the data, and key information used for encryption of the data are stored, unlike the first area. And including
The electronic device according to claim 1, wherein the generation unit generates the address in the second area.
前記生成部は、生成された前記アドレスを前記制御部に出力し、
前記制御部は、前記アドレスを参照し、該アドレスの前記データに対して前記演算部が
前記第一の演算処理または前記第二の演算処理を行うように制御することを特徴とする請
求項2に記載の電子機器。
The generation unit outputs the generated address to the control unit,
The control unit refers to the address and controls the calculation unit to perform the first calculation process or the second calculation process on the data at the address. The electronic device as described in.
前記第一領域は、前記データが記憶される記憶領域と、前記第一の演算処理及び前記第
二の演算処理に用いられる前記作業領域と、前記鍵情報を保持する鍵領域とに区分される
ことを特徴とする請求項3に記載の演算装置。
The first area is divided into a storage area for storing the data, the work area used for the first calculation process and the second calculation process, and a key area for holding the key information. The arithmetic unit according to claim 3.
前記生成部は、前記データアドレスおよび前記鍵アドレスの上位ビットと、前記第一カ
ウンタ値と、に基づいて、前記第一の演算処理に用いられる前記記憶装置内の前記アドレ
スを生成することを特徴とする請求項4に記載の電子機器。
The generation unit generates the address in the storage device used for the first arithmetic processing based on the high-order bits of the data address and the key address and the first counter value. The electronic device according to claim 4.
暗号方式で用いられる演算を処理する演算回路と、
前記演算の演算回数を参照し、前記第一の演算の対象のデータが記憶される記憶装置の
保存位置を決定するアドレスを生成する電子機器。
An arithmetic circuit for processing arithmetic used in the encryption method;
An electronic device that generates an address that refers to the number of calculations of the calculation and determines a storage position of a storage device in which data targeted for the first calculation is stored.
JP2015107434A 2015-05-27 2015-05-27 Electronic apparatus Pending JP2015173497A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2015107434A JP2015173497A (en) 2015-05-27 2015-05-27 Electronic apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2015107434A JP2015173497A (en) 2015-05-27 2015-05-27 Electronic apparatus

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2011184938A Division JP5755970B2 (en) 2011-08-26 2011-08-26 Arithmetic unit

Publications (1)

Publication Number Publication Date
JP2015173497A true JP2015173497A (en) 2015-10-01

Family

ID=54260507

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2015107434A Pending JP2015173497A (en) 2015-05-27 2015-05-27 Electronic apparatus

Country Status (1)

Country Link
JP (1) JP2015173497A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10187036A (en) * 1996-12-27 1998-07-14 Sony Corp Device and method for ciphering, and device and method for transmission and reception
JP2000132997A (en) * 1998-10-26 2000-05-12 Nec Corp Semiconductor integrated circuit
JP2000307440A (en) * 1999-04-23 2000-11-02 Denso Corp Data stream converting device and data transmission system
JP2001265214A (en) * 2000-03-22 2001-09-28 Matsushita Electric Ind Co Ltd Storage medium recorded with data having data array structure stored thereon, and method for recording and reproducing data
JP2003066837A (en) * 2001-08-23 2003-03-05 Sony Corp Address generating method and data deciphering method
JP2003098960A (en) * 2001-09-25 2003-04-04 Matsushita Electric Works Ltd Crystograph decoding device
US20030133568A1 (en) * 2001-12-18 2003-07-17 Yosef Stein Programmable data encryption engine for advanced encryption standard algorithm
JP2004325677A (en) * 2003-04-23 2004-11-18 Sony Corp Encryption processing device, encryption processing method, and computer program
JP2005531023A (en) * 2002-06-25 2005-10-13 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Round key generation for AES (Rijndael) block ciphers
JP2008209499A (en) * 2007-02-23 2008-09-11 Toshiba Corp Aes decryption apparatus and program
JP2009069686A (en) * 2007-09-14 2009-04-02 Konica Minolta Business Technologies Inc Encryption circuit and decryption circuit

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH10187036A (en) * 1996-12-27 1998-07-14 Sony Corp Device and method for ciphering, and device and method for transmission and reception
JP2000132997A (en) * 1998-10-26 2000-05-12 Nec Corp Semiconductor integrated circuit
JP2000307440A (en) * 1999-04-23 2000-11-02 Denso Corp Data stream converting device and data transmission system
JP2001265214A (en) * 2000-03-22 2001-09-28 Matsushita Electric Ind Co Ltd Storage medium recorded with data having data array structure stored thereon, and method for recording and reproducing data
JP2003066837A (en) * 2001-08-23 2003-03-05 Sony Corp Address generating method and data deciphering method
JP2003098960A (en) * 2001-09-25 2003-04-04 Matsushita Electric Works Ltd Crystograph decoding device
US20030133568A1 (en) * 2001-12-18 2003-07-17 Yosef Stein Programmable data encryption engine for advanced encryption standard algorithm
JP2005531023A (en) * 2002-06-25 2005-10-13 コーニンクレッカ フィリップス エレクトロニクス エヌ ヴィ Round key generation for AES (Rijndael) block ciphers
JP2004325677A (en) * 2003-04-23 2004-11-18 Sony Corp Encryption processing device, encryption processing method, and computer program
JP2008209499A (en) * 2007-02-23 2008-09-11 Toshiba Corp Aes decryption apparatus and program
JP2009069686A (en) * 2007-09-14 2009-04-02 Konica Minolta Business Technologies Inc Encryption circuit and decryption circuit

Similar Documents

Publication Publication Date Title
JP4905000B2 (en) Cryptographic processing apparatus, cryptographic processing method, and computer program
JP4783104B2 (en) Encryption / decryption device
US9363074B2 (en) Encryption processing apparatus, encryption processing method, and computer program
US10121392B2 (en) Masking and unmasking methods and devices
US8724804B2 (en) Encryption processing apparatus
US20120159186A1 (en) Securing the implementation of a cryptographic process using key expansion
JP2005531023A (en) Round key generation for AES (Rijndael) block ciphers
JP2009516964A (en) Encryption protection method
SE1350203A1 (en) Device encryption process and process for unsafe environments
US20210284703A1 (en) Encryption device and operation method thereof
JP2015191106A (en) Encryption processing device, encryption processing method, and program
JP2008233683A (en) Encryption processing apparatus and program
EP3644546B1 (en) Apparatus and method for generating cryptographic algorithm, apparatus and method for encryption
EP3644547B1 (en) Apparatus and method for generating cryptographic algorithm, apparatus and method for encryption
US10411881B2 (en) Data processing apparatus, method for processing data, and medium
JP5755970B2 (en) Arithmetic unit
JP2011101413A (en) Method for making safe electronic cryptography assembly with secret key
JP2015191107A (en) Encryption processing device, encryption processing method, and program
CN110034918B (en) SM4 acceleration method and device
JP2014240921A (en) Encryption device, encryption processing method and encryption processing program
JP2015173497A (en) Electronic apparatus
JP4857230B2 (en) Pseudorandom number generator and encryption processing device using the same
US11265145B2 (en) Method and device for performing substitution table operations
US11061996B2 (en) Intrinsic authentication of program code
US20240113871A1 (en) Encryption processing apparatus, encryption processing method for encryption processing apparatus, and storage medium

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20160210

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20160226

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20160819