KR101321259B1 - Apparatus and method for calculating subtraction for montgomery inverse algorithm - Google Patents

Apparatus and method for calculating subtraction for montgomery inverse algorithm Download PDF

Info

Publication number
KR101321259B1
KR101321259B1 KR1020130058328A KR20130058328A KR101321259B1 KR 101321259 B1 KR101321259 B1 KR 101321259B1 KR 1020130058328 A KR1020130058328 A KR 1020130058328A KR 20130058328 A KR20130058328 A KR 20130058328A KR 101321259 B1 KR101321259 B1 KR 101321259B1
Authority
KR
South Korea
Prior art keywords
variable
subtraction
value
operation unit
inverse algorithm
Prior art date
Application number
KR1020130058328A
Other languages
Korean (ko)
Inventor
정석원
이경효
홍휘승
김단환
하국용
Original Assignee
목포대학교산학협력단
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 목포대학교산학협력단 filed Critical 목포대학교산학협력단
Priority to KR1020130058328A priority Critical patent/KR101321259B1/en
Priority to PCT/KR2013/006884 priority patent/WO2014189171A1/en
Application granted granted Critical
Publication of KR101321259B1 publication Critical patent/KR101321259B1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/721Modular inversion, reciprocal or quotient calculation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/57Arithmetic logic units [ALU], i.e. arrangements or devices for performing two or more of the operations covered by groups G06F7/483 – G06F7/556 or for performing logical operations
    • G06F7/575Basic arithmetic logic units, i.e. devices selectable to perform either addition, subtraction or one of several logical operations, using, at least partially, the same circuitry
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/50Adding; Subtracting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/728Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic using Montgomery reduction

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Mathematical Optimization (AREA)
  • Computing Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Mathematical Physics (AREA)
  • Complex Calculations (AREA)

Abstract

PURPOSE: A subtraction operation device for a Montgomery inverse algorithm and a method thereof are provided to perform a complementary operation and an add operation based on two variables, thereby comparing and operating sizes at the same time. CONSTITUTION: A comparison operation unit (110) compares the sizes of variable U and variable V. A subtraction operation unit (120) operates a difference value of the variable U and the variable V by performing an add operation with the complement of the bit values for the variable U and the variable V. The comparison operation unit compares the sizes of the variable U and the variable V by considering the most significant bit value of a reference value. When the most significant bit value is 1, the comparison operation unit determines that the variable U is bigger than the variable V. [Reference numerals] (110) Comparison operation unit; (120) Subtraction operation unit; (AA) Variable U; (BB) Variable V

Description

몽고메리 역원 알고리즘을 위한 뺄셈 연산 장치 및 그 방법{APPARATUS AND METHOD FOR CALCULATING SUBTRACTION FOR MONTGOMERY INVERSE ALGORITHM}Subtraction operation apparatus for Montgomery inverse algorithm and its method {APPARATUS AND METHOD FOR CALCULATING SUBTRACTION FOR MONTGOMERY INVERSE ALGORITHM}

본 발명은 몽고메리 역원 알고리즘에 사용되는 다수의 변수들에 대한 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치 및 그 방법에 관한 것이다.The present invention relates to a subtraction operation apparatus and method for the Montgomery inverse algorithm for a plurality of variables used in the Montgomery inverse algorithm.

타원곡선 암호의 장점들로 인하여, 유한체 위에서의 타원곡선을 하드웨어적으로 구현하기 위한 노력이 세계 각지에서 이루어 지고 있다. 홀수 특징(characteristic)과 2의 지수승에 가까운 소수 p 에 대하여 GF(p) 상에서의 타원 곡선의 효율적인 유한체 곱셈 구현을 위한 기법, Certicom 사의 ONB(Optimal Normal Basis) 에서의 효율적인 유한체 곱셈 구현 기법, Cylink 사의 ONB(Optimal Normal Basis) 에서의 효율적인 유한체 곱셈 구현 기법과 같은 다양한 기법들이 시도되고 있다.Due to the advantages of elliptic curve cryptography, efforts are being made worldwide to implement an elliptic curve on a finite body in hardware. Efficient finite field multiplication of elliptic curves on GF (p) for odd characteristic and exponent prime p near 2, efficient finite field multiplication in Certicom's Optimal Normal Basis (ONB) In addition, various techniques have been tried, such as efficient finite field multiplication implementation in Cylink's Optimal Normal Basis (ONB).

그러나, 이러한 최근의 다양한 기법들은 (1) 공개키와 개인키 전송을 수행하기 위해 요구되는 계산량이 많고, (2) 키 사이즈 측면에서 매우 많은 키 사이즈로 임의의 키를 저장하기 위해 요구되는 기억공간이 많으며, (3) 통신 대역폭(bandwidth) 측면에서 메시지를 암호화하거나 서명을 전송하기 위해 요구되는 통신 대역폭이 매우 큰 문제점이 있다.However, these recent various techniques have (1) a large amount of computation required to perform public and private key transmissions, and (2) a storage space required for storing arbitrary keys with very large key sizes in terms of key size. (3) In terms of communication bandwidth, there is a problem in that the communication bandwidth required for encrypting a message or transmitting a signature is very large.

또한, 암호 시스템의 이론적 안정성과 별도로, 전력 소모량과 알고리즘의 수행시간이나 전력 소모량의 차이, 전자파 방출량 등과 같은 부가 정보를 이용/분석하여 비밀키를 찾아내는 부채널 공격(SCA, Side Channel Attack)의 경우, IC 카드, 모바일 폰, PDA 등과 같은 내장된 하드웨어에서 암호 알고리즘의 구현에 대한 실질적인 위협이 되고 있다. 이에, 비밀키의 단위 비트당 연산 수행 시간이 길고 전력 소모량이 많으므로, 전력 소모량 분석(SPA 및 DPA) 기술 및 이에 대응하는 스칼라 곱셈 알고리즘에 관한 연구에 초점이 맞추어져 있다. In addition, in case of side channel attack (SCA) that finds a secret key by using / analyzing additional information such as power consumption, algorithm execution time, power consumption difference, electromagnetic wave emission amount, etc. This is a real threat to the implementation of cryptographic algorithms in embedded hardware such as ICs, mobile phones, PDAs, and the like. Accordingly, since the operation execution time per unit bit of the secret key is long and the power consumption is large, the focus on the power consumption analysis (SPA and DPA) technology and the corresponding scalar multiplication algorithm is focused.

대한민국 공개특허 제1020100062565호(2010.06.10), "모듈러스의 음의 역원을 구하는 방법"Republic of Korea Patent Publication No. 1020100062565 (2010.06.10), "Method of obtaining the negative inverse of the modulus" 대한민국 등록특허 제1005851190000호(2006.05.24), "암호화 장치, 암호화 방법 및 그 기록매체"Republic of Korea Patent No. 1005851190000 (May 24, 2006), "Encryption apparatus, encryption method and recording medium thereof" 대한민국 공개특허 제1020120088316호(2012.08.08), "몽고메리 역원 계산 장치 및 이를 이용한 몽고메리 역원 계산 방법"Republic of Korea Patent Publication No. 1020120088316 (2012.08.08), "Montgomery inverter calculation device and method for calculating the Montgomery inversion using the same"

몽고메리 역원알고리즘을 위한 크기 비교와 차이가 동시에 연산되는 뺄셈 연산 장치 및 그 방법을 제공하고자 한다.The present invention provides a subtraction operation apparatus and method in which size comparison and difference are simultaneously computed for the Montgomery inverse algorithm.

또한, 몽고메리 역원알고리즘에 사용되는 두 변수를 기반으로 보수 연산 및 덧셈 연산으로 크기 비교와 차이값을 동시에 연산이 가능한 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치 및 그 방법을 제공하고자 한다.In addition, the present invention provides a subtraction operation apparatus and method for a Montgomery inverse algorithm, which can simultaneously calculate size comparisons and difference values using complementary and addition operations based on two variables used in the Montgomery inverse algorithm.

일 실시예에 따른 몽고메리 역원 알고리즘에 사용되는 다수의 변수들(U, V 여기서 U, V, < 2n 임)에 대한 뺄셈 연산 장치는, 변수 U 및 변수 V에 대한 차이(U-V) 및 2n 의 합에 대한 기준값인 2n +(U-V) 으로부터 U 및 V 의 크기를 비교하는 연산을 수행하는 비교 연산부; 및 상기 비교 연산부에서의 비교 결과를 기반으로 상기 변수 U 및 상기 변수 V 에 대한 비트값의 보수로부터 덧셈 연산을 수행하여 상기 변수 U 및 상기 변수 V의 차이값을 연산하는 뺄셈 연산부를 포함한다.The subtraction operation apparatus for a plurality of variables (U, V where U, V, <2 n ) used in the Montgomery inverse algorithm according to an embodiment may include a difference (UV) and 2 n for the variable U and the variable V. A comparison operation unit which performs an operation for comparing the sizes of U and V from 2 n + (UV), which is a reference value for the sum of? And a subtraction calculator configured to calculate a difference value between the variable U and the variable V by performing an addition operation from the complement of the bit values of the variable U and the variable V based on the comparison result in the comparison operator.

상기 비교 연산부는, 상기 기준값의 최상위 비트값을 고려하여 상기 변수 U 및 상기 변수 V 의 크기를 비교할 수 있다.The comparison operation unit may compare the magnitudes of the variable U and the variable V in consideration of the most significant bit value of the reference value.

상기 비교 연산부는, 상기 최상위 비트값이 '1'이면, 상기 변수 U가 상기 변수 V 보다 큰 것으로 판단하고, 상기 최상위 비트값이 '0'이면 상기 변수 V가 상기 변수 U 보다 큰 것으로 판단할 수 있다.The comparison operation unit may determine that the variable U is greater than the variable V when the most significant bit value is '1', and determine that the variable V is greater than the variable U when the most significant bit value is '0'. have.

상기 비교 연산부는, 상기 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과를 고려하여 상기 변수 U 및 상기 변수 V의 크기를 비교할 수 있다.The comparison operation unit may compare the sizes of the variable U and the variable V in consideration of an addition operation result for U + (~ V) +1 based on a value (~ V) inverting the bit value of the variable V. have.

