JP5939074B2 - Code processing method, information processing apparatus, and program - Google Patents

Code processing method, information processing apparatus, and program Download PDF

Info

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
Application number
JP2012169880A
Other languages
Japanese (ja)
Other versions
JP2014029610A (en
Inventor
豊 田宮
豊 田宮
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2012169880A priority Critical patent/JP5939074B2/en
Publication of JP2014029610A publication Critical patent/JP2014029610A/en
Application granted granted Critical
Publication of JP5939074B2 publication Critical patent/JP5939074B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

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.

特開昭61−190630号公報JP-A-61-190630 特開平2−73428号公報Japanese Patent Laid-Open No. 2-73428 特開2002−73190号公報JP 2002-73190 A

上記のように、電子回路の製造をハードウェアベンダに依頼する場合、電子回路の動作を記述したコードをハードウェアベンダに渡すことがある。しかし、コードに記述されたデータ処理の手順が、そのコードを作成したユーザにとってノウハウとして保護すべき秘密情報である場合がある。例えば、画像処理のための電子回路をハードウェアベンダに製造してもらうときであっても、画像処理のアルゴリズムをノウハウとして秘匿しておきたい場合が考えられる。その場合に、コードをそのままハードウェアベンダに渡してしまうと、コードとして表された秘密情報が漏洩してしまうおそれがあるという問題がある。   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の実施の形態の情報処理装置を示す図である。It is a figure which shows the information processing apparatus of 1st Embodiment. 第2の実施の形態の情報処理システムを示す図である。It is a figure which shows the information processing system of 2nd Embodiment. 端末装置のハードウェア例を示すブロック図である。It is a block diagram which shows the hardware example of a terminal device. ソースコードの例を示す図である。It is a figure which shows the example of a source code. 電子回路の第1の例を示すブロック図である。It is a block diagram which shows the 1st example of an electronic circuit. 変換されたソースコードの例を示す図である。It is a figure which shows the example of the converted source code. 配列テーブルの例を示す図である。It is a figure which shows the example of an arrangement | sequence table. グループテーブルの例を示す図である。It is a figure which shows the example of a group table. 端末装置の機能例を示すブロック図である。It is a block diagram which shows the function example of a terminal device. ハードウェア部品製造の手順例を示すフローチャートである。It is a flowchart which shows the example of a procedure of hardware component manufacture. ソースコード秘匿化の手順例を示すフローチャートである。It is a flowchart which shows the example of a procedure of source code concealment. 電子回路の第2の例を示すブロック図である。It is a block diagram which shows the 2nd example of an electronic circuit. 電子回路の第3の例を示すブロック図である。It is a block diagram which shows the 3rd example of an electronic circuit. 電子回路の第4の例を示すブロック図である。It is a block diagram which shows the 4th example of an electronic circuit.

以下、本実施の形態を図面を参照して説明する。
[第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 information processing apparatus 10 according to the first embodiment converts a code (for example, a source code written in a high-level language). The information processing apparatus 10 may be a client computer as a terminal device operated by a user or a server computer accessed from the terminal device.

情報処理装置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 information processing apparatus 10 includes a storage unit 11 and a generation unit 12. The storage unit 11 may be a volatile memory such as a RAM (Random Access Memory) or a non-volatile storage device such as an HDD (Hard Disk Drive) or a flash memory. The generation unit 12 is, for example, a processor. The “processor” may be a CPU, a DSP (Digital Signal Processor), an electronic circuit such as an ASIC (Application Specific Integrated Circuit) or an FPGA (Field Programmable Gate Array), or a set of a plurality of processors. The processor executes, for example, a program stored in a memory (or the storage unit 11).

記憶部11は、第1のコード21,21aを記憶する。第1のコード21,21aは、例えば、ユーザがC言語やC++言語などの高級言語で作成したソースコードである。第1のコード21には、複数の変数が定義されており、演算のオペランドであってそれら複数の変数の何れかを参照するオペランドが記載されている。演算には、四則演算や論理演算や比較演算などが含まれ得る。オペランドは、関数に渡す引数でもよい。第1のコード21aには、複数の関数が定義されており、それら複数の関数の何れかを呼び出す関数呼出文が記載されている。関数は、サブルーチンやメソッドと呼ばれるものでもよい。   The storage unit 11 stores the first codes 21 and 21a. The first codes 21 and 21a are source codes created by a user in a high-level language such as C language or C ++ language, for example. The first code 21 defines a plurality of variables, and describes an operand that is an operation operand and refers to any one of the plurality of variables. The operations can include four arithmetic operations, logical operations, comparison operations, and the like. The operand may be an argument passed to the function. A plurality of functions are defined in the first code 21a, and a function call statement that calls any one of the plurality of functions is described. The function may be called a subroutine or a method.

生成部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 generation unit 12 converts the first code 21 into the second code 22. At this time, the generation unit 12 detects the operand of the operation from the first code 21 and uses the variable name described in the detected operand as the variable name of any variable in the second code 22. Replace with an unidentified identifier. For example, when variable names x and y are used to define two variables in the second code 22, the variable name of the operand is replaced with an identifier A [0] different from any variable name. As a result, in the second code 22, the correspondence between the defined variable and the operation is unknown. The variable name for defining each variable in the second code 22 may be the same as or different from the first code 21. Further, the generation unit 12 generates correspondence information 23 indicating which of the plurality of variables the identifier corresponds to. For example, the correspondence information 23 indicates that the identifier A [0] is obtained by replacing the variable name x.

また、生成部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 generation unit 12 converts the first code 21a to the second code 22a. At this time, the generation unit 12 detects the function call statement from the first code 21a, and uses the function name described in the detected function call statement as the function name of any function in the second code 22a. Is also replaced with an unused identifier. For example, when function names f and g are used to define two functions in the second code 22a, the function name in the function call statement is replaced with an identifier A [1] different from any function name. The Thereby, in the second code 22a, the correspondence between the defined function and the function call becomes unknown. The function name for defining each function in the second code 22a may be the same as or different from the first code 21a. Further, the generation unit 12 generates correspondence information 23a indicating which of the plurality of functions the identifier corresponds to. For example, the correspondence information 23a indicates that the identifier A [1] is obtained by replacing the function name f.

生成された第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 correspondence information 23 is stored as secret information without being provided to a hardware vendor. When the electronic circuit is manufactured from the second code 22, for example, control data corresponding to the correspondence information 23 is written in the memory of the electronic circuit. This control data is for controlling the selection circuit, for example.

第2のコード22と同様に、生成された第2のコード22aは、例えば、電子回路を製造するハードウェアベンダに提供される。また、生成された対応情報23aは、例えば、ハードウェアベンダに提供されずに秘密情報として保管される。   Similar to the second code 22, the generated second code 22a is provided to, for example, a hardware vendor that manufactures an electronic circuit. Further, the generated correspondence information 23a is stored as secret information without being provided to a hardware vendor, for example.

なお、上記では、生成部12が変数名の置換と関数名の置換の両方の機能を備えることとしたが、何れか一方の機能のみ備えるようにしてもよい。また、生成部12は、1つの第1のコードに対して変数名の置換と関数名の置換の両方を実行してもよい。その場合、生成する対応情報を、変数名と置換した識別子が何れの変数に対応するかと、関数名と置換した識別子が何れの関数に対応するかの両方を示すようにしてもよい。   In the above description, the generation unit 12 has both functions of variable name replacement and function name replacement. However, only one of the functions may be provided. The generation unit 12 may perform both variable name substitution and function name substitution for one first code. In this case, the generated correspondence information may indicate both of which variable the identifier replaced with the variable name corresponds to, and which function the identifier replaced with the function name corresponds to.

ここで、情報処理装置10が第1のコード21を難読化した場合、難読化されたコードでは依然として変数の定義で使用される変数名とその変数の参照で使用される変数名とが一致している。同様に、情報処理装置10が第1のコード21aを難読化した場合、難読化されたコードでは依然として関数の定義で使用される関数名と関数呼出で使用される関数名とが一致している。このため、難読化を行っただけでは、どのデータに対してどのような演算が行われるかというデータと演算の関係がコードから読み取られてしまう。   Here, when the information processing apparatus 10 obfuscates the first code 21, the variable name used in the definition of the variable still matches the variable name used in the reference of the variable in the obfuscated code. ing. Similarly, when the information processing apparatus 10 obfuscates the first code 21a, the function name used in the function definition still matches the function name used in the function call in the obfuscated code. . For this reason, only by performing obfuscation, the relationship between data and what operation is performed on which data is read from the code.

これに対し、第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 information processing apparatus 10 of the first embodiment, the first codes 21 and 21a are converted into the second codes 22 and 22a, and separately from the second codes 22 and 22a. Correspondence information 23, 23a is generated. Since the second code 22, 22a expresses a control structure such as loop / branch and calculation contents, an electronic circuit can be manufactured from the second code 22, 22a. On the other hand, even if the second codes 22 and 22a are provided to the hardware vendor, the secret information included in the first codes 21 and 21a is stored in the hardware vendor by storing the correspondence information 23 and 23a as secret information. Risk of leakage can be reduced.

[第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 network 31, a database server 32, a ROM writer 33, terminal devices 34 and 100, and a manufacturing device 35.

データベースサーバ32、ROMライタ33および端末装置100は、ユーザ企業に設置されている。端末装置34および製造装置35は、ハードウェアベンダに設置されている。ハードウェアベンダは、ユーザ企業から依頼を受けてハードウェア部品200を製造する。ユーザ企業は、ハードウェアベンダに製造してもらったハードウェア部品200を使用する。例えば、ユーザ企業は、ハードウェア部品200にプロセッサなどの他のハードウェア部品を接続して自社内で使用する。または、ユーザ企業は、ハードウェア部品200を組み込んだ電子機器(例えば、プリンタなど)を製造して出荷する。ただし、ユーザ企業は、部品ではなく完成品の製造をハードウェアベンダに依頼してもよい。   The database server 32, the ROM writer 33, and the terminal device 100 are installed in the user company. The terminal device 34 and the manufacturing device 35 are installed in a hardware vendor. The hardware vendor manufactures the hardware component 200 in response to a request from the user company. The user company uses a hardware component 200 manufactured by a hardware vendor. For example, the user company connects another hardware component such as a processor to the hardware component 200 and uses it in the company. Alternatively, the user company manufactures and ships an electronic device (for example, a printer) in which the hardware component 200 is incorporated. However, the user company may request a hardware vendor to manufacture a finished product instead of a part.

端末装置100は、ユーザが操作するクライアントコンピュータである。端末装置100は、ハードウェア部品200に搭載される電子回路の動作を示すソースコードを編集する。ソースコードは、C言語やC++言語などの高級言語で記述されている。このソースコードは、電子回路を意識して作成されていなくてもよく、データ処理をソフトウェアで実現するために作成されたものを流用してもよい。端末装置100は、元のソースコードから、ハードウェアベンダに提供する外部情報(元のソースコードから変換されたソースコードを含む)とハードウェアベンダに提供せずに秘密に管理する秘密情報を生成する。なお、外部情報と秘密情報の生成は、端末装置100ではなく、端末装置100から社内ネットワークを介してアクセスされるサーバコンピュータが実行してもよい。   The terminal device 100 is a client computer operated by a user. The terminal device 100 edits the source code indicating the operation of the electronic circuit mounted on the hardware component 200. The source code is described in a high-level language such as C language or C ++ language. This source code does not have to be created in consideration of the electronic circuit, and may be used for realizing data processing by software. The terminal device 100 generates, from the original source code, external information (including source code converted from the original source code) to be provided to the hardware vendor and secret information that is secretly managed without being provided to the hardware vendor. To do. The generation of the external information and the secret information may be executed not by the terminal device 100 but by a server computer accessed from the terminal device 100 via the in-house network.

ネットワーク31は、ユーザ企業の社内ネットワーク(例えば、LAN(Local Area Network))とハードウェアベンダの社内ネットワークとを結ぶ広域ネットワークである。ネットワーク31を介してユーザ企業からハードウェアベンダに、ハードウェア部品200を製造するための情報(外部情報)が送信される。ただし、外部情報は、可搬記録媒体のようなネットワーク31以外の媒体を利用して渡すようにしてもよい。   The network 31 is a wide area network that connects an internal network (for example, a LAN (Local Area Network)) of a user company and an internal network of a hardware vendor. Information (external information) for manufacturing the hardware component 200 is transmitted from the user company to the hardware vendor via the network 31. However, the external information may be transferred using a medium other than the network 31 such as a portable recording medium.

データベースサーバ32は、データをHDDなどの不揮発性の記憶媒体に保存するサーバコンピュータである。データベースサーバ32は、ユーザ企業の社内ネットワークを介して端末装置100から秘密情報を受信し、ユーザ企業の外部に流出しないように秘密情報を保管する。また、データベースサーバ32は、端末装置100からのアクセスに応じて、保管している秘密情報を端末装置100に送信する。ただし、秘密情報はデータベースサーバ32でなく端末装置100に保管するようにしてもよい。   The database server 32 is a server computer that stores data in a nonvolatile storage medium such as an HDD. The database server 32 receives confidential information from the terminal device 100 via the in-house network of the user company, and stores the confidential information so as not to leak out of the user company. Further, the database server 32 transmits the stored secret information to the terminal device 100 in response to the access from the terminal device 100. However, the secret information may be stored in the terminal device 100 instead of the database server 32.

ROMライタ33は、端末装置100に接続されており、不揮発性メモリにデータを書き込む電子機器である。ROMライタ33は、ハードウェアベンダから受け取ったハードウェア部品200を使用可能な状態にするために、ハードウェア部品200が備えるメモリに秘密情報に応じた制御データを書き込む。ただし、ハードウェア部品200が備えるメモリがRAMなどの揮発性メモリである場合、ROMライタ33を利用せず、ハードウェア部品200に接続されるプロセッサが起動時に制御データを書き込めばよい。その場合、例えば、制御データはハードウェア部品200が搭載される電子機器に保存される。また、ROMライタ33は、端末装置100と異なる装置に接続されていてもよい。   The ROM writer 33 is an electronic device that is connected to the terminal device 100 and writes data to a nonvolatile memory. The ROM writer 33 writes control data corresponding to the secret information in a memory included in the hardware component 200 in order to make the hardware component 200 received from the hardware vendor usable. However, when the memory included in the hardware component 200 is a volatile memory such as a RAM, the ROM writer 33 is not used, and the processor connected to the hardware component 200 may write the control data at startup. In that case, for example, the control data is stored in an electronic device on which the hardware component 200 is mounted. The ROM writer 33 may be connected to a device different from the terminal device 100.

端末装置34は、ハードウェアベンダのユーザが操作するクライアントコンピュータである。端末装置34は、ユーザ企業から受け取った外部情報に基づいて、実装設計用の回路データを生成する。このとき、端末装置34のユーザは、外部情報に含まれるソースコードを編集して最適化する。電子回路を意識して作成されていないソースコードを最適化することで、製造される電子回路の動作速度や回路規模が改善される。端末装置34は、高位合成ツールや論理合成ツールを使用して、最適化されたソースコードから回路データを生成する。なお、回路データの生成は、端末装置34ではなく、端末装置34から社内ネットワークを介してアクセスされるサーバコンピュータが実行してもよい。   The terminal device 34 is a client computer operated by a hardware vendor user. The terminal device 34 generates circuit data for mounting design based on the external information received from the user company. At this time, the user of the terminal device 34 edits and optimizes the source code included in the external information. By optimizing the source code that has not been created in consideration of the electronic circuit, the operation speed and circuit scale of the manufactured electronic circuit are improved. The terminal device 34 generates circuit data from the optimized source code using a high-level synthesis tool or a logic synthesis tool. The generation of circuit data may be executed not by the terminal device 34 but by a server computer accessed from the terminal device 34 via an in-house network.

製造装置35は、端末装置34が生成した回路データに基づいてハードウェア部品200を製造する。ハードウェア部品200は、例えば、プリント基板上に集積回路などの電子回路を実装したものである。電子回路は、例えば、ASICやFPGAとして製造される。電子回路は、製造後にユーザ企業が制御データを書き込むことができるメモリを備える。メモリは、EPROM(Erasable Programmable Read Only Memory)などの不揮発性メモリでもよいし、RAMなどの揮発性メモリでもよい。   The manufacturing device 35 manufactures the hardware component 200 based on the circuit data generated by the terminal device 34. The hardware component 200 is, for example, an electronic circuit such as an integrated circuit mounted on a printed board. The electronic circuit is manufactured, for example, as an ASIC or FPGA. The electronic circuit includes a memory in which a user company can write control data after manufacture. The memory may be a nonvolatile memory such as an EPROM (Erasable Programmable Read Only Memory) or a volatile memory such as a RAM.

図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 terminal device 100 includes a CPU 101, a RAM 102, an HDD 103, an image signal processing unit 104, an input signal processing unit 105, a disk drive 106, a communication interface 107, and an interface 108. The unit is connected to the bus 109 in the terminal device 100. The database server 32 and the terminal device 34 can also be realized by the same hardware as the terminal device 100.

CPU101は、プログラムの命令を実行する演算器を含むプロセッサである。CPU101は、HDD103に記憶されているプログラムやデータの少なくとも一部をRAM102にロードしてプログラムを実行する。なお、CPU101は複数のプロセッサコアを備えてもよく、端末装置100は複数のプロセッサを備えてもよく、複数のプロセッサまたはプロセッサコアを用いて並列処理を行ってもよい。また、2以上のプロセッサの集合、FPGAやASICなどの専用回路、2以上の専用回路の集合、プロセッサと専用回路の組み合わせなどを「プロセッサ」と呼んでもよい。   The CPU 101 is a processor including an arithmetic unit that executes program instructions. The CPU 101 loads at least a part of the program and data stored in the HDD 103 into the RAM 102 and executes the program. Note that the CPU 101 may include a plurality of processor cores, and the terminal device 100 may include a plurality of processors, or may perform parallel processing using a plurality of processors or processor cores. A set of two or more processors, a dedicated circuit such as an FPGA or an ASIC, a set of two or more dedicated circuits, a combination of a processor and a dedicated circuit, and the like may be called a “processor”.

RAM102は、CPU101が実行するプログラムやプログラムから参照されるデータを一時的に記憶する揮発性メモリである。なお、端末装置100は、RAM以外の種類のメモリを備えてもよく、複数個の揮発性メモリを備えてもよい。   The RAM 102 is a volatile memory that temporarily stores programs executed by the CPU 101 and data referenced from the programs. Note that the terminal device 100 may include a type of memory other than the RAM, or may include a plurality of volatile memories.

HDD103は、OS(Operating System)やファームウェアやアプリケーションソフトウェアなどのソフトウェアのプログラムおよびデータを記憶する不揮発性の記憶装置である。なお、端末装置100は、フラッシュメモリやSSD(Solid State Drive)などの他の種類の記憶装置を備えてもよく、複数個の不揮発性の記憶装置を備えてもよい。   The HDD 103 is a non-volatile storage device that stores software programs and data such as an OS (Operating System), firmware, and application software. The terminal device 100 may include other types of storage devices such as a flash memory and an SSD (Solid State Drive), and may include a plurality of nonvolatile storage devices.

画像信号処理部104は、CPU101からの命令に従って、端末装置100に接続されたディスプレイ41に画像を出力する。ディスプレイ41としては、CRT(Cathode Ray Tube)ディスプレイや液晶ディスプレイなどを用いることができる。   The image signal processing unit 104 outputs an image to the display 41 connected to the terminal device 100 in accordance with a command from the CPU 101. As the display 41, a CRT (Cathode Ray Tube) display, a liquid crystal display, or the like can be used.

入力信号処理部105は、端末装置100に接続された入力デバイス42から入力信号を取得し、CPU101に通知する。入力デバイス42としては、マウスやタッチパネルなどのポインティングデバイス、キーボードなどを用いることができる。   The input signal processing unit 105 acquires an input signal from the input device 42 connected to the terminal device 100 and notifies the CPU 101 of the input signal. As the input device 42, a pointing device such as a mouse or a touch panel, a keyboard, or the like can be used.

ディスクドライブ106は、記録媒体43に記録されたプログラムやデータを読み取る駆動装置である。記録媒体43として、例えば、フレキシブルディスク(FD:Flexible Disk)やHDDなどの磁気ディスク、CD(Compact Disc)やDVD(Digital Versatile Disc)などの光ディスク、光磁気ディスク(MO:Magneto-Optical disk)を使用できる。ディスクドライブ106は、CPU101からの命令に従って、記録媒体43から読み取ったプログラムやデータをRAM102またはHDD103に格納する。   The disk drive 106 is a drive device that reads programs and data recorded on the recording medium 43. As the recording medium 43, for example, a magnetic disk such as a flexible disk (FD) or HDD, an optical disk such as a CD (Compact Disc) or a DVD (Digital Versatile Disc), or a magneto-optical disk (MO). Can be used. The disk drive 106 stores the program and data read from the recording medium 43 in the RAM 102 or the HDD 103 in accordance with a command from the CPU 101.

通信インタフェース107は、ネットワークを介してデータベースサーバ32や端末装置34と通信を行う。通信インタフェース107は、ケーブルが接続される有線インタフェースでもよいし、無線通信を行う無線インタフェースであってもよい。   The communication interface 107 communicates with the database server 32 and the terminal device 34 via a network. The communication interface 107 may be a wired interface to which a cable is connected, or may be a wireless interface that performs wireless communication.

インタフェース108には、ROMライタ33が接続される。インタフェース108は、CPU101からの命令に従ってROMライタ33に制御データを送信する。
ただし、端末装置100はディスクドライブ106を備えなくてもよく、他の端末装置からアクセスされる場合には画像信号処理部104や入力信号処理部105を備えなくてもよい。また、ディスプレイ41や入力デバイス42は、端末装置100の筐体と一体に形成されてもよい。なお、RAM102またはHDD103は第1の実施の形態の記憶部11の一例であり、CPU101は第1の実施の形態の生成部12の一例である。
The ROM writer 33 is connected to the interface 108. The interface 108 transmits control data to the ROM writer 33 in accordance with a command from the CPU 101.
However, the terminal device 100 may not include the disk drive 106, and may not include the image signal processing unit 104 and the input signal processing unit 105 when accessed from another terminal device. Further, the display 41 and the input device 42 may be formed integrally with the casing of the terminal device 100. The RAM 102 or the HDD 103 is an example of the storage unit 11 according to the first embodiment, and the CPU 101 is an example of the generation unit 12 according to the first embodiment.

図4は、ソースコードの例を示す図である。ソースコード111は、端末装置100において変換される前のオリジナルのソースコードである。ソースコード111は、第1の実施の形態の第1のコード21,21aの一例である。   FIG. 4 is a diagram illustrating an example of source code. The source code 111 is an original source code before being converted in the terminal device 100. The source code 111 is an example of the first codes 21 and 21a according to the first embodiment.

ソースコード111には、複数の変数と複数の関数が定義されている。図4の例では、入力データが代入される2つの変数と演算結果が代入される1つの変数とが定義されている。前者の2つは整数型(int型)の変数であり、ソースコード111では変数名apple,bananaが使用されている。後者は整数型の変数であり、ソースコード111では変数名outが使用されている。また、図4の例では、2つの関数が定義されている。2つの関数はそれぞれ整数型の引数を1つ受け取って整数型の戻り値を返すものであり、ソースコード111では関数名buy,sellが使用されている。   In the source code 111, a plurality of variables and a plurality of functions are defined. In the example of FIG. 4, two variables to which input data is substituted and one variable to which an operation result is substituted are defined. The former two are integer type (int type) variables. In the source code 111, the variable names apple and banna are used. The latter is an integer type variable, and the variable name out is used in the source code 111. In the example of FIG. 4, two functions are defined. Each of the two functions receives one integer type argument and returns an integer type return value. In the source code 111, function names buy and sell are used.

そして、図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 source code 111 shown in FIG. 4 to the hardware vendor as it is, the hardware vendor is expected to manufacture an electronic circuit as shown in FIG. The first electronic circuit includes a comparison circuit 211, arithmetic circuits 212 and 213 corresponding to functions, and a multiplexer 214.

比較回路211は、第1の入力信号(in[0])と第2の入力信号(in[1])とを比較し、前者の値が後者の値より大きい場合は真=1を出力し、それ以外の場合は偽=0を出力する。演算回路212は、第2の入力信号を受け取って関数名buyの関数で定義された演算を行う。演算回路213は、第2の入力信号を受け取って関数名sellの関数で定義された演算を行う。マルチプレクサ214は、出力信号(out)として、比較回路211が真=1を出力したときは演算回路212の演算結果を選択し、比較回路211が偽=0を出力したときは演算回路213の演算結果を選択する。   The comparison circuit 211 compares the first input signal (in [0]) with the second input signal (in [1]), and outputs true = 1 when the former value is larger than the latter value. In other cases, false = 0 is output. The arithmetic circuit 212 receives the second input signal and performs an operation defined by the function having the function name buy. The arithmetic circuit 213 receives the second input signal and performs an operation defined by the function having the function name “cell”. The multiplexer 214 selects the operation result of the operation circuit 212 when the comparison circuit 211 outputs true = 1 as the output signal (out), and the operation of the operation circuit 213 when the comparison circuit 211 outputs false = 0. Select the result.

このように、ソースコード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 source code 111 can be manufactured from the source code 111. However, from the source code 111 shown in FIG. 4, the first input data is used as the first reference operand of the comparison operation, and the second input data is used as the second reference operand of the comparison operation. Can be clearly read. In addition, it can be clearly seen from the source code 111 shown in FIG. 4 that the first input data is used as an argument of the function names buy and sell. If the relationship between the data and the operation to be performed on which data is the knowledge (knowhow) to be kept secret, the know-how leaks by passing the source code 111 to the hardware vendor. .

そこで、端末装置100は、データと演算の関係が不明になるようにソースコード111を変換してハードウェアベンダに提供する。ただし、変換されたソースコードからは、プロセッサに実行させるオブジェクトコードを生成することはできない。   Therefore, the terminal device 100 converts the source code 111 so as to make the relationship between the data and the calculation unclear and provides it to the hardware vendor. However, object code to be executed by the processor cannot be generated from the converted source code.

図6は、変換されたソースコードの例を示す図である。ソースコード112は、端末装置100において変換された後のハードウェアベンダに提供されるソースコードである。ソースコード112は、第1の実施の形態の第2のコード22,22aの一例である。   FIG. 6 is a diagram illustrating an example of converted source code. The source code 112 is source code provided to a hardware vendor after being converted in the terminal device 100. The source code 112 is an example of the second codes 22 and 22a of the first embodiment.

ソースコード112には、ソースコード111と同じ複数の変数と複数の関数が定義されている。図6の例では、3つの変数を定義するため、ソースコード111と同じ変数名apple,banana,outが使用され、2つの関数を定義するため、ソースコード111と同じ関数名buy,sellが使用されている。ただし、ソースコード111をソースコード112に変換する際、難読化を行って変数名や関数名を変えてもよい。   The source code 112 defines the same variables and functions as the source code 111. In the example of FIG. 6, in order to define three variables, the same variable names apple, banana, and out are used as the source code 111, and in order to define two functions, the same function names buy and sell as the source code 111 are used. Has been. However, when the source code 111 is converted to the source code 112, obfuscation may be performed to change the variable name or function name.

一方、ソースコード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 source code 112, a variable name or function name defined in the source code 112 is not described in a statement that refers to a variable or function. That is, the variable name described as the reference operand (including the argument specified by the function call) of the operation is replaced with a dummy identifier. In the example of FIG. 6, the variable names apple and banana described as reference operands for the comparison operation are replaced with identifiers x [0] and x [1], and the variable name banana described as an argument of the function call is an identifier. x [2] is substituted. Also, the function name described in the function call statement is replaced with a dummy identifier. In the example of FIG. 6, the function names buy and sell described in the function call statement are replaced with dummy identifiers x [3] and x [4].

変数や関数を参照する文に記載された変数名や関数名がダミーの識別子に置換されることで、ソースコード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 source code 112. In the example of FIG. 6, the comparison operation determines whether the first input data is larger than the second input data, or whether the second input data is larger than the first input data. It is unknown whether it is judged. In the example of FIG. 6, it is unclear which of the first input data and the second input data is specified as the function call argument. In the example of FIG. 6, it is unknown which of the two functions is called in each function call statement.

このように、ソースコード111をソースコード112に変換すると、データと演算の対応関係の情報が失われる一方、実行され得る演算の種類やプログラムの制御構造の情報は失われない。図6の例では、比較回路や2つの関数に対応する2つの演算回路を含み、比較回路の出力に応じて出力信号を選択するような電子回路を製造すべきことが、ソースコード112から読み取れる。なお、図6の例では、全ての参照オペランドの変数名や全ての関数呼出文の関数名をダミーの識別子に置換しているが、一部の変数名や関数名のみ置換してもよい。例えば、ソースコード111の記述の中で重要なノウハウを含む記述の範囲をユーザが指定したとき、その範囲内にある変数名や関数名のみ置換してもよい。また、ユーザが置換対象の変数や関数を指定するようにしてもよい。   As described above, when the source code 111 is converted into the source code 112, the information on the correspondence between the data and the operation is lost, while the information on the type of operation that can be executed and the control structure of the program is not lost. In the example of FIG. 6, it can be read from the source code 112 that an electronic circuit that includes a comparison circuit and two arithmetic circuits corresponding to two functions and selects an output signal according to the output of the comparison circuit should be manufactured. . In the example of FIG. 6, the variable names of all reference operands and the function names of all function call statements are replaced with dummy identifiers, but only some of the variable names and function names may be replaced. For example, when the user specifies a description range including important know-how in the description of the source code 111, only the variable name or function name within the range may be replaced. In addition, the user may designate a variable or function to be replaced.

図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 terminal device 100 when the source code 111 is converted into the source code 112. The array table 113 is stored in the database server 32 as secret information that is not provided to the hardware vendor. The array table 113 includes items of an identifier and an original name.

識別子の項目には、変数名または関数名に代えてソースコード112に記載されたダミーの識別子が登録される。例えば、複数の識別子は配列として表現され、その場合には配列の添字のみで各識別子を特定することができる。オリジナル名の項目には、ダミーの識別子に置換する前の元の変数名または関数名が登録される。図7に示すように、同じ変数または関数を参照する2以上の文がソースコード111に含まれるとき、1つの変数名または関数名に対して異なる2以上のダミーの識別子を割り当ててよい。図7の例では、ダミーの識別子x[1],x[2]は共に変数名bananaに対応している。   In the identifier item, a dummy identifier written in the source code 112 is registered instead of the variable name or the function name. For example, a plurality of identifiers are expressed as an array, and in this case, each identifier can be specified only by the subscript of the array. In the original name item, the original variable name or function name before replacement with a dummy identifier is registered. As shown in FIG. 7, when two or more statements that refer to the same variable or function are included in the source code 111, two or more different dummy identifiers may be assigned to one variable name or function name. In the example of FIG. 7, dummy identifiers x [1] and x [2] both correspond to the variable name banana.

図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 terminal device 100 when the source code 111 is converted into the source code 112. The group table 114 is provided to the hardware vendor together with the source code 112. The group table 114 includes items of type, identifier, and original name.

型の項目には、変数の型または関数の型が登録される。関数の型は、戻り値の型と引数の型の組み合わせであり、何れの変数の型とも異なる。識別子の項目には、型が同じ変数について使用されたダミーの識別子の集合、または、型が同じ関数について使用されたダミーの識別子の集合が登録される。オリジナル名の項目には、型が同じ変数の変数名の集合、または、型が同じ関数の関数名の集合が登録される。   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 source code 111 in FIG. 4 is converted into the source code 112 in FIG. 6, dummy identifiers x [0], x [1], x [2] are associated with variable names apple, banna, Identifiers x [3] and x [4] are associated with function names buy and sell.

これにより、ハードウェアベンダは、各ダミーの識別子に対応する変数名または関数名の候補を絞り込むことができる。ハードウェアベンダは、例えば、グループテーブル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 terminal device 100 includes a design information storage unit 110, a source code editing unit 120, a source code conversion unit 130, a design information transmission unit 140, and a control data generation unit 150. The design information storage unit 110 is realized as a storage area secured in the RAM 102 or the HDD 103, for example. The source code editing unit 120, the source code conversion unit 130, the design information transmission unit 140, and the control data generation unit 150 are realized as software modules, for example.

設計情報記憶部110は、ソースコード111(変換前)、ソースコード112(変換後)、配列テーブル113およびグループテーブル114を記憶する。ソースコード編集部120は、入力デバイス42を通じてユーザ入力を受け付け、ユーザ入力に応じて設計情報記憶部110に記憶されたソースコード111を編集する。ソースコード変換部130は、設計情報記憶部110に記憶されたソースコード111を解析する。そして、ソースコード変換部130は、ソースコード111からソースコード112と配列テーブル113とグループテーブル114を生成し、設計情報記憶部110に格納する。   The design information storage unit 110 stores a source code 111 (before conversion), a source code 112 (after conversion), an array table 113, and a group table 114. The source code editing unit 120 receives user input through the input device 42 and edits the source code 111 stored in the design information storage unit 110 in accordance with the user input. The source code conversion unit 130 analyzes the source code 111 stored in the design information storage unit 110. Then, the source code conversion unit 130 generates the source code 112, the arrangement table 113, and the group table 114 from the source code 111, and stores them in the design information storage unit 110.

設計情報送信部140は、ソースコード112とグループテーブル114を、外部情報としてネットワーク31を介してハードウェアベンダに送信する。または、設計情報送信部140は、ソースコード112とグループテーブル114をハードウェアベンダに渡す可搬記録媒体に書き込む。また、設計情報送信部140は、配列テーブル113を秘密情報としてデータベースサーバ32に送信する。制御データ生成部150は、ハードウェア部品200が製造されると、データベースサーバ32から配列テーブル113を取得し、ハードウェア部品200を制御するための制御データを配列テーブル113から生成する。そして、制御データ生成部150は、制御データをROMライタ33に送る。   The design information transmitting unit 140 transmits the source code 112 and the group table 114 as external information to the hardware vendor via the network 31. Alternatively, the design information transmission unit 140 writes the source code 112 and the group table 114 on a portable recording medium that is passed to the hardware vendor. Further, the design information transmission unit 140 transmits the array table 113 to the database server 32 as secret information. When the hardware component 200 is manufactured, the control data generation unit 150 acquires the array table 113 from the database server 32 and generates control data for controlling the hardware component 200 from the array table 113. Then, the control data generation unit 150 sends the control data to the ROM writer 33.

ただし、ハードウェア部品200が製造される前に、制御データ生成部150が制御データを生成してもよい。その場合、データベースサーバ32には、配列テーブル113に代えてまたは配列テーブル113と共に、生成された制御データを秘密情報として保存しておいてもよい。また、前述のように、ハードウェア部品200の備えるメモリに制御データを書き込むことは、端末装置100以外の装置が行ってもよく、ハードウェア部品200の搭載された電子機器が起動する毎にその電子機器が実行してもよい。後者の場合、生成された制御データはその電子機器にインストールされる。   However, the control data generation unit 150 may generate control data before the hardware component 200 is manufactured. In that case, the generated control data may be stored as secret information in the database server 32 instead of or together with the array table 113. Further, as described above, the control data may be written into the memory included in the hardware component 200 by a device other than the terminal device 100, and every time an electronic device in which the hardware component 200 is mounted is activated. An electronic device may execute. In the latter case, the generated control data is installed in the electronic device.

図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 code editing unit 120 of the terminal device 100 creates the source code 111 according to the user input (step S1). The source code conversion unit 130 of the terminal device 100 performs a concealment process on the generated source code 111. That is, the source code conversion unit 130 generates a source code 112, an array table 113, and a group table 114 from the source code 111. The generated source code 112 and group table 114 are passed to the hardware vendor as external information. The generated array table 113 is managed as secret information without being passed to the hardware vendor (step S2).

端末装置34は、ソースコード112に対して最適化処理を行う。すなわち、端末装置34は、電子回路の動作速度が速く回路規模が小さくなるように、ユーザ入力に応じてソースコード112を修正する(ステップS3)。端末装置34は、高位合成(動作合成)ツールを用いて、修正されたソースコード112からハードウェア記述言語で記述したRTLモデルを生成する(ステップS4)。端末装置34は、RTLモデルに基づいて電子回路をシミュレーションすることで、RTLモデルが適切か検証する(ステップS5)。   The terminal device 34 performs an optimization process on the source code 112. That is, the terminal device 34 modifies the source code 112 according to the user input so that the operation speed of the electronic circuit is fast and the circuit scale is small (step S3). The terminal device 34 generates an RTL model described in a hardware description language from the corrected source code 112 using a high-level synthesis (behavioral synthesis) tool (step S4). The terminal device 34 verifies whether the RTL model is appropriate by simulating the electronic circuit based on the RTL model (step S5).

ステップ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 source code 111. The terminal device 34 generates circuit data for mounting design from the RTL model using a logic synthesis tool. For example, when an electronic circuit is mounted as an ASIC, an ASIC logic synthesis tool is used, and when an electronic circuit is mounted as an FPA, an FPGA logic synthesis tool is used. The manufacturing device 35 manufactures an electronic circuit corresponding to the circuit data generated by the terminal device 34, and manufactures the hardware component 200 on which the electronic circuit is mounted (step S7).

端末装置100の制御データ生成部150は、ステップS2で生成された配列テーブル113から、電子回路が変換前のソースコード111に対応する動作をするように制御するための制御データを生成する。制御データは、例えば、電子回路に含まれる各選択回路に何れの信号を選択すればよいか指示するためのデータである(ステップS8)。ROMライタ33は、電子回路が備えるメモリに制御データを書き込む(ステップS9)。   The control data generation unit 150 of the terminal device 100 generates control data for controlling the electronic circuit to perform an operation corresponding to the source code 111 before conversion, from the arrangement table 113 generated in step S2. The control data is, for example, data for instructing each selection circuit included in the electronic circuit which signal should be selected (step S8). The ROM writer 33 writes control data to the memory provided in the electronic circuit (step S9).

図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 code conversion unit 130 generates an empty array table 113 and an empty group table 114 and stores them in the design information storage unit 110.

(ステップS11)ソースコード変換部130は、ソースコード111を構文解析して変数参照の記述と関数呼出文を検出する。変数参照の記述は、演算のオペランド(関数呼出で指定する引数を含む)であって何れかの変数を参照する参照オペランドである。   (Step S11) The source code conversion unit 130 parses the source code 111 to detect a variable reference description and a function call statement. The description of the variable reference is an operation operand (including an argument specified by a function call) and is a reference operand that refers to any variable.

(ステップS12)ソースコード変換部130は、ステップS11で検出した変数参照の記述および関数呼出文のうち何れか1つを選択する。
(ステップS13)ソースコード変換部130は、配列テーブル113を参照して、未使用のダミーの識別子を1つ選択する。ダミーの識別子が配列として表現されている場合は、未使用の添字のうち最も番号が小さいものを選択する。そして、ソースコード変換部130は、ステップS12で選択した変数参照の記述または関数呼出文に記載された名称(変数名または関数名)を、選択したダミーの識別子に置換する。これにより、変数名または関数名がダミーの識別子に置換されたソースコード112が生成される。
(Step S12) The source code conversion unit 130 selects one of the variable reference description and the function call statement detected in Step S11.
(Step S13) The source code conversion unit 130 refers to the arrangement table 113 and selects one unused dummy identifier. When the dummy identifier is expressed as an array, the unused index with the smallest number is selected. Then, the source code conversion unit 130 replaces the name (variable name or function name) described in the variable reference description or function call statement selected in step S12 with the selected dummy identifier. Thereby, the source code 112 in which the variable name or function name is replaced with the dummy identifier is generated.

なお、上記説明では、変数参照の記述または関数呼出文毎に異なるダミーの識別子を用いるとしたが、同じ変数名または関数名に対しては同じダミーの識別子を用いるようにしてもよい。また、前と同じ変数名または関数名が現れたときに、前と同じ識別子を用いるか異なる識別子を用いるかを、ランダムまたは所定の規則に従って選択してもよい。   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 code conversion unit 130 registers the original variable name or function name in the array table 113 in association with the dummy identifier selected in Step S13.
(Step S15) The source code conversion unit 130 determines the type of the referenced variable or the type of the function to be called. The variable type is described in a statement defining a variable in the source code 111, and the function type is described in a statement defining a function in the source code 111.

(ステップS16)ソースコード変換部130は、ステップS15で判定した型がグループテーブル114に登録されているか判断する。登録されている場合、ソースコード変換部130は、その型に対応するエントリ(識別子の集合とオリジナル名の集合)を選択し、登録されていない場合、新たなエントリをグループテーブル114に追加する。そして、ソースコード変換部130は、識別子の集合にステップS13で選択したダミーの識別子を追加し、オリジナル名の集合に元の変数名または関数名を追加する。   (Step S16) The source code conversion unit 130 determines whether the type determined in step S15 is registered in the group table 114. If registered, the source code conversion unit 130 selects an entry (a set of identifiers and a set of original names) corresponding to the type, and adds a new entry to the group table 114 if not registered. Then, the source code conversion unit 130 adds the dummy identifier selected in step S13 to the set of identifiers, and adds the original variable name or function name to the set of original names.

(ステップS17)ソースコード変換部130は、ステップS12で、検出された変数参照の記述および関数呼出文を全て選択したか判断する。全て選択した場合は処理をステップS18に進め、未選択のものがある場合は処理をステップS12に進める。   (Step S17) The source code conversion unit 130 determines whether or not all of the detected variable reference descriptions and function call statements have been selected in step S12. If all are selected, the process proceeds to step S18. If there is any unselected item, the process proceeds to step S12.

(ステップS18)ソースコード変換部130は、ソースコード112およびグループテーブル114を、ハードウェアベンダに提供するべき外部情報として出力する。
(ステップS19)ソースコード変換部130は、配列テーブル113を、ハードウェアベンダに提供せずに秘密に管理するべき秘密情報として保存する。
(Step S18) The source code conversion unit 130 outputs the source code 112 and the group table 114 as external information to be provided to the hardware vendor.
(Step S19) The source code conversion unit 130 stores the arrangement table 113 as secret information that should be secretly managed without being provided to the hardware vendor.

なお、上記のステップ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 source code 112 and the group table 114 manufactures an electronic circuit as shown in FIG. 12, for example. The second electronic circuit includes a comparison circuit 211, arithmetic circuits 212 and 213, multiplexers 214 and 231 to 235, and a memory 220. The functions of the comparison circuit 211, the arithmetic circuits 212 and 213, and the multiplexer 214 are as described in FIG.

マルチプレクサ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 multiplexer 231 selects one of the first input signal (in [0]) and the second input signal (in [1]) and inputs it to the comparison circuit 211 as a first operand. The multiplexer 232 selects one of the first and second input signals and inputs it to the comparison circuit 211 as the second operand. The multiplexer 233 selects one of the first and second input signals and inputs it to the arithmetic circuits 212 and 213 as an argument. The multiplexer 234 selects one of the operation results of the operation circuits 212 and 213 and inputs it to the multiplexer 214 as the first operation result. The multiplexer 235 selects one of the operation results of the operation circuits 212 and 213 and inputs it to the multiplexer 214 as the second operation result.

このように、ソースコード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 source code 112 indicates two input signals in [0], in [1]. Multiplexers 231 to 233 are provided so that input signals can be selected after the electronic circuit is manufactured. In addition, since it is unclear which identifiers x [3] and x [4] described in the source code 112 indicate the function names buy and sell, which function should be used for the calculation? Multiplexers 234 and 235 are provided for selection after manufacture of the electronic circuit.

メモリ220は、電子回路の製造時点ではデータが書き込まれていない空のメモリでよい。メモリ220には、電子回路の製造後にマルチプレクサ231〜235を制御するための制御データが書き込まれる。メモリ220が不揮発性メモリである場合は、例えば、ハードウェア部品200を使用し始める前にROMライタ33を用いて制御データが書き込まれる。メモリ220が揮発性メモリである場合は、例えば、ハードウェア部品200を搭載した電子機器が起動する毎に制御データが書き込まれる。   The memory 220 may be an empty memory in which no data is written at the time of manufacturing the electronic circuit. The memory 220 is written with control data for controlling the multiplexers 231 to 235 after the electronic circuit is manufactured. When the memory 220 is a non-volatile memory, for example, the control data is written using the ROM writer 33 before starting to use the hardware component 200. When the memory 220 is a volatile memory, for example, control data is written every time an electronic device equipped with the hardware component 200 is activated.

マルチプレクサ231〜235それぞれを制御するためのデータは、2つの信号の何れを選択すればよいかを示すデータである。例えば、“01101”というビット列がメモリ220に書き込まれる。これは、マルチプレクサ231が第1の入力信号を選択し、マルチプレクサ232,233が第2の入力信号を選択することを示している。また、これは、マルチプレクサ234が演算回路212の演算結果を選択し、マルチプレクサ235が演算回路213の演算結果を選択することを示している。ただし、上記の制御データの記載は一例であり、制御データの記載方法は電子回路の実装方法に依存する。このような制御データは、電子回路の構造と配列テーブル113に基づいて生成できる。   Data for controlling each of the multiplexers 231 to 235 is data indicating which of the two signals should be selected. For example, a bit string “01101” is written in the memory 220. This indicates that the multiplexer 231 selects the first input signal, and the multiplexers 232 and 233 select the second input signal. This also indicates that the multiplexer 234 selects the calculation result of the calculation circuit 212 and the multiplexer 235 selects the calculation result of the calculation circuit 213. However, the description of the control data is an example, and the description method of the control data depends on the mounting method of the electronic circuit. Such control data can be generated based on the structure of the electronic circuit and the arrangement table 113.

図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 source code 112 and the group table 114 can also manufacture an electronic circuit as shown in FIG. The third electronic circuit includes a comparison circuit 211, arithmetic circuits 212 and 213, a memory 220, and switch boxes 241 and 242.

上記の第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 multiplexers 231 to 233 to select the input signal, while the third electronic circuit uses the switch box 241 to select the input signal. The switch box 241 can switch ON / OFF of six contacts formed between two input lines and three output lines. The two input lines correspond to the two input signals in [0] and in [1]. The three output lines correspond to the first operand of the comparison circuit 211, the second operand of the comparison circuit 211, and the arguments of the arithmetic circuits 212 and 213.

また、第2の電子回路はマルチプレクサ234,235を用いて演算結果を選択するのに対し、第3の電子回路はスイッチボックス242を用いて演算結果を選択する。スイッチボックス242は、2つの入力線と2つの出力線との間に形成される4個の接点のON/OFFを切り替えることができる。2つの入力線は2つの演算回路212,213の演算結果に対応し、2つの出力線はマルチプレクサ214の2つの入力に対応する。   The second electronic circuit uses the multiplexers 234 and 235 to select the operation result, while the third electronic circuit uses the switch box 242 to select the operation result. The switch box 242 can switch ON / OFF of four contacts formed between two input lines and two output lines. The two input lines correspond to the calculation results of the two arithmetic circuits 212 and 213, and the two output lines correspond to the two inputs of the multiplexer 214.

メモリ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 switch boxes 241 and 242 is written in the memory 220 after the electronic circuit is manufactured. Data for controlling the switch box 241 is data indicating ON / OFF of each of the six contacts. For example, a bit string “1000011” is written in the memory 220. This means that the first output line is connected to the first input line, the second output line is connected to the second input line, and the third output line is connected to the second input line. Show. The data for controlling the switch box 242 is data indicating ON / OFF of each of the four contacts. For example, a bit string “1001” is written in the memory 220. This indicates that the first output line is connected to the first input line and the second output line is connected to the second input line. However, the description of the control data is an example, and the description method of the control data depends on the mounting method of the electronic circuit.

電子回路がFPGAとして実装される場合、このようにスイッチボックス241,242を使用することで回路規模を抑制することができる。スイッチボックス241,242を制御するための制御データは、配列テーブル113に基づいて生成できる。   When the electronic circuit is mounted as an FPGA, the circuit scale can be suppressed by using the switch boxes 241 and 242 in this way. Control data for controlling the switch boxes 241 and 242 can be generated based on the arrangement table 113.

図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 comparison circuit 211, multiplexers 214, 231 to 233, a memory 220, and look-up tables (LUTs) 251 and 252. The functions of the comparison circuit 211, the multiplexers 214, 231 to 233, and the memory 220 are as described with reference to FIG.

第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 memory 220 includes data defining the correspondence between the input value and the output value of the lookup table 251 and data defining the correspondence between the input value and the output value of the lookup table 252. It is. One of the two correspondence relationships indicates a function having a function name buy, and the other indicates a function having a function name sell. The lookup tables 251 and 252 calculate an output value corresponding to the input value based on the control data written in the memory 220.

このように、ルックアップテーブル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 source code 112, the calculation result of the lookup table 251 is input to the multiplexer 214 as the first calculation result. Good. Similarly, the calculation result of the lookup table 252 may be input to the multiplexer 214 as the second calculation result. That is, the multiplexers 234 and 235 and the switch box 242 need not be provided between the lookup tables 251 and 252 and the multiplexer 214, and the circuit scale of the electronic circuit can be suppressed.

なお、図14では入力信号を選択するためにマルチプレクサ231〜233を用いているが、図13に示したようにスイッチボックス241を用いてもよい。
第2の実施の形態の情報処理システムによれば、ハードウェアベンダにハードウェア部品200の製造を依頼するにあたり、ソースコード111がソースコード112に変換され、また、配列テーブル113およびグループテーブル114が生成される。そして、ソースコード112およびグループテーブル114が外部情報としてハードウェアベンダに渡される一方、配列テーブル113が秘密情報として保管される。
In FIG. 14, the multiplexers 231 to 233 are used to select the input signal, but the switch box 241 may be used as shown in FIG.
According to the information processing system of the second embodiment, when requesting the hardware vendor to manufacture the hardware component 200, the source code 111 is converted into the source code 112, and the array table 113 and the group table 114 are Generated. Then, the source code 112 and the group table 114 are transferred to the hardware vendor as external information, while the array table 113 is stored as secret information.

ソースコード112はプログラムの制御構造や演算内容を表現しており、グループテーブル114は各ダミーの識別子に対応する変数または関数の候補を示しているため、マルチプレクサやスイッチボックスなどの選択回路を利用して電子回路を製造することが可能である。一方、ソースコード112およびグループテーブル114からは、どの入力データに対してどのような演算を行うかという具体的なデータと演算の対応関係を読み取ることができない。このため、データと演算の対応関係がノウハウとして保護すべき情報であっても、配列テーブル113をハードウェアベンダに提供せずに秘密に保管することで、ノウハウがハードウェアベンダに漏洩するリスクを低減することができる。   Since the source code 112 represents the control structure and operation contents of the program, and the group table 114 indicates candidates for variables or functions corresponding to the dummy identifiers, a selection circuit such as a multiplexer or a switch box is used. Thus, it is possible to manufacture an electronic circuit. On the other hand, from the source code 112 and the group table 114, it is impossible to read the correspondence relationship between the specific data and the calculation as to what calculation is performed on which input data. For this reason, even if the correspondence between the data and the calculation is information that should be protected as know-how, storing the array table 113 secretly without providing it to the hardware vendor makes it possible for the know-how to leak to the hardware vendor. Can be reduced.

なお、第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 information processing apparatus 10 to execute a program. The functions of the second embodiment can be realized by causing the terminal device 100 to execute a program. The program can be recorded on a computer-readable recording medium (for example, the recording medium 43). As the recording medium, for example, a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like can be used. Magnetic disks include FD and HDD. Optical discs include CD, CD-R (Recordable) / RW (Rewritable), DVD, and DVD-R / RW. The program may be recorded and distributed on a portable recording medium. In that case, the program may be copied from a portable recording medium to another recording medium such as an HDD and then executed.

10 情報処理装置
11 記憶部
12 生成部
21,21a 第1のコード
22,22a 第2のコード
23,23a 対応情報
DESCRIPTION OF SYMBOLS 10 Information processing apparatus 11 Memory | storage part 12 Production | generation part 21,21a 1st code | cord | chord 22,22a 2nd code | cord 23,23a

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.
前記電子回路は、前記演算に対応する演算回路と、前記複数の変数に対応する複数の信号のうち前記演算回路に入力される信号を選択する選択回路とを含んでおり、
前記制御データは、前記選択回路を制御するためのデータである、
請求項記載のコード処理方法。
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 .
前記第1のコードには複数の関数が定義されており、前記オペランドに加えて、前記第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乃至の何れか一項に記載のコード処理方法。
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 .
前記第1のコード内から前記オペランドに加えて他のオペランドを検出し、
前記第2のコードの生成では、前記オペランドと前記他のオペランドとが同一の変数を参照する場合であっても、検出された前記他のオペランドの変数名を前記識別子と異なる他の識別子に置換することを許容する、
請求項1乃至の何れか一項に記載のコード処理方法。
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のコード内から演算のオペランドであって前記複数の変数の何れかを参照するオペランドを検出し、前記第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.
JP2012169880A 2012-07-31 2012-07-31 Code processing method, information processing apparatus, and program Expired - Fee Related JP5939074B2 (en)

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)

* Cited by examiner, † Cited by third party
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

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