JP5939074B2 - Code processing method, information processing apparatus, and program - Google Patents
Code processing method, information processing apparatus, and program Download PDFInfo
- Publication number
- JP5939074B2 JP5939074B2 JP2012169880A JP2012169880A JP5939074B2 JP 5939074 B2 JP5939074 B2 JP 5939074B2 JP 2012169880 A JP2012169880 A JP 2012169880A JP 2012169880 A JP2012169880 A JP 2012169880A JP 5939074 B2 JP5939074 B2 JP 5939074B2
- Authority
- JP
- Japan
- Prior art keywords
- code
- variables
- operand
- electronic circuit
- source code
- 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.)
- Expired - Fee Related
Links
Images
Landscapes
- Stored Programmes (AREA)
Description
本発明はコード処理方法、情報処理装置およびプログラムに関する。 The present invention relates to a code processing method, an information processing apparatus, and a program.
現在、集積回路(IC:Integrated Circuit)などの電子回路を設計するとき、C言語やC++言語といった人間が理解容易な高級言語(プログラミング言語)を使用することがある。例えば、高位合成(または、動作合成)として、高級言語で記述された動作記述であるソースコードからハードウェア記述言語(HDL:Hardware Description Language)で記述されたRTL(Register Transfer Level)モデルを生成する。そして、論理合成として、生成されたRTLモデルからネットリストなどの回路データを生成する。 Currently, when designing an electronic circuit such as an integrated circuit (IC), a high-level language (programming language) such as a C language or a C ++ language that is easy for humans to understand may be used. For example, as high-level synthesis (or behavioral synthesis), an RTL (Register Transfer Level) model described in a hardware description language (HDL) is generated from source code that is a behavioral description described in a high-level language. . As logic synthesis, circuit data such as a net list is generated from the generated RTL model.
高位合成を利用することで、データ処理をソフトウェアで実現するために作成しておいたソースコードや、ハードウェアの専門知識をもたないソフトウェア技術者が作成したソースコードを利用して、電子回路を製造することが可能となる。ただし、ハードウェアを意識せずに作成されたソースコードからそのまま自動的に回路データを生成すると、動作速度や回路規模の点から非効率な電子回路が製造されてしまう可能性がある。この場合、高位合成を意識してソースコードを修正することで、動作速度や回路規模を改善し得る。ユーザがハードウェアベンダに電子回路の製造を依頼する場合には、ハードウェアベンダ側で最適化作業を行えるようにソースコードを渡すことが考えられる。 Using high-level synthesis, an electronic circuit can be created using source code created to implement data processing in software, or source code created by a software engineer who does not have hardware expertise. Can be manufactured. However, if circuit data is automatically generated as it is from source code created without being aware of hardware, an inefficient electronic circuit may be manufactured in terms of operation speed and circuit scale. In this case, the operation speed and circuit scale can be improved by modifying the source code in consideration of high-level synthesis. When a user requests a hardware vendor to manufacture an electronic circuit, it is conceivable to pass a source code so that the hardware vendor can perform optimization work.
なお、計算機システム毎に異なった符号化規則を割り当て、実行させたい計算機システムに対応する符号化規則に従ってプログラムを符号化することで、他の計算機システムでは当該プログラムを実行できないようにした機密保護方法が提案されている。また、ソースコードを暗号化してユーザに提供し、ユーザがもつコンパイラによってソースコードを復号してからコンパイルし実行形式ファイルを生成するプログラム提供方法が提案されている。また、ROM(Read Only Memory)に記憶されたソースプログラムに含まれる命令を変換テーブルに従って変換し、CPU(Central Processing Unit)は変換後のソースプログラムをアセンブルして実行するプログラム変換方法が提案されている。 A security method that assigns a different encoding rule to each computer system and encodes the program according to the encoding rule corresponding to the computer system to be executed, so that the other computer system cannot execute the program. Has been proposed. Also, a program providing method has been proposed in which source code is encrypted and provided to the user, and the source code is decrypted by a compiler owned by the user and then compiled to generate an executable file. Further, a program conversion method has been proposed in which instructions included in a source program stored in a ROM (Read Only Memory) are converted according to a conversion table, and a CPU (Central Processing Unit) assembles and executes the converted source program. Yes.
上記のように、電子回路の製造をハードウェアベンダに依頼する場合、電子回路の動作を記述したコードをハードウェアベンダに渡すことがある。しかし、コードに記述されたデータ処理の手順が、そのコードを作成したユーザにとってノウハウとして保護すべき秘密情報である場合がある。例えば、画像処理のための電子回路をハードウェアベンダに製造してもらうときであっても、画像処理のアルゴリズムをノウハウとして秘匿しておきたい場合が考えられる。その場合に、コードをそのままハードウェアベンダに渡してしまうと、コードとして表された秘密情報が漏洩してしまうおそれがあるという問題がある。 As described above, when a hardware vendor is requested to manufacture an electronic circuit, a code describing the operation of the electronic circuit may be passed to the hardware vendor. However, the data processing procedure described in the code may be secret information that should be protected as know-how for the user who created the code. For example, even when a hardware vendor manufactures an electronic circuit for image processing, there may be a case where it is desired to keep the image processing algorithm secret as know-how. In that case, if the code is directly passed to the hardware vendor, there is a problem that the secret information represented as the code may be leaked.
秘密情報の漏洩を抑制する技術の1つとして、コードの難読化がある。コードの難読化では、例えば、コードに記載された変数名を、変数の意味を推測し難いような他の変数名(ランダムな記号列など)に変換する。また、例えば、コードに記載された関数名を、関数の意味を推測し難いような他の関数名(ランダムな記号列など)に変換する。 One technique for suppressing leakage of secret information is obfuscation of codes. In code obfuscation, for example, a variable name described in the code is converted into another variable name (such as a random symbol string) that makes it difficult to guess the meaning of the variable. Further, for example, the function name described in the code is converted into another function name (such as a random symbol string) that makes it difficult to guess the meaning of the function.
しかし、コードを難読化しても、どのデータに対してどのような演算が行われるのかというデータと演算の関係が依然としてコードの中で表現されている。よって、データ処理の手順が秘密情報である場合には、難読化されたコードが解析されることで秘密情報が漏洩してしまうリスクが残る。例えば、単に変数名を変換しても、難読化したコードにおいて変数の定義と変数の参照とが関連付けられているため、その変数に格納されたデータがどのような演算に利用されているかがコードから読み取られてしまう。 However, even if the code is obfuscated, the relationship between the data and what operation is performed on which data is still expressed in the code. Therefore, when the data processing procedure is confidential information, there is a risk that the confidential information is leaked by analyzing the obfuscated code. For example, even if the variable name is simply converted, the definition of the variable and the reference of the variable are associated in the obfuscated code, so the code that indicates what operation the data stored in the variable is used for Will be read from.
一側面では、本発明は、コードとして表された秘密情報が漏洩するリスクを低減できるコード処理方法、情報処理装置およびプログラムを提供することを目的とする。 In one aspect, an object of the present invention is to provide a code processing method, an information processing apparatus, and a program that can reduce the risk of leakage of secret information represented as a code.
一側面では、コンピュータが実行するコード処理方法が提供される。このコード処理方法では、複数の変数が定義された第1のコード内から、演算のオペランドであって複数の変数の何れかを参照するオペランドを検出する。第1のコードから変換された第2のコードであって、検出されたオペランドの変数名を当該第2のコード内において複数の変数の何れの変数名としても使用されていない識別子に置換した第2のコードを生成し、また、識別子が複数の変数の何れに対応するかを示す対応情報を生成する。 In one aspect, a computer-implemented code processing method is provided. In this code processing method, an operand that is an operation operand and refers to any of the plurality of variables is detected from within the first code in which the plurality of variables are defined. A second code converted from the first code, wherein the variable name of the detected operand is replaced with an identifier that is not used as any variable name of the plurality of variables in the second code. 2 is generated, and correspondence information indicating which of the plurality of variables corresponds to the identifier is generated.
また、一側面では、コンピュータが実行するコード処理方法が提供される。このコード処理方法では、複数の関数が定義された第1のコード内から、複数の関数の何れかを呼び出す関数呼出文を検出する。第1のコードから変換された第2のコードであって、検出された関数呼出文の関数名を当該第2のコード内において複数の関数の何れの関数名としても使用されていない識別子に置換した第2のコードを生成し、また、識別子が複数の関数の何れに対応するかを示す対応情報を生成する。 In one aspect, a code processing method executed by a computer is provided. In this code processing method, a function call statement that calls one of the plurality of functions is detected from within the first code in which the plurality of functions are defined. A second code converted from the first code, wherein the function name of the detected function call statement is replaced with an identifier that is not used as any function name of a plurality of functions in the second code The second code is generated, and correspondence information indicating which of the plurality of functions corresponds to the identifier is generated.
また、一側面では、記憶部と生成部とを有する情報処理装置が提供される。
また、一側面では、コンピュータに処理を実行させるプログラムが提供される。
In one aspect, an information processing apparatus including a storage unit and a generation unit is provided.
In one aspect, a program for causing a computer to execute processing is provided.
一側面では、コードとして表された秘密情報が漏洩するリスクを低減できる。 In one aspect, the risk of leaking confidential information expressed as a code can be reduced.
以下、本実施の形態を図面を参照して説明する。
[第1の実施の形態]
図1は、第1の実施の形態の情報処理装置を示す図である。第1の実施の形態の情報処理装置10は、コード(例えば、高級言語で記述されたソースコード)を変換する。情報処理装置10は、ユーザによって操作される端末装置としてのクライアントコンピュータでもよいし、端末装置からアクセスされるサーバコンピュータでもよい。
Hereinafter, the present embodiment will be described with reference to the drawings.
[First Embodiment]
FIG. 1 is a diagram illustrating the information processing apparatus according to the first embodiment. The
情報処理装置10は、記憶部11と生成部12を有する。記憶部11は、RAM(Random Access Memory)などの揮発性メモリでもよいし、HDD(Hard Disk Drive)やフラッシュメモリなどの不揮発性の記憶装置でもよい。生成部12は、例えば、プロセッサである。「プロセッサ」は、CPUやDSP(Digital Signal Processor)でもよく、ASIC(Application Specific Integrated Circuit)やFPGA(Field Programmable Gate Array)などの電子回路でもよく、複数のプロセッサの集合であってもよい。プロセッサは、例えば、メモリ(記憶部11でもよい)に記憶されたプログラムを実行する。
The
記憶部11は、第1のコード21,21aを記憶する。第1のコード21,21aは、例えば、ユーザがC言語やC++言語などの高級言語で作成したソースコードである。第1のコード21には、複数の変数が定義されており、演算のオペランドであってそれら複数の変数の何れかを参照するオペランドが記載されている。演算には、四則演算や論理演算や比較演算などが含まれ得る。オペランドは、関数に渡す引数でもよい。第1のコード21aには、複数の関数が定義されており、それら複数の関数の何れかを呼び出す関数呼出文が記載されている。関数は、サブルーチンやメソッドと呼ばれるものでもよい。
The
生成部12は、第1のコード21を第2のコード22に変換する。このとき、生成部12は、第1のコード21内から演算のオペランドを検出し、検出したオペランドに記載されている変数名を、第2のコード22内において何れの変数の変数名としても使用されていない識別子に置換する。例えば、第2のコード22内で2つの変数を定義するために変数名x,yが使用されているとき、オペランドの変数名が何れの変数名とも異なる識別子A[0]に置換される。これにより、第2のコード22では、定義された変数と演算との対応が不明となる。なお、第2のコード22内で各変数を定義するための変数名は、第1のコード21と同じでもよいし異なってもよい。また、生成部12は、識別子が複数の変数の何れに対応するかを示す対応情報23を生成する。例えば、対応情報23は、識別子A[0]が変数名xを置換したものであることを示す。
The
また、生成部12は、第1のコード21aを第2のコード22aに変換する。このとき、生成部12は、第1のコード21a内から関数呼出文を検出し、検出した関数呼出文に記載されている関数名を、第2のコード22a内において何れの関数の関数名としても使用されていない識別子に置換する。例えば、第2のコード22a内で2つの関数を定義するために関数名f,gが使用されているとき、関数呼出文の関数名が何れの関数名とも異なる識別子A[1]に置換される。これにより、第2のコード22aでは、定義された関数と関数呼出との対応が不明となる。なお、第2のコード22a内で各関数を定義するための関数名は、第1のコード21aと同じでもよいし異なってもよい。また、生成部12は、識別子が複数の関数の何れに対応するかを示す対応情報23aを生成する。例えば、対応情報23aは、識別子A[1]が関数名fを置換したものであることを示す。
Further, the
生成された第2のコード22は、例えば、電子回路を製造するハードウェアベンダに提供される。これにより、第2のコード22が示すデータ処理を実現するための電子回路が製造される。ただし、第2のコード22では、少なくとも1つの演算について、どの変数のデータが参照されるかというデータと演算の関係が不明になっている。このため、製造される電子回路は、例えば、複数の変数に対応する複数の信号のうち何れかの信号を選択して演算回路に入力できるような選択回路を備える。生成された対応情報23は、例えば、ハードウェアベンダに提供されずに秘密情報として保管される。第2のコード22から電子回路が製造されると、例えば、対応情報23に応じた制御データが電子回路のメモリに書き込まれる。この制御データは、例えば、選択回路を制御するものである。
The generated second code 22 is provided to, for example, a hardware vendor that manufactures an electronic circuit. As a result, an electronic circuit for realizing the data processing indicated by the second code 22 is manufactured. However, in the second code 22, for at least one operation, the relationship between the data and the operation of which variable data is referenced is unknown. For this reason, the manufactured electronic circuit includes, for example, a selection circuit that can select one of a plurality of signals corresponding to a plurality of variables and input the selected signal to the arithmetic circuit. For example, the generated
第2のコード22と同様に、生成された第2のコード22aは、例えば、電子回路を製造するハードウェアベンダに提供される。また、生成された対応情報23aは、例えば、ハードウェアベンダに提供されずに秘密情報として保管される。
Similar to the second code 22, the generated
なお、上記では、生成部12が変数名の置換と関数名の置換の両方の機能を備えることとしたが、何れか一方の機能のみ備えるようにしてもよい。また、生成部12は、1つの第1のコードに対して変数名の置換と関数名の置換の両方を実行してもよい。その場合、生成する対応情報を、変数名と置換した識別子が何れの変数に対応するかと、関数名と置換した識別子が何れの関数に対応するかの両方を示すようにしてもよい。
In the above description, the
ここで、情報処理装置10が第1のコード21を難読化した場合、難読化されたコードでは依然として変数の定義で使用される変数名とその変数の参照で使用される変数名とが一致している。同様に、情報処理装置10が第1のコード21aを難読化した場合、難読化されたコードでは依然として関数の定義で使用される関数名と関数呼出で使用される関数名とが一致している。このため、難読化を行っただけでは、どのデータに対してどのような演算が行われるかというデータと演算の関係がコードから読み取られてしまう。
Here, when the
これに対し、第1の実施の形態の情報処理装置10によれば、第1のコード21,21aが第2のコード22,22aに変換され、また、第2のコード22,22aとは別に対応情報23,23aが生成される。第2のコード22,22aではループ・分岐などの制御構造や演算内容が表現されているため、第2のコード22,22aから電子回路を製造することが可能である。一方、第2のコード22,22aをハードウェアベンダに提供しても、対応情報23,23aを秘密情報として保管することで、第1のコード21,21aに含まれる秘密情報がハードウェアベンダに漏洩するリスクを低減できる。
On the other hand, according to the
[第2の実施の形態]
図2は、第2の実施の形態の情報処理システムを示す図である。第2の実施の形態の情報処理システムは、ネットワーク31、データベースサーバ32、ROMライタ33、端末装置34,100および製造装置35を含む。
[Second Embodiment]
FIG. 2 illustrates an information processing system according to the second embodiment. The information processing system according to the second embodiment includes a
データベースサーバ32、ROMライタ33および端末装置100は、ユーザ企業に設置されている。端末装置34および製造装置35は、ハードウェアベンダに設置されている。ハードウェアベンダは、ユーザ企業から依頼を受けてハードウェア部品200を製造する。ユーザ企業は、ハードウェアベンダに製造してもらったハードウェア部品200を使用する。例えば、ユーザ企業は、ハードウェア部品200にプロセッサなどの他のハードウェア部品を接続して自社内で使用する。または、ユーザ企業は、ハードウェア部品200を組み込んだ電子機器(例えば、プリンタなど)を製造して出荷する。ただし、ユーザ企業は、部品ではなく完成品の製造をハードウェアベンダに依頼してもよい。
The
端末装置100は、ユーザが操作するクライアントコンピュータである。端末装置100は、ハードウェア部品200に搭載される電子回路の動作を示すソースコードを編集する。ソースコードは、C言語やC++言語などの高級言語で記述されている。このソースコードは、電子回路を意識して作成されていなくてもよく、データ処理をソフトウェアで実現するために作成されたものを流用してもよい。端末装置100は、元のソースコードから、ハードウェアベンダに提供する外部情報(元のソースコードから変換されたソースコードを含む)とハードウェアベンダに提供せずに秘密に管理する秘密情報を生成する。なお、外部情報と秘密情報の生成は、端末装置100ではなく、端末装置100から社内ネットワークを介してアクセスされるサーバコンピュータが実行してもよい。
The
ネットワーク31は、ユーザ企業の社内ネットワーク(例えば、LAN(Local Area Network))とハードウェアベンダの社内ネットワークとを結ぶ広域ネットワークである。ネットワーク31を介してユーザ企業からハードウェアベンダに、ハードウェア部品200を製造するための情報(外部情報)が送信される。ただし、外部情報は、可搬記録媒体のようなネットワーク31以外の媒体を利用して渡すようにしてもよい。
The
データベースサーバ32は、データをHDDなどの不揮発性の記憶媒体に保存するサーバコンピュータである。データベースサーバ32は、ユーザ企業の社内ネットワークを介して端末装置100から秘密情報を受信し、ユーザ企業の外部に流出しないように秘密情報を保管する。また、データベースサーバ32は、端末装置100からのアクセスに応じて、保管している秘密情報を端末装置100に送信する。ただし、秘密情報はデータベースサーバ32でなく端末装置100に保管するようにしてもよい。
The
ROMライタ33は、端末装置100に接続されており、不揮発性メモリにデータを書き込む電子機器である。ROMライタ33は、ハードウェアベンダから受け取ったハードウェア部品200を使用可能な状態にするために、ハードウェア部品200が備えるメモリに秘密情報に応じた制御データを書き込む。ただし、ハードウェア部品200が備えるメモリがRAMなどの揮発性メモリである場合、ROMライタ33を利用せず、ハードウェア部品200に接続されるプロセッサが起動時に制御データを書き込めばよい。その場合、例えば、制御データはハードウェア部品200が搭載される電子機器に保存される。また、ROMライタ33は、端末装置100と異なる装置に接続されていてもよい。
The
端末装置34は、ハードウェアベンダのユーザが操作するクライアントコンピュータである。端末装置34は、ユーザ企業から受け取った外部情報に基づいて、実装設計用の回路データを生成する。このとき、端末装置34のユーザは、外部情報に含まれるソースコードを編集して最適化する。電子回路を意識して作成されていないソースコードを最適化することで、製造される電子回路の動作速度や回路規模が改善される。端末装置34は、高位合成ツールや論理合成ツールを使用して、最適化されたソースコードから回路データを生成する。なお、回路データの生成は、端末装置34ではなく、端末装置34から社内ネットワークを介してアクセスされるサーバコンピュータが実行してもよい。
The
製造装置35は、端末装置34が生成した回路データに基づいてハードウェア部品200を製造する。ハードウェア部品200は、例えば、プリント基板上に集積回路などの電子回路を実装したものである。電子回路は、例えば、ASICやFPGAとして製造される。電子回路は、製造後にユーザ企業が制御データを書き込むことができるメモリを備える。メモリは、EPROM(Erasable Programmable Read Only Memory)などの不揮発性メモリでもよいし、RAMなどの揮発性メモリでもよい。
The
図3は、端末装置のハードウェア例を示すブロック図である。端末装置100は、CPU101、RAM102、HDD103、画像信号処理部104、入力信号処理部105、ディスクドライブ106、通信インタフェース107およびインタフェース108を有する。上記ユニットは、端末装置100内でバス109に接続されている。データベースサーバ32や端末装置34も、端末装置100と同様のハードウェアにより実現できる。
FIG. 3 is a block diagram illustrating a hardware example of the terminal device. The
CPU101は、プログラムの命令を実行する演算器を含むプロセッサである。CPU101は、HDD103に記憶されているプログラムやデータの少なくとも一部をRAM102にロードしてプログラムを実行する。なお、CPU101は複数のプロセッサコアを備えてもよく、端末装置100は複数のプロセッサを備えてもよく、複数のプロセッサまたはプロセッサコアを用いて並列処理を行ってもよい。また、2以上のプロセッサの集合、FPGAやASICなどの専用回路、2以上の専用回路の集合、プロセッサと専用回路の組み合わせなどを「プロセッサ」と呼んでもよい。
The
RAM102は、CPU101が実行するプログラムやプログラムから参照されるデータを一時的に記憶する揮発性メモリである。なお、端末装置100は、RAM以外の種類のメモリを備えてもよく、複数個の揮発性メモリを備えてもよい。
The
HDD103は、OS(Operating System)やファームウェアやアプリケーションソフトウェアなどのソフトウェアのプログラムおよびデータを記憶する不揮発性の記憶装置である。なお、端末装置100は、フラッシュメモリやSSD(Solid State Drive)などの他の種類の記憶装置を備えてもよく、複数個の不揮発性の記憶装置を備えてもよい。
The
画像信号処理部104は、CPU101からの命令に従って、端末装置100に接続されたディスプレイ41に画像を出力する。ディスプレイ41としては、CRT(Cathode Ray Tube)ディスプレイや液晶ディスプレイなどを用いることができる。
The image
入力信号処理部105は、端末装置100に接続された入力デバイス42から入力信号を取得し、CPU101に通知する。入力デバイス42としては、マウスやタッチパネルなどのポインティングデバイス、キーボードなどを用いることができる。
The input
ディスクドライブ106は、記録媒体43に記録されたプログラムやデータを読み取る駆動装置である。記録媒体43として、例えば、フレキシブルディスク(FD:Flexible Disk)やHDDなどの磁気ディスク、CD(Compact Disc)やDVD(Digital Versatile Disc)などの光ディスク、光磁気ディスク(MO:Magneto-Optical disk)を使用できる。ディスクドライブ106は、CPU101からの命令に従って、記録媒体43から読み取ったプログラムやデータをRAM102またはHDD103に格納する。
The
通信インタフェース107は、ネットワークを介してデータベースサーバ32や端末装置34と通信を行う。通信インタフェース107は、ケーブルが接続される有線インタフェースでもよいし、無線通信を行う無線インタフェースであってもよい。
The
インタフェース108には、ROMライタ33が接続される。インタフェース108は、CPU101からの命令に従ってROMライタ33に制御データを送信する。
ただし、端末装置100はディスクドライブ106を備えなくてもよく、他の端末装置からアクセスされる場合には画像信号処理部104や入力信号処理部105を備えなくてもよい。また、ディスプレイ41や入力デバイス42は、端末装置100の筐体と一体に形成されてもよい。なお、RAM102またはHDD103は第1の実施の形態の記憶部11の一例であり、CPU101は第1の実施の形態の生成部12の一例である。
The
However, the
図4は、ソースコードの例を示す図である。ソースコード111は、端末装置100において変換される前のオリジナルのソースコードである。ソースコード111は、第1の実施の形態の第1のコード21,21aの一例である。
FIG. 4 is a diagram illustrating an example of source code. The
ソースコード111には、複数の変数と複数の関数が定義されている。図4の例では、入力データが代入される2つの変数と演算結果が代入される1つの変数とが定義されている。前者の2つは整数型(int型)の変数であり、ソースコード111では変数名apple,bananaが使用されている。後者は整数型の変数であり、ソースコード111では変数名outが使用されている。また、図4の例では、2つの関数が定義されている。2つの関数はそれぞれ整数型の引数を1つ受け取って整数型の戻り値を返すものであり、ソースコード111では関数名buy,sellが使用されている。
In the
そして、図4の例では、以下のようなプログラムの制御構造が記述されている。まず、変数名appleの変数の値(第1の入力データ)と変数名bananaの変数の値(第2の入力データ)とが比較されて、前者が後者より大きいか判断される。比較結果が真(true)であれば、変数名bananaの変数の値を実引数として用いて、関数名buyの関数が呼び出される。比較結果が偽(false)であれば、変数名bananaの変数の値を実引数として用いて、関数名sellの関数が呼び出される。 In the example of FIG. 4, the following program control structure is described. First, the value of the variable with the variable name “apple” (first input data) is compared with the value of the variable with the variable name “banana” (second input data) to determine whether the former is greater than the latter. If the comparison result is true, the function with the function name buy is called using the value of the variable with the variable name banana as an actual argument. If the comparison result is false, the function with the function name cell is called using the value of the variable with the variable name banana as an actual argument.
図5は、電子回路の第1の例を示すブロック図である。もしユーザ企業がハードウェアベンダに図4に示したソースコード111をそのまま渡した場合、ハードウェアベンダは図5に示すような電子回路を製造するものと予想される。この第1の電子回路は、比較回路211、関数に対応する演算回路212,213およびマルチプレクサ214を含む。
FIG. 5 is a block diagram illustrating a first example of an electronic circuit. If the user company delivers the
比較回路211は、第1の入力信号(in[0])と第2の入力信号(in[1])とを比較し、前者の値が後者の値より大きい場合は真=1を出力し、それ以外の場合は偽=0を出力する。演算回路212は、第2の入力信号を受け取って関数名buyの関数で定義された演算を行う。演算回路213は、第2の入力信号を受け取って関数名sellの関数で定義された演算を行う。マルチプレクサ214は、出力信号(out)として、比較回路211が真=1を出力したときは演算回路212の演算結果を選択し、比較回路211が偽=0を出力したときは演算回路213の演算結果を選択する。
The
このように、ソースコード111から、ソースコード111が示すデータ処理を実現する電子回路を製造することが可能である。しかし、図4に示したソースコード111からは、第1の入力データが比較演算の第1の参照オペランドとして使用され、第2の入力データが比較演算の第2の参照オペランドとして使用されることが明確に読み取れる。また、図4に示したソースコード111からは、第1の入力データが、関数名buy,sellの引数として使用されることが明確に読み取れる。もし、どのデータに対してどのような演算を行うかというデータと演算の関係が秘匿したい知識(ノウハウ)である場合には、ソースコード111をハードウェアベンダに渡すことでノウハウが漏洩してしまう。
In this manner, an electronic circuit that realizes data processing indicated by the
そこで、端末装置100は、データと演算の関係が不明になるようにソースコード111を変換してハードウェアベンダに提供する。ただし、変換されたソースコードからは、プロセッサに実行させるオブジェクトコードを生成することはできない。
Therefore, the
図6は、変換されたソースコードの例を示す図である。ソースコード112は、端末装置100において変換された後のハードウェアベンダに提供されるソースコードである。ソースコード112は、第1の実施の形態の第2のコード22,22aの一例である。
FIG. 6 is a diagram illustrating an example of converted source code. The
ソースコード112には、ソースコード111と同じ複数の変数と複数の関数が定義されている。図6の例では、3つの変数を定義するため、ソースコード111と同じ変数名apple,banana,outが使用され、2つの関数を定義するため、ソースコード111と同じ関数名buy,sellが使用されている。ただし、ソースコード111をソースコード112に変換する際、難読化を行って変数名や関数名を変えてもよい。
The
一方、ソースコード112では、変数や関数を参照する文に、ソースコード112で定義された変数名や関数名が記載されない。すなわち、演算の参照オペランド(関数呼出で指定される引数を含む)として記載されていた変数名がダミーの識別子に置換される。図6の例では、比較演算の参照オペランドとして記載されていた変数名apple,bananaが識別子x[0],x[1]に置換され、関数呼出の引数として記載されていた変数名bananaが識別子x[2]に置換されている。また、関数呼出文に記載されていた関数名がダミーの識別子に置換される。図6の例では、関数呼出文に記載されていた関数名buy,sellが、ダミーの識別子x[3],x[4]に置換されている。
On the other hand, in the
変数や関数を参照する文に記載された変数名や関数名がダミーの識別子に置換されることで、ソースコード112からはデータと演算との関係を読み取ることができなくなる。図6の例では、比較演算は、第1の入力データの方が第2の入力データより大きいことを判定しているのか、第2の入力データの方が第1の入力データより大きいことを判定しているのか、不明である。また、図6の例では、関数呼出の引数として、第1の入力データと第2の入力データの何れを指定しているのか不明である。また、図6の例では、各関数呼出文において2つの関数の何れが呼び出されているのか不明である。
By replacing the variable name or function name described in the statement referring to the variable or function with a dummy identifier, the relationship between the data and the operation cannot be read from the
このように、ソースコード111をソースコード112に変換すると、データと演算の対応関係の情報が失われる一方、実行され得る演算の種類やプログラムの制御構造の情報は失われない。図6の例では、比較回路や2つの関数に対応する2つの演算回路を含み、比較回路の出力に応じて出力信号を選択するような電子回路を製造すべきことが、ソースコード112から読み取れる。なお、図6の例では、全ての参照オペランドの変数名や全ての関数呼出文の関数名をダミーの識別子に置換しているが、一部の変数名や関数名のみ置換してもよい。例えば、ソースコード111の記述の中で重要なノウハウを含む記述の範囲をユーザが指定したとき、その範囲内にある変数名や関数名のみ置換してもよい。また、ユーザが置換対象の変数や関数を指定するようにしてもよい。
As described above, when the
図7は、配列テーブルの例を示す図である。配列テーブル113は、ソースコード111をソースコード112に変換するときに端末装置100が生成する。配列テーブル113は、ハードウェアベンダに提供しない秘密情報としてデータベースサーバ32に保存される。配列テーブル113には、識別子とオリジナル名の項目が含まれる。
FIG. 7 is a diagram illustrating an example of an arrangement table. The arrangement table 113 is generated by the
識別子の項目には、変数名または関数名に代えてソースコード112に記載されたダミーの識別子が登録される。例えば、複数の識別子は配列として表現され、その場合には配列の添字のみで各識別子を特定することができる。オリジナル名の項目には、ダミーの識別子に置換する前の元の変数名または関数名が登録される。図7に示すように、同じ変数または関数を参照する2以上の文がソースコード111に含まれるとき、1つの変数名または関数名に対して異なる2以上のダミーの識別子を割り当ててよい。図7の例では、ダミーの識別子x[1],x[2]は共に変数名bananaに対応している。
In the identifier item, a dummy identifier written in the
図8は、グループテーブルの例を示す図である。グループテーブル114は、ソースコード111をソースコード112に変換するときに端末装置100が生成する。グループテーブル114は、ソースコード112と併せてハードウェアベンダに提供される。グループテーブル114には、型、識別子およびオリジナル名の項目が含まれる。
FIG. 8 is a diagram illustrating an example of a group table. The group table 114 is generated by the
型の項目には、変数の型または関数の型が登録される。関数の型は、戻り値の型と引数の型の組み合わせであり、何れの変数の型とも異なる。識別子の項目には、型が同じ変数について使用されたダミーの識別子の集合、または、型が同じ関数について使用されたダミーの識別子の集合が登録される。オリジナル名の項目には、型が同じ変数の変数名の集合、または、型が同じ関数の関数名の集合が登録される。 In the type item, a variable type or a function type is registered. The function type is a combination of the return value type and the argument type, and is different from any variable type. In the identifier item, a set of dummy identifiers used for variables of the same type or a set of dummy identifiers used for functions of the same type is registered. In the item of original name, a set of variable names of variables having the same type or a set of function names of functions having the same type is registered.
このように、グループテーブル114では、変数や関数が型に応じてグループ分けされ、グループ毎にダミーの識別子の集合と変数名または関数名の集合とが対応付けられる。図4のソースコード111が図6のソースコード112に変換される場合、ダミーの識別子x[0],x[1],x[2]と変数名apple,bananaとが対応付けられ、ダミーの識別子x[3],x[4]と関数名buy,sellとが対応付けられる。
In this way, in the group table 114, variables and functions are grouped according to types, and a set of dummy identifiers and a set of variable names or function names are associated with each group. When the
これにより、ハードウェアベンダは、各ダミーの識別子に対応する変数名または関数名の候補を絞り込むことができる。ハードウェアベンダは、例えば、グループテーブル114に基づいて、変数名の集合に対応する信号の集合の中から何れかの信号を選択する選択回路(マルチプレクサなど)を実装する。また、ハードウェアベンダは、例えば、グループテーブル114に基づいて、関数名の集合に対応する演算回路の集合が出力する信号の中から何れかの信号を選択する選択回路を実装する。各選択回路が何れの信号を選択するかは、配列テーブル113から生成される制御データに従って制御されることになる。 As a result, the hardware vendor can narrow down candidates for variable names or function names corresponding to the respective dummy identifiers. For example, the hardware vendor implements a selection circuit (such as a multiplexer) that selects any signal from a set of signals corresponding to a set of variable names based on the group table 114. For example, the hardware vendor implements a selection circuit that selects one of signals output from a set of arithmetic circuits corresponding to a set of function names based on the group table 114. Which signal each selection circuit selects is controlled according to control data generated from the array table 113.
図9は、端末装置の機能例を示すブロック図である。端末装置100は、設計情報記憶部110、ソースコード編集部120、ソースコード変換部130、設計情報送信部140および制御データ生成部150を有する。設計情報記憶部110は、例えば、RAM102またはHDD103に確保した記憶領域として実現される。ソースコード編集部120、ソースコード変換部130、設計情報送信部140および制御データ生成部150は、例えば、ソフトウェアのモジュールとして実現される。
FIG. 9 is a block diagram illustrating an example of functions of the terminal device. The
設計情報記憶部110は、ソースコード111(変換前)、ソースコード112(変換後)、配列テーブル113およびグループテーブル114を記憶する。ソースコード編集部120は、入力デバイス42を通じてユーザ入力を受け付け、ユーザ入力に応じて設計情報記憶部110に記憶されたソースコード111を編集する。ソースコード変換部130は、設計情報記憶部110に記憶されたソースコード111を解析する。そして、ソースコード変換部130は、ソースコード111からソースコード112と配列テーブル113とグループテーブル114を生成し、設計情報記憶部110に格納する。
The design
設計情報送信部140は、ソースコード112とグループテーブル114を、外部情報としてネットワーク31を介してハードウェアベンダに送信する。または、設計情報送信部140は、ソースコード112とグループテーブル114をハードウェアベンダに渡す可搬記録媒体に書き込む。また、設計情報送信部140は、配列テーブル113を秘密情報としてデータベースサーバ32に送信する。制御データ生成部150は、ハードウェア部品200が製造されると、データベースサーバ32から配列テーブル113を取得し、ハードウェア部品200を制御するための制御データを配列テーブル113から生成する。そして、制御データ生成部150は、制御データをROMライタ33に送る。
The design
ただし、ハードウェア部品200が製造される前に、制御データ生成部150が制御データを生成してもよい。その場合、データベースサーバ32には、配列テーブル113に代えてまたは配列テーブル113と共に、生成された制御データを秘密情報として保存しておいてもよい。また、前述のように、ハードウェア部品200の備えるメモリに制御データを書き込むことは、端末装置100以外の装置が行ってもよく、ハードウェア部品200の搭載された電子機器が起動する毎にその電子機器が実行してもよい。後者の場合、生成された制御データはその電子機器にインストールされる。
However, the control
図10は、ハードウェア部品製造の手順例を示すフローチャートである。
端末装置100のソースコード編集部120は、ユーザ入力に応じてソースコード111を作成する(ステップS1)。端末装置100のソースコード変換部130は、作成されたソースコード111に対して秘匿化処理を行う。すなわち、ソースコード変換部130は、ソースコード111から、ソースコード112と配列テーブル113とグループテーブル114を生成する。生成されたソースコード112とグループテーブル114は、外部情報としてハードウェアベンダに渡される。生成された配列テーブル113は、ハードウェアベンダに渡されずに秘密情報として管理される(ステップS2)。
FIG. 10 is a flowchart illustrating an example of a procedure for manufacturing a hardware component.
The source
端末装置34は、ソースコード112に対して最適化処理を行う。すなわち、端末装置34は、電子回路の動作速度が速く回路規模が小さくなるように、ユーザ入力に応じてソースコード112を修正する(ステップS3)。端末装置34は、高位合成(動作合成)ツールを用いて、修正されたソースコード112からハードウェア記述言語で記述したRTLモデルを生成する(ステップS4)。端末装置34は、RTLモデルに基づいて電子回路をシミュレーションすることで、RTLモデルが適切か検証する(ステップS5)。
The
ステップS5の検証によってRTLモデルが示す電子回路の動作や性能が妥当であると判断される場合、処理がステップS7に進められ、妥当でないと判断される場合、処理がステップS3の最適化処理に戻る(ステップS6)。ただし、修正量が少ないときは、ソースコード111を修正する代わりにRTLモデルを修正してもよい。端末装置34は、論理合成ツールを用いてRTLモデルから実装設計用の回路データを生成する。例えば、電子回路をASICとして実装するときはASIC用の論理合成ツールが用いられ、電子回路をFPAとして実装するときはFPGA用の論理合成ツールが用いられる。製造装置35は、端末装置34が生成した回路データに対応する電子回路を製造し、電子回路を搭載したハードウェア部品200を製造する(ステップS7)。
If it is determined by the verification in step S5 that the operation or performance of the electronic circuit indicated by the RTL model is appropriate, the process proceeds to step S7. If it is determined that the operation is not appropriate, the process proceeds to the optimization process in step S3. Return (step S6). However, when the correction amount is small, the RTL model may be corrected instead of correcting the
端末装置100の制御データ生成部150は、ステップS2で生成された配列テーブル113から、電子回路が変換前のソースコード111に対応する動作をするように制御するための制御データを生成する。制御データは、例えば、電子回路に含まれる各選択回路に何れの信号を選択すればよいか指示するためのデータである(ステップS8)。ROMライタ33は、電子回路が備えるメモリに制御データを書き込む(ステップS9)。
The control
図11は、ソースコード秘匿化の手順例を示すフローチャートである。図11のフローチャートが示す処理は、上記のステップS2において実行される。
(ステップS10)ソースコード変換部130は、空の配列テーブル113と空のグループテーブル114を生成し、設計情報記憶部110に格納する。
FIG. 11 is a flowchart illustrating an example of a procedure for concealing source code. The process shown in the flowchart of FIG. 11 is executed in step S2.
(Step S <b> 10) The source
(ステップS11)ソースコード変換部130は、ソースコード111を構文解析して変数参照の記述と関数呼出文を検出する。変数参照の記述は、演算のオペランド(関数呼出で指定する引数を含む)であって何れかの変数を参照する参照オペランドである。
(Step S11) The source
(ステップS12)ソースコード変換部130は、ステップS11で検出した変数参照の記述および関数呼出文のうち何れか1つを選択する。
(ステップS13)ソースコード変換部130は、配列テーブル113を参照して、未使用のダミーの識別子を1つ選択する。ダミーの識別子が配列として表現されている場合は、未使用の添字のうち最も番号が小さいものを選択する。そして、ソースコード変換部130は、ステップS12で選択した変数参照の記述または関数呼出文に記載された名称(変数名または関数名)を、選択したダミーの識別子に置換する。これにより、変数名または関数名がダミーの識別子に置換されたソースコード112が生成される。
(Step S12) The source
(Step S13) The source
なお、上記説明では、変数参照の記述または関数呼出文毎に異なるダミーの識別子を用いるとしたが、同じ変数名または関数名に対しては同じダミーの識別子を用いるようにしてもよい。また、前と同じ変数名または関数名が現れたときに、前と同じ識別子を用いるか異なる識別子を用いるかを、ランダムまたは所定の規則に従って選択してもよい。 In the above description, a different dummy identifier is used for each variable reference description or function call statement. However, the same dummy identifier may be used for the same variable name or function name. Further, when the same variable name or function name as before appears, it may be selected at random or according to a predetermined rule whether the same identifier as before or a different identifier is used.
(ステップS14)ソースコード変換部130は、配列テーブル113に、ステップS13で選択したダミーの識別子と対応付けて元の変数名または関数名を登録する。
(ステップS15)ソースコード変換部130は、参照される変数の型または呼び出される関数の型を判定する。変数の型はソースコード111の変数を定義する文に記載されており、関数の型はソースコード111の関数を定義する文に記載されている。
(Step S14) The source
(Step S15) The source
(ステップS16)ソースコード変換部130は、ステップS15で判定した型がグループテーブル114に登録されているか判断する。登録されている場合、ソースコード変換部130は、その型に対応するエントリ(識別子の集合とオリジナル名の集合)を選択し、登録されていない場合、新たなエントリをグループテーブル114に追加する。そして、ソースコード変換部130は、識別子の集合にステップS13で選択したダミーの識別子を追加し、オリジナル名の集合に元の変数名または関数名を追加する。
(Step S16) The source
(ステップS17)ソースコード変換部130は、ステップS12で、検出された変数参照の記述および関数呼出文を全て選択したか判断する。全て選択した場合は処理をステップS18に進め、未選択のものがある場合は処理をステップS12に進める。
(Step S17) The source
(ステップS18)ソースコード変換部130は、ソースコード112およびグループテーブル114を、ハードウェアベンダに提供するべき外部情報として出力する。
(ステップS19)ソースコード変換部130は、配列テーブル113を、ハードウェアベンダに提供せずに秘密に管理するべき秘密情報として保存する。
(Step S18) The source
(Step S19) The source
なお、上記のステップS13の置換、ステップS14の配列テーブル113の更新およびステップS16のグループテーブル114の更新は、任意の順序で実行してよい。
図12は、電子回路の第2の例を示すブロック図である。ソースコード112およびグループテーブル114を受け取ったハードウェアベンダは、例えば、図12のような電子回路を製造する。この第2の電子回路は、比較回路211、演算回路212,213、マルチプレクサ214,231〜235およびメモリ220を含む。比較回路211、演算回路212,213およびマルチプレクサ214の機能は、図5で説明した通りである。
Note that the replacement in step S13, the update of the array table 113 in step S14, and the update of the group table 114 in step S16 may be executed in an arbitrary order.
FIG. 12 is a block diagram illustrating a second example of an electronic circuit. The hardware vendor that has received the
マルチプレクサ231は、第1の入力信号(in[0])および第2の入力信号(in[1])の一方を選択し、第1のオペランドとして比較回路211に入力する。マルチプレクサ232は、第1および第2の入力信号の一方を選択し、第2のオペランドとして比較回路211に入力する。マルチプレクサ233は、第1および第2の入力信号の一方を選択し、引数として演算回路212,213に入力する。マルチプレクサ234は、演算回路212,213の演算結果の一方を選択し、1番目の演算結果としてマルチプレクサ214に入力する。マルチプレクサ235は、演算回路212,213の演算結果の一方を選択し、2番目の演算結果としてマルチプレクサ214に入力する。
The
このように、ソースコード112に記載された識別子x[0],x[1],x[2]が2つの入力信号in[0],in[1]の何れを指しているか不明であるため、入力信号を電子回路の製造後に選択できるようにマルチプレクサ231〜233が設けられる。また、ソースコード112に記載された識別子x[3],x[4]が関数名buy,sellの2つの関数の何れを指しているか不明であるため、何れの関数の演算結果を利用するか電子回路の製造後に選択できるようにマルチプレクサ234,235が設けられる。
Thus, since it is unclear which identifier x [0], x [1], x [2] described in the
メモリ220は、電子回路の製造時点ではデータが書き込まれていない空のメモリでよい。メモリ220には、電子回路の製造後にマルチプレクサ231〜235を制御するための制御データが書き込まれる。メモリ220が不揮発性メモリである場合は、例えば、ハードウェア部品200を使用し始める前にROMライタ33を用いて制御データが書き込まれる。メモリ220が揮発性メモリである場合は、例えば、ハードウェア部品200を搭載した電子機器が起動する毎に制御データが書き込まれる。
The
マルチプレクサ231〜235それぞれを制御するためのデータは、2つの信号の何れを選択すればよいかを示すデータである。例えば、“01101”というビット列がメモリ220に書き込まれる。これは、マルチプレクサ231が第1の入力信号を選択し、マルチプレクサ232,233が第2の入力信号を選択することを示している。また、これは、マルチプレクサ234が演算回路212の演算結果を選択し、マルチプレクサ235が演算回路213の演算結果を選択することを示している。ただし、上記の制御データの記載は一例であり、制御データの記載方法は電子回路の実装方法に依存する。このような制御データは、電子回路の構造と配列テーブル113に基づいて生成できる。
Data for controlling each of the
図13は、電子回路の第3の例を示すブロック図である。ソースコード112およびグループテーブル114を受け取ったハードウェアベンダは、図13のような電子回路を製造することもできる。この第3の電子回路は、比較回路211、演算回路212,213、メモリ220およびスイッチボックス241,242を含む。
FIG. 13 is a block diagram illustrating a third example of the electronic circuit. A hardware vendor that has received the
上記の第2の電子回路はマルチプレクサ231〜233を用いて入力信号を選択するのに対し、この第3の電子回路はスイッチボックス241を用いて入力信号を選択する。スイッチボックス241は、2つの入力線と3つの出力線との間に形成される6個の接点のON/OFFを切り替えることができる。2つの入力線は、2つの入力信号in[0],in[1]に対応する。3つの出力線は、比較回路211の第1のオペランド、比較回路211の第2のオペランド、演算回路212,213の引数に対応する。
The second electronic circuit uses the
また、第2の電子回路はマルチプレクサ234,235を用いて演算結果を選択するのに対し、第3の電子回路はスイッチボックス242を用いて演算結果を選択する。スイッチボックス242は、2つの入力線と2つの出力線との間に形成される4個の接点のON/OFFを切り替えることができる。2つの入力線は2つの演算回路212,213の演算結果に対応し、2つの出力線はマルチプレクサ214の2つの入力に対応する。
The second electronic circuit uses the
メモリ220には、電子回路の製造後にスイッチボックス241,242を制御するための制御データが書き込まれる。スイッチボックス241を制御するためのデータは、6個の接点それぞれのON/OFFを示すデータである。例えば、“100011”というビット列がメモリ220に書き込まれる。これは、第1の出力線が第1の入力線に接続され、第2の出力線が第2の入力線に接続され、第3の出力線が第2の入力線に接続されることを示す。また、スイッチボックス242を制御するためのデータは、4個の接点それぞれのON/OFFを示すデータである。例えば、“1001”というビット列がメモリ220に書き込まれる。これは、第1の出力線が第1の入力線に接続され、第2の出力線が第2の入力線に接続されることを示す。ただし、上記の制御データの記載は一例であり、制御データの記載方法は電子回路の実装方法に依存する。
Control data for controlling the
電子回路がFPGAとして実装される場合、このようにスイッチボックス241,242を使用することで回路規模を抑制することができる。スイッチボックス241,242を制御するための制御データは、配列テーブル113に基づいて生成できる。
When the electronic circuit is mounted as an FPGA, the circuit scale can be suppressed by using the
図14は、電子回路の第4の例を示すブロック図である。ハードウェアベンダは図14のような電子回路を製造することもできる。この第4の電子回路は、比較回路211、マルチプレクサ214,231〜233、メモリ220およびルックアップテーブル(LUT:Lookup Table)251,252を含む。比較回路211、マルチプレクサ214,231〜233およびメモリ220の機能は、図12で説明した通りである。
FIG. 14 is a block diagram illustrating a fourth example of the electronic circuit. The hardware vendor can also manufacture an electronic circuit as shown in FIG. The fourth electronic circuit includes a
第4の電子回路では、ルックアップテーブル251,252のうちの一方を用いて関数名buyの関数を実現し、他方を用いて関数名sellの関数を実現する。メモリ220に書き込まれる制御データには、ルックアップテーブル251の入力値と出力値との対応関係を定義したデータと、ルックアップテーブル252の入力値と出力値との対応関係を定義したデータが含まれる。2つの対応関係の一方は関数名buyの関数を示しており、他方は関数名sellの関数を示している。ルックアップテーブル251,252は、メモリ220に書き込まれた制御データに基づいて、入力値に対応する出力値を算出する。
In the fourth electronic circuit, one of the look-up tables 251 and 252 is used to realize the function with the function name buy, and the other is used to realize the function with the function name sell. The control data written to the
このように、ルックアップテーブル251,252を用いることで、ルックアップテーブル251,252と2つの関数とを電子回路の製造後に対応付けることができる。よって、ソースコード112で識別子x[3],x[4]と2つの関数との対応が不明であっても、ルックアップテーブル251の演算結果を第1の演算結果としてマルチプレクサ214に入力してよい。同様に、ルックアップテーブル252の演算結果を第2の演算結果としてマルチプレクサ214に入力してよい。すなわち、ルックアップテーブル251,252とマルチプレクサ214の間にマルチプレクサ234,235やスイッチボックス242を設けなくてもよく、電子回路の回路規模を抑制することができる。
In this manner, by using the lookup tables 251 and 252, the lookup tables 251 and 252 and the two functions can be associated with each other after the electronic circuit is manufactured. Therefore, even if the correspondence between the identifiers x [3] and x [4] and the two functions is unknown in the
なお、図14では入力信号を選択するためにマルチプレクサ231〜233を用いているが、図13に示したようにスイッチボックス241を用いてもよい。
第2の実施の形態の情報処理システムによれば、ハードウェアベンダにハードウェア部品200の製造を依頼するにあたり、ソースコード111がソースコード112に変換され、また、配列テーブル113およびグループテーブル114が生成される。そして、ソースコード112およびグループテーブル114が外部情報としてハードウェアベンダに渡される一方、配列テーブル113が秘密情報として保管される。
In FIG. 14, the
According to the information processing system of the second embodiment, when requesting the hardware vendor to manufacture the
ソースコード112はプログラムの制御構造や演算内容を表現しており、グループテーブル114は各ダミーの識別子に対応する変数または関数の候補を示しているため、マルチプレクサやスイッチボックスなどの選択回路を利用して電子回路を製造することが可能である。一方、ソースコード112およびグループテーブル114からは、どの入力データに対してどのような演算を行うかという具体的なデータと演算の対応関係を読み取ることができない。このため、データと演算の対応関係がノウハウとして保護すべき情報であっても、配列テーブル113をハードウェアベンダに提供せずに秘密に保管することで、ノウハウがハードウェアベンダに漏洩するリスクを低減することができる。
Since the
なお、第1の実施の形態の機能は、情報処理装置10にプログラムを実行させることで実現できる。また、第2の実施の形態の機能は、端末装置100にプログラムを実行させることで実現できる。プログラムは、コンピュータ読み取り可能な記録媒体(例えば、記録媒体43)に記録しておくことができる。記録媒体としては、例えば、磁気ディスク、光ディスク、光磁気ディスク、半導体メモリなどを使用できる。磁気ディスクには、FDおよびHDDが含まれる。光ディスクには、CD、CD−R(Recordable)/RW(Rewritable)、DVDおよびDVD−R/RWが含まれる。プログラムは、可搬型の記録媒体に記録されて配布されることがある。その場合、可搬型の記録媒体からHDDなどの他の記録媒体にプログラムを複製してから(インストールしてから)実行してもよい。
Note that the functions of the first embodiment can be realized by causing the
10 情報処理装置
11 記憶部
12 生成部
21,21a 第1のコード
22,22a 第2のコード
23,23a 対応情報
DESCRIPTION OF
Claims (9)
複数の変数が定義された第1のコード内から、演算のオペランドであって前記複数の変数の何れかを参照するオペランドを検出し、
前記第1のコードから変換された第2のコードであって、検出された前記オペランドの変数名を当該第2のコード内において前記複数の変数の何れの変数名としても使用されていない識別子に置換した第2のコードを生成し、また、前記識別子が前記複数の変数の何れに対応するかを示す対応情報を生成し、
前記第2のコードに基づいて電子回路が製造された後、前記電子回路が備えるメモリに前記対応情報に応じた制御データを書き込む、
コード処理方法。 A code processing method executed by a computer,
Detecting an operand that is an operand of an operation and refers to any of the plurality of variables from within the first code in which the plurality of variables is defined;
A second code converted from the first code, wherein the detected variable name of the operand is not used as any variable name of the plurality of variables in the second code; Generating a replaced second code, and generating correspondence information indicating which of the plurality of variables the identifier corresponds to,
After the electronic circuit is manufactured based on the second code, control data corresponding to the correspondence information is written in a memory included in the electronic circuit .
Code processing method.
前記制御データは、前記選択回路を制御するためのデータである、
請求項1記載のコード処理方法。 The electronic circuit includes an arithmetic circuit corresponding to the arithmetic, and a selection circuit that selects a signal input to the arithmetic circuit among a plurality of signals corresponding to the plurality of variables.
The control data is data for controlling the selection circuit.
The code processing method according to claim 1 .
前記第2のコードの生成では、検出された前記関数呼出文の関数名を前記第2のコード内において前記複数の関数の何れの関数名としても使用されておらず前記識別子と異なる他の識別子に置換し、
前記対応情報は、前記他の識別子が前記複数の関数の何れに対応するかを更に示す、
請求項1または2記載のコード処理方法。 A plurality of functions are defined in the first code, and in addition to the operand, a function call statement that calls any one of the plurality of functions from within the first code is detected,
In the generation of the second code, the function name of the detected function call statement is not used as any function name of the plurality of functions in the second code and is different from the identifier. Is replaced with
The correspondence information further indicates to which of the plurality of functions the other identifier corresponds.
The code processing method according to claim 1 or 2 .
前記第2のコードおよび前記対応情報に加えて、前記識別子が何れのグループに対応するかを示すグループ情報を生成する、
請求項1乃至3の何れか一項に記載のコード処理方法。 Grouping the plurality of variables;
In addition to the second code and the correspondence information, group information indicating which group the identifier corresponds to is generated.
The code processing method according to any one of claims 1 to 3 .
前記第2のコードの生成では、前記オペランドと前記他のオペランドとが同一の変数を参照する場合であっても、検出された前記他のオペランドの変数名を前記識別子と異なる他の識別子に置換することを許容する、
請求項1乃至4の何れか一項に記載のコード処理方法。 Detecting other operands in the first code in addition to the operands;
In the generation of the second code, even if the operand and the other operand refer to the same variable, the detected variable name of the other operand is replaced with another identifier different from the identifier. To allow,
The code processing method according to any one of claims 1 to 4 .
複数の変数が定義された第1のコード内から、演算のオペランドであって前記複数の変数の何れかを参照するオペランドを検出し、
前記第1のコードから変換された第2のコードであって、検出された前記オペランドの変数名を当該第2のコード内において前記複数の変数の何れの変数名としても使用されていない識別子に置換した第2のコードを生成し、また、前記識別子が前記複数の変数の何れに対応するかを示す対応情報を生成し、
生成された前記対応情報を、前記第2のコードに基づいて電子回路を製造する製造者に提供しない秘密情報として記憶装置に保存する、
コード処理方法。 A code processing method executed by a computer,
Detecting an operand that is an operand of an operation and refers to any of the plurality of variables from within the first code in which the plurality of variables is defined;
A second code converted from the first code, wherein the detected variable name of the operand is not used as any variable name of the plurality of variables in the second code; Generating a replaced second code, and generating correspondence information indicating which of the plurality of variables the identifier corresponds to,
The generated correspondence information is stored in a storage device as confidential information that is not provided to a manufacturer that manufactures an electronic circuit based on the second code .
Code processing method.
複数の関数が定義された第1のコード内から、前記複数の関数の何れかを呼び出す関数呼出文を検出し、
前記第1のコードから変換された第2のコードであって、検出された前記関数呼出文の関数名を当該第2のコード内において前記複数の関数の何れの関数名としても使用されていない識別子に置換した第2のコードを生成し、また、前記識別子が前記複数の関数の何れに対応するかを示す対応情報を生成し、
前記第2のコードに基づいて電子回路が製造された後、前記電子回路が備えるメモリに前記対応情報に応じた制御データを書き込む、
コード処理方法。 A code processing method executed by a computer,
A function call statement for calling one of the plurality of functions is detected from within the first code in which the plurality of functions are defined;
A second code converted from the first code, wherein the function name of the detected function call statement is not used as any function name of the plurality of functions in the second code Generating a second code replaced with an identifier, and generating correspondence information indicating which of the plurality of functions the identifier corresponds to,
After the electronic circuit is manufactured based on the second code, control data corresponding to the correspondence information is written in a memory included in the electronic circuit .
Code processing method.
前記第1のコード内から演算のオペランドであって前記複数の変数の何れかを参照するオペランドを検出し、前記第1のコードから変換された第2のコードであって検出された前記オペランドの変数名を当該第2のコード内において前記複数の変数の何れの変数名としても使用されていない識別子に置換した第2のコードを生成し、また、前記識別子が前記複数の変数の何れに対応するかを示す対応情報を生成する生成部と、
前記第2のコードに基づいて電子回路が製造された後、前記電子回路が備えるメモリに前記対応情報に応じた制御データを書き込む書込部と、
を有する情報処理装置。 A storage unit for storing a first code in which a plurality of variables are defined;
An operand that is an operation operand and refers to any of the plurality of variables is detected from within the first code, and a second code that is converted from the first code is detected. A second code is generated by replacing the variable name with an identifier that is not used as any variable name of the plurality of variables in the second code, and the identifier corresponds to any of the plurality of variables. A generating unit that generates correspondence information indicating whether to do,
After the electronic circuit is manufactured based on the second code, a writing unit that writes control data corresponding to the correspondence information in a memory included in the electronic circuit;
An information processing apparatus.
複数の変数が定義された第1のコード内から、演算のオペランドであって前記複数の変数の何れかを参照するオペランドを検出し、
前記第1のコードから変換された第2のコードであって、検出された前記オペランドの変数名を当該第2のコード内において前記複数の変数の何れの変数名としても使用されていない識別子に置換した第2のコードを生成し、また、前記識別子が前記複数の変数の何れに対応するかを示す対応情報を生成し、
前記第2のコードに基づいて電子回路が製造された後、前記電子回路が備えるメモリに前記対応情報に応じた制御データを書き込む、
処理を実行させるプログラム。
On the computer,
Detecting an operand that is an operand of an operation and refers to any of the plurality of variables from within the first code in which the plurality of variables is defined;
A second code converted from the first code, wherein the detected variable name of the operand is not used as any variable name of the plurality of variables in the second code; Generating a replaced second code, and generating correspondence information indicating which of the plurality of variables the identifier corresponds to,
After the electronic circuit is manufactured based on the second code, control data corresponding to the correspondence information is written in a memory included in the electronic circuit .
A program that executes processing.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012169880A JP5939074B2 (en) | 2012-07-31 | 2012-07-31 | Code processing method, information processing apparatus, and program |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2012169880A JP5939074B2 (en) | 2012-07-31 | 2012-07-31 | Code processing method, information processing apparatus, and program |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2014029610A JP2014029610A (en) | 2014-02-13 |
JP5939074B2 true JP5939074B2 (en) | 2016-06-22 |
Family
ID=50202133
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2012169880A Expired - Fee Related JP5939074B2 (en) | 2012-07-31 | 2012-07-31 | Code processing method, information processing apparatus, and program |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5939074B2 (en) |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0997182A (en) * | 1995-09-29 | 1997-04-08 | Matsushita Electric Ind Co Ltd | Program converter and debugger |
JPH1039905A (en) * | 1996-07-29 | 1998-02-13 | Fuji Electric Co Ltd | Program display method and programming device |
JP4045802B2 (en) * | 2002-01-08 | 2008-02-13 | ソニー株式会社 | Program processing apparatus, program processing method, storage medium, and computer program |
JP4420210B2 (en) * | 2004-06-08 | 2010-02-24 | オムロン株式会社 | Program development support apparatus and processing method |
EP2107489A3 (en) * | 2006-12-21 | 2009-11-04 | Telefonaktiebolaget L M Ericsson (PUBL) | Obfuscating computer program code |
CN102713839B (en) * | 2009-10-08 | 2015-11-25 | 爱迪德技术有限公司 | For the system and method for the positive oneself's amendment in kinematic function calling system |
JP2011100398A (en) * | 2009-11-09 | 2011-05-19 | Nec Corp | Program editing device and program editing method therefor |
-
2012
- 2012-07-31 JP JP2012169880A patent/JP5939074B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JP2014029610A (en) | 2014-02-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102107872B1 (en) | Compiler based obfuscation | |
CN106415496A (en) | Unified intermediate representation | |
US10719657B1 (en) | Process design kit (PDK) with design scan script | |
JP6164054B2 (en) | Information processing apparatus, compiling method, and compiler program | |
CN108595187A (en) | Method, device and the storage medium of Android installation kit integrated software development kit | |
US7822615B2 (en) | Translating expressions in a computing environment | |
JP6692281B2 (en) | Test case generation device and test case generation method | |
US10013517B1 (en) | High level programming language core protection for high level synthesis | |
KR20100028026A (en) | Method and apparatus for changing and adding activation keys for functions of digital content without having to change and recompile the digital content | |
MX2014014102A (en) | Method, system and device for protection against reverse engineering and/or tampering with programs. | |
JP5939074B2 (en) | Code processing method, information processing apparatus, and program | |
CN107038352A (en) | Intranet security access method, device and terminal | |
JP6173644B1 (en) | Information processing apparatus, information processing method, and information processing program | |
WO2017095257A1 (en) | Automatic code virtualization for a compiler | |
JP6818568B2 (en) | Communication device, communication specification difference extraction method and communication specification difference extraction program | |
JP2021103354A (en) | Program testing method | |
JP2006202330A (en) | Method for designing system lsi and recording medium storing the same | |
JP7259679B2 (en) | Data processing method and data processing program | |
JP6142585B2 (en) | Device management system, device management device, device management device control method and program | |
Chen et al. | LLM for Mobile: An Initial Roadmap | |
JP2016139203A (en) | Design information creation method, design information creation apparatus, and program | |
Drzevitzky | Proof-carrying hardware: A novel approach to reconfigurable hardware security | |
KR20230030768A (en) | Artificial intelligence model transformation method, artificial intelligence model transformation apparatus, artificial intelligence model driving method and artificial intelligence model driving apparatus for preventing leakage of artificial intelligence model | |
CN116755703A (en) | Method, device, computer equipment and storage medium for flexibly deploying SDK package | |
JP2023088120A (en) | Software development device and software development program |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20150406 |
|
A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20160120 |
|
A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20160216 |
|
A521 | Written amendment |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20160330 |
|
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: 20160419 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20160502 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5939074 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
LAPS | Cancellation because of no payment of annual fees |