상기 뺄셈 연산부는, 상기 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과를 고려하여 상기 변수 U 및 상기 변수 V의 차이값을 연산할 수 있다.The subtraction operator calculates a difference between the variable U and the variable V in consideration of an addition operation result for U + (~ V) +1 based on a value (~ V) inverting the bit value of the variable V. can do.

상기 뺄셈 연산부는, 상기 비교 연산부가 상기 변수 U 가 상기 변수 V 보다 크다고 판단한 경우, 상기 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과로부터 최상위 비트를 제거하여 상기 변수 U 및 상기 변수 V의 차이값을 연산할 수 있다.The subtraction operation unit adds an operation to U + (− V) +1 based on a value (˜V) in which the comparison operation unit determines that the variable U is greater than the variable V, based on an inverted bit value of the variable V. The difference between the variable U and the variable V may be calculated by removing the most significant bit from the result.

상기 뺄셈 연산부는, 상기 비교 연산부가 상기 변수 V 가 상기 변수 U 보다 크다고 판단한 경우, 상기 변수 U의 비트값을 반전시킨 값(~U)을 기반으로, V+(~U)+1에 대한 덧셈 연산 결과로부터 최상위 비트를 제거하여 상기 변수 V 및 상기 변수 U의 차이값을 연산할 수 있다.The subtraction operation unit adds an operation to V + (− U) +1 based on a value (~ U) inverting the bit value of the variable U when the comparison operation unit determines that the variable V is larger than the variable U. The difference value between the variable V and the variable U may be calculated by removing the most significant bit from the result.

상기 뺄셈 연산부는, 상기 변수 U 및 상기 변수 V 에 대한 각각의 비트값의 보수, (~U) 및 (~V) 로부터 U+(~V)+1 및 V+(~U)+1에 대한 덧셈 연산을 병렬적으로 연산하고, 상기 연산된 U+(~V)+1 및 상기 연산된 V+(~U)+1의 최상위 비트를 각각 제거할 수 있다.The subtraction operation unit is a complement of each bit value for the variable U and the variable V, and an addition operation for U + (~ V) +1 and V + (~ U) +1 from (~ U) and (~ V). Are computed in parallel, and the most significant bits of the calculated U + (~ V) +1 and the calculated V + (~ U) +1 can be removed.

상기 뺄셈 연산부는, 상기 비교 연산부에서의 비교 결과를 기반으로 상기 연산된 U+(~V)+1 및 상기 연산된 V+(~U)+1 중 어느 하나를 선택하고, 선택된 어느 하나 값의 최상위 비트를 제거하여 상기 변수 V 및 상기 변수 U의 차이값을 연산할 수 있다.The subtraction operator selects any one of the calculated U + (~ V) +1 and the calculated V + (~ U) +1 based on the comparison result in the comparison operator, and selects the most significant bit of the selected value. The difference value between the variable V and the variable U may be calculated by removing.

본 발명의 다른 실시예에 따른 몽고메리 역원 알고리즘에 사용되는 다수의 변수들(U, V 여기서 U, V, < 2n 임)에 대한 뺄셈 연산 장치는, 변수 U 및 변수 V의 각각에 대한 보수 연산을 병렬적으로 수행하는 보수 연산부; 및 상기 변수 U 및 변수 V와, 보수 연산의 수행 결과인 (~V) 및 (~U)를 기반으로 U+(~V)+1 및 V+(~U)+1에 대한 덧셈 연산을 수행하는 덧셈부를 포함한다.Subtraction operation apparatus for a plurality of variables (U, V where U, V, <2 n ) used in the Montgomery inverse algorithm according to another embodiment of the present invention, the complement operation for each of the variable U and variable V Compensation operation unit for performing the parallel; And an addition operation for performing an addition operation on U + (~ V) +1 and V + (~ U) +1 based on the variables U and V, and (~ V) and (~ U) which are the result of the complement operation. Contains wealth.

상기 뺄셈 연산 장치는 상기 연산된 U+(~V)+1 및 상기 연산된 V+(~U)+1를 고려하여 상기 변수 U 및 상기 변수 V의 크기 비교 및 차이값을 동시에 출력할 수 있다. The subtraction operation apparatus may simultaneously output a magnitude comparison and a difference value between the variable U and the variable V in consideration of the calculated U + (~ V) +1 and the calculated V + (~ U) +1.

본 발명의 일 실시예에 따른 몽고메리 역원 알고리즘에 사용되는 다수의 변수들(U, V 여기서 U, V, < 2n 임)에 대한 뺄셈 연산 방법은 변수 U 및 변수 V에 대한 차이(U-V) 및 2n 의 합에 대한 기준값인 2n+(U-V) 으로부터 U 및 V 의 크기를 비교하는 연산을 수행하는 단계; 및 상기 비교 결과를 기반으로 상기 변수 U 및 상기 변수 V 에 대한 비트값의 보수로부터 덧셈 연산을 수행하여 상기 변수 U 및 상기 변수 V의 차이값을 연산하는 단계를 포함한다.The subtraction operation method for a plurality of variables (U, V where U, V, <2 n ) used in the Montgomery inverse algorithm according to an embodiment of the present invention may include a difference (UV) for the variable U and the variable V and performing a computation for comparing the magnitude of U and V from the 2 n + (UV) reference value for the sum of n 2; And performing an addition operation from the complement of the bit values of the variable U and the variable V based on the comparison result to calculate a difference value between the variable U and the variable V.

비교하는 연산을 수행하는 상기 단계는, 상기 기준값의 최상위 비트값을 고려하여 상기 변수 U 및 상기 변수 V 의 크기를 비교하는 단계를 포함할 수 있다.The performing of the comparing operation may include comparing the size of the variable U and the variable V in consideration of the most significant bit value of the reference value.

비교하는 연산을 수행하는 상기 단계는, 상기 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과에 대한 최상위 비트값을 고려하는 단계를 포함할 수 있다.The performing of the comparing operation may include considering the most significant bit value of the result of the addition operation on U + (~ V) +1 based on the value (~ V) inverting the bit value of the variable V. It may include.

비교하는 연산을 수행하는 상기 단계는, 상기 최상위 비트값이 '1'이면, 상기 변수 U가 상기 변수 V 보다 큰 것으로 판단하고, 상기 최상위 비트값이 '0'이면 상기 변수 V가 상기 변수 U 보다 큰 것으로 판단하는 단계를 포함할 수 있다.The performing of the comparing operation may include determining that the variable U is greater than the variable V when the most significant bit value is '1', and wherein the variable V is greater than the variable U when the most significant bit value is '0'. May be determined to be large.

차이값을 연산하는 상기 단계는, 상기 변수 U 가 상기 변수 V 보다 큰 경우, 상기 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과로부터 최상위 비트를 제거하여 상기 변수 U 및 상기 변수 V의 차이값을 연산할 수 있다.The step of calculating a difference value, when the variable U is greater than the variable V, based on the value (~ V) inverting the bit value of the variable V, the result of the addition operation for U + (~ V) + 1 The difference value between the variable U and the variable V may be calculated by removing the most significant bit from.

차이값을 연산하는 상기 단계는, 상기 변수 V 가 상기 변수 U 보다 큰 경우, 상기 변수 U의 비트값을 반전시킨 값(~U)을 기반으로, V+(~U)+1에 대한 덧셈 연산 결과로부터 최상위 비트를 제거하여 상기 변수 V 및 상기 변수 U의 차이값을 연산하는 단계를 포함할 수 있다.The step of calculating a difference value, when the variable V is greater than the variable U, based on the value (~ U) inverting the bit value of the variable U, the result of the addition operation for V + (~ U) + 1 And calculating a difference value between the variable V and the variable U by removing the most significant bit from the variable bit.

차이값을 연산하는 상기 단계는, 상기 변수 U 및 상기 변수 V 에 대한 각각의 비트값의 보수, (~U) 및 (~V) 로부터 U+(~V)+1 및 V+(~U)+1에 대한 덧셈 연산을 병렬적으로 연산하고, 상기 연산된 U+(~V)+1 및 상기 연산된 V+(~U)+1의 최상위 비트를 각각 제거하는 단계를 포함할 수 있다.The step of calculating the difference value is the complement of each bit value for the variable U and the variable V, from (~ U) and (~ V) to U + (~ V) +1 and V + (~ U) +1. Computing an add operation for and in parallel, and removing the most significant bits of the calculated U + (~ V) + 1 and the calculated V + (~ U) + 1, respectively.

차이값을 연산하는 상기 단계는, 상기 비교 연산부에서의 비교 결과를 기반으로 상기 연산된 U+(~V)+1 및 상기 연산된 V+(~U)+1 중 어느 하나를 선택하고, 선택된 어느 하나 값의 최상위 비트를 제거하여 상기 변수 V 및 상기 변수 U의 차이값을 연산하는 단계를 포함할 수 있다.The calculating of the difference value may include selecting any one of the calculated U + (~ V) +1 and the calculated V + (~ U) +1 based on the comparison result in the comparison operation unit, and selecting any one selected. Computing the difference value between the variable V and the variable U by removing the most significant bit of the value.

본 발명의 다른 실시예에 따른 몽고메리 역원 알고리즘에 사용되는 다수의 변수들(U, V 여기서 U, V, < 2n 임)에 대한 뺄셈 연산 방법에 있어서, 변수 U 및 변수 V의 각각에 대한 보수 연산을 병렬적으로 수행하는 단계; 상기 변수 U 및 변수 V와, 상기 보수 연산의 수행 결과인 (~V) 및 (~U)를 기반으로 U+(~V)+1 및 V+(~U)+1에 대한 덧셈 연산을 수행하는 단계; 및 상기 연산된 U+(~V)+1 및 상기 연산된 V+(~U)+1를 고려하여 상기 변수 U 및 상기 변수 V의 크기 비교 및 차이값을 동시에 출력하는 단계를 포함한다.In the subtraction operation method for a plurality of variables (U, V where U, V, <2 n ) used in the Montgomery inverse algorithm according to another embodiment of the present invention, the complement of each of the variables U and V Performing the operations in parallel; Performing an addition operation on U + (~ V) +1 and V + (~ U) +1 based on the variable U and the variable V and (~ V) and (~ U) which are the result of performing the complementary operation. ; And simultaneously outputting a comparison and difference between the variable U and the variable V in consideration of the calculated U + (~ V) +1 and the calculated V + (~ U) +1.

