KR20080092813A - Processor having indirect branch validation unit for secure program execution - Google Patents
Processor having indirect branch validation unit for secure program execution Download PDFInfo
- Publication number
- KR20080092813A KR20080092813A KR1020070058604A KR20070058604A KR20080092813A KR 20080092813 A KR20080092813 A KR 20080092813A KR 1020070058604 A KR1020070058604 A KR 1020070058604A KR 20070058604 A KR20070058604 A KR 20070058604A KR 20080092813 A KR20080092813 A KR 20080092813A
- Authority
- KR
- South Korea
- Prior art keywords
- branch instruction
- branch
- address
- array
- instruction
- Prior art date
Links
- 238000010200 validation analysis Methods 0.000 title abstract description 5
- 238000012545 processing Methods 0.000 claims abstract description 64
- 230000006870 function Effects 0.000 claims description 97
- 238000000034 method Methods 0.000 claims description 66
- 239000011159 matrix material Substances 0.000 claims description 32
- 238000012795 verification Methods 0.000 claims description 30
- 238000004422 calculation algorithm Methods 0.000 claims description 12
- 238000004364 calculation method Methods 0.000 claims description 9
- 241000700605 Viruses Species 0.000 abstract description 32
- 230000007257 malfunction Effects 0.000 abstract description 4
- 229960005486 vaccine Drugs 0.000 abstract description 4
- 230000002159 abnormal effect Effects 0.000 abstract description 3
- 238000012544 monitoring process Methods 0.000 abstract description 3
- 238000010586 diagram Methods 0.000 description 21
- 238000003491 array Methods 0.000 description 14
- 230000010365 information processing Effects 0.000 description 7
- 229920001690 polydopamine Polymers 0.000 description 5
- 238000013478 data encryption standard Methods 0.000 description 2
- 230000036316 preload Effects 0.000 description 2
- 230000002155 anti-virotic effect Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000004590 computer program Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000004148 unit process Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/30—Arrangements for executing machine instructions, e.g. instruction decode
- G06F9/30003—Arrangements for executing specific machine instructions
- G06F9/3005—Arrangements for executing specific machine instructions to perform operations for flow control
- G06F9/30061—Multi-way branch instructions, e.g. CASE
Abstract
Description
도 1은 분기 명령 검증부가 없는 일반적인 중앙 처리 장치의 구조를 도시한 도면이다.1 is a diagram showing the structure of a general CPU without a branch instruction verification unit.
도 2는 본 발명에 따라 분기 명령 검증부(branch instruction validation unit)를 포함하는 중앙 처리 장치의 구조를 도시한 도면이다.2 is a diagram illustrating a structure of a central processing unit including a branch instruction validation unit according to the present invention.
도 3은 현재 로드한 분기 명령과 연관된 현재 어드레스 값 및 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합으로 구성된 참조표를 도시한 도면이다.FIG. 3 is a diagram showing a reference table composed of a combination of a current address value associated with a branch instruction currently loaded and a branch purpose address value for the branch instruction.
도 4는 본 발명의 일실시예로서 소정의 길이의 배열을 이용하여 구현된 분기 명령 검증부의 참조표를 도시한 도면이다.4 is a diagram illustrating a reference table of a branch instruction verifying unit implemented using an arrangement of a predetermined length as an embodiment of the present invention.
도 5는 본 발명의 일실시예에 따라서 매우 적은 계산량을 가지는 간단한 해시 함수의 연산 과정을 도시한 도면이다.5 is a diagram illustrating the operation of a simple hash function having a very small calculation amount according to an embodiment of the present invention.
도 6은 본 발명의 일실시예에 따라서 상기 분기 명령과 연관된 현재 어드레스 값을 섞는 다른 여러 가지 방법을 도시한 도면이다.FIG. 6 illustrates another method for mixing the current address value associated with the branch instruction in accordance with one embodiment of the present invention.
도 7은 본 발명의 일실시예에 따라, 행렬의 원소 값을 이용한 H3 방식의 해시 함수의 동작을 도시한 도면이다.FIG. 7 is a diagram illustrating an operation of a H3 type hash function using element values of a matrix according to an embodiment of the present invention.
도 8은 본 발명에 따라서 두 개의 배열을 직렬로 연결하여 구현된 분기 명령 검증부의 구조를 도시한 도면이다.8 is a diagram illustrating a structure of a branch instruction verifying unit implemented by connecting two arrays in series according to the present invention.
도 9는 본 발명에 따라서 H3 방식의 해시함수를 이용해 순차적인 계산을 통하여 분기 명령을 검증하는 분기 명령 검증부의 구조를 도시한 도면이다. 9 is a diagram illustrating a structure of a branch instruction verifying unit verifying a branch instruction through sequential calculation using a hash function of the H3 method according to the present invention.
도 10은 본 발명에 따라서 분기 예측부와 분기 산출부를 더 포함하는 중앙 처리 장치의 구조를 도시한 도면이다.10 is a diagram illustrating a structure of a central processing unit further including a branch predicting unit and a branch calculating unit according to the present invention.
도 11은 분기 명령이 유효한지 여부를 검증하는 단계를 포함하는 중앙 처리 장치의 분기 명령 실행 방법을 단계별로 도시한 흐름도이다.11 is a flowchart illustrating a step-by-step method of executing a branch instruction of a central processing unit including verifying whether a branch instruction is valid.
도 12는 특정 분기 명령에 대해 예측된 분기 목적 어드레스와 산출된 분기 명령 어드레스의 값이 동일하지 않은 경우에만 상기 분기 명령이 유효한지 검증하는 분기 명령 실행 방법을 단계별로 도시한 흐름도이다.12 is a flowchart illustrating a step-by-step method of executing a branch instruction for verifying that the branch instruction is valid only when the predicted branch purpose address and the calculated branch instruction address for a particular branch instruction do not have the same value.
도 13은 참조표를 이용하여 분기 명령이 유효한지 여부를 검증하는 단계를 포함하는 분기 명령 실행 방법을 단계별로 도시한 흐름도이다.13 is a flowchart illustrating a step-by-step method of executing a branch instruction including verifying whether a branch instruction is valid using a reference table.
도 14는 해시 함수를 이용하여 분기 명령이 유효한지 여부를 검증하는 단계를 포함하는 분기 명령 실행 방법을 단계별로 도시한 흐름도이다.14 is a flow diagram illustrating a step by step method of executing a branch instruction comprising verifying whether a branch instruction is valid using a hash function.
본 발명은 컴퓨터, PDA, 핸드폰 등의 정보처리기기가 컴퓨터 바이러스 등으로 인하여 오작동 하는 것을 방지하는 기술에 관한 것으로, 더욱 상세하게는 정보처리기기에 내장된 중앙 처리 장치가 컴퓨터 프로그램의 명령을 실행할 때 상기 명 령이 컴퓨터 바이러스 또는 해킹에 의한 비 정상적인 명령인지, 일반 프로그램에 의한 정상적인 명령인지 검증하는 방법 및 장치에 관한 것이다.The present invention relates to a technology for preventing malfunction of information processing devices such as computers, PDAs, mobile phones, etc. due to computer viruses, and more particularly, when the central processing unit embedded in the information processing device executes a computer program command. It relates to a method and apparatus for verifying whether the command is a normal command by a computer virus or a hack or a normal command.
종래의 컴퓨터 바이러스 방지 기술에 따르면, 기존에 발생한 컴퓨터 바이러스의 샘플을 수집하여 상기 컴퓨터 바이러스의 특징이 되는 일정한 문자열을 추출하고, 상기 문자열이 특정 컴퓨터의 파일 등에 존재하는지 여부를 이용하여 컴퓨터 바이러스에 감염 되었는지 여부를 판단하였다.According to the conventional computer virus protection technology, a sample of a computer virus that has been generated is collected to extract a constant character string characteristic of the computer virus, and the computer virus is infected by using whether the string exists in a file of a specific computer or the like. It was judged whether or not.
따라서, 새로운 컴퓨터 바이러스가 발생하면, 상기 새로운 컴퓨터 바이러스의 정체를 파악하고, 특징이 되는 문자열을 추출하여 상기 컴퓨터 바이러스에 대응하는 백신 프로그램이 개발되어야 하므로, 기존의 백신프로그램에 상기 컴퓨터 바이러스의 정보가 추가되기 전에는 상기 새로운 컴퓨터 바이러스에 대한 대비가 불가능하여, 새로운 컴퓨터 바이러스에 대한 피해는 막을 수 없었다. 또, 상기 컴퓨터 바이러스의 종류가 증가함에 따라서, 상기 특징이 되는 문자열의 종류도 비례하여 증가하게 되었고, 백신프로그램이 상기 문자열의 존재여부를 검사하는 과정에 소요되는 시간도 증가할 수 밖에 없었다.Therefore, when a new computer virus is generated, an antivirus program corresponding to the computer virus should be developed by identifying the identity of the new computer virus, extracting a character string, and the information of the computer virus in the existing vaccine program. Before the addition, it was impossible to prepare for the new computer virus, so that damage to the new computer virus could not be prevented. In addition, as the type of computer virus increases, the type of the character string is increased proportionally, and the time required for the process of checking whether the character string is present is inevitably increased.
컴퓨터가 해커에 의하여 컨트롤 플로우 공격을 받는 경우에, 해커는 컴퓨터의 취약점을 이용하여 특정 어드레스에 자신의 프로그램을 실행시키는 코드를 삽입한다. 공격을 받은 컴퓨터는 일반 프로그램을 실행하는 도중에 상기 코드에 의하여 해커의 프로그램이 시작되는 명령이 저장된 어드레스로 분기하고, 해커의 프로그램을 실행 함으로써 사용자의 의도와는 달리, 해커의 의도에 의하여 동작하게 된다.When a computer is attacked by a hacker for a control flow, the hacker uses a vulnerability in the computer to inject code that executes his program at a specific address. The attacked computer branches to the address where the command to start the hacker's program is executed by the code while executing the general program, and operates by the hacker's intention, unlike the user's intention, by executing the hacker's program. .
종래의 기술로는, 해커의 공격으로 인하여 컴퓨터의 취약점이 공개되면, 프로그램의 제작사가 상기 취약점을 수정한 패치 프로그램을 이용하여 해커의 공격을 저지할 수 있을 뿐이고, 아직 공개되지 않은 수많은 취약점을 이용한 다른 공격에 대해 뚜렷한 해결책이 없었다.In the related art, when a vulnerability of a computer is disclosed due to a hacker attack, a program maker can only stop a hacker's attack by using a patch program that fixes the vulnerability. There was no obvious solution to other attacks.
본 발명은 상기와 같은 종래 기술을 개선하기 위해 안출된 것으로서, 컴퓨터 바이러스를 감시, 치료하는 백신 프로그램에 의하지 않고, 상기 컴퓨터 바이러스에 의한 오작동을 방지하는 방법 및 장치를 제공하는 것을 목적으로 한다.The present invention has been made to improve the prior art as described above, and an object of the present invention is to provide a method and apparatus for preventing a malfunction caused by the computer virus, not by a vaccine program for monitoring and treating a computer virus.
본 발명의 또 다른 목적은 해커에 의해 공격을 당한 컴퓨터가, 해커가 삽입한 프로그램을 실행하는 것을 방지하는 방법 및 장치를 제공하는 것을 목적으로 한다.Another object of the present invention is to provide a method and apparatus for preventing a computer attacked by a hacker from executing a program inserted by the hacker.
상기의 목적을 이루고, 종래기술의 문제점을 해결하기 위하여, 본 발명의 일측에 따른 중앙 처리 장치는 분기 명령이 유효한지 검증하는 분기 명령 검증부 및, 상기 분기 명령이 유효한 것으로 검증된 경우에, 상기 분기 명령을 실행하는 분기 명령 실행부를 포함하는 것을 특징으로 한다.In order to achieve the above object, and to solve the problems of the prior art, the central processing unit according to one aspect of the present invention is a branch instruction verification unit for verifying that the branch instruction is valid, and when the branch instruction is verified to be valid, And a branch instruction execution unit for executing the branch instruction.
본 발명의 다른 측면에 따른 중앙 처리 장치는 적어도 하나 이상의 분기 명령의 어드레스 값과 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합으로 구성된 참조표를 구비하고, 상기 특정 분기 명령과 연관된 현재 어드레스 값과 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합이 상기 참조표에 존재하지 않으면 상기 분기 명령을 유효하지 않은 분기 명령으로 판단하고, 상기 분기 명령을 실행하지 않는 것을 특징으로 한다.A central processing unit according to another aspect of the present invention includes a look-up table composed of a combination of address values of at least one or more branch instructions and branch destination address values for the branch instruction, the current address value associated with the particular branch instruction and the If the combination of the branch purpose address values for the branch instruction does not exist in the reference table, the branch instruction is regarded as an invalid branch instruction, and the branch instruction is not executed.
본 발명의 또 다른 일면에 따른 중앙 처리 장치는 기 설정된 길이의 배열을 구비하고, 프로그램 카운터에 저장된 분기 명령의 어드레스 값과 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합을 적어도 하나 이상의 해시함수에 입력하여 상기 배열의 적어도 하나 이상의 어드레스 값을 생성하고, 상기 적어도 하나 이상의 어드레스에 저장된 상기 배열의 값에 기반하여 상기 분기 명령이 유효한지 여부를 판단하고, 상기 판단 결과, 상기 분기 명령이 유효하지 않으면 상기 분기 명령을 실행하지 않는 것을 특징으로 한다.According to another aspect of the present invention, a central processing unit includes an array having a predetermined length and inputs a combination of an address value of a branch instruction stored in a program counter and a branch purpose address value for the branch instruction into at least one hash function. Generate at least one address value of the array, and determine whether the branch instruction is valid based on a value of the array stored at the at least one address, and if the branch instruction is invalid, The branch instruction is not executed.
본 발명의 또 다른 일면에 따른 분기 명령 실행 방법은, 중앙 처리 장치가 분기 명령을 실행하는 방법에 있어서 상기 분기 명령이 유효한지 검증하는 단계 및 상기 분기 명령이 유효하지 않은 것으로 검증되면, 상기 분기 명령을 실행하지 않는 단계를 포함하는 것을 특징으로 한다.According to still another aspect of the present invention, there is provided a method of executing a branch instruction, wherein the branch instruction verifies that the branch instruction is valid and verifies that the branch instruction is invalid in the method of executing the branch instruction. It characterized in that it comprises a step of not executing.
이하 첨부 도면들 및 첨부 도면들에 기재된 내용들을 참조하여 본 발명의 바람직한 실시예를 상세하게 설명하지만, 본 발명이 실시예들에 의해 제한되거나 한정되는 것은 아니다. 각 도면에 제시된 동일한 참조부호는 동일한 부재를 나타낸다.Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings and the contents described in the accompanying drawings, but the present invention is not limited or limited to the embodiments. Like reference numerals in the drawings denote like elements.
본 발명에서의 중앙 처리 장치는 소정의 알고리즘에 따라서 정해진 명령을 실행하는 장치로서, CPU, 프로세서 및 콘트롤러 등 이와 유사한 기능을 수행하는 장치들을 모두 포함하는 것으로 해석될 수 있다.In the present invention, the central processing unit is a device that executes a predetermined command according to a predetermined algorithm, and may be interpreted as including all devices that perform similar functions such as a CPU, a processor, and a controller.
도 1은 분기 명령 검증부가 없는 일반적인 중앙 처리 장치의 구조를 도시한 도면이다. 이하 도1을 참조하여 일반적인 중앙 처리 장치의 명령 실행 과정을 설명하기로 한다. 중앙 처리 장치(110)는 사용자가 원하는 결과를 산출할 수 있도록 구성된 프로그램을 수행한다. 프로그래머가 작성한 프로그램은 컴파일과정을 거쳐 상기 중앙 처리 장치가 실행할 수 있는 기계어 코드로 변환되어 외부 기억장치(120)에 저장된다. 본 발명의 일실시예에 따르면, 상기 컴파일된 프로그램은 도 1과 같이 데이터 영역(121)과 코드 영역(122)가 분리되어 저장될 수도 있고, 데이터 영역(121)과 코드 영역(122)이 분리되지 않고 혼재되어 저장될 수 있다.1 is a diagram showing the structure of a general CPU without a branch instruction verification unit. Hereinafter, a command execution process of a general CPU will be described with reference to FIG. 1. The
중앙 처리 장치(110)는 기억장치(120)의 코드 영역(122)에 저장된 명령을 로드한다. 상기 로드한 명령과 연관된 현재 어드레스 값은 프로그램 카운터에 저장되어 있다. 상기 명령은 기계어 코드의 형식으로 저장되어 있다. 중앙 처리 장치(110)는 상기 로드한 기계어 코드를 분기 명령 실행부(111)에서 실행 한다. 중앙 처리 장치(110)는 상기 로드한 명령이 분기 명령이 아닌, 일반 적인 명령이라면, 현재 로드한 명령과 연관된 현재 어드레스가 저장된 프로그램 카운터의 값을 증가 시켜 다음 명령이 저장된 어드레스를 가리키게 한다. 중앙 처리 장치는 다음 어드레스에 저장된 명령을 순차적으로 로드하며 정해진 작업을 수행한다.The
만약 상기 로드한 명령이 특정 어드레스 위치의 명령을 실행하기를 요구하는 분기 명령이라면, 중앙 처리 장치(110)는 프로그램 카운터에 상기 특정 어드레스를 저장하고, 상기 특정 어드레스에 저장된 명령을 로드하여 상기 분기 명령 실행부(111)에서 실행 한다. 여기서 분기명령의 대상이 되는 명령이 저장된 저장부의 어드레스를 "분기 목적 어드레스"라고 한다.If the loaded instruction is a branch instruction requesting to execute an instruction of a specific address position, the
만약 상기 로드한 명령이 특정 변수의 값에 따라서 분기할지 여부를 결정하는 명령이거나, 특정 변수의 값에 따라서 분기할 목적 어드레스의 값이 달라지는 명령이라면, 상기 특정 변수의 값을 검토하고, 그 결과에 따라서 다음 실행할 명령이 저장된 분기 목적 어드레스의 값을 프로그램 카운터에 저장한다.If the loaded command is a command for deciding whether or not to branch according to the value of a specific variable or a command whose value of a target address to branch is changed according to the value of a specific variable, the value of the specific variable is reviewed and the result is determined. Therefore, the value of the branch destination address in which the next instruction is stored is stored in the program counter.
중앙 처리 장치(110)은 분기 명령 실행부(111)에서의 실행한 결과 값을 데이터 영역(121)에 저장할 수 있다.The
컴퓨터 바이러스, 또는 해커는 상기 컴퓨터의 취약점을 이용하여 상기 분기 여부를 결정하는 특정 변수의 값을 조작하거나, 분기 목적 어드레스의 값을 조작 함으로써, 정상적인 프로그램 수행 절차에 의한 분기 목적 어드레스에 저장된 명령을 수행하지 않고, 컴퓨터 바이러스, 또는 해커가 삽입해 놓은 명령이 저장된 어드레스로 분기하게 한다.A computer virus, or a hacker, uses a vulnerability of the computer to manipulate a value of a specific variable for deciding whether to branch or to manipulate a value of a branch destination address, thereby executing an instruction stored at a branch destination address by a normal program execution procedure. Instead, a computer virus or hacker inserts an instruction into a stored address.
따라서, 현재 로드한 명령이 저장된 어드레스와 이웃한, 다음 어드레스에 저장된 명령을 순차적으로 수행하는 일반적인 명령의 경우에는 특별히 상기 명령을 검증할 필요가 없으나, 현재 로드한 명령과 이웃하지 않은 명령을 로드하여 실행하는 분기 명령의 경우에는 상기 분기 명령이 유효한 명령인지 여부를 검증하여 컴퓨터 바이러스, 또는 해커에 의한 피해를 막을 수 있다.Therefore, in the case of the general instruction that sequentially executes the instruction stored at the next address next to the stored address, it is not necessary to verify the instruction. However, the instruction that is not adjacent to the currently loaded instruction is loaded. In the case of a branch instruction to be executed, it is possible to verify whether the branch instruction is a valid instruction to prevent damage by a computer virus or a hacker.
도 2는 본 발명에 따라 분기 명령 검증부를 포함하는 중앙 처리 장치의 구조를 도시한 도면이다. 이하 도 2를 참조하여 분기 명령 검증부를 포함하는 중앙 처리 장치의 구조를 설명하기로 한다.2 is a diagram showing the structure of a central processing unit including a branch instruction verification unit according to the present invention. Hereinafter, the structure of the CPU including the branch instruction verification unit will be described with reference to FIG. 2.
중앙 처리 장치(210)의 외부에는 명령이 저장된 코드 영역(222)과 프로그램을 실행하기 위한 데이터가 저장된 데이터 영역(221)로 구성된 외부 기억장치(220)가 존재한다.Outside the
중앙 처리 장치(210)는 외부 기억 장치(220)의 코드 영역(222)에서 명령을 로드하고, 만약 상기 로드한 명령이 분기 명령이라면, 분기 명령 검증부(212)에서 상기 분기 명령이 유효한 명령인지 검증한다.The
만약 분기 명령 검증부(212)에서 상기 분기 명령이 유효한 명령으로 검증하였다면, 분기 명령 검증부(212)는 상기 분기 명령이 유효하다는 분기 명령 유효신호를 분기 명령 실행부(211)로 전송한다. 상기 분기 명령 유효신호를 수신한 분기 명령 실행부(211)는 상기 분기 명령을 실행한다. 만약 상기 분기 명령 유효신호를 수신하지 못하거나, 유효하지 않은 분기명령이라는 신호를 수신한 분기 명령 실행부(211)는 상기 분기 명령을 수행하지 않는다.If the
본 발명의 일실시예에 따르면 분기 명령 검증부(212)가 상기 분기 명령을 유효하지 않은 명령으로 검증한 경우, 분기 명령 실행부(211)는 상기 분기 명령에 대하여 오류가 발생한 것으로 판단 하거나, 사용자에게 오류 발생 보고를 할 수 있다.According to an embodiment of the present invention, when the branch
본 발명의 일실시예에 따르면 상기 분기 명령이 유효하다는 분기 명령 유효 신호는 '1'로, 유효하지 않은 분기 명령이라는 분기 명령 유효신호는 '0'을 나타낼 수 있다. According to an embodiment of the present invention, the branch instruction valid signal indicating that the branch instruction is valid may be '1', and the branch instruction valid signal of an invalid branch instruction may indicate '0'.
도 3은 현재 로드한 분기 명령과 연관된 현재 어드레스 값 및 상기 분기 명 령에 대한 분기 목적 어드레스 값의 조합으로 구성된 참조표를 도시한 도면이다. 이하 도 3을 참조하여 분기 명령의 검증 과정을 설명하기로 한다.FIG. 3 is a diagram showing a reference table composed of a combination of a current address value associated with a branch instruction currently loaded and a branch purpose address value for the branch instruction. Hereinafter, the verification process of the branch instruction will be described with reference to FIG. 3.
일례로서, 도3의 참조표는 중앙 처리 장치에 내장된 메모리에 저장될 수 있다.As an example, the lookup table of FIG. 3 may be stored in a memory embedded in the central processing unit.
중앙 처리 장치가 분기 명령을 실행 한다면, 상기 분기 명령과 관련하여 상기 분기 명령이 저장되어 있는 외부기억장치의 현재 어드레스 값과 상기 분기 명령에 의해 실행될 다음 명령이 저장되어 있는 분기 목적 어드레스가 생성된다.If the central processing unit executes a branch instruction, a branch destination address is stored which stores the current address value of the external storage device in which the branch instruction is stored and the next instruction to be executed by the branch instruction.
프로그램의 수행은 특정한 루틴을 반복하여 수행하거나, 특정한 분기 지점에서, 특정 변수의 값에 따라서 몇 가지 가능한 분기 목적 어드레스로 분기하여 이루어 지는 것이 보통이므로 상기 두 어드레스로 구성된 조합은 유한한 개수를 가진다.Since the execution of a program is usually performed by repeating a specific routine or branching to some possible branch destination address depending on the value of a specific variable, a combination of the two addresses has a finite number.
예를 들어 실행해야 할 특정 분기 명령이, 특정 변수 'A'의 값이 '0'보다 큰 경우에는 제1 어드레스로 분기하고 'A'의 값이 '0'보다 작은 경우에는 제2 어드레스로 분기하여, 상기 제2 어드레스에 저장되어 있는 명령을 수행하는 분기 명령이라 가정하자.For example, a specific branch instruction to be executed branches to the first address if the value of the specific variable 'A' is greater than '0' and to the second address if the value of the 'A' is less than '0'. Assume that the instruction is a branch instruction that executes an instruction stored at the second address.
중앙 처리 장치는 상기 특정 분기 명령을 수행하는 도중에 특정 변수 'A'의 값에 따라서, 제1 어드레스로 분기하거나, 제2 어드레스로 분기할 수 있을 뿐이다. 만약 분기 명령과 연관된 현재 어드레스가 외부 기억 장치의 상기 특정 분기 명령이 저장된 어드레스 값과 동일하고, 상기 분기 명령에 대한 분기 목적 어드레스의 값이 제3 어드레스를 가리키고 있다면, 상기 분기 명령은 정상적인 분기 명령이라 고 볼 수 없다. 따라서, 이 경우에는 분기 명령 검증부는 상기 분기 명령은 유효하지 않은 분기 명령이라는 분기 명령 유효신호를 분기 명령 실행부로 전송 한다. The CPU may only branch to the first address or branch to the second address according to the value of the specific variable 'A' during the execution of the specific branching command. If the current address associated with the branch instruction is the same as the address value in which the specific branch instruction of the external storage device is stored, and the value of the branch destination address for the branch instruction points to the third address, the branch instruction is a normal branch instruction. And can't see. Therefore, in this case, the branch instruction verification section sends a branch instruction valid signal to the branch instruction execution section that the branch instruction is a branch instruction which is not valid.
도 3의 참조표에는 제1 분기명령과 연관된 현재 어드레스 값과 관련하여, 상기 분기 명령에 대한 제1 분기 목적 어드레스(311), 제2 분기 목적 어드레스(312), 제3 분기 목적 어드레스(313)이 저장되어 있다.In the reference table of FIG. 3, a first
또한, 제2 분기명령과 연관된 현재 어드레스 값과 관련하여, 상기 분기 명령에 대한 제1 분기 목적 어드레스(321), 제2 분기 목적 어드레스(322), 제3 분기 목적 어드레스(323)가 저장되어 있다.In addition, in relation to a current address value associated with a second branch instruction, a first
또한, 제3 분기명령과 연관된 현재 어드레스 값과 관련하여, 상기 분기 명령에 대한 제1 분기 목적 어드레스(331), 제2 분기 목적 어드레스(332), 제3 분기 목적 어드레스(333)이 저장되어 있다.In addition, in relation to a current address value associated with a third branch instruction, a first
만약 프로그램 카운터에 제1 분기 명령과 연관된 현재 어드레스 값이 저장되어 있고, 상기 분기 명령의 실행 결과 얻어진 분기 목적 어드레스가, 상기 제1 분기 명령에 대한 제1, 제2, 제3 분기 목적 어드레스(311, 312, 313) 중의 하나라면 상기 분기 명령은 정상적인 분기 명령이라고 검증할 수 있다. 그러나 상기 분기 명령의 실행 결과 얻어진 분기 목적 어드레스가 상기 제1, 제2, 제3 분기 목적 어드레스(311, 312, 313)가 아닌 제4의 분기 목적 어드레스라면, 상기 분기 명령은 컴퓨터 바이러스 또는 해킹에 의한, 유효하지 않은 분기 명령으로 판단할 수 있다.If a current address value associated with the first branch instruction is stored in the program counter, the branch target address obtained as a result of the execution of the branch instruction is the first, second, and third branch target addresses 311 for the first branch instruction. , 312, 313 may verify that the branch instruction is a normal branch instruction. However, if the branch purpose address obtained as a result of the execution of the branch instruction is a fourth branch purpose address instead of the first, second, and third branch purpose addresses 311, 312, and 313, the branch instruction may be subjected to a computer virus or a hack. Can be determined to be an invalid branch instruction.
따라서, 분기 명령 검증부는, 정상적인 분기명령이 저장되어 있는 현재 어드레스 값과, 상기 정상적인 분기 명령에 의해 실행될 다음 명령이 저장되어 있는 분 기 목적 어드레스의 가능한 조합을 모두 구비하는 참조표를 이용하여, 특정 분기 명령이 저장되어 있는 현재 어드레스 값 및 상기 분기 명령에 대한 목적 어드레스 값의 조합이 상기 참조표에 존재하면 상기 분기 명령은 유효한 분기명령으로 검증하고, 유효한 분기 명령임을 나타내는 분기 명령 유효신호를 분기 명령 실행부로 전송한다. 만약 특정 분기 명령이 저장되어 있는 현재 어드레스 값 및 상기 분기 명령에 대한 목적 어드레스 값의 조합이 상기 참조표에 존재하지 않으면 상기 분기 명령은 유효하지 않은 분기 명령으로 검증하고, 상기 특정 분기 명령이 유효하지 않은 명령이라는 분기 명령 유효신호를 분기명령 실행부로 전송한다. Therefore, the branch instruction verifier uses a look-up table that includes all possible combinations of the current address value in which the normal branch instruction is stored and the branch destination address in which the next instruction to be executed by the normal branch instruction is stored. If a combination of the current address value in which the branch instruction is stored and the destination address value for the branch instruction is present in the reference table, the branch instruction verifies as a valid branch instruction, and branches a valid instruction for branch instruction indicating that the branch instruction is a valid branch instruction. Send it to the execution unit. If a combination of the current address value in which a specific branch instruction is stored and the destination address value for the branch instruction does not exist in the reference table, the branch instruction is verified as an invalid branch instruction, and the specific branch instruction is invalid. A branch instruction valid signal called a non-command is transmitted to the branch instruction execution unit.
본 발명의 일실시예에 의하면 컴퓨터, PDA, 핸드폰 등의 정보처리기기의 중앙 처리 장치는, 검증할 분기 명령의 어드레스 값과 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합으로 구성된 참조표를 구비한다. 본 발명의 일실시예에 따르면, 상기 참조표는 상기 중앙 처리장치의 메모리 부분에 저장된다.According to an embodiment of the present invention, a central processing unit of an information processing device such as a computer, a PDA, a cellular phone, and the like has a reference table composed of a combination of an address value of a branch instruction to be verified and a branch destination address value for the branch instruction. . According to one embodiment of the invention, the reference table is stored in a memory portion of the central processing unit.
특정 분기 명령이 유효한지 여부를 검증하기 위하여 프로그램 카운터에 저장된 상기 분기 명령의 어드레스 값과, 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합이 상기 참조표에 존재하지 않으면 상기 분기 명령을 유효하지 않은 분기 명령으로 검증한다. 상기 분기 명령이 유효하지 않으면 중앙 처리 장치는 상기 분기 명령을 실행하지 않을 수 있다. The branch instruction is invalid if the combination of the address value of the branch instruction stored in the program counter and the branch destination address value for the branch instruction does not exist in the reference table to verify whether a specific branch instruction is valid. Verify by command If the branch instruction is invalid, the central processing unit may not execute the branch instruction.
본 발명의 일실시예에 의하면, 상기 분기 명령 검증부는, 상기 검증 작업을 더욱 더 엄격하게 수행하기 위하여, 상기 분기 명령이 저장되어 있는 현재 어드레스 값과, 상기 분기 명령에 대한 분기 목적 어드레스의 값뿐만이 아니라, 상기 중 앙 처리 장치가 수행한 과거의 분기 명령 이력을 더 고려할 수 있다. 상기 분기 명령 검증부는, 상기 분기 명령이 저장되어 있는 현재 어드레스 값과 상기 분기 명령에 대한 분기 목적 어드레스의 값, 상기 분기 명령 이전에 수행하였던 분기 명령이 저장된 어드레스의 값의 조합으로 구성된 참조표를 구비하고, 상기 분기 명령이 저장된 어드레스 값, 상기 분기 명령에 대한 분기 목적 어드레스 값, 상기 분기 명령 이전에 수행하였던 분기 명령이 저장된 어드레스의 값의 조합이 상기 참조표에 존재하는 경우에만 상기 분기 명령이 정상적인 분기 명령인 것으로 검증할 수 있다. 만약 상기 참조표에 존재하지 않으면 비정상적인 분기 명령인 것으로 검증할 수 있다. According to an embodiment of the present invention, the branch instruction verifying unit may further include a current address value in which the branch instruction is stored and a value of a branch destination address for the branch instruction in order to perform the verification operation more strictly. Rather, the history of past branch instructions performed by the central processing unit can be further considered. The branch instruction verifying unit includes a reference table including a combination of a current address value in which the branch instruction is stored, a value of a branch destination address for the branch instruction, and a value of an address in which a branch instruction performed before the branch instruction is stored. And the branch instruction is normal only when a combination of an address value stored in the branch instruction, a branch purpose address value for the branch instruction, and a value of an address in which the branch instruction performed before the branch instruction is stored in the reference table. You can verify that it is a branch instruction. If it does not exist in the reference table, it can be verified as an abnormal branch instruction.
본 발명의 다른 실시예에 의하면, 상기 분기 명령 검증부는, 상기 분기 명령 이전의 분기 명령에 대하여 분기 산출부가 산출한 과거의 분기 목적 어드레스와, 상기 분기 명령 이전의 분기 명령에 대하여 중앙 처리 장치가 실제로 분기한 분기 목적 어드레스를 더 고려하여 상기 분기 명령이 유효한지 여부를 검증할 수 있다. 중앙 처리 장치가 실제로 분기한 분기 목적 어드레스는 중앙 처리 장치 내부의 분기 이력 시프트 레지스터에 저장되어 있다, 분기 명령 검증부는 분기 이력 시프트 레지스터에 저장된, 과거에 실제로 분기한 분기 목적 어드레스와 분기 명령부가 과거의 분기 명령에 대하여 산출한 분기 목적 어드레스를 서로 비교하여 만약 서로 일치 하지 않는다면 상기 분기 명령을 유효하지 않은 분기 명령으로 검증할 수 있다. 분기 명령 검증부는 상기 분기 명령 바로 이전의 분기 명령뿐만 아니라, 상기 분기 명령 이전의 수 개의 분기 명령에 대해서 산출된 분기 목적 어드레스와 분기 한 분기 목적 어드레스가 일치하는지 여부를 고려하여 상기 분기 명령을 검증할 수 있다.According to another embodiment of the present invention, the branch instruction verifying section is configured such that the central processing unit actually executes the past branch destination address calculated by the branch calculating section for the branch instruction before the branch instruction, and the branch instruction before the branch instruction. It is possible to verify whether the branch instruction is valid by further considering the branching destination address. The branching destination address actually branched by the central processing unit is stored in the branch history shift register inside the central processing unit. The branch instruction verifying section stored in the branch history shift register, the branching destination address actually branched in the past, and the branching instruction section of the past are stored in the past. By comparing the branch destination addresses calculated for the branch instructions with each other, the branch instructions can be verified as invalid branch instructions if they do not match. The branch instruction verifier verifies the branch instruction in consideration of whether the branch purpose address calculated for several branch instructions immediately before the branch instruction matches the branch purpose address branched as well as the branch instruction immediately before the branch instruction. Can be.
본 발명의 또 다른 실시예에 의하면, 상기 분기 명령 검증부는, 상기 검증 작업을 더욱 더 엄격하게 수행하기 위하여, 상기 분기 명령이 저장되어 있는 현재 어드레스 값과, 상기 분기 명령에 대한 분기 목적 어드레스의 값뿐만이 아니라, 상기 중앙 처리 장치가 수행한 과거의 명령 수행 이력을 더 고려할 수 있다. 상기 분기 명령 검증부는, 상기 분기 명령이 저장되어 있는 현재 어드레스 값과 상기 분기 명령에 대한 분기 목적 어드레스의 값, 상기 분기 명령 이전에 수행하였던 명령이 저장된 어드레스의 값의 조합으로 구성된 참조표를 구비하고, 상기 분기 명령이 저장된 어드레스 값, 상기 분기 명령에 대한 분기 목적 어드레스 값, 상기 분기 명령 이전에 수행하였던 명령이 저장된 어드레스의 값의 조합이 상기 참조표에 존재하는 경우에만 상기 분기 명령이 정상적인 분기 명령인 것으로 검증할 수 있다. 만약 상기 참조표에 존재하지 않으면 비정상적인 분기 명령인 것으로 검증할 수 있다. According to another embodiment of the present invention, the branch instruction verifying unit may further include: a current address value in which the branch instruction is stored, and a value of a branch destination address for the branch instruction, in order to perform the verification operation more strictly. In addition, the past command execution history performed by the CPU may be further considered. The branch instruction verifying unit includes a reference table including a combination of a current address value in which the branch instruction is stored, a value of a branch destination address for the branch instruction, and a value of an address in which the instruction executed before the branch instruction is stored. The branch instruction is a normal branch instruction only when a combination of an address value stored in the branch instruction, a branch purpose address value for the branch instruction, and a value of an address in which the instruction executed before the branch instruction is stored in the reference table. Can be verified as If it does not exist in the reference table, it can be verified as an abnormal branch instruction.
도 4는 본 발명의 일실시예로서 소정의 길이의 배열을 이용하여 구현된 분기 명령 검증부의 참조표를 도시한 도면이다. 이하 도 4를 참조하여 분기 명령 검증 과정을 설명하기로 한다.4 is a diagram illustrating a reference table of a branch instruction verifying unit implemented using an arrangement of a predetermined length as an embodiment of the present invention. Hereinafter, the branch instruction verification process will be described with reference to FIG. 4.
컴퓨터는 범용 정보 처리 장치로서, 그 중앙 처리 장치는 수많은 개수의 명령을 처리하므로, 분기 명령을 검증하는 분기 명령 검증부의 참조표는 매우 큰 용량을 차지하게 된다.The computer is a general-purpose information processing apparatus, and since the central processing unit processes a large number of instructions, the reference table of the branch instruction verification unit for verifying the branch instruction occupies a very large capacity.
참조표의 용량이 너무 크면, 특정 분기 명령과 연관된 현재 어드레스의 값 및 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합이 상기 참조표에 있는지 여부를 판단하는데 많은 시간이 걸려 상기 중앙 처리 장치의 성능이 저하된다. 또, 상기 중앙 처리 장치 내에 넓은 면적을 차지하여 상기 중앙 처리 장치의 설계를 어렵게 한다.If the capacity of the lookup table is too large, it takes a long time to determine whether a combination of the value of the current address associated with a particular branch instruction and the branch destination address value for the branch instruction is in the lookup table, which degrades the performance of the central processing unit. do. In addition, it occupies a large area in the central processing unit, making it difficult to design the central processing unit.
본 발명의 일실시예에 의하면 상기 참조표를 블룸 필터(bloom filter)를 이용하여 구현할 수 있다. 블룸 필터는 주어진 원소가 어떤 집합에 속하는지 여부를 검사하는데 사용할 수 있는 자료구조의 일종이다. 블룸 필터는 기 설정된 길이의 배열로 구성되고, 소정의 해시함수(hash function)를 이용하여 상기 기 설정된 길이의 배열의 값을 읽어, 이에 기반하여 주어진 원소가 상기 어떤 집합에 속하는지 여부를 검사한다.According to an embodiment of the present invention, the reference table may be implemented using a bloom filter. Bloom filters are a type of data structure that can be used to check which set a given element belongs to. The bloom filter is composed of an array of preset lengths, and reads the values of the arrays of the preset lengths using a predetermined hash function to check whether a given element belongs to the set. .
블룸 필터는, 무한대 개수의 원소에 대하여 특정 집합에 속하는지 여부를 검사할 수 있지만, 원소의 수가 일정 개수 이상 늘어나면 오류가 발생할 수 있고, 또 원소의 개수가 늘어남에 따라서 상기 오류의 발생 가능성은 증가한다.The BLUM filter can check whether an infinite number of elements belong to a specific set, but an error may occur when the number of elements increases by more than a certain number, and as the number of elements increases, the possibility of occurrence of the error may increase. Increases.
해시 함수는 임의의 데이터를 입력 받아 해시 값을 생성하는 함수로서, 해시 값이 다르다면 반드시 그 입력 데이터가 다른 특징을 가지는 함수이다. 입력 데이터의 한 비트만 달라진다고 해도, 해시함수의 출력인 해시 값은 크게 달라지게 된다.The hash function is a function that receives arbitrary data and generates a hash value. If the hash values are different, the input data must have different characteristics. Even if only one bit of the input data is changed, the hash value, which is the output of the hash function, is greatly changed.
본 발명의 일실시예에 있어서, 상기 분기 명령 검증부는 기 설정된 길이의 배열(430)을 구비하고, 상기 분기 명령 검증부는 적어도 하나 이상의 해시 함 수(421, 422, 423)에 검증할 분기 명령과 연관된 현재 어드레스 값과 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합(410)을 입력하여 상기 기 설정된 길이의 배열의 적어도 하나 이상의 어드레스 값을 생성 한다. 상기 분기 명령 검증부는 상기 적어도 하나 이상의 어드레스 값에서의 상기 기 설정된 길이의 배열의 값(431, 432, 433)에 기반하여 상기 분기 명령이 유효한지 여부를 판단할 수 있다.In one embodiment of the present invention, the branch instruction verifier has an
검증할 분기 명령과 연관된 현재 어드레스 값과, 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합을 간단히 'B'(410)라고 하기로 하자.A combination of the current address value associated with the branch instruction to be verified and the branch destination address value for the branch instruction is simply referred to as 'B' 410.
해시 함수(421, 422, 423)는 상기 'B'값을 입력 받아, 상기 기 설정된 길이의 배열의 어드레스 값을 생성한다. 도면의 실시예에서는 3개의 해시 함수(421, 422, 423)가 사용된 블룸 필터가 도시 되었다.The hash functions 421, 422, and 423 receive the 'B' value and generate address values of the array having the preset length. In the embodiment of the figure, a bloom filter is shown in which three
상기 분기 명령 검증부는 상기 기 설정된 길이의 배열의 어드레스 값에 저장된 배열의 값(431, 432, 433)에 기반하여 상기 분기 명령이 유효한지 여부를 판단한다. The branch instruction verifier determines whether the branch instruction is valid based on the array values 431, 432, and 433 stored in the address values of the array having the preset length.
본 발명의 일실시예에 따르면, 상기 생성된 기 설정된 길이의 배열의 어드레스에 저장된 값이 모두 동일하면, 상기 분기 명령 검증부는 상기 분기 명령이 유효한 분기 명령이라고 검증한다. 도면에 도시된 실시예에서는 3개의 해시 함수에 의해 생성된 3개의 어드레스에 저장된 배열의 값이 모두 1로 동일하므로, 상기 분기 명령은 유효한 분기 명령으로 검증 된다. According to an embodiment of the present invention, if all the values stored in the generated addresses of the preset length array are the same, the branch instruction verification unit verifies that the branch instruction is a valid branch instruction. In the embodiment shown in the figure, since the values of the arrays stored in the three addresses generated by the three hash functions are all equal to 1, the branch instruction is verified as a valid branch instruction.
본 발명의 일실시예에 따르면, 상기 중앙 처리 장치가 수행할 프로그램을 소정의 시간 동안 실행하고, 상기 프로그램이 수행한 분기 명령의 조합을 조사하여 상기 배열에 저장될 값을 결정할 수 있다.According to an embodiment of the present invention, the CPU may execute a program to be executed for a predetermined time, and determine a value to be stored in the array by examining a combination of branch instructions performed by the program.
만약 상기 적어도 하나 이상의 해시 함수(421,422, 423)에 의해 생성된 상기 배열의 어드레스에 저장된 상기 배열의 값이 서로 동일하지 않으면 상기 분기 명령 검증부는 상기 분기 명령이 유효하지 않은 것으로 검증할 수 있다. If the values of the arrays stored in the addresses of the arrays generated by the at least one
본 발명의 일실시예에 의하면, 컴퓨터 PDA, 핸드폰 등의 정보처리기기의 중앙 처리장치는 기 설정된 길이의 배열을 구비한다. 특정 분기 명령이 유효한지 여부를 검증하기 위하여, 프로그램 카운터에 저장된 상기 특정 분기 명령의 어드레스 값과 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합을 적어도 하나 이상의 해시 함수에 입력하여 상기 기 설정된 길이의 배열의 적어도 하나 이상의 어드레스 값을 생성한다.According to an embodiment of the present invention, a central processing unit of an information processing device such as a computer PDA, a mobile phone, etc. has an arrangement of a predetermined length. In order to verify whether a specific branch instruction is valid, a combination of an address value of the specific branch instruction stored in a program counter and a branch destination address value for the branch instruction is input to at least one hash function to arrange the preset length. Generate at least one address value of.
중앙 처리 장치는 상기 적어도 하나 이상의 어드레스에 저장된 상기 기 설정된 길이의 배열의 값을 읽어, 상기 값을 비교한다.The CPU reads the values of the array of the preset length stored in the at least one address and compares the values.
본 발명의 일실시예에 따르면 상기 배열의 값이 모두 동일하면 상기 분기 명령은 유효한 것으로 검증할 수 있다. 만약 상기 배열의 값이 모두 '1'인 경우에 상기 분기 명령이 유효한 것으로 검증한다면, 상기 배열의 값을 서로 논리곱(AND)연산 수행하여 간단히 상기 분기 명령이 유효한지 여부를 검증할 수 있다. According to an embodiment of the present invention, if all values of the array are the same, the branch instruction may be verified as valid. If the branch instructions are valid when the values of the array are all '1', it is possible to verify whether the branch instructions are valid by performing AND operation on the values of the array.
해시 함수는 까다로운 성질을 가지고 있으므로, 이를 구현하기가 쉽지 않고, 그 계산 과정에 있어 소요되는 시간으로 인하여 중앙 처리 장치의 성능 저하를 초래하므로, 상기 성질을 만족하면서도 적은 계산량을 가지는 해시 함수를 사용하는 것이 분기 명령 검증부를 구현하는데 있어 매우 중요하다.Since the hash function has a tricky property, it is not easy to implement it, and the time required for the calculation process causes the performance of the central processing unit to be degraded. This is very important for implementing branch instruction verification.
도 5는 본 발명의 일실시예에 따라서 매우 적은 계산량을 가지는 간단한 해시 함수의 연산 과정을 도시한 도면이다. 이하 도 5를 참조하여 간단한 해시 함수의 연산 과정을 설명하기로 한다.5 is a diagram illustrating the operation of a simple hash function having a very small calculation amount according to an embodiment of the present invention. Hereinafter, the operation of a simple hash function will be described with reference to FIG. 5.
상기 간단한 해시 함수는 상기 분기 명령과 연관된 현재 어드레스(510)의 비트 순서를 셔플(shuffle)하고, 상기 분기 명령에 대한 분기 목적 어드레스 값(520)과 배타적 논리합(Exclusive OR)연산을 수행하여 상기 기 설정된 길이의 배열의 어드레스 값(530)을 생성한다.The simple hash function shuffles the bit order of the
본 발명에서의 "셔플"은 특정 배열의 순서를 기 설정된 방법에 의하여 뒤바꾸는 것으로, 셔플 되기 전의 배열과 셔플된 후의 배열은 배열에 저장된 데이터의 순서가 바뀌었을 뿐, 그 데이터 값이 달라지는 것은 아니다.In the present invention, "shuffle" reverses the order of a specific array by a predetermined method. The array before the shuffled and the array after shuffled only change the order of the data stored in the array, but the data value does not change. .
도 5에 도시된 실시예에서는 일반적인 32비트 중앙 처리 장치를 가정하여 상기 어드레스 값(510, 520, 530)들은 모두 4바이트의 길이를 가지고 있다. 본 실시예에서는 8비트 단위의 바이트를 기준으로 상기 어드레스들을 셔플하지만, 비트 단위로 상기 어드레스를 셔플하는 것도 가능하다. 검증할 분기 명령과 연관된 현재 어드레스 값(510)의 첫째, 둘째, 셋째, 넷째 바이트(511, 512, 513, 514)는 각각 상기 분기 명령에 대한 분기 목적 어드레스 값(520)의 첫째, 셋째, 둘째, 넷째(521, 523, 522, 524)바이트와 배타적 논리곱 연산을 수행하여 각각 상기 기 설정된 길이의 배열의 어드레스의 첫째, 셋째, 둘째, 넷째(531, 533, 532, 534)바이트를 생성 한다. In the embodiment illustrated in FIG. 5, the address values 510, 520, and 530 have a length of 4 bytes, assuming a general 32-bit CPU. In the present embodiment, the addresses are shuffled on the basis of 8-bit bytes, but it is also possible to shuffle the addresses on a bit-by-bit basis. The first, second, third, and
도 6은 본 발명의 또 다른 실시예에 의하여 간단한 해시 함수가 상기 분기 명령과 연관된 현재 어드레스 값을 셔플하는 다른 여러 가지 방법을 도시한 도면이다. 이하 도 6을 참조하여 간단한 해시 함수의 연산 과정을 설명하기로 한다.6 is a diagram illustrating another method for a simple hash function to shuffle the current address value associated with the branch instruction according to another embodiment of the present invention. Hereinafter, the operation of a simple hash function will be described with reference to FIG. 6.
도 6의 a에 도시한 해시 함수는 검증할 분기 명령과 연관된 현재 어드레스 값(610)의 첫째, 둘째, 셋째, 넷째 바이트가 각각 상기 분기 명령에 대한 분기 목적 어드레스 값(620)의 넷째, 첫째, 둘째, 셋째 바이트와 배타적 논리곱 연산을 수행하여 각각 상기 기 설정된 길이의 배열의 어드레스의 넷째, 첫째, 둘째, 셋째 바이트를 생성 한다.The hash function shown in FIG. 6A has the first, second, third, and fourth bytes of the
도 6의 b에 도시한 해시 함수는 검증할 분기 명령과 연관된 현재 어드레스 값(630)의 첫째, 둘째, 셋째, 넷째 바이트가 각각 상기 분기 명령에 대한 분기 목적 어드레스 값(640)의 둘째, 셋째, 넷째, 첫째 바이트와 배타적 논리곱 연산을 수행하여 각각 상기 기 설정된 길이의 배열의 어드레스의 둘째, 셋째, 넷째, 첫째 바이트를 생성 한다.The hash function shown in b of FIG. 6 includes the first, second, third, and fourth bytes of the
도 6의 c에 도시한 해시 함수는 검증할 분기 명령과 연관된 현재 어드레스 값(650)의 첫째, 둘째, 셋째, 넷째 바이트가 각각 상기 분기 명령에 대한 분기 목적 어드레스 값(660)의 첫째, 넷째, 셋째, 둘째 바이트와 배타적 논리곱 연산을 수행하여 각각 상기 기 설정된 길이의 배열의 어드레스의 첫째, 넷째, 셋째, 둘째 바이트를 생성 한다.The hash function shown in FIG. 6C has the first, second, third, and fourth bytes of the
도 6의 d에 도시한 해시 함수는 검증할 분기 명령과 연관된 현재 어드레스 값(670)의 첫째, 둘째, 셋째, 넷째 바이트가 각각 상기 분기 명령에 대한 분기 목적 어드레스 값(680)의 셋째, 둘째, 첫째, 넷째 바이트와 배타적 논리곱 연산을 수 행하여 각각 상기 기 설정된 길이의 배열의 어드레스의 셋째, 둘째, 첫째, 넷째 바이트를 생성 한다.The hash function shown in d of FIG. 6 includes the first, second, third, and fourth bytes of the
본 발명의 일실시예에 있어서, 상기 분기 명령 검증부에 사용되는 해시 함수는 SHA(Secure Hash Algorithm)-1 알고리즘, MD5(Message-Digest algorithm 5) 알고리즘, HMAC(keyed-Hash Message Authentication Code) 알고리즘, 및 AES(Advanced Encryption Standard) 표준 중에서 적어도 어느 하나 이상을 이용한 해시 함수일 수 있다.In one embodiment of the present invention, the hash function used in the branch instruction verification unit is a Secure Hash Algorithm (SHA) -1 algorithm, a Message-Digest algorithm 5 (MD5) algorithm, a keyed-Hash Message Authentication Code (HMAC) algorithm. , And a hash function using at least one of the Advanced Encryption Standard (AES) standard.
SHA-1은 미국 NIST에 의해 개발된 SHS(secure hash standard) 내에 정의된 알고리즘이다. SHA-1은 1994년에 발간된 SHA의 개정판으로서, SHA 내에 남아있던 결함들을 수정한 것으로 암호학의 관점에서 매우 우수한 해시 함수로 평가되고 있다. 이 해시 함수는 길이 264 비트 이하의 메시지를 160 비트 길이의 축약된 메시지로 만들어낸다. 상기 SHA-1은 종래 널리 알려진 함수로, 이하 자세한 설명은 생략하기로 한다.SHA-1 is an algorithm defined within the secure hash standard (SHS) developed by the US NIST. SHA-1 is a revision of SHA, published in 1994, that corrects the defects remaining in SHA and is considered to be a very good hash function in terms of cryptography. This hash function produces a short message that is 160 bits long and 160 bits long. The SHA-1 is a conventionally well known function, and a detailed description thereof will be omitted.
AES(Advanced Encryption Standard)은 'Rijndael' 이라고도 알려져 있으며 미국 정부 표준으로 지정된 블록 암호 형식이다. 이전의 DES(Data Encryption Standard)를 대체하며, 미국 표준 기술 연구소(NIST)가 5년의 표준화 과정을 거쳐 발표되었다. 블록의 크기로 128, 160, 190, 224, 256 비트를 사용할 수 있으며, 미국 표준으로 인정받은 것은 128비트이다. 상기 AES는 종래 널리 알려진 함수이므로, 자세한 설명은 생략하기로 한다.The Advanced Encryption Standard (AES), also known as 'Rijndael', is a block cipher format designated as the US government standard. It replaces the former Data Encryption Standard (DES), and the National Institute of Standards and Technology (NIST) was published after five years of standardization. 128, 160, 190, 224, and 256 bits are available for the block size, and 128 bits are recognized as a US standard. Since the AES is a conventionally well known function, a detailed description thereof will be omitted.
상기 SHA-1, MD5, HMAC, AES와 같은 우수한 해시 함수를 사용한다면 상기 블 룸 필터의 사용에 있어 오류가 발생할 가능성은 크게 줄어 들게 된다. The use of good hash functions such as SHA-1, MD5, HMAC, and AES reduces the likelihood of error in the use of the bloom filter.
도 7은 본 발명의 일실시예에 따라, 행렬의 원소 값을 이용한 H3 방식의 해시 함수의 동작을 도시한 도면이다. 이하 도 7을 참조하여 H3 방식의 해시 함수의 동작을 설명하기로 한다.FIG. 7 is a diagram illustrating an operation of a H3 type hash function using element values of a matrix according to an embodiment of the present invention. Hereinafter, the operation of the H3 type hash function will be described with reference to FIG. 7.
상기 해시 함수는 소정의 비트 패턴으로 구성된 행렬(730)을 구비한다. 상기 해시 함수는 검증할 분기 명령과 연관된 현재 어드레스 값과 상기 분기 명령에 대한 분기 목적 어드레스의 조합(710)을 입력 받는다. 상기 조합에 상응하는 행렬(730)의 특정 열의 구성요소 각각을 논리곱 연산(751, 752, 753, 761, 762, 763) 수행하고, 상기 논리곱 연산 수행한 복수의 값들을 배타적 논리합 연산(754, 764)하여 상기 기 설정된 길이의 배열의 어드레스(720)의 특정 비트를 구성한다.The hash function has a
검증할 분기 명령과 연관된 현재 어드레스 값과 상기 분기 명령에 대한 분기 목적 어드레스의 조합(710)은 i 비트의 길이를 가지고 있고, 상기 해시 함수의 출력인 상기 기 설정된 길이의 배열의 어드레스 값(720)은 j 비트의 길이를 가지고 있다. 소정의 비트 패턴으로 구성된 행렬(730)은 i x j 의 차원을 가진다.The
상기 해시 함수의 i 비트의 입력을 X라고 하면, 상기 입력 비트는 상기 소정의 비트 패턴으로 구성된 행렬의 첫째 열과 연산을 수행하여 상기 해시 함수의 출력값의 첫째 비트를 구성한다.If the input of the i bit of the hash function is X, the input bit performs an operation with the first column of the matrix composed of the predetermined bit pattern to form the first bit of the output value of the hash function.
상기 i 비트의 입력 X중에서 첫째 비트(711)는 상기 소정의 비트 패턴으로 구성된 행렬(730)의 첫째 열의 첫째 행의 원소(731)와 논리곱(AND)연산(751)을 수행한다.The
상기 i 비트의 입력 X중에서 둘째 비트(712)는 상기 소정의 비트 패턴으로 구성된 행렬(730)의 첫째 열의 둘째 행의 원소(732)와 논리곱(AND)연산(752)을 수행한다.The
상기 i 비트의 입력 X중에서 마지막 비트(713)는 상기 소정의 비트 패턴으로 구성된 행렬(730)의 첫째 열의 마지막 행의 원소(733)와 논리곱(AND)연산(753)을 수행한다.The
상기 논리곱 연산을 수행한 결과는 배타적 논리합(Exclusive-OR)연산이 수행(754)되어 그 결과가 상기 j비트의 해시 함수의 출력 중에서 첫째 비트(721)가 된다.The result of performing the AND operation is an exclusive-OR operation 754, and the result is the first bit 721 of the output of the j-bit hash function.
상기 i 비트의 입력 X중에서 첫째 비트(711)는 상기 소정의 비트 패턴으로 구성된 행렬(730)의 둘째 열의 첫째 행의 원소(741)와 논리곱(AND)연산(761)을 수행한다.The
상기 i 비트의 입력 X중에서 둘째 비트(712)는 상기 소정의 비트 패턴으로 구성된 행렬(730)의 둘째 열의 둘째 행의 원소(742)와 논리곱(AND)연산(742)을 수행한다.A
상기 i 비트의 입력 X중에서 마지막 비트(713)는 상기 소정의 비트 패턴으로 구성된 행렬(730)의 둘째 열의 마지막 행의 원소(743)와 논리곱(AND)연산(743)을 수행한다.The
상기 논리곱 연산을 수행한 결과는 배타적 논리합(Exclusive-OR)연산이 수행(764)되어 그 결과가 상기 j 비트의 해시 함수의 출력 중에서 둘째 비트(722)가 된다.The result of performing the AND operation is an exclusive-OR operation 764, and the result is the
이와 같은 과정을 상기 j 비트의 해시 함수의 출력(720)을 구성하는 모든 비트의 값을 얻을 때까지 수행하면 상기 소정의 비트 패턴으로 구성된 행렬을 이용하여 상기 기 설정된 길이의 배열의 어드레스 값을 구할 수 있다.If the above process is performed until the values of all the bits constituting the output 720 of the j-bit hash function are obtained, an address value of the array having the predetermined length is obtained using a matrix composed of the predetermined bit pattern. Can be.
본 발명에서의 H3 방식의 해시 함수는 도 7에서 설명하는 바와 같이, 소정의 비트 패턴으로 구성된 행렬(730)을 구비하고, 상기 행렬과 상기 해시 함수의 입력과 소정의 논리연산을 수행하여 상기 기 설정된 길이의 행렬의 어드레스를 생성하는 함수를 말한다.As described with reference to FIG. 7, the H3 hash function according to the present invention includes a
소정의 비트 패턴으로 구성된 행렬(730)을 구비하고, 상기 행렬과 상기 해시 함수의 입력과의 논리곱(751, 752, 753, 761, 762, 763), 배타적 논리합(Exclusive-OR)연산(754, 764)에 의하여 상기 해시 함수의 출력을 구하는 방식에 따른다면, 상기 소정의 비트 패턴으로 구성된 행렬의 값을 바꾸는 것만으로 같은 입력에 대하여 다른 어드레스를 생성하는 함수를 구현할 수 있다. A
도 8은 본 발명에 따라서 두 개의 배열을 직렬로 연결하여 구현된 분기 명령 검증부의 구조를 도시한 도면이다. 이하 도 8을 참조하여 분기 명령 검증 과정을 설명하기로 한다.8 is a diagram illustrating a structure of a branch instruction verifying unit implemented by connecting two arrays in series according to the present invention. Hereinafter, the branch instruction verification process will be described with reference to FIG. 8.
상기 분기 명령 검증부는 두 개의 배열(830, 831)로 구성된 기 설정된 길이의 배열과 수 개의 해시 함수(820, 821, 822, 823, 824, 825, 826, 827), 그리고 상기 기 설정된 길이의 배열에 저장된 값에 기반하여 검증할 분기 명령이 정상적인 분기 명령인지 여부를 판단하는 판단부(840)로 구성된다. 상기 수 개의 해시 함 수(820, 821, 822, 823, 824, 825, 826, 827)는 상기 간단한 해시 함수, SHA 또는 AES 방식의 해시함수, 그리고 H3방식의 해시 함수가 사용될 수 있다.The branch instruction verifier includes an array of a preset length consisting of two
이를 달리 표현하면 상기 수 개의 해시 함수는 상기 기 설정된 길이의 배열을 구성하는 배열(830, 831)의 개수만큼의 그룹별로 구별된다. 도 8의 실시예에서는 상기 기 설정된 길이의 배열을 구성하는 배열이 2개이므로, 상기 해시 함수는 2그룹으로 분류될 수 있다. 상기 해시함수의 제1 그룹(820, 821, 822, 823)은 전체 배열에 대한 어드레스를 생성하는 것이 아니라, 배열 1에 대한 하위 어드레스만을 생성하고, 상기 해시 함수의 제2 그룹(824, 825, 826, 827)은 상기 배열 2에 대한 하위 어드레스 만을 생성한다.In other words, the several hash functions are distinguished by groups as many as the number of
도 8에서는 상기 분기 명령 검증부의 기 설정된 길이의 배열이 2개의 배열로 구성된 실시예를 예시하고 있으나, 본 발명의 다른 실시예에 따른 분기 명령 검증부는, 상기 기 설정된 길이의 배열을 N개의 배열로 구성하고, 수 개의 해시 함수를 N개의 그룹별로 구별하여 분기 명령을 검증할 수 있다.8 illustrates an embodiment in which the array of preset lengths of the branch command verifying unit is composed of two arrays, but the branch command verifying unit according to another embodiment of the present invention uses the array of preset lengths as N arrays. The branch instruction can be verified by classifying several hash functions into groups of N.
검증할 분기명령과 연관된 현재 어드레스 값 및 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합(810)이 상기 각각의 해시함수(820, 821, 822, 823, 824, 825, 826, 827)에 입력된다.A
제1 그룹에 속한 해시 함수(820, 821, 822, 823)는 상기 제1 배열(830)의 어드레스 값을 생성하고, 제2 그룹에 속한 해시 함수(824, 825, 826, 827)는 상기 제2 배열(831)의 어드레스 값을 생성한다. 상기 제1, 제2 배열의 어드레스 값에 저장된 상기 기 설정된 길이의 배열의 값이 모두 동일하면 상기 검증할 분기 명령은 유효한 명령으로 검증할 수 있다.The hash functions 820, 821, 822, and 823 belonging to the first group generate the address values of the
본 발명의 일실시예에 따르면 상기 해시 함수(820, 821, 822, 823, 824, 825, 826, 827)가 생성한 제1, 제2 배열의 어드레스 값에 저장된 상기 기 설정된 길이의 배열의 값이 모두 1이라면 상기 해시 함수의 개수만큼의 출력을 논리곱(AND)연산(840)을 수행하여 손쉽게 상기 분기 명령이 상기 기 설정된 길이의 배열에 존재하는지 여부를 판단할 수 있다. According to an embodiment of the present invention, the value of the preset length array stored in the address values of the first and second arrays generated by the hash functions 820, 821, 822, 823, 824, 825, 826, and 827. If all of 1's are equal to the output of the hash function, the AND
도 9는 본 발명에 따라서 H3방식의 해시 함수를 이용하여 순차적인 계산을 통하여 분기 명령을 검증하는 분기 명령 검증부의 구조를 도시한 도면이다. 이하 도 9를 참조하여 분기 명령 검증 과정을 설명하기로 한다.9 is a diagram illustrating a structure of a branch instruction verifying unit verifying a branch instruction through sequential calculation using a hash function of the H3 method according to the present invention. Hereinafter, the branch instruction verification process will be described with reference to FIG. 9.
검증할 분기명령과 연관된 현재 어드레스 값 및 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합(910)이 상기 각각의 해시함수(921, 922, 923, 924)에 입력된다.A
상기 각각의 해시 함수(921, 922, 923, 924)는 H3 방식이므로, 각각의 해시 함수(921, 922, 923, 924)는 소정의 비트 패턴으로 구성된 Q00, Q10, Q20, Q30 행렬(931, 932, 933, 934)을 구비한다.Since each of the hash functions 921, 922, 923, and 924 is an H3 scheme, each of the hash functions 921, 922, 923, and 924 includes a Q00, Q10, Q20, and
각각의 해시 함수(921, 922, 923, 924)는 상기 소정의 비트 패턴으로 구성된 Q00, Q10, Q20, Q30 행렬(931, 932, 933, 934)과 상기 검증할 분기명령과 연관된 현재 어드레스 값 및 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합(910)을 이용하여 상기 기 설정된 길이의 배열 (950)의 어드레스를 생성한다.Each
상기 해시 함수(921, 922, 923, 924)가 생성한 어드레스에서의 상기 기 설정 된 길이의 배열의 값을 모두 논리곱(AND)연산(960)하여 그 결과를 버퍼(buffer)(970)에 저장한다.AND all the values of the array of the predetermined length at the address generated by the hash functions 921, 922, 923, and 924 to AND
상기 해시 함수(921, 922, 923, 924)는 상기 소정의 비트 패턴으로 구성된 행렬을 Q01, Q11, Q21, Q31(941, 942, 943, 944)로 교체하고 다시 검증할 분기명령과 연관된 현재 어드레스 값 및 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합(910)을 이용하여 다시 상기 기 설정된 길이의 배열의 어드레스 값을 생성 한다.The
상기 해시 함수(921, 922, 923, 924)가 생성한 어드레스에서의 기 설정된 길이의 배열의 값을 모두 논리곱(AND)연산(960)하고, 그 결과를 버퍼(970)에 저장된 결과와 다시 논리곱 연산(AND)을 수행한다.An AND
만약 Q00, Q10, Q20, Q30 행렬(931, 932, 933, 934)을 이용한 해시 함수(921, 922, 923, 924)와 Q01, Q11, Q21, Q31 행렬(941, 942, 943, 944)을 이용한 해시 함수(921, 922, 923, 924)가 생성한 어드레스에서의 상기 기 설정된 길이의 배열의 값이 모두 1로 동일하면 상기 논리곱 연산의 수행 결과는 1이 된다. 따라서 상기 논리곱 연산의 결과가 1이라면 상기 분기 명령은 유효한 분기 명령으로 검증할 수 있다.If the hash function (921, 922, 923, 924) using the Q00, Q10, Q20, Q30 matrix (931, 932, 933, 934) and the Q01, Q11, Q21, Q31 matrix (941, 942, 943, 944) If the values of the array of the predetermined length at the addresses generated by the hash functions 921, 922, 923, and 924 used are all equal to 1, the result of performing the AND operation is 1. Therefore, if the result of the AND operation is 1, the branch instruction can be verified as a valid branch instruction.
8개의 해시 함수를 이용하여 한 번에 계산하지 않고, 4개의 해시 함수를 이용하여 순차적으로, 2번에 걸쳐 계산하여 상기 분기 명령이 유효한지 여부를 검증하면, 중앙 처리 장치 내에서 상기 분기 명령 검증부가 차지하는 면적을 줄일 수 있어, 상기 분기 명령의 검증에 소요되는 시간에 민감하지 않은 경우에 유용하다. 본 발명의 실시예에 따라서, 2개의 해시 함수를 이용하여 4번에 걸쳐 계산을 반복하여 상기 분기 명령이 유효한 분기 명령인지 여부를 결정할 수도 있다. Verifying that the branch instruction is valid by calculating twice in succession using four hash functions, instead of calculating it at once using eight hash functions, verifying the branch instruction within a central processing unit. The area occupied by the addition can be reduced, which is useful when it is not sensitive to the time taken to verify the branch instruction. According to an embodiment of the present invention, two hash functions may be used to repeat the calculation four times to determine whether the branch instruction is a valid branch instruction.
도 10은 본 발명에 따라서 분기 예측부와 분기 산출부를 더 포함하는 중앙 처리 장치의 구조를 도시한 도면이다. 이하 도 10을 참조하여 분기 명령 검증 과정을 설명하기로 한다.10 is a diagram illustrating a structure of a central processing unit further including a branch predicting unit and a branch calculating unit according to the present invention. Hereinafter, the branch instruction verification process will be described with reference to FIG. 10.
상기 중앙 처리 장치(1010)의 외부의 외부 기억장치(1020)는 데이터 영역(1021)과 코드영역(1022)으로 구분되어 중앙 처리 장치(1010)가 수행할 프로그램이 저장되어 있다.The
일반적으로 중앙 처리 장치와 외부 기억 장치간의 데이터 교환에 소요되는 시간은 상기 중앙 처리 장치 내부에서 데이터 교환에 소요되는 시간보다 훨씬 긴 것이 보통이므로, 중앙 처리 장치는 분기 명령의 경우에, 상기 분기 명령의 실행 결과 분기될 분기 목적 어드레스의 값을 분기 예측부(1013)에서 예측 한다.In general, the time required for data exchange between the central processing unit and the external storage device is usually much longer than the time required for data exchange inside the central processing unit. Execution result The
상기 예측한 결과에 기반하여 분기 명령 실행부(1011)는 외부 기억장치(1020)의 상기 분기 목적 어드레스에 저장된 명령을 미리 로드하고 상기 미리 로드한 명령을 실행한다.Based on the predicted result, the branch
분기 산출부(1014)는 상기 분기 명령이 특정 변수의 값에 의하여 분기 여부가 결정되거나, 분기 목적 어드레스의 값이 달라진다면, 상기 특정 변수의 값을 실제로 검토하여 분기 목적 어드레스의 값을 정확히 산출한다.The
만약 분기 예측부(1013)에서 예측한 분기 목적 어드레스의 값과, 상기 분기 산출부(1014)에서 산출한 분기 목적 어드레스의 값이 동일하지 않다면, 분기 명령 실행부(1011)는 상기 미리 로드하여 실행한 명령의 실행 결과를 폐기하고, 상기 분기 산출부(1014)에서 산출한 분기 목적 어드레스에 저장된 명령을 다시 로드하여 실행하게 된다.If the value of the branch object address predicted by the
만약 분기 예측부(1013)에서 예측한 분기 목적 어드레스의 값과, 분기 산출부(1014)에서 산출한 분기 목적 어드레스의 값이 동일하면, 분기 명령 실행부(1011)은 상기 미리 로드하여 실행한 명령의 실행 결과를 저장하여, 상기 프로그램의 실행 속도를 향상시킨다.If the value of the branch destination address predicted by the
분기 예측부(1013)는 정적, 또는 동적 예측 기법을 사용하여 상기 분기 명령에 대한 분기 목적 어드레스를 예측한다. 분기 예측부(1013)에서 예측한 분기 목적 어드레스는 컴퓨터 바이러스나 해커의 침입을 받지 않았기 때문에 상기 분기 명령에 연관된 현재 어드레스 값과 분기 예측부(1013)에서 예측한 분기 목적 어드레스 값의 조합은 상기 예측된 분기 목적 어드레스 값이 분기 산출부(1014)에서 산출한 분기 목적 어드레스와의 일치하는지 여부에 관계없이 유효한 조합 중의 하나가 된다.The
따라서, 검증할 분기 명령과 분기 예측부(1013)에서 예측한 분기 목적 어드레스 값의 조합은 언제나 분기 명령 검증부(1012)의 참조표에 존재하는 조합으로서, 상기 분기 명령은 유효한 분기 명령이다.Therefore, the combination of the branch instruction to be verified and the branch destination address value predicted by the
그러나 만약 컴퓨터 바이러스에 감염되거나 해커가 침입하여 상기 분기 명령에 대한 분기 목적 어드레스의 값을 결정하는 특정 변수의 값이 조작 된다면 분기 명령 예측부(1013)에서 예측한 분기 목적 어드레스의 값과 분기 산출부(1014)에서 산출한 분기 목적 어드레스의 값이 서로 상이하게 된다.However, if the value of a specific variable that determines the value of the branch destination address for the branch instruction is infected by a computer virus or a hacker intrudes, the value of the branch destination address predicted by the
물론 분기 예측부(1013)에서 분기 목적 어드레스를 잘못 예측한다면 분기 예측부(1013)에서 예측한 분기 목적 어드레스의 값과 분기 산출부(1014)에서 산출한 분기 목적 어드레스의 값이 동일하지 않을 수도 있다.Of course, if the
그러나 일단 분기 산출부(1014)에서 산출한 분기 목적 어드레스는 상기 분기 목적 어드레스를 결정하는 특정 변수값이 컴퓨터 바이러스나 해커에 의해 조작되었을 가능성이 있는데, 상기 분기 목적 어드레스가 분기 예측부(1013)에서 예측한 분기 목적 어드레스와 동일하면 검증할 분기 명령과 연관된 현재 어드레스와 분기 산출부(1014)에서 산출한 분기 목적 어드레스 값의 조합은 분기 명령 검증부의 참조표에 존재하는 조합으로서, 상기 분기 명령은 유효한 분기 명령이라는 것은 확인할 수 있다.However, the branch destination address calculated by the
분기 명령의 유효성을 검증하면 중앙 처리 장치가 안전하게 동작할 수는 있으나 유효성을 검증하는데 소요되는 시간으로 인하여 상기 중앙 처리장치의 명령 처리 성능은 떨어지게 된다. 만약 분기 예측부에서 예측한 분기 목적 어드레스의 값과 분기 산출부에서 산출한 분기 목적 어드레스의 값이 서로 동일하면 상기 분기 명령이 유효한 것으로 가정하여 상기 분기 명령 검증부가 동작하지 않고, 상이한 경우에만 상기 분기 명령이 유효한지 상기 분기 명령 검증부가 검증한다면 상기 중앙 처리 장치의 명령 수행 성능을 크게 개선 할 수 있다. Although validating the branch instruction allows the central processing unit to operate safely, the processing time of the central processing unit is degraded due to the time required to verify the validity of the branch instruction. If the value of the branch object address predicted by the branch predictor and the value of the branch object address calculated by the branch calculator are equal to each other, it is assumed that the branch instruction is valid and the branch instruction verifier does not operate. If the branch instruction verifier verifies whether the instruction is valid, the instruction execution performance of the central processing unit can be greatly improved.
도 11은 분기 명령이 유효한지 여부를 검증하는 단계를 포함하는 중앙 처리 장치의 분기 명령 실행 방법을 단계별로 도시한 흐름도이다. 이하 도 11을 참조하 여 중앙 처리 장치의 분기 명령 실행 방법을 설명하기로 한다.11 is a flowchart illustrating a step-by-step method of executing a branch instruction of a central processing unit including verifying whether a branch instruction is valid. Hereinafter, a branch instruction execution method of the CPU will be described with reference to FIG. 11.
단계(S1110)에서 중앙 처리 장치는 특정 분기 명령을 실행하기 위하여 외부 저장장치에 저장되어 있는 상기 특정 분기 명령을 로드한다. 이때 상기 중앙 처리 장치의 프로그램 카운터에는 상기 특정 분기 명령의 어드레스 값이 저장된다. 중앙 처리 장치는 단계(S1120)에서 상기 로드한 특정 분기 명령이 유효한지 여부를 검증하고, 유효한 분기 명령이라고 검증되면 단계(S1130)에서 상기 분기 명령을 실행한다.In step S1110, the central processing unit loads the specific branch instruction stored in the external storage device to execute the specific branch instruction. At this time, the address value of the specific branch instruction is stored in the program counter of the central processing unit. The central processing unit verifies whether the loaded specific branch instruction is valid in step S1120, and executes the branch instruction in step S1130 when it is verified that it is a valid branch instruction.
만약 유효하지 않은 분기 명령이라고 검증되면, 단계(1140)상기 중앙 처리 장치가 실행하려는 프로그램은 컴퓨터 바이러스에 감염되거나, 해커에 의해 해킹된 프로그램이라고 판단하여 상기 프로그램의 실행을 중지한다. If it is verified that the branch instruction is invalid,
본 발명의 일실시예에 따르면 단계(S1120)에서 분기 명령을 유효하지 않은 분기 명령으로 검증한 경우, 단계(S1140)에서 상기 분기 명령에 대하여 오류가 발생한 것으로 판단 하거나, 사용자에게 오류 발생 보고를 할 수 있다.According to an embodiment of the present invention, when the branch instruction is verified as an invalid branch instruction in step S1120, it is determined that an error occurs in the branch instruction in step S1140, or an error occurrence report is reported to the user. Can be.
도 12는 특정 분기 명령에 대해 예측된 분기 목적 어드레스와 산출된 분기 명령 어드레스의 값이 동일하지 않은 경우에만 상기 분기 명령이 유효한지 검증하는 분기 명령 실행 방법을 단계별로 도시한 흐름도이다. 이하 도 12를 참조하여 분기 명령 실행 방법을 설명하기로 한다.12 is a flowchart illustrating a step-by-step method of executing a branch instruction for verifying that the branch instruction is valid only when the predicted branch purpose address and the calculated branch instruction address for a particular branch instruction do not have the same value. Hereinafter, a branch instruction execution method will be described with reference to FIG. 12.
단계(S1210)에서, 중앙 처리 장치는 특정 분기 명령을 실행하기 위하여 외부 저장장치에 저장되어 있는 상기 특정 분기 명령을 로드한다. 이때 상기 중앙 처리 장치의 프로그램 카운터에는 상기 특정 분기 명령의 어드레스 값이 저장된다.In step S1210, the central processing unit loads the specific branch instruction stored in the external storage device to execute the specific branch instruction. At this time, the address value of the specific branch instruction is stored in the program counter of the central processing unit.
중앙 처리 장치는 단계(S1220)에서 상기 로드한 분기 명령에 대한 분기 목적 어드레스를 예측하고, 단계(S1230)에서 상기 로드한 분기 명령에 대한 분기 목적 어드레스를 산출한다.The central processing unit predicts a branch destination address for the loaded branch instruction in step S1220, and calculates a branch destination address for the loaded branch instruction in step S1230.
상기 예측된 분기 목적 어드레스는 과거의 분기이력 등을 고려한 것이고, 상기 산출된 분기 목적 어드레스는 상기 분기 명령의 분기 목적 어드레스를 결정하는 특정 변수 값들을 고려한 것이므로, 산출된 분기 목적 어드레스는 부정확한 값이지만, 예측된 분기 목적 어드레스는 정확한 값이다. 그러나 분기 목적 어드레스를 결정하는 특정 변수 값은 컴퓨터 바이러스나 해커에 의하여 조작된 값일 수 있으므로, 산출된 분기 목적 어드레스는 상기 검증할 분기 명령과 관련 없는, 전혀 엉뚱한 어드레스로서, 해커가 삽입해 놓은 명령을 실행 시키는 것일 수 있다. 반면에, 예측된 분기 목적 어드레스는 상기 검증할 분기 명령이 선택 가능한 수 개의 분기 목적 어드레스 중의 하나를 선택한 것이므로, 컴퓨터 바이러스나 해커에 의한 영향을 의심할 필요가 없다.Since the estimated branch destination address takes into account past branch history and the like, and the calculated branch destination address takes into account specific variable values for determining the branch destination address of the branch instruction, the calculated branch destination address is an incorrect value. The predicted branch destination address is correct. However, since the specific variable value that determines the branch destination address may be a value manipulated by a computer virus or a hacker, the calculated branch destination address is a totally wrong address that is irrelevant to the branch command to be verified. It can be done. On the other hand, since the predicted branch destination address is one of several branch destination addresses selectable by the branch instruction to be verified, there is no need to doubt the influence of a computer virus or a hacker.
단계(S1240)에서, 중앙 처리 장치는 예측된 분기 목적 어드레스와 산출된 분기 목적 어드레스가 동일한지 여부를 판단한다. 만약 동일하면 상기 분기 명령은 컴퓨터 바이러스나 해커에 의해 영향 받지 않은 유효한 분기 명령인 것으로 판단할 수 있어, 단계(S1250)에서 상기 분기 명령을 실행한다.In step S1240, the central processing unit determines whether the predicted branch destination address and the calculated branch destination address are the same. If the same, the branch instruction can be determined to be a valid branch instruction unaffected by a computer virus or a hacker, and executes the branch instruction in step S1250.
만약 상기 예측된 분기 목적 어드레스와 상기 산출된 분기 목적 어드레스가 동일하지 않다면, 단계(S1260)에서 상기 분기 명령이 유효한지 여부를 검증한다. 만약 상기 분기 명령이 유효한 것으로 검증되면, 단계(S1250)에서 상기 분기 명령 을 실행하고, 상기 분기 명령이 유효하지 않은 것으로 검증되면 단계(S1270)에서 상기 분기 명령을 실행하도록 하는 프로그램의 실행을 중지할 수 있다. If the predicted branch destination address and the calculated branch destination address are not the same, it is verified in step S1260 whether the branch instruction is valid. If the branch instruction is verified to be valid, the branch instruction is executed in step S1250, and if the branch instruction is verified to be invalid, execution of a program for executing the branch instruction in step S1270 is stopped. Can be.
도 13은 참조표를 이용하여 분기 명령이 유효한지 여부를 검증하는 단계를 포함하는 분기 명령 실행 방법을 단계별로 도시한 흐름도이다. 이하 도 13을 참조하여 분기 명령 실행 방법을 상세히 설명하기로 한다.13 is a flowchart illustrating a step-by-step method of executing a branch instruction including verifying whether a branch instruction is valid using a reference table. Hereinafter, a branch instruction execution method will be described in detail with reference to FIG. 13.
단계(S1310)에서 컴퓨터, PDA, 핸드폰 등의 정보처리기기의 중앙 처리 장치는, 특정 분기 명령을 실행하기 위하여 외부 저장장치에 저장되어 있는 상기 특정 분기 명령을 로드한다. 이때 상기 중앙 처리 장치의 프로그램 카운터에는 상기 특정 분기 명령의 어드레스 값이 저장된다.In step S1310, the central processing unit of the information processing device such as a computer, PDA, mobile phone, etc., loads the specific branch instruction stored in the external storage device to execute the specific branch instruction. At this time, the address value of the specific branch instruction is stored in the program counter of the central processing unit.
중앙처리장치는 단계(S1320)에서 상기 분기 명령의 분기 조건 등을 고려하여 상기 로드한 분기 명령에 대한 분기 목적 어드레스를 산출한다.In step S1320, the CPU calculates a branch destination address for the loaded branch instruction in consideration of the branch condition of the branch instruction.
단계(S1330)에서, 상기 중앙처리 장치는 적어도 하나 이상의 분기 명령과 연관된 현재 어드레스 값과 상기 적어도 하나 이상의 분기 명령에 대한 분기 목적 어드레스 값의 조합으로 구성된 참조표에, 상기 로드한 분기 명령과 연관된 현재 어드레스 값과 상기 산출한 목적 어드레스의 조합이 존재하는지 여부를 판단한다.In step S1330, the central processing unit includes a current table associated with the loaded branch instruction in a look-up table composed of a combination of a current address value associated with at least one branch instruction and a branch destination address value for the at least one branch instruction. It is determined whether a combination of the address value and the calculated destination address exists.
만약 상기 로드한 분기 명령과 연관된 현재 어드레스 값과 상기 산출한 목적 어드레스 값의 조합이 상기 참조표에 존재 한다면 단계(S1340)에서 상기 분기 명령은 유효한 분기 명령으로 검증하고, 단계(S1350)에서 상기 분기 명령을 실행한다.If a combination of the current address value and the calculated destination address value associated with the loaded branch instruction exists in the reference table, the branch instruction is verified as a valid branch instruction at step S1340, and the branch at step S1350. Run the command.
만약 상기 로드한 분기 명령과 연관된 현재 어드레스 값과 상기 산출한 목적 어드레스 값의 조합이 상기 참조표에 존재하지 않는 다면, 단계(S1360)에서 상기 분기 명령은 유효하지 않은 분기 명령으로 검증하고, 단계(S1370)에서 상기 분기 명령을 실행하도록 하는 프로그램의 실행을 중지한다. If the combination of the current address value and the calculated destination address value associated with the loaded branch instruction does not exist in the reference table, the branch instruction is verified as an invalid branch instruction in step S1360, and the step ( In step S1370, the execution of the program for executing the branch instruction is stopped.
도 14는 해시 함수를 이용하여 분기 명령이 유효한지 여부를 검증하는 단계를 포함하는 분기 명령 실행 방법을 단계별로 도시한 흐름도이다. 이하 도 14를 참조하여 분기 명령 실행 방법을 상세히 설명하기로 한다.14 is a flow diagram illustrating a step by step method of executing a branch instruction comprising verifying whether a branch instruction is valid using a hash function. Hereinafter, a branch instruction execution method will be described in detail with reference to FIG. 14.
단계(S1410)에서 컴퓨터, PDA, 핸드폰 등의 정보처리기기의 중앙 처리 장치는, 특정 분기 명령을 실행하기 위하여 외부 저장장치에 저장되어 있는 상기 특정 분기 명령을 로드한다. 이때 상기 중앙 처리 장치의 프로그램 카운터에는 상기 특정 분기 명령의 어드레스 값이 저장된다.In step S1410, the central processing unit of the information processing device such as a computer, PDA, mobile phone, etc., loads the specific branch instruction stored in the external storage device to execute the specific branch instruction. At this time, the address value of the specific branch instruction is stored in the program counter of the central processing unit.
중앙 처리장치는 단계(S1420)에서 상기 분기 명령의 분기 조건 등을 고려하여 상기 로드한 분기 명령에 대한 분기 목적 어드레스를 산출한다.In step S1420, the central processing unit calculates a branch destination address for the loaded branch instruction in consideration of the branch condition of the branch instruction.
단계(S1430)에서는 적어도 하나 이상의 해시 함수에 상기 분기 명령과 연관된 현재 어드레스 값과 상기 분기 명령에 대한 분기 목적 어드레스 값의 조합을 입력한다.In step S1430, a combination of a current address value associated with the branch instruction and a branch destination address value for the branch instruction is input to at least one hash function.
단계(S1440)에서는 상기 적어도 하나 이상의 해시 함수가 기 설정된 길이의 배열의 적어도 하나 이상의 어드레스 값을 생성한다. 상기 해시 함수는 상기 분기 명령의 어드레스 값을 셔플하고, 상기 셔플한 값을 상기 분기 명령에 대한 분기 목적 어드레스 값과 배타적 논리합 연산을 수행하는 것일 수도 있고, 소정의 비트패턴으로 구성된 행렬을 이용한 것일 수도 있다.In step S1440, the at least one hash function generates at least one address value of an array of a predetermined length. The hash function may be to shuffle the address value of the branch instruction, perform an exclusive OR operation on the branch target address value with respect to the branch instruction, or use a matrix formed of a predetermined bit pattern. have.
단계(S1450)에서는 상기 생성한 적어도 하나 이상의 어드레스에 저장된 상기 기 설정된 길이의 배열의 값을 읽어 상기 배열의 적어도 하나 이상의 값들을 비교한다.In operation S1450, the value of the array having the preset length stored in the generated at least one address is read and the at least one value of the array is compared.
본 발명의 일실시예에 따르면 상기 적어도 하나 이상의 어드레스에 저장된 상기 기 설정된 길이의 배열의 적어도 어느 하나 이상의 값이 모두 동일하면 단계(S1460)에서 상기 분기 명령이 유효한 것으로 검증할 수 있다. 만약 상기 기 설정된 길이의 배열의 적어도 어느 하나 이상의 값이 모두 '1'인 경우에 상기 분기 명령이 유효한 것으로 검증한다면, 상기 배열의 적어도 어느 하나 이상의 값을 논리곱 (AND)연산을 수행하여 그 결과가 '1'이 된다면 상기 분기 명령은 유효한 것을 검증할 수 있다.According to an embodiment of the present invention, if at least one or more values of the array of the preset length stored in the at least one or more addresses are all the same, the branch instruction may be verified as valid in step S1460. If the branch instruction is valid when at least one or more values of the array having the predetermined length are all '1', the AND operation is performed on the at least one or more values of the array. If is '1' the branch instruction can verify that it is valid.
만약 상기 분기 명령이 유효한 분기 명령으로 검증 된다면 단계(S1470)에서 상기 분기 명령을 실행한다.If the branch instruction is verified as a valid branch instruction, the branch instruction is executed in step S1470.
만약 단계(S1450)에서 상기 기 설정된 길이의 배열의 적어도 어느 하나 이상의 값이 모두 동일하지 않다면, 단계(S1480)에서 상기 분기 명령은 유효하지 않은 분기 명령으로 검증할 수 있다. 단계(S1490)에서 상기 분기 명령을 실행하도록 하는 프로그램의 실행을 중지할 수 있다.If at least one or more values of the array of the preset length are not the same at step S1450, the branch instruction may be verified as an invalid branch instruction at step S1480. In operation S1490, execution of the program for executing the branch instruction may be stopped.
본 발명에 따르면, 컴퓨터 바이러스를 감시, 치료하는 백신프로그램에 의하지 않고, 컴퓨터 바이러스 컴퓨터 바이러스에 의한 오작동을 방지할 수 있다.According to the present invention, a malfunction due to a computer virus computer virus can be prevented without using a vaccine program for monitoring and treating a computer virus.
본 발명에 따르면, 해커에 의해 공격 당한 컴퓨터가, 해커가 삽입한 프로그램을 실행하는 것을 방지하여, 사용자의 자료와 기밀을 보호할 수 있다.According to the present invention, a computer attacked by a hacker can be prevented from executing a program inserted by the hacker, thereby protecting user data and confidentiality.
Claims (30)
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US11/965,003 US8006078B2 (en) | 2007-04-13 | 2007-12-27 | Central processing unit having branch instruction verification unit for secure program execution |
PCT/KR2008/001997 WO2008127009A1 (en) | 2007-04-13 | 2008-04-10 | Central processing unit having branch instruction verification unit for secure program execution |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
US90771207P | 2007-04-13 | 2007-04-13 | |
US60/907,712 | 2007-04-13 |
Publications (2)
Publication Number | Publication Date |
---|---|
KR20080092813A true KR20080092813A (en) | 2008-10-16 |
KR101413682B1 KR101413682B1 (en) | 2014-07-01 |
Family
ID=40153716
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
KR1020070058604A KR101413682B1 (en) | 2007-04-13 | 2007-06-14 | Processor having indirect branch validation unit for secure program execution |
Country Status (1)
Country | Link |
---|---|
KR (1) | KR101413682B1 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101217668B1 (en) * | 2011-05-12 | 2013-01-02 | 주식회사 안랩 | Malicious program hooking prevention apparatus and method |
WO2014088276A1 (en) * | 2012-12-04 | 2014-06-12 | 주식회사 안랩 | Abnormal path call detecting apparatus and abnormal path call detecting method |
KR20170038045A (en) * | 2014-09-02 | 2017-04-05 | 제말토 에스에이 | System and method for protecting a device against attacks on processing flow using a code pointer complement |
US11148150B2 (en) * | 2018-10-19 | 2021-10-19 | Semes Co., Ltd. | Liquid dispensing nozzle and substrate treating apparatus |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3499252B2 (en) * | 1993-03-19 | 2004-02-23 | 株式会社ルネサステクノロジ | Compiling device and data processing device |
KR100731550B1 (en) * | 2004-11-29 | 2007-06-22 | 주식회사 안철수연구소 | Method for diagnosing malicious computer program |
-
2007
- 2007-06-14 KR KR1020070058604A patent/KR101413682B1/en active IP Right Grant
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR101217668B1 (en) * | 2011-05-12 | 2013-01-02 | 주식회사 안랩 | Malicious program hooking prevention apparatus and method |
WO2014088276A1 (en) * | 2012-12-04 | 2014-06-12 | 주식회사 안랩 | Abnormal path call detecting apparatus and abnormal path call detecting method |
KR20170038045A (en) * | 2014-09-02 | 2017-04-05 | 제말토 에스에이 | System and method for protecting a device against attacks on processing flow using a code pointer complement |
US11148150B2 (en) * | 2018-10-19 | 2021-10-19 | Semes Co., Ltd. | Liquid dispensing nozzle and substrate treating apparatus |
Also Published As
Publication number | Publication date |
---|---|
KR101413682B1 (en) | 2014-07-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US8006078B2 (en) | Central processing unit having branch instruction verification unit for secure program execution | |
Shuai et al. | Modelling analysis and auto-detection of cryptographic misuse in android applications | |
CN111052115B (en) | Data processing apparatus and method of authentication depending on call path | |
US9298947B2 (en) | Method for protecting the integrity of a fixed-length data structure | |
US9443107B2 (en) | Method for protecting the integrity of a group of memory elements using an aggregate authentication code | |
US8266691B2 (en) | Renewable integrity rooted system | |
WO2013151874A1 (en) | Checksum and hashing operations resilient to malicious input data | |
CN109117643B (en) | System processing method and related equipment | |
KR101413682B1 (en) | Processor having indirect branch validation unit for secure program execution | |
US20220092201A1 (en) | Authentication of files | |
US11093605B2 (en) | Monitoring real-time processor instruction stream execution | |
Li et al. | A control flow integrity checking technique based on hardware support | |
JP6040780B2 (en) | Cryptographic processing apparatus, method and program | |
CN108694322B (en) | Method for initializing a computerized system and computerized system | |
Idris et al. | Enhancement Data Integrity Checking Using Combination MD5 and SHA1 Algorithm in Hadoop Architecture | |
Blass et al. | Forward security with crash recovery for secure logs | |
CN113228012A (en) | Method and apparatus for authenticating FPGA configuration | |
Lipton et al. | Provable virus detection: using the uncertainty principle to protect against Malware | |
Braga et al. | From Dragondoom to Dragonstar: Side-channel Attacks and Formally Verified Implementation of WPA3 Dragonfly Handshake | |
CN117610004A (en) | Firmware verification method, system starting method, device, system, equipment and medium | |
Park et al. | A study on the processing and reinforcement of message digest through two-dimensional array masking | |
Blass et al. | Forward Integrity and Crash Recovery for Secure Logs. | |
KR101173761B1 (en) | Method and apparatus for defending from and detecting outside program attacks | |
Ciocan et al. | A Modified Argon2i Using a Tweaked Variant of Blake3 | |
KR20230137423A (en) | Enhanced encoding message inspection for RSA signature verification |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A201 | Request for examination | ||
E902 | Notification of reason for refusal | ||
E902 | Notification of reason for refusal | ||
E701 | Decision to grant or registration of patent right | ||
GRNT | Written decision to grant | ||
FPAY | Annual fee payment |
Payment date: 20170522 Year of fee payment: 4 |
|
FPAY | Annual fee payment |
Payment date: 20180518 Year of fee payment: 5 |