본 발명의 실시예에 따르면 몽고메리 역원알고리즘을 위한 크기 비교와 차이를 동시에 연산할 수 있다.According to an embodiment of the present invention, the size comparison and the difference for the Montgomery inverse algorithm can be simultaneously calculated.

또한, 본 발명의 실시예에 따르면 몽고메리 역원알고리즘에 사용되는 두 변수를 기반으로 보수 연산 및 덧셈 연산으로 크기 비교와 차이값을 동시에 연산이 가능하다.In addition, according to an embodiment of the present invention, based on two variables used in the Montgomery inverse algorithm, it is possible to simultaneously calculate the size comparison and the difference value using a complementary operation and an addition operation.

도 1은 본 발명의 일 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치의 구성을 도시한 블록도이다.
도 2는 본 발명의 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치의 비교 연산부의 구성을 도시한 것이다.
도 3은 본 발명의 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치의 뺄셈 연산부의 구성을 도시한 것이다.
도 4는 본 발명의 다른 실시예에 따른 몽고메리 역원알고리즘용 크기 비교와 차이값의 출력이 동시에 되는 뺄셈 연산 장치를 도시한 것이다.
도 5 내지 도 9는 본 발명의 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치를 활용한 유한체 원소에 대한 역원 연산 장치를 도시한 것이다.
도 10 내지 도 12는 본 발명의 일 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 방법을 설명하기 위해 도시한 흐름도이다.
도 13은 본 발명의 다른 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 방법을 설명하기 위해 도시한 흐름도이다.
1 is a block diagram showing the configuration of a subtraction operation apparatus for the Montgomery inverse algorithm according to an embodiment of the present invention.
2 illustrates a configuration of a comparison operation unit of a subtraction operation apparatus for the Montgomery inverse algorithm according to an embodiment of the present invention.
3 illustrates a configuration of a subtraction operation unit of a subtraction operation apparatus for the Montgomery inverse algorithm according to an embodiment of the present invention.
FIG. 4 illustrates a subtraction operation apparatus at which the size comparison for Montgomery inverse algorithm and the output of a difference value are simultaneously performed according to another embodiment of the present invention.
5 to 9 illustrate an inverse computing device for a finite element using a subtraction computing device for the Montgomery inverse algorithm of the present invention.
10 to 12 are flowcharts illustrating a subtraction operation method for the Montgomery inverse algorithm according to an embodiment of the present invention.
13 is a flowchart illustrating a subtraction operation method for the Montgomery inverse algorithm according to another embodiment of the present invention.

이하 첨부 도면들 및 첨부 도면들에 기재된 내용들을 참조하여 본 발명의 실시예를 상세하게 설명하지만, 본 발명이 실시예에 의해 제한되거나 한정되는 것은 아니다.Hereinafter, embodiments of the present invention will be described in detail with reference to the accompanying drawings and accompanying drawings, but the present invention is not limited to or limited by the embodiments.

한편, 본 발명을 설명함에 있어서, 관련된 공지 기능 또는 구성에 대한 구체적인 설명이 본 발명의 요지를 불필요하게 흐릴 수 있다고 판단되는 경우에는, 그 상세한 설명을 생략할 것이다. 그리고, 본 명세서에서 사용되는 용어(terminology)들은 본 발명의 실시예를 적절히 표현하기 위해 사용된 용어들로서, 이는 사용자, 운용자의 의도 또는 본 발명이 속하는 분야의 관례 등에 따라 달라질 수 있다. 따라서, 본 용어들에 대한 정의는 본 명세서 전반에 걸친 내용을 토대로 내려져야 할 것이다.
In the following description of the present invention, a detailed description of known functions and configurations incorporated herein will be omitted when it may make the subject matter of the present invention rather unclear. The terminology used herein is a term used for appropriately expressing an embodiment of the present invention, which may vary depending on the user, the intent of the operator, or the practice of the field to which the present invention belongs. Therefore, the definitions of these terms should be based on the contents throughout this specification.

도 1은 본 발명의 일 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치의 구성을 도시한 블록도이다.1 is a block diagram showing the configuration of a subtraction operation apparatus for the Montgomery inverse algorithm according to an embodiment of the present invention.

도 1을 참조하면, 본 발명의 일실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치(100)는 몽고메리 역원 알고리즘에 사용되는 다수의 변수들(U, V 여기서 U, V, < 2n 임)에 대하여 크기를 비교하여 그 차이값(U-V 또는 V-U)을 연산한다. 이를 위해, 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치(100)는 비교 연산부(110) 및 뺄셈 연산부(120)를 포함한다.Referring to Figure 1, the subtraction operation apparatus 100 for Montgomery inverse algorithm according to an embodiment of the present invention is a number of variables used in the Montgomery inverse algorithm (U, V where U, V, <2 n ) Compare the magnitudes with and calculate the difference (UV or VU). To this end, the subtraction operation apparatus 100 for the Montgomery inverse algorithm includes a comparison operation unit 110 and a subtraction operation unit 120.

비교 연산부(110)는 몽고메리 역원 알고리즘에 사용되는 다수의 변수들(U, V 여기서 U, V, < 2n 임) 중 변수 U 및 변수 V에 대한 차이(U-V) 및 2n 의 합에 대한 기준값인 2n+(U-V) 으로부터 U 및 V 의 크기를 비교하는 연산을 수행한다.The comparison operation unit 110 is a reference value for the sum of the difference (UV) and the sum of 2 n of the variable U and the variable V among a plurality of variables (U, V, where U, V, and <2 n ) used in the Montgomery inverse algorithm. An operation of comparing the magnitudes of U and V from 2 n + (UV) is performed.

실시예에 따라, 비교 연산부(110)는 기준값인 2n+(U-V)의 최상위 비트값을 고려하여 변수 U 및 변수 V 의 크기를 비교한다. 예를 들어, 비교 연산부(110)는 U ≥ V 인 즉, U-V ≥ 0 라면 2n+(U-V) ≥ 0 이므로 기준값인 2n+(U-V) 의 결과값 중 최상위 비트값이 '1' 이 경우로 판단한다. 반면, 비교 연산부(110)는 U < V 인 즉, U-V < 0 라면 2n+(U-V) < 0 이므로 기준값인 2n+(U-V) 의 결과값 중 최상위 비트값이 '0' 이 경우로 판단한다.According to an exemplary embodiment, the comparison operation unit 110 compares the sizes of the variables U and V by considering the most significant bit value of 2 n + (UV) which is a reference value. For example, the comparison operation unit 110 is U ≥ V, that is, if UV ≥ 0, 2 n + (UV) ≥ 0, if the most significant bit value of the result value of the reference value 2 n + (UV) is '1' Judging by. On the other hand, the comparison operation unit 110 determines that the most significant bit value of the result value of the reference value 2 n + (UV) is '0' because U <V, that is, if UV <0, 2 n + (UV) <0. do.

또한, 비교 연산부(110)는 기준값인 2n+(U-V)은 (2n-1-V)+U+1 와 등가관계에 있고, 상기 (2n-1-V) 는 변수 V 의 비트값을 반전시킨 값(~V), 즉 1의 보수로서 표현될 수 있기 때문에, 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과를 고려하여 변수 U 및 변수 V의 크기를 비교하는 연산을 수행할 수 있다.In addition, the comparison operation unit 110 has a reference value of 2 n + (UV) is equivalent to (2 n- 1-V) + U + 1, and (2 n- 1-V) is a bit value of the variable V. Since it can be expressed as an inverted value (~ V), that is, a complement of 1, the result of the addition operation on U + (~ V) +1 is based on the inverted value (~ V) of the bit value of the variable V. In consideration of this, an operation of comparing the sizes of the variables U and V may be performed.

보다 구체적으로는 비교 연산부(110)는 기준값인 2n+(U-V)의 최상위 비트값이 '1'이면, 변수 U가 변수 V 보다 큰 것으로 판단하고, 최상위 비트값이 '0'이면 변수 V가 변수 U 보다 큰 것으로 판단한다.More specifically, the comparison operation unit 110 determines that the variable U is greater than the variable V when the most significant bit value of the reference value 2 n + (UV) is '1', and the variable V is the most significant bit value of the value '0'. It is determined to be greater than the variable U.

뺄셈 연산부(120)는 비교 연산부(120)에서의 비교 결과를 기반으로 변수 U 및 변수 V 에 대한 비트값의 보수로부터 덧셈 연산을 수행하여 U 및 V의 차이값을 연산한다.The subtraction operator 120 calculates a difference between U and V by performing an addition operation from the complement of the bit values of the variables U and V based on the comparison result of the comparison operator 120.

실시예에 따라, 뺄셈 연산부(120)는 비교 연산부(110)가 변수 U 가 변수 V 보다 크다고 판단한 경우(U ≥ V), 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과로부터 최상위 비트를 제거하여 변수 U 및 변수 V의 차이값(U-V)을 연산한다. According to an exemplary embodiment, when the comparison operator 110 determines that the variable U is greater than the variable V (U ≥ V), the subtraction operator 120 based on the inverted bit value of the variable V (~ V), U + Compute the difference value UV between the variable U and the variable V by removing the most significant bit from the result of the addition operation for (~ V) +1.

즉, 뺄셈 연산부(120)는 변수 U 가 변수 V 보다 크다고 판단한 경우(U ≥ V), 상기 변수 U 및 변수 V 의 차이(U-V)인 U-V = 2n+(U-V)-2n = U+(2n-1-V)+1-2n = U+(~V)+1??2n 과 등가관계에 있고, 상기 (2n-1-V) 는 변수 V 의 비트값을 반전시킨 값(~V), 즉 1의 보수로서 표현될 수 있기 때문에, 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 덧셈 연산 결과로부터 최상위 비트를 제거하여 변수 U 및 변수 V의 차이값(U-V)을 연산한다.That is, when the subtraction operation unit 120 determines that the variable U is larger than the variable V (U ≥ V), UV = 2 n + (UV) -2 n = U + (2), which is the difference (UV) between the variable U and the variable V. n- 1-V) + 1-2 n = U + (~ V) +1 ?? 2 n , which is equivalent to (2 n- 1-V), where the value of the inverted bit value of the variable V (~ V), i.e., it can be expressed as a complement of one, thus removing the most significant bit from the result of the addition operation addition operation on U + (~ V) +1, based on the inverted value of the variable V (~ V). Calculates the difference (UV) between the variable U and the variable V.

반면, 뺄셈 연산부(120)는 비교 연산부(110)가 변수 V 가 변수 U 보다 크다고 판단한 경우(U < V), 변수 U의 비트값을 반전시킨 값(~U)을 기반으로, V+(~U)+1에 대한 덧셈 연산 결과로부터 최상위 비트를 제거하여 변수 V 및 변수 U의 차이값(V-U)을 연산한다.On the other hand, when the comparison operation unit 110 determines that the variable V is larger than the variable U (U <V), the subtraction operation unit 120 based on the value inverted the bit value of the variable U (~ U), V + (~ U The difference value (VU) of the variables V and U is calculated by removing the most significant bit from the result of the addition operation for) +1.

즉, 비교 연산부(110)는 변수 V 가 변수 U 보다 크다고 판단한 경우(U < V), 상기 변수 V 및 변수 U 의 차이(V-U)인 V-U = 2n+(V-U)-2n = V+(2n-1-U)+1-2n = V+(~U)+1??2n 과 등가관계에 있고, 상기 (2n-1-U) 는 변수 U 의 비트값을 반전시킨 값(~U), 즉 1의 보수로서 표현될 수 있기 때문에, 변수 U의 비트값을 반전시킨 값(~U)을 기반으로, V+(~U)+1 에 대한 덧셈 연산 결과로부터 최상위 비트를 제거하여 변수 V 및 변수 U의 차이값(V-U)을 연산한다.That is, when the comparison operation unit 110 determines that the variable V is greater than the variable U (U <V), VU = 2 n + (VU) -2 n = V + (2), which is the difference (VU) between the variable V and the variable U. n- 1-U) + 1-2 n = V + (~ U) +1 ?? 2 n, and (2 n- 1-U) is an inverted bit value of the variable U (~ U), i.e., it can be expressed as 1's complement, so that the variable is removed by removing the most significant bit from the result of the addition operation on V + (~ U) +1, based on the inverted value of the variable U (~ U). Compute the difference value VU of V and the variable U.

실시예에 따라서는 뺄셈 연산부(120)는 변수 U 및 변수 V 에 대한 각각의 비트값의 보수, (~U) 및 (~V) 로부터 U+(~V)+1 및 V+(~U)+1에 대한 덧셈 연산을 병렬적으로 연산하고, 병렬적으로 연산된 U+(~V)+1 및 V+(~U)+1의 최상위 비트를 각각 제거하여 변수 U 및 V 에 대한 차이값을 연산할 수도 있다.According to an exemplary embodiment, the subtraction operator 120 may complement U + (~ V) +1 and V + (~ U) +1 from the complement of each bit value for the variable U and the variable V, (~ U) and (~ V). You can compute the difference values for the variables U and V by performing the addition operation on the parallel and removing the most significant bits of U + (~ V) +1 and V + (~ U) +1 respectively. have.

또한, 실시예에 따라서는 뺄셈 연산부(120)는 비교 연산부(110)에서의 비교 결과를 기반으로, 연산된 U+(~V)+1 및 연산된 V+(~U)+1 중 어느 하나를 선택하고, 선택된 어느 하나 값의 최상위 비트를 제거하여 변수 V 및 변수 U의 차이값을 연산할 수도 있다. In addition, according to the exemplary embodiment, the subtraction operator 120 selects one of the calculated U + (~ V) +1 and the calculated V + (~ U) +1 based on the comparison result in the comparison operation unit 110. The difference between the variable V and the variable U may be calculated by removing the most significant bit of the selected one value.

이하에서는 도 2를 참고하여 본 발명의 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치(100)의 비교 연산부(110)를 상세히 설명하기로 한다.
Hereinafter, the comparison operation unit 110 of the subtraction operation apparatus 100 for the Montgomery inverse algorithm according to an embodiment of the present invention will be described in detail with reference to FIG. 2.

도 2는 본 발명의 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치의 비교 연산부의 구성을 도시한 것이다.2 illustrates a configuration of a comparison operation unit of a subtraction operation apparatus for the Montgomery inverse algorithm according to an embodiment of the present invention.

비교 연산부(110)는 몽고메리 역원 알고리즘에 사용되는 변수 U 및 변수 V에 대한 입력 신호들(In_comp u 및 In_comp v)로부터 그 크기를 비교한 결과 신호(o_is u large)를 출력한다.The comparison operation unit 110 outputs a signal o_is u large as a result of comparing the magnitudes of the input signals In_comp u and In_comp v for the variables U and V used in the Montgomery inverse algorithm.

비교 연산부(110)는 변수 U 및 변수 V 차이(U-V) 및 2n 의 합에 대한 기준값인 2n+(U-V) 으로부터 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과를 고려할 수 있다. The comparison operation unit 110 is based on a value (~ V) in which the bit value of the variable V is inverted from 2 n + (UV) which is a reference value for the sum of the variable U and the variable V difference (UV) and 2 n , and U + ( Consider the result of the addition operation on ~ V) +1.

비교 연산부(110)는 기준값인 2n+(U-V)은 (2n-1-V)+U+1 와 등가관계에 있고, 상기 (2n-1-V) 는 변수 V 의 비트값을 반전시킨 값(~V), 즉 1의 보수로서 표현될 수 있기 때문에, 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과로부터 변수 U 및 변수 V의 크기를 비교할 수 있다.The comparison operation unit 110 has a reference value 2 n + (UV) is equivalent to (2 n- 1-V) + U + 1, and (2 n- 1-V) inverts the bit value of the variable V. Since it can be expressed as a complement value (~ V), that is, a complement of one, the variable U from the result of the addition operation on U + (~ V) +1 is based on the inverted value of the variable V (~ V). And the magnitude of the variable V can be compared.

보다 구체적으로는 비교 연산부(110)는 기준값인 U+(~V)+1 의 최상위 비트값이 '1'이면, 변수 U가 변수 V 보다 큰 것으로 판단하고, 최상위 비트값이 '0'이면 변수 V가 변수 U 보다 큰 것으로 판단한다.More specifically, the comparison operation unit 110 determines that the variable U is greater than the variable V when the most significant bit value of the reference value U + (~ V) +1 is '1', and the variable V if the most significant bit value is '0'. Is determined to be greater than the variable U.

도 2를 참고하면, 비교 연산부(110)는 보수연산부(111) 및 덧셈부(112)를 포함할 수 있다. 보수 연산부(111)는 224비트의 변수 V에 대한 입력 신호(In_comp v)의 비트값을 반전시키고, 덧셈부(112)는 224비트의 변수 U에 대한 입력 신호(In_comp U), 보수 연산부(111)로부터 비트값이 반전된 (~V), 및 '1' 에 대하여 덧셈 연산을 수행하여 225 비트의 결과값을 출력한다. Referring to FIG. 2, the comparison operation unit 110 may include a maintenance operator 111 and an adder 112. The complement operator 111 inverts the bit value of the input signal In_comp v for the variable V of 224 bits, and the adder 112 inputs the signal In_comp U for the variable U of 224 bits, and the complement operator 111. A sum operation is performed on the inverted bit value (~ V) and '1', and a result value of 225 bits is output.

비교 연산부(110)는 225비트의 U+(~V)+1 에 대한 덧셈 연산 결과의 최상위 비트값을 고려하여 상기 최상위 비트값이 '1'이면, 변수 U가 변수 V 보다 큰 것으로 판단하고, 최상위 비트값이 '0'이면 변수 V가 변수 U 보다 큰 것으로 판단하고, 결과 신호(o_is u large)를 출력한다.The comparison operation unit 110 determines that the variable U is greater than the variable V when the most significant bit value is '1' in consideration of the most significant bit value of the addition operation result of 225 bits of U + (~ V) +1. If the bit value is '0', it is determined that the variable V is larger than the variable U, and the resultant signal o_is u large is output.

이하에서는 도 3을 참고하여 본 발명의 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치(100)의 뺄셈 연산부(120)를 상세히 설명하기로 한다.
Hereinafter, the subtraction operator 120 of the subtraction operator 100 for the Montgomery inverse algorithm according to an embodiment of the present invention will be described in detail with reference to FIG. 3.

도 3은 본 발명의 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치의 뺄셈 연산부의 구성을 도시한 것이다.3 illustrates a configuration of a subtraction operation unit of a subtraction operation apparatus for the Montgomery inverse algorithm according to an embodiment of the present invention.

뺄셈 연산부(120)는 몽고메리 역원 알고리즘에 사용되는 변수 U 및 변수 V에 대한 입력 신호들(In_minus u 및 In_minus v)로부터 그 차이값에 대한 결과 신호(o_u minus v)를 출력한다.The subtraction operator 120 outputs a result signal o_u minus v for the difference value from the input signals In_minus u and In_minus v for the variables U and V used in the Montgomery inverse algorithm.

뺄셈 연산부(120)는 변수 U 및 변수 V 차이(U-V)가 U+(~V)+1??2n 로부터 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과를 고려할 수 있다. Subtraction operator 120 is based on the value (~ V) in which the variable U and the variable V difference (UV) inverts the bit value of the variable V from U + (~ V) + 1 ?? 2 n , U + (~ V) Consider the result of the addition operation on +1.

뺄셈 연산부(120)는 변수 U 가 변수 V 보다 크다고 판단한 경우(U ≥ V), 상기 변수 U 및 변수 V 의 차이(U-V)인 U-V = 2n+(U-V)-2n = U+(2n-1-V)+1-2n = U+(~V)+1??2n 과 등가관계에 있고, 상기 (2n-1-V) 는 변수 V 의 비트값을 반전시킨 값(~V), 즉 1의 보수로서 표현될 수 있기 때문에, 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 덧셈 연산 결과로부터 최상위 비트를 제거하여 변수 U 및 변수 V의 차이값(U-V)을 연산한다.When the subtraction operation unit 120 determines that the variable U is greater than the variable V (U ≥ V), UV = 2 n + (UV) -2 n = U + (2 n −, which is the difference (UV) between the variable U and the variable V). 1-V) + 1-2 n = U + (~ V) +1 ?? 2 n, and (2 n- 1-V) is the value inverting the bit value of the variable V (~ V) In other words, since it can be expressed as a complement of 1, the variable is removed by removing the most significant bit from the result of the addition operation on U + (~ V) +1 based on the inverted value of the variable V (~ V). Compute the difference value UV between U and the variable V.

도 3을 참고하면, 뺄셈 연산부(120)는 보수연산부(121) 및 덧셈부(122)를 포함할 수 있다. 보수 연산부(121)는 224비트의 변수 V에 대한 입력 신호(In_minus v)의 비트값을 반전시키고, 덧셈부(112)는 224비트의 변수 U에 대한 입력 신호(In_munus u), 보수 연산부(121)로부터 비트값이 반전된 (~V), 및 '1' 에 대하여 덧셈 연산을 수행하여 225 비트의 결과값을 출력한다. Referring to FIG. 3, the subtraction operator 120 may include a complement operator 121 and an adder 122. The complement operator 121 inverts the bit value of the input signal In_minus v for the variable V of 224 bits, and the adder 112 inputs the signal In_munus u for the variable U of 224 bits, and the complement operator 121. A sum operation is performed on the inverted bit value (~ V) and '1', and a result value of 225 bits is output.

뺄셈 연산부(110)는 225비트의 U+(~V)+1 에 대한 덧셈 연산 결과의 최상위 비트값을 제거하여 변수 U 및 변수 V의 차이값(U-V)에 대한 결과 신호(o_u minus v)를 출력한다.The subtraction operation unit 110 outputs the result signal o_u minus v for the difference value UV of the variable U and the variable V by removing the most significant bit value of the addition operation result of 225 bits of U + (~ V) +1. do.

이하에서는 도 4를 참조하여, 몽고메리 역원알고리즘용 크기 비교와 차이값의 출력이 동시에 되는 뺄셈 연산 장치를 상세히 설명하기로 한다.
Hereinafter, with reference to FIG. 4, a subtraction operation apparatus in which the size comparison for Montgomery inverse algorithm and the output of the difference value are simultaneously described will be described in detail.

도 4는 본 발명의 다른 실시예에 따른 몽고메리 역원알고리즘용 크기 비교와 차이값의 출력이 동시에 되는 뺄셈 연산 장치를 도시한 것이다.FIG. 4 illustrates a subtraction operation apparatus at which the size comparison for Montgomery inverse algorithm and the output of a difference value are simultaneously performed according to another embodiment of the present invention.

도 4를 참고하면 본 발명의 다른 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치(200)는 보수 연산부 및 덧셈부를 포함한다.Referring to FIG. 4, the subtraction operation apparatus 200 for the Montgomery inverse algorithm according to another embodiment of the present invention includes a complement operation unit and an addition unit.

보수 연산부는 224비트의 변수 U 및 변수 V의 각각에 대한 보수 연산을 병렬적으로 수행한다. 실시예에 따라 보수 연산부는 변수 U 의 입력 신호(In_sub_u)에 대한 보수 연산을 수행하는 제1 보수 연산부(210) 및 변수 V 의 입력 신호(In_sub_v)에 대한 보수 연산을 수행하는 제2 보수 연산부(230)를 포함할 수 있다.The complement operation unit performs a complement operation on each of the 224 bit variables U and V in parallel. According to an embodiment, the complement operation unit may perform a complement operation on the input signal In_sub_u of the variable U and the second complement operation unit performing a complement operation on the input signal In_sub_v of the variable V. 230).

덧셈부는 변수 U 및 변수 V와, 보수 연산의 수행 결과인 (~V) 및 (~U)를 기반으로 U+(~V)+1 및 V+(~U)+1에 대한 덧셈 연산을 수행한다. 실시예에 따라 덧셈부는 (1) 변수 U, 보수 연산의 수행 결과인 (~V), 및 '1' 에 대한 덧셈 연산(U+(~V)+1)을 수행하는 제1 덧셈기(220)와, (2) 변수 V, 보수 연산의 수행 결과인 (~U), 및 '1' 에 대한 덧셈 연산(V+(~U)+1)을 수행하는 제2 덧셈기(240)를 포함할 수 있다. The adder performs an addition operation on U + (~ V) +1 and V + (~ U) +1 based on the variables U and V, and (~ V) and (~ U) which are the result of the complement operation. According to an embodiment, the adder includes: (1) a first adder 220 which performs a variable U, a result of performing a complementary operation (~ V), and an addition operation (U + (~ V) +1) for '1'; , (2) a variable V, a complementary operation (~ U), and a second adder 240 performing an addition operation (V + (~ U) +1) on '1'.

본 발명의 다른 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치(200)는 제1 덧셈기(220)로부터의 225비트의 U+(~V)+1 에 대한 덧셈 연산 결과의 최상위 비트값을 고려하여 상기 최상위 비트값이 '1'이면, 변수 U가 변수 V 보다 큰 것으로 판단하고, 최상위 비트값이 '0'이면 변수 V가 변수 U 보다 큰 것으로 판단하고, 제1 결과 신호(o_is u large)를 출력한다.The subtraction operation apparatus 200 for the Montgomery inverse algorithm according to another embodiment of the present invention considers the most significant bit value of the addition operation result for U + (~ V) +1 of 225 bits from the first adder 220. If the most significant bit value is '1', it is determined that the variable U is greater than the variable V. If the most significant bit value is '0', the variable V is greater than the variable U, and the first result signal o_is u large is determined. Output

또한, 본 발명의 다른 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치(200)는 제1 덧셈기(220)로부터의 225비트의 U+(~V)+1 에 대한 덧셈 연산 결과의 최상위 비트값을 제거하여 변수 U 및 변수 V의 차이값(U-V)에 대한 결과 신호(o_u sub v)를 출력한다.In addition, the subtraction operation apparatus 200 for the Montgomery inverse algorithm according to another embodiment of the present invention calculates the most significant bit value of the addition operation result for U + (~ V) +1 of 225 bits from the first adder 220. The resultant signal o_u sub v for the difference value UV between the variable U and the variable V is removed.

반면, 본 발명의 다른 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치(200)는 제2 덧셈기(240)로부터의 225비트의 V+(~U)+1 에 대한 덧셈 연산 결과의 최상위 비트값을 제거하여 변수 V 및 변수 U의 차이값(V-U)에 대한 결과 신호(o_v sub u)를 출력한다.On the other hand, the subtraction operation apparatus 200 for the Montgomery inverse algorithm according to another embodiment of the present invention calculates the most significant bit value of the addition operation result for V + (~ U) +1 of 225 bits from the second adder 240. The resultant signal o_v sub u for the difference value VU between the variable V and the variable U is output.

본 발명의 실시예에 따르면 몽고메리 역원알고리즘에 사용되는 두 변수에 대한 보수연산 결과를 기반으로 하는 덧셈 연산의 수행 결과로부터 크기 비교와 차이값을 동시에 연산할 수 있다.
According to an embodiment of the present invention, the size comparison and the difference value may be simultaneously calculated from the result of the addition operation based on the complementary result of two variables used in the Montgomery inverse algorithm.

도 5 내지 도 9는 본 발명의 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치를 활용한 유한체 원소에 대한 역원 연산 장치를 설명하기 위해 도시한 것으로서, 도 5는 역원 연산 장치의 구성을 도시한 것이고, 도 6 및 도 7은 도 5의 역원 연산 장치의 변수들에 대한 제1 연산부 및 제2 연산부의 구성을 설명하기 위해 도시한 것이며, 도 8 은 도 5의 역원 연산 장치의 조건 생성부의 구성을 도시한 것이고, 도 9는 조건 생성부로부터의 변수의 zero 여부를 판단하는 구성을 도시한 것이다.5 to 9 illustrate the inverse computing device for the finite element using the subtraction operation device for the Montgomery inverse algorithm of the present invention, and FIG. 5 illustrates the configuration of the inverse computing device. 6 and 7 are views for explaining the configuration of the first operation unit and the second operation unit for the variables of the inverse arithmetic operation apparatus of FIG. 5, FIG. 9 illustrates a configuration for determining whether a variable from the condition generator is zero.

본 발명의 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치를 활용한 역원 연산 장치(300)는 하기 표 1과 같은 역원 알고리즘을 수행할 수 있다.The inverse calculation apparatus 300 using the subtraction operation apparatus for the Montgomery inverse algorithm of the present invention may perform the inverse algorithm shown in Table 1 below.

[표 1][Table 1]

Figure 112013045587085-pat00001

Figure 112013045587085-pat00001

도 5를 참고하면, 본 발명의 본 발명의 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치를 활용한 유한체 원소에 대한 역원 연산 장치(300)는 조건 생성부(210, condition Gen), 제1 연산부(220, calUV), 제2 연산부(230, calRS) 및 제어부(240, controlLogic)를 포함한다.Referring to FIG. 5, the inverse calculating device 300 for the finite element using the subtraction calculating device for the Montgomery inverse algorithm according to the present invention includes a condition generating unit 210 and a first calculating unit 220. , calUV), a second calculator 230, and a controller 240 (controlLogic).

도 5 및 도 8을 참조하면, 조건 생성부(210, condition Gen)는 제어부(240, controlLogic)와 신호를 주고 받으며, clk 및 rst 값에 대응하여 k 값을 0부터 1씩 증가시키면서 k가 2n 보다 작을 때까지를 계산하기 위하여 k 값을 1씩 증가시켜 레지스터에 저장하여 9비트 신호를 선언, 512비트까지 값을 증가시킨다.5 and 8, the condition generator 210 (condition Gen) exchanges a signal with the control unit 240 (controlLogic), and k increases the value of k from 0 to 1 in correspondence with the clk and rst values. To calculate until smaller, increase the value of k by 1 and store it in a register to declare a 9-bit signal and increase the value to 512 bits.

본 발명의 실시예에 다르면, 224비트 기준인 경우, 조건 생성부(210, condition Gen)는 k 값을 448까지 증가시키고, 9비트의 신호가 필요하게 되어 k 값을 제어부(240)로 가져오기 위한 1비트의 동기신호가 요구된다. According to an embodiment of the present invention, in the case of the 224-bit reference, the condition generator 210 (condition Gen) increases the k value to 448 and requires a 9-bit signal to bring the k value to the controller 240. 1 bit synchronization signal is required.

도 5 및 도 7을 참조하면, 제1 연산부(220, calUV)는 표 1에서의 역원 알고리즘에 있어 변수 U 및 V 에 대한 연산을 수행한다. 보다 구체적으로, 제1 연산부(220, calUV)는 상기 표 1에서의 알고리즘 중 while 구문의 4.1.1 의 U0 = 0 인 경우, U를 2로 나누어 다시 U로 지정하는 경우, 4.1.3 의 U > V 인 경우, (U-V)/2를 하여 다시 U에 지정하는 경우, U 에 초기값을 저장 부분, U 값을 그대로 유지시키는 4가지 연산의 경우에 대하여, 상기 4가지 수행 연산을 선택기(Mux)를 통하여 한 clk 동안 4가지 수행 연산 결과 중 하나의 값을 선택하여 레지스터에 저장하고 각 동기에 맞춰 값을 선택한다. 5 and 7, the first operation unit 220 (calUV) performs operations on the variables U and V in the inverse algorithm shown in Table 1. More specifically, the first calculation unit 220 (calUV), when U 0 = 0 in 4.1.1 of the while statement in the algorithm of Table 1, divides U into 2 and designates U again, In the case of U> V, if (UV) / 2 is assigned to U, the four performing operations are selected for the four operations in which the initial value is stored in U and the U value is kept as it is. Mux) selects the value of one of four execution results during one clk, stores it in a register, and selects the value for each sync.

실시예에 따라, 제1 연산부(220, calUV)는 변수 V 에 대해서도 전술한 바와 같은 동일한 연산을 수행할 수 있다.According to an embodiment, the first calculator 220 (calUV) may perform the same operation as described above with respect to the variable V.

도 5 및 도 6을 참조하면, 제2 연산부(230, calRS)는 표 1에서의 역원 알고리즘에 있어 변수 R 및 S 에 대한 연산을 수행한다. 예를 들면, 제2 연산부(230, calRS)는 변수 R 에 대해서는 5가지 연산을, S 에 대해서는 4가지의 연산을 수행한다. 5 and 6, the second operation unit 230 (calRS) performs operations on variables R and S in the inverse algorithm in Table 1. For example, the second calculating unit 230 (calRS) performs five operations on the variable R and four operations on the S.

구체적으로 변수 S에 대하여 제2 연산부(230, calRS)는 S 를 2배하여 다시 S에 지정하는 경우, S 의 초기값을 지정하는 경우, S에서 R 의 차이를 구하여 S에 지정하는 경우, S 의 값을 그대로 지정하는 경우에 대하여 제1 연산부와 유사하게 선택기(Mux)를 사용하여 4가지의 연산을 수행한다. 변수 R 에 대해서는 전술한 4가지 연산 이외에 제2 연산부(230, calRS)는 조건 생성부(310)에 의한 k 값이 448까지 증가되어 변수 R 의 경우 변수 P 보다 같거나 큰 경우가 발생하는 경우로서, 최고차 항을 낮추기 위한 mode P 연산을 한 번 더 하는 경우를 더 수행한다. 이 경우, 제2 연산부(230, calRS)는 R 에서 P 를 뺀 값을 R 에 다시 지정하는 경우로서, 5가지의 연산 수행 결과에서 선택기(Mux)를 통하여 어느 하나의 값을 선택한다. Specifically, when the second calculation unit 230 (calRS) doubles S and assigns S to the variable S, when the initial value of S is specified, when the difference between R is obtained from S and assigned to S, Similarly to the first operation unit, four operations are performed using the selector Mux in the case of specifying the value of. For the variable R, in addition to the four operations described above, the second calculating unit 230 (calRS) may increase the value of k by the condition generator 310 to 448 so that the variable R may be equal to or larger than the variable P. In this case, the mode P operation is performed once more to lower the highest order term. In this case, the second calculation unit 230 (calRS) is a case in which R is a value obtained by subtracting P from R, and selects one value through a selector Mux from five calculation results.

제어부(340)는 조건 생성부(210, condition Gen), 제1 연산부(220, calUV), 제2 연산부(230, calRS) 들이 동기 신호에 맞춰 연관 연산 신호를 생성하여 주고 받을 수 있도록 타이밍을 조절한다. 실시예에 따라서는 선택기(Mux)를 통한 변수들의 값들의 레지스터에 저장하고 독출하는 과정을 논리적인 흐름(IF, CASE 문)과 같이 순차적인 흐름을 제어한다. The controller 340 adjusts the timing so that the condition generator 210 (condition Gen), the first calculator 220 (calUV), and the second calculator 230 (calRS) can generate and receive an associated operation signal according to the synchronization signal. do. According to the embodiment, the process of storing and reading the registers of the values of the variables through the selector Mux controls the sequential flow such as a logical flow (IF, CASE statement).

이를 통해 제어부(340)는 모든 역원 알고리즘의 선언된 변수들의 초기값을 정의하고, 로직의 흐름에 따라 동기를 맞춰 조건 생성부(210, condition Gen), 제1 연산부(220, calUV), 제2 연산부(230, calRS) 간의 충돌을 방지한다.
Through this, the control unit 340 defines initial values of the declared variables of all the inverse algorithms, and synchronizes according to the flow of logic to generate the condition generator 210 (condition Gen), the first operation unit 220 (calUV), and the second. The collision between the calculation units 230 and calRS is prevented.

도 10 내지 도 12는 본 발명의 일 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 방법을 설명하기 위해 도시한 흐름도이다.10 to 12 are flowcharts illustrating a subtraction operation method for the Montgomery inverse algorithm according to an embodiment of the present invention.

도 10을 참조하면, 몽고메리 역원 알고리즘에 사용되는 다수의 변수들(U, V 여기서 U, V, < 2n 임)에 대한 뺄셈 연산 방법의 1010 단계에서 변수 U 및 변수 V에 대한 차이(U-V) 및 2n 의 합에 대한 기준값인 2n+(U-V) 으로부터 U 및 V 의 크기를 비교하는 연산을 수행한다. 이하에서는 도 11을 참고하여 1010 단계를 보다 상세히 설명하기로 한다.Referring to FIG. 10, the difference (UV) for the variables U and V in step 1010 of the subtraction operation method for a plurality of variables (U, V where U, V, and <2 n ) used in the Montgomery inverse algorithm. and it performs the operation for comparing the magnitude of U and V from the sum of 2 n 2 n + (UV) for the reference value of. Hereinafter, operation 1010 will be described in more detail with reference to FIG. 11.

도 11을 참조하면, 단계 1011에서 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과에 대한 최상위 비트값을 고려한다. Referring to FIG. 11, the most significant bit value for the result of the addition operation on U + (˜V) +1 is considered based on the value (˜V) inverting the bit value of the variable V in step 1011.

1012 단계에서 덧셈 연산 결과에 대한 최상위 비트값이 '1'인지 여부를 판단하여, 1012 단계에서 상기 최상위 비트값이 '1' 이면, 1013 단계에서 변수 U가 변수 V보다 큰 것으로 판단하고, 1012 단계에서 상기 최상위 비트값이 '1' 이 아닌 경우에는 1014 단계에서 변수 V가 변수 U 보다 큰 것으로 판단한다.
In step 1012, it is determined whether the most significant bit value for the addition operation result is '1'. If the most significant bit value is '1' in step 1012, it is determined that the variable U is greater than the variable V in step 1013, and in step 1012. If the most significant bit value is not '1' in step 1014 it is determined that the variable V is greater than the variable U.

다시 도 10을 참조하면, 1020 단계에서 비교 결과를 기반으로 변수 U 및 변수 V 에 대한 비트값의 보수로부터 덧셈 연산을 수행하여 변수 U 및 변수 V 의 차이값을 연산한다. 이하에서는 도 12를 참고하여 1020 단계를 보다 상세히 설명하기로 한다. Referring back to FIG. 10, in operation 1020, a difference operation between the variables U and V is calculated by performing an addition operation from the complement of bit values for the variables U and V based on the comparison result. Hereinafter, step 1020 will be described in more detail with reference to FIG. 12.

도 12를 참조하면, 1021 단계에서 변수 U 및 변수 V 의 크기 판단 결과를 고려하고, 1022 단계에서 상기 크기 판단 결과로부터 변수 U가 변수 V보다 큰 경우라고 판단된 경우에는 1023 단계에서 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1에 대한 덧셈 연산 결과로부터 최상위 비트를 제거하여 변수 U 및 변수 V의 차이값을 연산한다.Referring to FIG. 12, when the size U of the variable U and the variable V are determined in step 1021, and the size U is determined to be greater than the variable V from the size determination result in step 1022, the bits of the variable V in step 1023. Based on the inverted value (~ V), the difference value between the variable U and the variable V is calculated by removing the most significant bit from the result of the addition operation on U + (~ V) +1.

반면, 1022 단계에서 상기 크기 판단 결과로부터 변수 V가 변수 U보다 큰 경우라고 판단된 경우에는 1024 단계에서 변수 U의 비트값을 반전시킨 값(~U)을 기반으로, V+(~U)+1에 대한 덧셈 연산 결과로부터 최상위 비트를 제거하여 변수 V 및 변수 U의 차이값을 연산한다.
On the other hand, when it is determined in step 1022 that the variable V is larger than the variable U from the size determination result, V + (~ U) +1 based on the value (~ U) inverting the bit value of the variable U in step 1024. Compute the difference between the variable V and the variable U by removing the most significant bit from the result of the addition operation for.

도 13은 본 발명의 다른 실시예에 따른 몽고메리 역원알고리즘을 위한 뺄셈 연산 방법을 설명하기 위해 도시한 흐름도이다.13 is a flowchart illustrating a subtraction operation method for the Montgomery inverse algorithm according to another embodiment of the present invention.

도 13을 참조하면, 몽고메리 역원 알고리즘에 사용되는 다수의 변수들(U, V 여기서 U, V, < 2n 임)에 대한 뺄셈 연산 방법의 1310 단계에서 변수 U 및 변수 V의 각각에 대한 보수 연산을 병렬적으로 수행한다.Referring to FIG. 13, in operation 1310 of the subtraction operation method for a plurality of variables (U, V, where U, V, and <2 n ) used in the Montgomery inverse algorithm, a complement operation for each of the variables U and V is performed. In parallel.

1320 단계에서 변수 U 및 변수 V와, 보수 연산의 수행 결과인 (~V) 및 (~U)를 기반으로 U+(~V)+1 및 V+(~U)+1에 대한 덧셈 연산을 수행을 수행한다.In operation 1320, an addition operation is performed on U + (~ V) +1 and V + (~ U) +1 based on the variables U and V and the results of the complementary operation (~ V) and (~ U). Perform.

1330 단계에서 연산된 U+(~V)+1 및 연산된 V+(~U)+1를 고려하여 변수 U 및 변수 V의 크기 비교 및 차이값을 동시에 출력한다.
In consideration of U + (~ V) +1 and V + (~ U) +1 calculated in operation 1330, the size comparison and difference values of the variables U and V are simultaneously output.

실시예에 따른 방법은 다양한 컴퓨터 수단을 통하여 수행될 수 있는 프로그램 명령 형태로 구현되어 컴퓨터 판독 가능 매체에 기록될 수 있다. 상기 컴퓨터 판독 가능 매체는 프로그램 명령, 데이터 파일, 데이터 구조 등을 단독으로 또는 조합하여 포함할 수 있다. 상기 매체에 기록되는 프로그램 명령은 실시예를 위하여 특별히 설계되고 구성된 것들이거나 컴퓨터 소프트웨어 당업자에게 공지되어 사용 가능한 것일 수도 있다. 컴퓨터 판독 가능 기록 매체의 예에는 하드 디스크, 플로피 디스크 및 자기 테이프와 같은 자기 매체(magnetic media), CD-ROM, DVD와 같은 광기록 매체(optical media), 플롭티컬 디스크(floptical disk)와 같은 자기-광 매체(magneto-optical media), 및 롬(ROM), 램(RAM), 플래시 메모리 등과 같은 프로그램 명령을 저장하고 수행하도록 특별히 구성된 하드웨어 장치가 포함된다. 프로그램 명령의 예에는 컴파일러에 의해 만들어지는 것과 같은 기계어 코드뿐만 아니라 인터프리터 등을 사용해서 컴퓨터에 의해서 실행될 수 있는 고급 언어 코드를 포함한다. 상기된 하드웨어 장치는 실시예의 동작을 수행하기 위해 하나 이상의 소프트웨어 모듈로서 작동하도록 구성될 수 있으며, 그 역도 마찬가지이다.The method according to an embodiment may be implemented in the form of a program command that can be executed through various computer means and recorded in a computer-readable medium. The computer-readable medium may include program instructions, data files, data structures, and the like, alone or in combination. The program instructions to be recorded on the medium may be those specially designed and configured for the embodiments or may be available to those skilled in the art of computer software. Examples of computer-readable media include magnetic media such as hard disks, floppy disks and magnetic tape; optical media such as CD-ROMs and DVDs; magnetic media such as floppy disks; Magneto-optical media, and hardware devices specifically configured to store and execute program instructions such as ROM, RAM, flash memory, and the like. Examples of program instructions include machine language code such as those produced by a compiler, as well as high-level language code that can be executed by a computer using an interpreter or the like. The hardware devices described above may be configured to operate as one or more software modules to perform the operations of the embodiments, and vice versa.

이상과 같이 실시예들이 비록 한정된 실시예와 도면에 의해 설명되었으나, 해당 기술분야에서 통상의 지식을 가진 자라면 상기의 기재로부터 다양한 수정 및 변형이 가능하다. 예를 들어, 설명된 기술들이 설명된 방법과 다른 순서로 수행되거나, 및/또는 설명된 시스템, 구조, 장치, 회로 등의 구성요소들이 설명된 방법과 다른 형태로 결합 또는 조합되거나, 다른 구성요소 또는 균등물에 의하여 대치되거나 치환되더라도 적절한 결과가 달성될 수 있다. While the present invention has been particularly shown and described with reference to exemplary embodiments thereof, it is to be understood that the invention is not limited to the disclosed exemplary embodiments. For example, it is to be understood that the techniques described may be performed in a different order than the described methods, and / or that components of the described systems, structures, devices, circuits, Lt; / RTI &gt; or equivalents, even if it is replaced or replaced.

그러므로, 다른 구현들, 다른 실시예들 및 특허청구범위와 균등한 것들도 후술하는 특허청구범위의 범위에 속한다.Therefore, other implementations, other embodiments, and equivalents to the claims are also within the scope of the following claims.

Claims (14)

몽고메리 역원 알고리즘에 사용되는 다수의 변수들(U, V 여기서 U, V, < 2n 임)에 대한 뺄셈 연산 장치에 있어서,
변수 U 및 변수 V에 대한 차이(U-V) 및 2n 의 합에 대한 기준값인 2n+(U-V) 으로부터 U 및 V 의 크기를 비교하는 연산을 수행하는 비교 연산부; 및
상기 비교 연산부에서의 비교 결과를 기반으로 상기 변수 U 및 상기 변수 V 에 대한 비트값의 보수로부터 덧셈 연산을 수행하여 상기 변수 U 및 상기 변수 V의 차이값을 연산하는 뺄셈 연산부
를 포함하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치.
In the subtraction operation apparatus for a number of variables (U, V where U, V, <2 n ) used in the Montgomery inverse algorithm,
A comparison operation unit which performs an operation for comparing the sizes of U and V from 2 n + (UV), which is a reference value for the sum of the difference (UV) and 2 n for the variable U and the variable V; And
A subtraction calculator configured to calculate a difference value between the variable U and the variable V by performing an addition operation from a complement of bit values of the variable U and the variable V based on the comparison result in the comparison operator.
Subtraction operation apparatus for Montgomery inverse algorithm comprising a.
제1항에 있어서,
상기 비교 연산부는,
상기 기준값의 최상위 비트값을 고려하여 상기 변수 U 및 상기 변수 V 의 크기를 비교하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치.
The method of claim 1,
The comparison operation unit,
A subtraction arithmetic apparatus for Montgomery inverse algorithm that compares magnitudes of the variable U and the variable V in consideration of the most significant bit value of the reference value.
제2항에 있어서,
상기 비교 연산부는,
상기 최상위 비트값이 '1'이면, 상기 변수 U가 상기 변수 V 보다 큰 것으로 판단하고, 상기 최상위 비트값이 '0'이면 상기 변수 V가 상기 변수 U 보다 큰 것으로 판단하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치.
3. The method of claim 2,
The comparison operation unit,
Subtraction for the Montgomery inverse algorithm that determines that the variable U is greater than the variable V when the most significant bit value is '1', and that the variable V is greater than the variable U when the most significant bit value is '0'. Computing device.
제1항에 있어서,
상기 비교 연산부는,
상기 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과를 고려하여 상기 변수 U 및 상기 변수 V의 크기를 비교하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치.
The method of claim 1,
The comparison operation unit,
For the Montgomery inverse algorithm that compares the magnitudes of the variable U and the variable V in consideration of the addition operation result of U + (~ V) +1 based on the inverted bit value of the variable V (~ V). Subtraction operation unit.
제1항에 있어서,
상기 뺄셈 연산부는,
상기 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과를 고려하여 상기 변수 U 및 상기 변수 V의 차이값을 연산하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치.
The method of claim 1,
The subtraction operation unit,
The Montgomery inverse algorithm that calculates the difference between the variable U and the variable V in consideration of the addition operation result for U + (~ V) +1 based on the inverted bit value of the variable V (~ V) Subtraction operation device for.
제5항에 있어서,
상기 뺄셈 연산부는,
상기 비교 연산부가 상기 변수 U 가 상기 변수 V 보다 크다고 판단한 경우, 상기 변수 V의 비트값을 반전시킨 값(~V)을 기반으로, U+(~V)+1 에 대한 덧셈 연산 결과로부터 최상위 비트를 제거하여 상기 변수 U 및 상기 변수 V의 차이값을 연산하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치.
The method of claim 5,
The subtraction operation unit,
When the comparison operation unit determines that the variable U is greater than the variable V, the most significant bit is obtained from the result of the addition operation on U + (˜V) +1, based on a value (˜V) in which the bit value of the variable V is inverted. Subtraction arithmetic apparatus for Montgomery inverse algorithm for removing the difference between the variable U and the variable V.
제5항에 있어서,
상기 뺄셈 연산부는,
상기 비교 연산부가 상기 변수 V 가 상기 변수 U 보다 크다고 판단한 경우, 상기 변수 U의 비트값을 반전시킨 값(~U)을 기반으로, V+(~U)+1에 대한 덧셈 연산 결과로부터 최상위 비트를 제거하여 상기 변수 V 및 상기 변수 U의 차이값을 연산하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치.
The method of claim 5,
The subtraction operation unit,
When the comparison operation unit determines that the variable V is larger than the variable U, the most significant bit is obtained from the addition operation result of V + (~ U) +1 based on the value (~ U) inverting the bit value of the variable U. Subtraction arithmetic apparatus for Montgomery inverse algorithm for removing the difference between the variable V and the variable U.
제5항에 있어서,
상기 뺄셈 연산부는,
상기 변수 U 및 상기 변수 V 에 대한 각각의 비트값의 보수, (~U) 및 (~V) 로부터 U+(~V)+1 및 V+(~U)+1에 대한 덧셈 연산을 병렬적으로 연산하고, 상기 연산된 U+(~V)+1 및 상기 연산된 V+(~U)+1의 최상위 비트를 각각 제거하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치.
The method of claim 5,
The subtraction operation unit,
Computation of the respective bit values for the variable U and the variable V, and add operations for U + (~ V) +1 and V + (~ U) +1 in parallel from (~ U) and (~ V) And subtracting the most significant bits of the calculated U + (~ V) +1 and the calculated V + (~ U) +1, respectively.
제5항에 있어서,
상기 뺄셈 연산부는,
상기 비교 연산부에서의 비교 결과를 기반으로 상기 연산된 U+(~V)+1 및 상기 연산된 V+(~U)+1 중 어느 하나를 선택하고, 선택된 어느 하나 값의 최상위 비트를 제거하여 상기 변수 V 및 상기 변수 U의 차이값을 연산하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치.
The method of claim 5,
The subtraction operation unit,
The variable is selected by selecting one of the calculated U + (~ V) +1 and the calculated V + (~ U) +1 and removing the most significant bit of the selected one value based on the comparison result in the comparison operation unit. A subtraction arithmetic unit for Montgomery inverse algorithm for calculating the difference between V and the variable U.
몽고메리 역원 알고리즘에 사용되는 다수의 변수들(U, V 여기서 U, V, < 2n 임)에 대한 뺄셈 연산 장치에 있어서,
변수 U 및 변수 V의 각각에 대한 보수 연산을 병렬적으로 수행하는 보수 연산부; 및
상기 변수 U 및 변수 V와, 보수 연산의 수행 결과인 (~V) 및 (~U)를 기반으로 U+(~V)+1 및 V+(~U)+1에 대한 덧셈 연산을 수행하는 덧셈부
를 포함하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치.
In the subtraction operation apparatus for a number of variables (U, V where U, V, <2 n ) used in the Montgomery inverse algorithm,
A complement operation unit that performs a complement operation on each of the variables U and V in parallel; And
An adder for performing an addition operation on U + (~ V) +1 and V + (~ U) +1 based on the variables U and V, and (~ V) and (~ U) which are the result of the complement operation.
Subtraction operation apparatus for Montgomery inverse algorithm comprising a.
제10항에 있어서,
상기 뺄셈 연산 장치는
상기 연산된 U+(~V)+1 및 상기 연산된 V+(~U)+1를 고려하여 상기 변수 U 및 상기 변수 V의 크기 비교 및 차이값을 동시에 출력하는 것을 특징으로 하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 장치.
The method of claim 10,
The subtraction operation device
Considering the calculated U + (~ V) + 1 and the calculated V + (~ U) + 1 in comparison with the size of the variable U and the variable V and outputs a difference value for the Montgomery inverse algorithm Subtraction operation unit.
몽고메리 역원 알고리즘에 사용되는 다수의 변수들(U, V 여기서 U, V, < 2n 임)에 대한 뺄셈 연산 방법에 있어서,
변수 U 및 변수 V에 대한 차이(U-V) 및 2n 의 합에 대한 기준값인 2n+(U-V) 으로부터 U 및 V 의 크기를 비교하는 연산을 수행하는 단계; 및
상기 비교 결과를 기반으로 상기 변수 U 및 상기 변수 V 에 대한 비트값의 보수로부터 덧셈 연산을 수행하여 상기 변수 U 및 상기 변수 V의 차이값을 연산하는 단계
를 포함하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 방법.
In the subtraction operation method for a plurality of variables (U, V where U, V, <2 n ) used in the Montgomery inverse algorithm,
Performing an operation for comparing the magnitudes of U and V from 2 n + (UV), which is a reference value for the sum of 2 n and the difference (UV) for the variables U and V; And
Calculating a difference value between the variable U and the variable V by performing an addition operation from a complement of bit values of the variable U and the variable V based on the comparison result.
Subtraction operation method for Montgomery inverse algorithm comprising a.
몽고메리 역원 알고리즘에 사용되는 다수의 변수들(U, V 여기서 U, V, < 2n 임)에 대한 뺄셈 연산 방법에 있어서,
변수 U 및 변수 V의 각각에 대한 보수 연산을 병렬적으로 수행하는 단계;
상기 변수 U 및 변수 V와, 상기 보수 연산의 수행 결과인 (~V) 및 (~U)를 기반으로 U+(~V)+1 및 V+(~U)+1에 대한 덧셈 연산을 수행하는 단계; 및
상기 연산된 U+(~V)+1 및 상기 연산된 V+(~U)+1를 고려하여 상기 변수 U 및 상기 변수 V의 크기 비교 및 차이값을 동시에 출력하는 단계
를 포함하는 연산하는 몽고메리 역원알고리즘을 위한 뺄셈 연산 방법.
In the subtraction operation method for a plurality of variables (U, V where U, V, <2 n ) used in the Montgomery inverse algorithm,
Performing a complement operation on each of the variables U and V in parallel;
Performing an addition operation on U + (~ V) +1 and V + (~ U) +1 based on the variable U and the variable V and (~ V) and (~ U) which are the result of performing the complementary operation. ; And
Simultaneously comparing the size of the variable U and the variable V and outputting a difference value in consideration of the calculated U + (~ V) +1 and the calculated V + (~ U) +1
Subtraction operation method for operating Montgomery inverse algorithm comprising a.
제12항 및 제13항 중 어느 한 항의 방법을 수행하기 위한 프로그램이 기록된 컴퓨터로 판독 가능한 기록 매체.

A computer-readable recording medium having recorded thereon a program for performing the method of claim 12.

KR1020130058328A 2013-05-23 2013-05-23 Apparatus and method for calculating subtraction for montgomery inverse algorithm KR101321259B1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
KR1020130058328A KR101321259B1 (en) 2013-05-23 2013-05-23 Apparatus and method for calculating subtraction for montgomery inverse algorithm
PCT/KR2013/006884 WO2014189171A1 (en) 2013-05-23 2013-07-31 Subtraction apparatus for montgomery inverse element algorithm and method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
KR1020130058328A KR101321259B1 (en) 2013-05-23 2013-05-23 Apparatus and method for calculating subtraction for montgomery inverse algorithm

Publications (1)

Publication Number Publication Date
KR101321259B1 true KR101321259B1 (en) 2013-10-29

Family

ID=49639105

Family Applications (1)

Application Number Title Priority Date Filing Date
KR1020130058328A KR101321259B1 (en) 2013-05-23 2013-05-23 Apparatus and method for calculating subtraction for montgomery inverse algorithm

Country Status (2)

Country Link
KR (1) KR101321259B1 (en)
WO (1) WO2014189171A1 (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100062565A (en) * 2008-12-02 2010-06-10 삼성전자주식회사 Method for calculating negative inverse of modulus
KR20100063623A (en) * 2008-12-03 2010-06-11 한국전자통신연구원 Method and apparatus for modular multiplication
KR20110068763A (en) * 2009-12-16 2011-06-22 한국전자통신연구원 Apparatus and method for complex constant multiplier and fft processor containing the complex constant multiplier
KR20120088316A (en) * 2011-01-31 2012-08-08 삼성전자주식회사 Montgomery inverse calculation device and method for calculating montgomery inverse using the same

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2002229773A (en) * 2001-01-26 2002-08-16 Internatl Business Mach Corp <Ibm> Processor, arithmetic unit, and arithmetic method
JP4223819B2 (en) * 2003-01-21 2009-02-12 株式会社日立製作所 Power residue calculation apparatus and program
GB0412084D0 (en) * 2004-05-29 2004-06-30 Univ Belfast "Method of calculating a modular inverse"

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20100062565A (en) * 2008-12-02 2010-06-10 삼성전자주식회사 Method for calculating negative inverse of modulus
KR20100063623A (en) * 2008-12-03 2010-06-11 한국전자통신연구원 Method and apparatus for modular multiplication
KR20110068763A (en) * 2009-12-16 2011-06-22 한국전자통신연구원 Apparatus and method for complex constant multiplier and fft processor containing the complex constant multiplier
KR20120088316A (en) * 2011-01-31 2012-08-08 삼성전자주식회사 Montgomery inverse calculation device and method for calculating montgomery inverse using the same

Also Published As

Publication number Publication date
WO2014189171A1 (en) 2014-11-27

Similar Documents

Publication Publication Date Title
Yarom et al. Recovering OpenSSL ECDSA nonces using the FLUSH+ RELOAD cache side-channel attack
JP5328186B2 (en) Data processing system and data processing method
US7908641B2 (en) Modular exponentiation with randomized exponent
EP3202079B1 (en) Exponent splitting for cryptographic operations
US8280042B2 (en) Decryption processor and decryption processing method
JP5182364B2 (en) Cryptographic processing method with tamper resistance against side channel attack
US20110013770A1 (en) Encrypting method having countermeasure function against power analyzing attacks
KR102132261B1 (en) Method and apparatus for computing montgomery multiplication performing final reduction wihhout comparator
JP2009500710A (en) Apparatus and method for protecting a data processing device against attack or analysis
JP5977996B2 (en) Modular power method and apparatus resistant to side channel attacks
Sghaier et al. Fast hardware implementation of ECDSA signature scheme
JP2009505148A (en) Circuit arrangement and method for performing inversion operation in encryption operation
US20100146029A1 (en) Method and apparatus for modular operation
Wu et al. On the improvement of wiener attack on rsa with small private exponent
KR101136972B1 (en) method for evaluating Elliptic Curve Cryptosystem
US20120039462A1 (en) Rsa signature method and apparatus
KR20210133801A (en) Method for doing quantum-resistant signature based on Ring-LWR and system thereof
JP2007187908A (en) Modular exponentiation calculation device and method having tolerance to side-channel attack
KR101321259B1 (en) Apparatus and method for calculating subtraction for montgomery inverse algorithm
CN105373366B (en) A kind of method and device generating Big prime
Hodjat et al. A scalable and high performance elliptic curve processor with resistance to timing attacks
Smyth et al. An adaptable and scalable asymmetric cryptographic processor
Yen et al. Improvement on Ha-Moon randomized exponentiation algorithm
Takemura et al. ECC Atomic Block with NAF against Strong Side-Channel Attacks on Binary Curves
JP2010008883A (en) Arithmetic device for cipher, arithmetic method for cipher, and program

Legal Events

Date Code Title Description
A201 Request for examination
A302 Request for accelerated examination
E701 Decision to grant or registration of patent right
GRNT Written decision to grant
FPAY Annual fee payment

Payment date: 20160907

Year of fee payment: 4

FPAY Annual fee payment

Payment date: 20170707

Year of fee payment: 5

FPAY Annual fee payment

Payment date: 20180831

Year of fee payment: 6