WO2023199440A1 - 符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラム - Google Patents

符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラム Download PDF

Info

Publication number
WO2023199440A1
WO2023199440A1 PCT/JP2022/017737 JP2022017737W WO2023199440A1 WO 2023199440 A1 WO2023199440 A1 WO 2023199440A1 JP 2022017737 W JP2022017737 W JP 2022017737W WO 2023199440 A1 WO2023199440 A1 WO 2023199440A1
Authority
WO
WIPO (PCT)
Prior art keywords
product
integer
remainder
signed
signed integer
Prior art date
Application number
PCT/JP2022/017737
Other languages
English (en)
French (fr)
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 PCT/JP2022/017737 priority Critical patent/WO2023199440A1/ja
Publication of WO2023199440A1 publication Critical patent/WO2023199440A1/ja

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

Definitions

  • the present invention relates to a signed integer remainder product calculation device, a signed integer remainder product calculation method, and a program.
  • Patent Document 1 relates to a method for calculating a remainder system that efficiently calculates a multiplication remainder calculation using a bisection multiplication remainder calculation method using a simple hardware configuration.
  • Patent Document 2 relates to a power remainder calculation method that quickly calculates the inverse required by the Montgomery multiplication algorithm without using an inverse-dedicated calculation unit.
  • Patent Document 3 relates to a cryptographic processing device that improves processing speed when performing remainder division using the Montgomery method.
  • NTT Number Theoretic Transform
  • FFT Fast Fourier Transform
  • lattice cryptosystems such as Saber and NTRU were selected as final candidates in the standardization competition for quantum-resistant computer cryptography by the National Institute of Standards and Technology; does not employ arithmetic transformation.
  • the method of converting negative data to unsigned integer representation data, calculating the remainder product of the unsigned data, then performing a conditional branch and converting it to the result of the remainder operation of the signed integer representation data requires processing. Not only does this increase efficiency, but the conditional branching makes fixed-time implementation impossible, and it loses resistance to side-channel attacks called timing attacks, making it unusable for cryptographic implementation.
  • the present invention contributes to making it possible to perform remainder product calculations on data in signed integer representation without converting negative data to data in unsigned integer representation.
  • the object of the present invention is to provide a product calculation device, a signed integer remainder product calculation method, and a program.
  • an input unit receiving a first signed integer, a second signed integer, a modulo P of a remainder, a positive integer n, and a constant R; a multiplication section;
  • a signed integer remainder product calculation device including a high-order bit acquisition unit,
  • the multiplication unit calculates a first product of 2n bits length from the second signed integer and the constant R,
  • the multiplication unit calculates a second product with a length of 2n bits from the first product and the first signed integer
  • the upper bit obtaining unit obtains a first upper bit by performing integer approximation on the result of performing a signed n-bit right shift on the second product,
  • the multiplication unit calculates a third product having a length of 2n bits from the first upper bit and the modulus P of the remainder
  • the high-order bit acquisition unit performs integer approximation on the result of performing a signed n-bit right shift on the third product to obtain a second high-order bit
  • the constant R is the reciprocal of the modulus P of the remainder
  • a signed integer remainder product calculation device including a high-order bit acquisition unit,
  • the multiplication unit calculates a second product with a length of 2n bits from the first product and the first signed integer,
  • the upper bit obtaining unit obtains a first upper bit by performing integer approximation on the result of performing a signed n-bit right shift on the second product,
  • the multiplication unit calculates a third product of 2n bits length from the first upper bit and the modulus P of the remainder,
  • the high-order bit acquisition unit performs integer approximation on the result of performing a signed n-bit right shift on the third product to obtain a second high-order bit
  • the constant R is the reciprocal of the modulus P of the remainder by calculating the remainder modulo 2 2n for the signed integer,
  • the input unit receives a first signed integer, a second signed integer, a modulus P, a positive integer n, and a constant R; a multiplication unit calculating a first product with a length of 2n bits from the second signed integer and the constant R; the multiplication unit calculating a second product with a length of 2n bits from the first product and the first signed integer; a step in which the high-order bit acquisition unit performs integer approximation on the result of performing a signed n-bit right shift on the second product to obtain a first high-order bit; the multiplication unit calculating a third product having a length of 2n bits from the first upper bit and the modulo P of the remainder; The upper bit obtaining unit performs integer approximation on the result of performing a signed n-bit right shift on the third product to obtain a second upper bit,
  • the constant R is the reciprocal of the modulo P of the remainder by calculating the remainder modulo 2 2n for signed integers, which can provide
  • the input section includes a first product of a length of 2n bits calculated in advance from the first signed integer, the second signed integer and the constant R, and the modulus of the remainder.
  • P and receiving a positive integer n a multiplication unit calculating a second product having a length of 2n bits from the first product and the first signed integer; a step in which the high-order bit acquisition unit performs integer approximation on the result of performing a signed n-bit right shift on the second product to obtain a first high-order bit; the multiplication unit calculating a third product having a length of 2n bits from the first upper bit and the modulo P of the remainder;
  • the upper bit obtaining unit performs integer approximation on the result of performing a signed n-bit right shift on the third product to obtain a second upper bit
  • the constant R is the reciprocal of the modulo P of the remainder by calculating the remainder modulo 2 2n for signed integers, which can provide a method for calculating a remainder product of signed integers, which can provide
  • the computer A process of receiving a first signed integer, a second signed integer, a modulo P of a remainder, a positive integer n, and a constant R; a process of calculating a first product of 2n bits length from the second signed integer and the constant R; calculating a second product with a length of 2n bits from the first product and the first signed integer; performing an integer approximation on the result of performing a signed n-bit right shift on the second product to obtain a first upper bit; a process of calculating a third product having a length of 2n bits from the first upper bit and the modulus P of the remainder; performing a process of performing integer approximation on the result of performing a signed n-bit right shift on the third product to obtain a second upper bit;
  • a program may be provided in which the constant R is the reciprocal of the modulus P of the remainder obtained by calculating a remainder modulo 2 2n for a signed integer.
  • the computer A process of receiving a first signed integer, a first product with a length of 2n bits calculated in advance from a second signed integer and a constant R, a modulo P of the remainder, and a positive integer n; calculating a second product with a length of 2n bits from the first product and the first signed integer; performing an integer approximation on the result of performing a signed n-bit right shift on the second product to obtain a first upper bit; a process of calculating a third product having a length of 2n bits from the first upper bit and the modulus P of the remainder; performing a process of performing integer approximation on the result of performing a signed n-bit right shift on the third product to obtain a second upper bit;
  • a program may be provided in which the constant R is the reciprocal of the modulus P of the remainder obtained by calculating a remainder modulo 2 2n for a signed integer.
  • this program can be recorded on a computer-readable storage medium.
  • the storage medium can be non-transient, such as a semiconductor memory, a hard disk, a magnetic recording medium, an optical recording medium, or the like.
  • the invention can also be implemented as a computer program product.
  • a signed integer contributes to making it possible to perform a remainder product calculation on data in signed integer representation without converting negative data to data in unsigned integer representation. It is possible to provide a remainder product calculation device, a signed integer remainder product calculation method, and a program.
  • FIG. 1 is a diagram illustrating an example of a schematic configuration of a signed integer remainder product calculation device according to an embodiment of the present invention
  • FIG. 2 is a flowchart illustrating an example of processing by the signed integer remainder product calculation device according to an embodiment of the present invention.
  • FIG. 2 is a diagram illustrating an example of a schematic configuration of a signed integer remainder product calculation device according to another embodiment of the present invention.
  • 7 is a flowchart illustrating an example of processing by a signed integer remainder product calculation device according to another embodiment of the present invention.
  • 1 is a diagram showing an example of the configuration of a signed integer remainder product calculation device according to a first embodiment of the present invention;
  • FIG. 2 is a diagram illustrating an example of the configuration of a high-order bit acquisition unit of the signed integer remainder product calculation device according to the first embodiment of the present invention.
  • FIG. 7 is a diagram illustrating an example of the configuration of a signed integer remainder product calculation device according to a second embodiment of the present invention.
  • FIG. 7 is a diagram illustrating an example of the configuration of a signed integer remainder product calculation device according to a third embodiment of the present invention.
  • FIG. 7 is a diagram illustrating an example of the configuration of a signed integer remainder product calculation device according to a fourth embodiment of the present invention.
  • 1 is a diagram showing the configuration of a computer constituting a signed integer remainder product calculation device of the present invention;
  • a first signed integer A, a second signed integer B, a modulo P of the remainder, a positive integer n, and a constant R are input.
  • the integer n is the computer performing the calculation or the halfword length of the product being calculated.
  • the constant R is ...(Formula 1) is an integer that satisfies, and indicates the remainder calculation modulo 2 2n for a signed integer, and the result of the remainder calculation is Has one of the following values:
  • the first signed integer A and the second signed integer B are is a signed integer that satisfies
  • integer approximation function for any integer z and real number For, choose the one that holds true.
  • An integer approximation function such that For example, a function that rounds off the first decimal place of a real number x There is.
  • FIG. 1 is a diagram showing an example of a schematic configuration of a signed integer remainder product calculation device according to an embodiment of the present invention.
  • the signed integer remainder product calculation device 10 includes an input section 100, a multiplication section 210, and an upper bit acquisition section 220.
  • FIG. 2 is a flowchart showing an example of processing by the signed integer remainder product calculation device 10 according to an embodiment of the present invention. The process starts in step S100.
  • step S101 the input unit 100 receives an input 20 including a first signed integer A, a second signed integer B, a modulo P of the remainder, a positive integer n, and a constant R.
  • the input unit 100 may be realized by, for example, a character input device such as a keyboard for inputting the input 20 described above.
  • the constant R is the modulus P of the remainder and the positive integer n, is an integer that satisfies indicates the remainder computation modulo 2 2n for signed integers.
  • step S102 the multiplier 210 calculates a first product of 2n bits from the second signed integer B and the constant R. Calculate.
  • step S103 the multiplication unit 210 calculates a second product of 2n bits length from the first product and the first signed integer A. Calculate.
  • step S105 the multiplication unit 210 calculates a third product having a length of 2n bits from the first upper bit and the modulus P of the remainder. Calculate.
  • step S106 the high-order bit acquisition unit 220 performs integer approximation on the result of performing the signed n-bit right shift on the third product to obtain the second high-order bit. is obtained and output as output 30.
  • the process ends in step S107.
  • the high-order bit acquisition unit 220 performs a signed n-bit right shift on the second product, and performs integer approximation on the result to obtain the first high-order bit. can be calculated and -5 is obtained.
  • the high-order bit acquisition unit 220 performs a signed n-bit right shift on the third product, and performs integer approximation on the result to obtain the second high-order bit. Then, in (Equation 3), ...(Formula 6) can be calculated, -2 is obtained, and this is output as the remainder product output 30.
  • a signed integer remainder product calculation device it is possible to perform a remainder product calculation on data in signed integer representation without converting negative data to data in unsigned integer representation.
  • a signed integer remainder product calculation device a signed integer remainder product calculation method, and a program can be provided.
  • FIG. 3 is a diagram showing an example of a schematic configuration of a signed integer remainder product calculation device 10 according to another embodiment of the present invention.
  • the components given the same reference numerals as in FIG. 1 are the same components, and the explanation thereof will be omitted.
  • FIG. 4 is a flowchart showing an example of processing by the signed integer remainder product calculation device 10 according to another embodiment of the present invention. Processing begins in step S200.
  • the first product It may be possible to pre-compute the Another embodiment of the invention is where the first product is pre-computed.
  • step S201 the input unit 100 receives the first signed integer A and the first product without receiving the second signed integer B and the constant R. , the modulus P of the remainder, and the integer n as inputs 20.
  • step S202 the multiplication unit 210 calculates a second product of 2n bits length from the first product and the first signed integer. Calculate.
  • step S203 the upper bit acquisition unit 220 performs integer approximation on the result of performing the signed n-bit right shift on the second product to obtain the first upper bit. get.
  • step S204 the multiplication unit 210 calculates a third product having a length of 2n bits from the first upper bit and the modulus P of the remainder. Calculate.
  • step S205 the high-order bit acquisition unit 220 performs integer approximation on the result of performing the signed n-bit right shift on the third product to obtain the second high-order bit. is obtained and output as output 30.
  • step S206 ends in step S206.
  • the signed integer remainder product calculation device 10 of another embodiment of the present invention shown in FIG. The second upper bits that are the same as the acquired second upper bits can be acquired and output as the output 30.
  • Step S102 can be omitted, and it is possible to speed up the computation of the remainder product.
  • FIG. 5 is a diagram showing an example of the configuration of the signed integer remainder product calculation device 10 according to the first embodiment of the present invention.
  • components given the same reference numerals as in FIG. 1 are the same components, and their explanations will be omitted.
  • the signed integer remainder product calculation device 10 includes an input section 100, a selection section 200, a multiplication section 210, a high-order bit acquisition section 220, and a first storage section 230 , a second storage section 240 , and a control section 300 . It is assumed that the signed integer remainder product calculation device 10 of each embodiment of the present invention described below receives a signed integer in two's complement representation, and performs each calculation using the signed integer in two's complement representation. .
  • the control unit 300 controls the selection process by the selection unit 200 of the signed integer remainder product calculation device 10 and performs overall control of the integer remainder product calculation device 10.
  • step S100 The processing of the signed integer remainder product calculation device 10 according to the first embodiment of the present invention starts in step S100.
  • step S101 the input unit 100 receives an input 20 including a first signed integer A, a second signed integer B, a modulo P of the remainder, a positive integer n, and a constant R.
  • the definitions of the first signed integer A, the second signed integer B, the modulus P of the remainder, the positive integer n, and the constant R are according to the present invention described with reference to FIGS. 1 and 2. Same as the definition of one embodiment.
  • step S102 the control unit 300 selects the second signed integer B121 and the constant R122 input to the selection unit 200, and sends the selection outputs 201 and 202 to the multiplication unit 210.
  • the multiplier 210 calculates a first product with a length of 2n bits from the second signed integer B and the constant R. Calculate.
  • the calculated first product is output to the output 211 of the multiplication unit 210, stored in the first storage unit 230, and further output.
  • step S103 the control unit 300 selects the first signed integer A123 input to the selection unit 200 and the output 231 of the first storage unit, and sends the selected outputs 201 and 202 to the multiplication unit 210. It will be done. Since the output 231 of the first storage unit is the first product with a length of 2n bits, the multiplication unit 210 generates a second product with a length of 2n bits from the first signed integer A and the first product. product Calculate. The calculated second product is output to the output 211 of the multiplication unit 210, stored in the first storage unit 230, and further output.
  • step S104 the output 231 of the first storage unit and the positive integer n125 are input to the upper bit acquisition unit 220.
  • the output 231 of the first storage unit is a second product with a length of 2n bits
  • the upper bit acquisition unit 220 performs a signed n-bit right shift on the second product with a length of 2n bits, and the result is: Perform integer approximation to obtain the first high-order bit is acquired and output as output 221.
  • the second storage unit 240 stores the first upper bit and further outputs it as an output 241.
  • step S105 the control unit 300 selects the modulus P124 of the remainder input to the selection unit 200 and the output 241 of the second storage unit, and sends the selected outputs 201 and 202 to the multiplication unit 210. Since the output 241 of the second storage unit is the first high-order bit, the multiplication unit 210 generates a third product of 2n bits length from the first high-order bit and the modulus P of the remainder. Calculate. The calculated third product is output to the output 211 of the multiplier 210. The first storage unit 230 stores the third product and outputs it as an output 231.
  • step S106 the output 231 of the first storage unit and the positive integer n125 are input to the upper bit acquisition unit 220.
  • the output 231 of the first storage unit is a third product with a length of 2n bits
  • the upper bit acquisition unit 220 performs a signed n-bit right shift on the third product with a length of 2n bits, and the result is: Perform integer approximation to obtain the second upper bit is acquired and output as output 221.
  • the second upper bit is stored by the second storage section 240 and output as the output 30.
  • the process ends in step S107.
  • An example of calculating a signed integer remainder product by the signed integer remainder product calculation device 10 according to the first embodiment of the present invention is as follows. This is the same as an example of remainder calculation by the integer remainder product calculation device 10.
  • FIG. 6 is a diagram showing an example of the configuration of the upper bit acquisition unit 220 of the signed integer remainder product calculation device 10 according to the first embodiment of the present invention.
  • the upper bit acquisition unit 220 includes a shift register 550 and an adder 560.
  • the upper bit acquisition unit 220 receives an input 500 having a length of 2n bits and an integer n125 as input.
  • an input 500 having a length of 2n bits (16 bits) includes a leftmost most significant bit (MSB) 501, bits 502 to 515, and a rightmost least significant bit (LSB). 516 included.
  • Input 500 is composed of upper n bits 5001 of bits 501 to 508 and lower n bits 5002 of bits 509 to 516.
  • the shift register 550 includes an upper n (8) bit register section 551, a lower n (8) bit register section 552, and a decimal register 553 for the input 500 having a length of 2n bits (16 bits).
  • the upper n(8) bits 5001 and lower n(8) bits 5002 of the input 500 having a length of 2n bits (16 bits) are the upper n(8) bits register part 551 and the lower n(8) bits register part of the shift register 550. 552, respectively.
  • the signed n-bit right shift is a process of shifting the input 500 loaded into the shift register 550 by n bits from the MSB to the LSB side.
  • the MSB value indicating the sign of bit 501 is set in upper n (8) bit register section 551 of shift register 550.
  • each register of shift register 550 represent the result of loading input 500 into shift register 550 and performing a signed n(8)-bit right shift.
  • the value of the MSB 501 is set in the upper n (8) bit register section 551 of the shift register 550, and the upper n bits 5001 of the input 500 are arranged in the lower n (8) bit register section 552 of the shift register 550.
  • the value of bit 509 of input 500 is set in first decimal place register 553 of shift register 550 .
  • integer approximation is performed on the output of the shift register 550 after the signed n-bit right shift. Integer approximation is performed, for example, by rounding to the first decimal place. Rounding to the first decimal place is performed by the adder 560, for example.
  • adder 560 includes 2n (16) full adders 5601 to 5616 having two inputs, a carry input, and a carry output, and includes a lower full adder (for example, full adder 5603).
  • the carry output is connected to the carry input of a full adder (for example, full adder 5602) at the next higher stage.
  • the output of the upper n-bit register section 551 of the shift register 550 is input to one input of each of the full adders 5601 to 5608 of the adder 560, and the output of the upper n-bit register section 551 of the shift register 550 is input to one input of each of the full adders 5609 to 5616.
  • the output of the lower n-bit register section 552 of 550 is input.
  • the value 0 (zero) is input to all other inputs of each of the full adders 5601 to 5616 of the adder 560.
  • the output of the first decimal place register 553 is input to the carry input 5616CIN of the full adder 5616.
  • the output 221 of the adder 560 is -5 in two's complement representation, and the upper bit acquisition unit 220 of the signed integer remainder product calculation device 10 of the first embodiment of the present invention , is obtained. Note that this value corresponds to the value -5 of the first upper bit in the example of calculating a remainder product of signed integers according to an embodiment of the present invention.
  • the upper bit acquisition unit 220 of the signed integer remainder product calculation device 10 according to one embodiment and another embodiment of the present invention described with reference to FIGS. 1 and 3 also corresponds to the first embodiment of the present invention.
  • the configuration may be similar to the configuration of the upper bit acquisition unit 220 of the signed integer remainder product calculation device 10 of the above configuration.
  • the signed integer remainder product calculation device 10 calculates the signed integer remainder product. can be calculated.
  • the first embodiment of the present invention it is possible to calculate a remainder product on data expressed as a signed integer without converting negative data to data expressed as an unsigned integer. It is possible to provide a signed integer remainder product calculation device, a signed integer remainder product calculation method, and a program.
  • FIG. 7 is a diagram showing an example of the configuration of a signed integer remainder product calculation device according to the second embodiment of the present invention.
  • components with the same reference numerals as in FIG. 5 are the same components.
  • the first product described in the first embodiment of the present invention may be
  • the second embodiment of the present invention is an embodiment in which the first product is calculated in advance.
  • step S200 the operation of the signed integer remainder product calculation device 10 of the second embodiment of the present invention.
  • step S201 the input unit 100 inputs the first signed integer A and the first product having a length of 2n bits without receiving the second signed integer B and the constant R. , a modulus P of the remainder, and an input 20 containing a positive integer n.
  • the definitions of the first signed integer A, the second signed integer B, the modulus P of the remainder, the positive integer n, and the constant R are according to the present invention described with reference to FIGS. 1 and 2. This is the same as described in one embodiment.
  • step S202 the control unit 300 selects the first signed integer A123 input to the selection unit 200 and the first product 126 having a length of 2n bits, and the selected outputs 201 and 202 are sent to the multiplication unit 210.
  • Sent. The multiplier 210 calculates a second product having a length of 2n bits from the first signed integer A and the first product. Calculate. The calculated second product is output to the output 211 of the multiplication unit 210, stored in the first storage unit 230, and further output.
  • step S203 the output 231 of the first storage unit and the positive integer n125 are input to the upper bit acquisition unit 220.
  • the output 231 of the first storage unit is a second product with a length of 2n bits
  • the upper bit acquisition unit 220 performs a signed n-bit right shift on the second product with a length of 2n bits, and the result is: Perform integer approximation to obtain the first high-order bit is acquired and output as output 221.
  • the second storage unit 240 stores the first upper bit and outputs it as an output 241.
  • step S204 the control unit 300 selects the modulus P124 of the remainder input to the selection unit 200 and the output 241 of the second storage unit, and sends the selected outputs 201 and 202 to the multiplication unit 210. Since the first upper bit is outputted to the output 241 of the first storage unit, the multiplication unit 210 calculates a third product of 2n bits length from the first upper bit and the modulus P of the remainder. Calculate. The calculated third product is output to the output 211 of the multiplier 210. The first storage unit 230 stores the third product and further outputs it as an output 231.
  • step S205 the output 231 of the first storage unit and the positive integer n125 are input to the upper bit acquisition unit 220.
  • the output 231 of the first storage unit is a third product with a length of 2n bits
  • the upper bit acquisition unit 220 performs a signed n-bit right shift on the third product with a length of 2n bits, and the result is: Perform integer approximation to obtain the second upper bit is acquired and output as output 221.
  • the second upper bit is stored by the second storage unit 240 and further output as the output 30.
  • An example of calculating a signed integer remainder product by the signed integer remainder product calculation device 10 according to the second embodiment of the present invention is as follows. This is the same as an example of remainder calculation by the integer remainder product calculation device 10.
  • the operation of the high-order bit acquisition unit 220 of the signed integer remainder product calculation device 10 according to the second embodiment of the present invention is similar to the operation of the signed integer remainder product calculation device 10 according to the signed integer embodiment described with reference to FIG.
  • the configuration and operation may be similar to the first upper bit acquisition unit 220 of the integer remainder product calculation device 10.
  • the signed integer remainder product calculation device 10 calculates the signed integer remainder product. can be calculated.
  • the second embodiment of the present invention it is possible to calculate a remainder product on data in signed integer representation without converting negative data to data in unsigned integer representation. It is possible to provide a signed integer remainder product calculation device, a signed integer remainder product calculation method, and a program.
  • the first product of the first embodiment of the present invention described with reference to FIG. Step S102 can be omitted, making it possible to speed up the computation of the remainder product.
  • FIG. 8 is a diagram showing an example of the configuration of a signed integer remainder product calculation device according to the third embodiment of the present invention.
  • components with the same reference numerals as in FIG. 5 are the same components.
  • the signed integer remainder product calculation device 10 according to the third embodiment of the present invention shown in FIG.
  • the input unit 100 executes the process of step S101 in FIG. Receive input 20.
  • the first multiplier 130 executes the process of step S102 in FIG. 2 and calculates a first product 131 of 2n bits length from the second signed integer B121 and constant R122.
  • the second multiplier 140 executes the process of step S103 in FIG. 2, and calculates a second product 141 of 2n bits length from the first product 131 and the first signed integer A123.
  • the first high-order bit acquisition unit 150 executes the process of step S104 in FIG. Get 151.
  • the third multiplier 160 executes the process of step S105 in FIG. 2, and calculates a third product 161 of 2n bits length from the first upper bit 151 and the modulus P124 of the remainder.
  • the second high-order bit acquisition unit 170 executes the process of step S106 in FIG. It is acquired and output as output 30.
  • FIG. 9 is a diagram showing an example of the configuration of a signed integer remainder product calculation device according to the fourth embodiment of the present invention.
  • components with the same reference numerals as in FIG. 7 are the same components.
  • the signed integer remainder product calculation device 10 according to the fourth embodiment of the present invention shown in FIG.
  • the input unit 100, the first multiplication execution unit 145, the first high-order bit acquisition unit 150, the second multiplication execution unit 165, and the second high-order bit acquisition unit 150 execute each step of the flowchart showing an example. It includes a bit acquisition section 170.
  • the input unit 100 executes the process of step S201 in FIG. 4, and inputs the first signed integer A and the first product. , a modulus P of the remainder, and a positive integer n.
  • the first multiplication execution unit 145 executes the process of step S202 in FIG. 4, and calculates a second product 141 having a length of 2n bits from the first product 126 and the first signed integer A123.
  • the first high-order bit acquisition unit 150 executes the process of step S203 in FIG. Get 151.
  • the second multiplication execution unit 165 executes the process of step S204 in FIG. 4, and calculates a third product 161 having a length of 2n bits from the first upper bit 151 and the modulus P124 of the remainder.
  • the second high-order bit acquisition unit 170 executes the process of step S205 in FIG. It is acquired and output as output 30.
  • a computer functioning as a signed integer remainder product calculation device 10.
  • This can be realized by a program that realizes this function.
  • a computer is exemplified by a configuration including a CPU (Central Processing Unit) 9010, a communication interface 9020, a memory 9030, and an auxiliary storage device 9040 in FIG. That is, the CPU 9010 in FIG. 10 executes a program for calculating a signed integer remainder product, and updates each calculation parameter stored in the auxiliary storage device 9040 or the like.
  • a CPU Central Processing Unit
  • the memory 9030 is a RAM (Random Access Memory), a ROM (Read Only Memory), or the like.
  • each part (processing means, function) of the signed integer remainder product calculation device 10 shown in the above-described one embodiment to the fourth embodiment is implemented in the processor of the above-mentioned computer using its hardware. This can be realized by a computer program that executes each process.

Landscapes

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

Abstract

符号付き整数の剰余積計算装置を提供する。符号付き整数の剰余積計算装置は、第1の符号付き整数と、第2の符号付き整数と、剰余の法Pと、正の整数nと、定数Rを受け取る入力部と、乗算部と、上位ビット取得部を含む。乗算部は、第2の符号付き整数と定数Rから2nビット長の第1の積を計算し、乗算部は、第1の積と第1の符号付き整数から2nビット長の第2の積を計算し、上位ビット取得部は、第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得し、乗算部は、第1の上位ビットと剰余の法Pから2nビット長の第3の積を計算し、上位ビット取得部は、第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得する。定数Rは、符号付き整数に対する22nを法とする剰余計算による剰余の法Pの逆数である。

Description

符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラム
 本発明は、符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラムに関する。
 特許文献1は、簡単なハードウェア構成によって、二分乗算剰余算法による乗算剰余算を効率よく計算する、剰余系の計算方法に関するものである。
 特許文献2は、逆元専用演算器を用いないでモンゴメリ乗算アルゴリズムで必要となる逆元を高速に計算する、べき乗剰余演算方法に関するものである。
 特許文献3は、モンゴメリ方式で剰余除算を行う場合の処理速度を向上させた、暗号処理装置に関するものである。
特開2007-219261号公報 特表2004-226516号公報 特開2003-150050号公報
 以下の分析は、本発明者によって与えられたものである。
 剰余積の効率的計算手法の応用例は種々あるが、例えば、数論変換が挙げられる。数論変換(Number Theoretic Transform、 NTT)とは、高速フーリエ変換(Fast Fourier Transform、 FFT)に類似した技術であり、特に剰余環の上でのFFTを指す。多数の剰余積を計算する必要があり効率的な剰余積の計算手法が重要である。
 また、数論変換は多項式同士の乗算を高速に計算するアルゴリズムに応用される。格子暗号とよばれる、格子問題という数学的問題の計算量的困難性を安全性の根拠とした公開鍵暗号では多項式環がしばしば用いられ、高速な多項式乗算アルゴリズムが実用上重要であり、数論変換が用いられることが多い。
 ただしパラメータ等の都合から必ずしもすべての多項式環を用いる格子暗号において数論変換が適用できるわけではない。例えば、SaberやNTRUといった格子暗号は米国標準技術研究所による耐量子計算機暗号の標準化コンペティションにおいて最終候補に選ばれた方式であるが、数論変換に不適な多項式環を用いているため多項式乗算アルゴリズムに数論変換を採用していない。
 しかしながら、近年、数論変換に不適な多項式環においても数論変換を行う手法が提案され、上述のSaberやNTRUにおいても多項式乗算アルゴリズムに数論変換を用いることが可能となった。剰余積の効率を高めることでSaberやNTRUにおける多項式乗算の高速化が達成できればその意義は非常に大きいと考えられる。
 数論変換に不適な多項式環への数論変換導入手法においては符号付きの整数表現を用いることが必要となる。
 剰余積の計算に関しては、例えば、特許文献1で紹介されているような、モンゴメリ(Montgomery)乗算の計算方法がある。モンゴメリ乗算の計算方法では、剰余積の計算で必要な剰余の法による除算を、乗算と、2のべき乗の剰余演算と、2のべき乗による除算により行うことにより、剰余の法による除算を行わずに剰余積の計算を行う方法であり、剰余積の計算の高速化が可能である。
 また、モンゴメリ乗算による計算方法から導出された、剰余積の計算を更に高速化することを可能とする方法も提案されている。しかしながら、モンゴメリ乗算を含めて、いずれの方法も、符号なしデータしか扱うことができない。従って、符号付きデータによる剰余積の計算を行う場合には、従来提案されている剰余積の計算の高速化の方法において、負のデータを符号なしデータに変換し、符号なしデータの剰余積を計算した後に、条件分岐を行い、符号付きデータの剰余演算結果に変換する処理が必要であった。
 また、負のデータを符号なし整数表現のデータに変換し、符号なしデータの剰余積を計算した後に、条件分岐を行い、符号付き整数表現のデータの剰余演算結果に変換する方法では、処理が増えて効率性が落ちるだけではなく、条件分岐により定時間実装が不可能となり、タイミングアタックと呼ばれるサイドチャネル攻撃への耐性を失うので、暗号実装に用いることができなくなる。
 本発明は、負のデータを符号なし整数表現のデータに変換することなく、符号付き整数表現のデータに対して剰余積の計算を行うことを可能とすることに貢献する、符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラムを、提供することを目的とする。
 本発明の第1の視点によれば、第1の符号付き整数と、第2の符号付き整数と、剰余の法Pと、正の整数nと、定数Rを受け取る入力部と、
 乗算部と、
 上位ビット取得部を含む、符号付き整数の剰余積計算装置であって、
 前記乗算部は、前記第2の符号付き整数と前記定数Rから2nビット長の第1の積を計算し、
 前記乗算部は、前記第1の積と前記第1の符号付き整数から2nビット長の第2の積を計算し、
 前記上位ビット取得部は、前記第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得し、
 前記乗算部は、前記第1の上位ビットと前記剰余の法Pから2nビット長の第3の積を計算し、
 前記上位ビット取得部は、前記第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得し、
 前記定数Rは、符号付き整数に対する22nを法とする剰余計算による前記剰余の法Pの逆数である、符号付き整数の剰余積計算装置を提供できる。
 本発明の第2の視点によれば、第1の符号付き整数と、第2の符号付き整数と定数Rから予め計算された2nビット長の第1の積と、剰余の法Pと、正の整数nを受け取る入力部と、
 乗算部と、
 上位ビット取得部を含む、符号付き整数の剰余積計算装置であって、
 前記乗算部は、前記第1の積と前記第1の符号付き整数から2nビット長の第2の積を計算し、
 前記上位ビット取得部は、前記第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得し、
 前記乗算部は、前記第1の上位ビットと前記剰余の法Pから2nビット長の第3の積を計算し、
 前記上位ビット取得部は、前記第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得し、
 前記定数Rは、符号付き整数に対する22nを法とする剰余計算による前記剰余の法Pの逆数である、符号付き整数の剰余積計算装置を提供できる。
 本発明の第3の視点によれば、入力部が、第1の符号付き整数と、第2の符号付き整数と、剰余の法Pと、正の整数nと、定数Rを受け取るステップと、
 乗算部が、前記第2の符号付き整数と前記定数Rから2nビット長の第1の積を計算するステップと、
 前記乗算部が、前記第1の積と前記第1の符号付き整数から2nビット長の第2の積を計算するステップと、
 上位ビット取得部が、前記第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得するステップと、
 前記乗算部が、前記第1の上位ビットと前記剰余の法Pから2nビット長の第3の積を計算するステップと、
 前記上位ビット取得部が、前記第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得するステップを含み、
 前記定数Rは、符号付き整数に対する22nを法とする剰余計算による前記剰余の法Pの逆数である、符号付き整数の剰余積計算方法を提供できる。本方法は、符号付き整数表現のデータに対して剰余積の計算を行うコンピュータという、特定の機械に結びつけられている。
 本発明の第4の視点によれば、入力部が、第1の符号付き整数と、第2の符号付き整数と定数Rから予め計算された2nビット長の第1の積と、剰余の法Pと、正の整数nを受け取るステップと、
 乗算部が、前記第1の積と前記第1の符号付き整数から2nビット長の第2の積を計算するステップと、
 上位ビット取得部が、前記第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得するステップと、
 前記乗算部が、前記第1の上位ビットと前記剰余の法Pから2nビット長の第3の積を計算するステップと、
 前記上位ビット取得部が、前記第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得するステップを含み、
 前記定数Rは、符号付き整数に対する22nを法とする剰余計算による前記剰余の法Pの逆数である、符号付き整数の剰余積計算方法を提供できる。本方法は、符号付き整数表現のデータに対して剰余積の計算を行うコンピュータという、特定の機械に結びつけられている。
 本発明の第5の視点によれば、コンピュータに、
 第1の符号付き整数と、第2の符号付き整数と、剰余の法Pと、正の整数nと、定数Rを受け取る処理と、
 前記第2の符号付き整数と前記定数Rから2nビット長の第1の積を計算する処理と、
 前記第1の積と前記第1の符号付き整数から2nビット長の第2の積を計算する処理と、
 前記第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得する処理と、
 前記第1の上位ビットと前記剰余の法Pから2nビット長の第3の積を計算する処理と、
 前記第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得する処理を実行させ、
 前記定数Rは、符号付き整数に対する22nを法とする剰余計算による前記剰余の法Pの逆数である、プログラムを提供できる。
 本発明の第6の視点によれば、コンピュータに、
 第1の符号付き整数と、第2の符号付き整数と定数Rから予め計算された2nビット長の第1の積と、剰余の法Pと、正の整数nを受け取る処理と、
 前記第1の積と前記第1の符号付き整数から2nビット長の第2の積を計算する処理と、
 前記第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得する処理と、
 前記第1の上位ビットと前記剰余の法Pから2nビット長の第3の積を計算する処理と、
 前記第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得する処理を実行させ、
 前記定数Rは、符号付き整数に対する22nを法とする剰余計算による前記剰余の法Pの逆数である、プログラムを提供できる。なお、このプログラムは、コンピュータが読み取り可能な記憶媒体に記録することができる。記憶媒体は、半導体メモリ、ハードディスク、磁気記録媒体、光記録媒体等の非トランジェント(non-transient)なものとすることができる。本発明は、コンピュータプログラム製品として具現することも可能である。
 本発明によれば、負のデータを符号なし整数表現のデータに変換することなく、符号付き整数表現のデータに対して剰余積の計算を行うことを可能とすることに貢献する、符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラムを提供することができる。
本発明の一実施形態の符号付き整数の剰余積計算装置の概略の構成の一例を示す図である。 本発明の一実施形態の符号付き整数の剰余積計算装置による処理の一例を示すフローチャートである。 本発明の別の一実施形態の符号付き整数の剰余積計算装置の概略の構成の一例を示す図である。 本発明の別の一実施形態の符号付き整数の剰余積計算装置による処理の一例を示すフローチャートである。 本発明の第1の実施形態の符号付き整数の剰余積計算装置の構成の一例を示す図である。 本発明の第1の実施形態の符号付き整数の剰余積計算装置の上位ビット取得部の構成の一例を示す図である。 本発明の第2の実施形態の符号付き整数の剰余積計算装置の構成の一例を示す図である。 本発明の第3の実施形態の符号付き整数の剰余積計算装置の構成の一例を示す図である。 本発明の第4の実施形態の符号付き整数の剰余積計算装置の構成の一例を示す図である。 本発明の符号付き整数の剰余積計算装置を構成するコンピュータの構成を示す図である。
 [本発明の一実施形態]
はじめに本発明の一実施形態の概要について図面を参照して説明する。なお、この概要に付記した図面参照符号は、理解を助けるための一例として各要素に便宜上付記したものであり、本発明を図示の態様に限定することを意図するものではない。また、以降の説明で参照する図面等のブロック間の接続線は、双方向及び単方向の双方を含む。一方向矢印については、主たる信号(データ)の流れを模式的に示すものであり、双方向性を排除するものではない。
 [符号付き整数の剰余積計算の内容]
本発明の一実施形態では、第1の符号付き整数Aと、第2の符号付き整数Bと、剰余の法Pと、正の整数nと、定数Rを入力とする。ここで、整数nは計算を行う計算機、又は、計算される積のハーフワード長である。ここで、定数Rは、

Figure JPOXMLDOC01-appb-I000005
          ・・・(式1)

を満たす整数であり、また、

Figure JPOXMLDOC01-appb-I000006

は、符号付き整数に対する22nを法とする剰余計算を示し、剰余計算の結果は、

Figure JPOXMLDOC01-appb-I000007

のいずれかの値を持つ。また、第1の符号付き整数Aと、第2の符号付き整数Bは、

Figure JPOXMLDOC01-appb-I000008
を満たす符号付き整数である。
 本発明の一実施形態では、上記入力から、Pを法とする符号付き整数の剰余積

Figure JPOXMLDOC01-appb-I000009
          ・・・(式2)

を、

Figure JPOXMLDOC01-appb-I000010
          ・・・(式3)
により計算する。
 なお、

Figure JPOXMLDOC01-appb-I000011

は、整数近似関数であり、任意の整数zと実数

Figure JPOXMLDOC01-appb-I000012

に対して、

Figure JPOXMLDOC01-appb-I000013

が成り立つものを選ぶ。そのような整数近似関数

Figure JPOXMLDOC01-appb-I000014

として、例えば、実数xの小数第1位を四捨五入する関数

Figure JPOXMLDOC01-appb-I000015

がある。
[符号付き整数の剰余積計算装置の概略の構成と動作]
最初に、本発明の一実施形態の符号付き整数の剰余積計算装置の概略の構成について説明する。図1は、本発明の一実施形態の符号付き整数の剰余積計算装置の概略の構成の一例を示す図である。図1を参照すると、符号付き整数の剰余積計算装置10は、入力部100と、乗算部210と、上位ビット取得部220を含む。
 次に、図1に示す本発明の一実施形態の符号付き整数の剰余積計算装置10の動作について、図2を参照して、説明する。図2は、本発明の一実施形態の符号付き整数の剰余積計算装置10による処理の一例を示すフローチャートである。処理は、ステップS100で開始する。
 ステップS101で、入力部100は、第1の符号付き整数Aと、第2の符号付き整数Bと、剰余の法Pと、正の整数nと、定数Rを含む入力20を受け取る。なお、入力部100は、例えば、上記入力20を入力するキーボード等の文字入力装置で実現されてもよい。なお、定数Rは、剰余の法Pと、正の整数nに対して、

Figure JPOXMLDOC01-appb-I000016

を満たす整数であり、

Figure JPOXMLDOC01-appb-I000017

は、符号付き整数に対する22nを法とする剰余計算を示す。
 ステップS102で、乗算部210は、第2の符号付き整数Bと定数Rから2nビット長の第1の積

Figure JPOXMLDOC01-appb-I000018

を計算する。
 次に、ステップS103で、乗算部210は、第1の積と第1の符号付き整数Aから2nビット長の第2の積

Figure JPOXMLDOC01-appb-I000019

を計算する。
 次に、ステップS104で、上位ビット取得部220は、第2の積Qに符号付きnビット右シフト(Q>>n(=Q/2))を行った結果に、整数近似を行って第1の上位ビット

Figure JPOXMLDOC01-appb-I000020

を取得する。
 次に、ステップS105で、乗算部210は、第1の上位ビットと剰余の法Pから2nビット長の第3の積

Figure JPOXMLDOC01-appb-I000021

を計算する。
 最後に、ステップS106で、上位ビット取得部220は、第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビット

Figure JPOXMLDOC01-appb-I000022

を取得し、出力30として、出力する。処理は、ステップS107で終了する。
[符号付き整数の剰余積の計算例]
次に、本発明の一実施形態の符号付き整数の剰余積計算装置10による、剰余計算の一例を説明する。なお、本発明の一実施形態の符号付き整数の剰余積計算装置10は、2の補数表現による符号付き整数を受け取り、2の補数表現による符号付き整数により、各計算を行うものとするが、以下の説明では、各数値を十進数で表記する。本発明の一実施形態の符号付き整数の剰余積計算装置10は、第1の符号付き整数A=-12、第2の符号付き整数B=19、剰余の法P=101、正の整数n=8、定数R、但し、

Figure JPOXMLDOC01-appb-I000023
             ・・・(式4)

を入力として受け取る。
 上記の入力を用いて、式(2)により、Pを法とする符号付き整数の剰余積を直接計算すると、

Figure JPOXMLDOC01-appb-I000024
             ・・・(式5)

となる。
 これに対して、本発明の一実施形態の符号付き整数の剰余積計算装置10により、上記の(式3)を計算した場合の計算過程を以下に説明する。
 乗算部210により、第2の符号付き整数B×定数R=19×(-20115)の2nビット(16ビット)長の第1の積を計算すると、式(3)の

Figure JPOXMLDOC01-appb-I000025

が計算でき、11031が得られる。
 次に、乗算部210により、第1の符号付き整数A×第1の積=-12×11031により、2nビット(16ビット)長の第2の積を計算すると、(式3)の

Figure JPOXMLDOC01-appb-I000026

が計算でき、-1300が得られる。
 次に、上位ビット取得部220により、第2の積に符号付きnビット右シフトを行い、その結果に、整数近似を行って第1の上位ビットを取得すると、(式3)における

Figure JPOXMLDOC01-appb-I000027

が計算でき、-5が得られる。
 次に乗算部210により、第1の上位ビット×剰余の法Pにより、2nビット(16ビット)長の第3の積を計算すると、(式3)における

Figure JPOXMLDOC01-appb-I000028

が計算でき、-505が得られる。
 最後に、上位ビット取得部220により、第3の積に符号付きnビット右シフトを行い、その結果に、整数近似を行って第2の上位ビットを取得すると、(式3)において

Figure JPOXMLDOC01-appb-I000029
        ・・・(式6)

が計算でき、-2が得られ、これを剰余積の出力30として出力する。
 上記の式(式5)と(式6)を比較すると、本発明の一実施形態の符号付き整数の剰余積計算装置10により、符号付き整数の剰余積

Figure JPOXMLDOC01-appb-I000030

を計算することができる。
 本発明の一実施形態によれば、負のデータを符号なし整数表現のデータに変換することなく、符号付き整数表現のデータに対して剰余積の計算を行うことを可能とすることに貢献する、符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラムを提供することができる。
[本発明の別の一実施形態]
次に、本発明の別の一実施形態の概要について図面を参照して説明する。図3は、本発明の別の一実施形態の符号付き整数の剰余積計算装置10の概略の構成の一例を示す図である。図3において、図1と同一の参照符号を付した構成要素は、同一の構成要素であるものとし、その説明を省略する。
 次に、本発明の別の一実施形態の符号付き整数の剰余積計算装置10の動作について、図4を参照して説明する。図4は、本発明の別の一実施形態の符号付き整数の剰余積計算装置10による処理の一例を示すフローチャートである。処理は、ステップS200で開始する。
 剰余積の応用例によっては、第1の積

Figure JPOXMLDOC01-appb-I000031

の事前計算を行える場合がある。本発明の別の一実施形態は、第1の積が事前に計算された場合の実施形態である。
 ステップS201で、入力部100が、第2の符号付き整数Bと定数Rを受け取ることなく、第1の符号付き整数Aと、第1の積

Figure JPOXMLDOC01-appb-I000032

と、剰余の法Pと、整数nを入力20として受け取る。
 次に、ステップS202で、乗算部210は、第1の積と第1の符号付き整数から2nビット長の第2の積

Figure JPOXMLDOC01-appb-I000033

を計算する。
 次に、ステップS203で、上位ビット取得部220は、第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビット

Figure JPOXMLDOC01-appb-I000034

を取得する。
 次に、ステップS204で、乗算部210は、第1の上位ビットと剰余の法Pから2nビット長の第3の積

Figure JPOXMLDOC01-appb-I000035

を計算する。
 次に、ステップS205で、上位ビット取得部220は、第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビット

Figure JPOXMLDOC01-appb-I000036

を取得し、出力30として、出力する。処理は、ステップS206で終了する。
 図3に示す本発明の別の一実施形態の符号付き整数の剰余積計算装置10は、上記の入力から、図1に示す本発明の一実施形態の符号付き整数の剰余積計算装置10で取得した第2の上位ビットと同一の第2の上位ビットを取得し、出力30として出力することができる。
 本発明の別の一実施形態によれば、負のデータを符号なし整数表現のデータに変換することなく、符号付き整数表現のデータに対して剰余積の計算を行うことを可能とすることに貢献する、符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラムを提供することができる。
 また、本発明の別の一実施形態によれば、第1の積が事前計算できる応用例では、図1及び図2を参照して説明した本発明の一実施形態の第1の積を計算するステップS102を省略することができ、剰余積の計算の高速化を図ることができる。
[第1の実施形態]
次に、本発明の第1の実施形態の符号付き整数の剰余積計算装置について、図面を参照して説明する。図5は、本発明の第1の実施形態の符号付き整数の剰余積計算装置10の構成の一例を示す図である。図5において、図1と同一の参照符号を付した構成要素は、同一の構成要素であるものとし、その説明を省略する。
 図5を参照すると、本発明の第1の実施形態の符号付き整数の剰余積計算装置10は、入力部100と、選択部200と、乗算部210と、上位ビット取得部220と、第1の記憶部230と、第2の記憶部240と、制御部300を含む。なお、以下の本発明の各実施形態の符号付き整数の剰余積計算装置10は、2の補数表現による符号付き整数を受け取り、2の補数表現による符号付き整数により、各計算を行うものとする。
 制御部300は、符号付き整数の剰余積計算装置10の選択部200による選択処理を制御し、及び、整数の剰余積計算装置10の全体の制御を行う。
 次に、本発明の第1の実施形態の符号付き整数の剰余積計算装置10の動作について、本発明の一実施形態の図2を参照して、説明する。本発明の第1の実施形態の符号付き整数の剰余積計算装置10の処理は、ステップS100で開始する。
 ステップS101において、入力部100は、第1の符号付き整数Aと、第2の符号付き整数Bと、剰余の法Pと、正の整数nと、定数Rを含む入力20を受け取る。第1の符号付き整数Aと、第2の符号付き整数Bと、剰余の法Pと、正の整数nと、定数Rの定義は、図1及び図2を参照して説明した本発明の一実施形態の定義と同一である。
 次に、ステップS102において、制御部300により、選択部200に入力された第2の符号付き整数B121と定数R122が選択され、選択出力201と202が乗算部210に送られる。乗算部210は、第2の符号付き整数Bと定数Rから、2nビット長の第1の積

Figure JPOXMLDOC01-appb-I000037

を計算する。計算された第1の積は、乗算部210の出力211に出力され、第1の記憶部230により記憶され、さらに出力される。
 次に、ステップS103において、制御部300により、選択部200に入力された第1の符号付き整数A123と第1の記憶部の出力231が選択され、選択出力201と202が乗算部210に送られる。第1の記憶部の出力231は、2nビット長の第1の積が出力されているので、乗算部210は、第1の符号付き整数Aと第1の積から2nビット長の第2の積

Figure JPOXMLDOC01-appb-I000038

を計算する。計算された第2の積は、乗算部210の出力211に出力され、第1の記憶部230により記憶され、さらに出力される。
 次に、ステップS104において、第1の記憶部の出力231と、正の整数n125が、上位ビット取得部220に入力される。第1の記憶部の出力231は、2nビット長の第2の積であり、上位ビット取得部220は、2nビット長の第2の積に符号付きnビット右シフトを行い、その結果に、整数近似を行って第1の上位ビット

Figure JPOXMLDOC01-appb-I000039

を取得し、出力221として出力する。第2の記憶部240は、第1の上位ビットを記憶し、出力241としてさらに出力する。
 次に、ステップS105において、制御部300により、選択部200に入力された剰余の法P124と第2の記憶部の出力241が選択され、選択出力201と202が乗算部210に送られる。第2の記憶部の出力241は、第1の上位ビットが出力されているので、乗算部210は、第1の上位ビットと剰余の法Pから2nビット長の第3の積

Figure JPOXMLDOC01-appb-I000040

を計算する。計算された第3の積は、乗算部210の出力211に出力される。第1の記憶部230は、第3の積を記憶し、出力231として出力する。
 最後に、ステップS106において、第1の記憶部の出力231と、正の整数n125が、上位ビット取得部220に入力される。第1の記憶部の出力231は、2nビット長の第3の積であり、上位ビット取得部220は、2nビット長の第3の積に符号付きnビット右シフトを行い、その結果に、整数近似を行って第2の上位ビット

Figure JPOXMLDOC01-appb-I000041

を取得し、出力221として出力する。第2の上位ビットは、第2の記憶部240により記憶され、出力30として出力される。処理は、ステップS107で終了する。
 本発明の第1の実施形態の符号付き整数の剰余積計算装置10による符号付き整数の剰余積の計算例は、図1及び図2を参照して説明した、本発明の一実施形態の符号付き整数の剰余積計算装置10による、剰余計算の一例と同様である。
[上位ビット取得部の構成]
次に、上位ビット取得部220の構成と動作について、図6を参照して説明する。図6は、本発明の第1の実施形態の符号付き整数の剰余積計算装置10の上位ビット取得部220の構成の一例を示す図である。
 図6を参照すると、上位ビット取得部220は、シフトレジスタ550と加算器560を含む。上位ビット取得部220は、2nビット長の入力500と、整数n125を入力として受け取る。
 図6を参照すると、2nビット(16ビット)長の入力500は、左端の最上位ビットMSB(Most Significant Bit)501と、ビット502からビット515と、右端の最下位ビットLSB(Least Siginicant Bit)516を含む。入力500は、ビット501から508の上位nビット5001とビット509から516の下位nビット5002により構成される。
 本発明の一実施形態では、符号付き整数の剰余積の計算例において、上位ビット取得部220の入力として、2の補数表現の-1300(dec、十進表記)が入力される場合の一例を示している。なお、この値は、本発明の一実施形態の、符号付き整数の剰余積の計算例において、上位ビット取得部220に入力されている第2の積の値に対応する。以下、2の補数表現の-1300(dec、十進表記)が入力された場合の上位ビット取得部220の計算動作について、説明する。
 シフトレジスタ550は、2nビット(16ビット)長の入力500に対する上位n(8)ビットレジスタ部551と下位n(8)ビットレジスタ部552と、少数第1位レジスタ553を含む。2nビット(16ビット)長の入力500の上位n(8)ビット5001と下位n(8)ビット5002は、シフトレジスタ550の上位n(8)ビットレジスタ部551と下位n(8)ビットレジスタ部552に、それぞれロードされる。
 つぎに、シフトレジスタ550にロードされた2nビット(16ビット)長の入力500は、入力された整数n125に従って、符号付きnビット右シフトが実施される。符号付きnビット右シフトは、シフトレジスタ550にロードされた入力500を、MSBからLSB側の向きに、nビットのシフトを行う処理である。この時に、シフトレジスタ550の上位n(8)ビットレジスタ部551には、ビット501の符号を示すMSBの値が設定される。
 図6を参照すると、シフトレジスタ550の各レジスタに示されている値は、入力500をシフトレジスタ550にロードして、符号付きn(8)ビット右シフトを実行した結果を示す。シフトレジスタ550の上位n(8)ビットレジスタ部551には、MSB501の値が設定され、シフトレジスタ550の下位n(8)ビットレジスタ部552には、入力500の上位nビット5001が配置され、シフトレジスタ550の少数第1位レジスタ553には、入力500のビット509の値が設定される。
 次に、シフトレジスタ550の符号付きnビット右シフト後の出力に対して、整数近似を行う。整数近似は、例えば、少数第1位の四捨五入により行う。少数第1位の四捨五入は、例えば、加算器560により行われる。
 図6を参照すると、加算器560は、2つの入力とキャリー入力とキャリー出力を有する2n(16)個の全加算器5601~5616を含み、下位の全加算器(例えば全加算器5603)のキャリー出力が上位の次段の全加算器(例えば全加算器5602)のキャリー入力に接続されている。
 加算器560の各全加算器5601~5608の一方の入力には、シフトレジスタ550の上位nビットレジスタ部551の出力が入力され、各全加算器5609~5616の一方の入力には、シフトレジスタ550の下位nビットレジスタ部552の出力が入力される。加算器560の各全加算器5601~5616の他方の全ての入力には、値0(ゼロ)が入力される。また、全加算器5616のキャリー入力5616CINには、少数第1位レジスタ553の出力が、入力される。
 図6を参照すると、加算器560の出力221は、2の補数表現の-5が出力され、本発明の第1の実施形態の符号付き整数の剰余積計算装置10の上位ビット取得部220により、

Figure JPOXMLDOC01-appb-I000042

が取得される。なお、この値は、本発明の一実施形態の、符号付き整数の剰余積の計算例における、第1の上位ビットの値-5に対応する。
 なお、図1及び3を参照して説明した、本発明の一実施形態及び別の一実施形態の符号付き整数の剰余積計算装置10の上位ビット取得部220も、本発明の第1の実施形態の符号付き整数の剰余積計算装置10の上位ビット取得部220の構成と同様でもよい。
 以上のように、本発明の第1の実施形態の符号付き整数の剰余積計算装置10により、符号付き整数の剰余積

Figure JPOXMLDOC01-appb-I000043

を計算することができる。
 本発明の第1の実施形態によれば、負のデータを符号なし整数表現のデータに変換することなく、符号付き整数表現のデータに対して剰余積の計算を行うことを可能とすることに貢献する、符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラムを提供することができる。
[第2の実施形態]
次に、本発明の第2の実施形態の符号付き整数の剰余積計算装置について、図面を参照して説明する。図7は、本発明の第2の実施形態の符号付き整数の剰余積計算装置の構成の一例を示す図である。図7において、図5と同一の参照符号を付した構成要素は、同一の構成要素であるものとする。
 剰余積の応用例によっては、本発明の第1の実施形態で説明した第1の積

Figure JPOXMLDOC01-appb-I000044

の事前計算を行える場合があり、本発明の第2の実施形態は第1の積が事前に計算された場合の実施形態である。
 次に、本発明の第2の実施形態の符号付き整数の剰余積計算装置10の動作について、本発明の別の一実施形態の図4を参照して、説明する。本発明の第2の実施形態の符号付き整数の剰余積計算装置10処理は、ステップS200で開始する。
 ステップS201において、入力部100は、第2の符号付き整数Bと定数Rを受け取ることなく、第1の符号付き整数Aと、2nビット長の第1の積

Figure JPOXMLDOC01-appb-I000045

と、剰余の法Pと、正の整数nを含む入力20を受け取る。第1の符号付き整数Aと、第2の符号付き整数Bと、剰余の法Pと、正の整数nと、定数Rの定義は、図1及び図2を参照して説明した本発明の一実施形態で説明したものと同一である。
 次に、ステップS202において、制御部300により、選択部200に入力された第1の符号付き整数A123と2nビット長の第1の積126が選択され、選択出力201と202が乗算部210に送られる。乗算部210は、第1の符号付き整数Aと第1の積から2nビット長の第2の積

Figure JPOXMLDOC01-appb-I000046

を計算する。計算された第2の積は、乗算部210の出力211に出力され、第1の記憶部230により記憶され、さらに出力される。
 次に、ステップS203において、第1の記憶部の出力231と、正の整数n125が、上位ビット取得部220に入力される。第1の記憶部の出力231は、2nビット長の第2の積であり、上位ビット取得部220は、2nビット長の第2の積に符号付きnビット右シフトを行い、その結果に、整数近似を行って第1の上位ビット

Figure JPOXMLDOC01-appb-I000047

を取得し、出力221として出力する。第2の記憶部240は、第1の上位ビットを、記憶し、出力241として出力する。
 次に、ステップS204において、制御部300により、選択部200に入力された剰余の法P124と第2の記憶部の出力241が選択され、選択出力201と202が乗算部210に送られる。第1の記憶部の出力241には、第1の上位ビットが出力されているので、乗算部210は、第1の上位ビットと剰余の法Pから2nビット長の第3の積

Figure JPOXMLDOC01-appb-I000048

を計算する。計算された第3の積は、乗算部210の出力211に出力される。第1の記憶部230は、第3の積を記憶し、さらに出力231として出力する。
 最後に、ステップS205において、第1の記憶部の出力231と、正の整数n125が、上位ビット取得部220に入力される。第1の記憶部の出力231は、2nビット長の第3の積であり、上位ビット取得部220は、2nビット長の第3の積に符号付きnビット右シフトを行い、その結果に、整数近似を行って第2の上位ビット

Figure JPOXMLDOC01-appb-I000049

を取得し、出力221として出力する。第2の上位ビットは、第2の記憶部240により記憶され、さらに出力30として出力される。処理は、ステップS206で終了する。
 本発明の第2の実施形態の符号付き整数の剰余積計算装置10による符号付き整数の剰余積の計算例は、図1及び図2を参照して説明した、本発明の一実施形態の符号付き整数の剰余積計算装置10による、剰余計算の一例と同様である。
 なお、本発明の第2の実施形態の符号付き整数の剰余積計算装置10の上位ビット取得部220の動作は、図6を参照して説明した、本発明の第1の実施形態の符号付き整数の剰余積計算装置10の第1の上位ビット取得部220の構成及び動作と同様でもよい。
 以上のように、本発明の第1の実施形態の符号付き整数の剰余積計算装置10により、符号付き整数の剰余積

Figure JPOXMLDOC01-appb-I000050

を計算することができる。
 本発明の第2の実施形態によれば、負のデータを符号なし整数表現のデータに変換することなく、符号付き整数表現のデータに対して剰余積の計算を行うことを可能とすることに貢献する、符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラムを提供することができる。
 また、本発明の第2の実施形態によれば、第1の積が事前計算できる応用例では、図2を参照して説明した本発明の第1の実施形態の第1の積を計算するステップS102を省略することができ、剰余積の計算の高速化を図ることができる。
[第3の実施形態]
次に、本発明の第3の実施形態の符号付き整数の剰余積計算装置について、図面を参照して説明する。図8は、本発明の第3の実施形態の符号付き整数の剰余積計算装置の構成の一例を示す図である。図8において、図5と同一の参照符号を付した構成要素は、同一の構成要素であるものとする。
 図8に記載の、本発明の第3の実施形態の符号付き整数の剰余積計算装置10は、図2に示す本発明の一実施形態の符号付き整数の剰余積計算装置による処理の一例を示すフローチャートの各ステップを、それぞれ実行する、入力部100と、第1の乗算部130と、第2の乗算部140と、第1の上位ビット取得部150と、第3の乗算部160と、第2の上位ビット取得部170を含むものである。
 入力部100は、図2のステップS101の処理を実行し、第1の符号付き整数Aと、第2の符号付き整数Bと、剰余の法Pと、正の整数nと、定数Rを含む入力20を受け取る。
 第1の乗算部130は、図2のステップS102の処理を実行し、第2の符号付き整数B121と定数R122から2nビット長の第1の積131を計算する。
 第2の乗算部140は、図2のステップS103の処理を実行し、前記第1の積131と前記第1の符号付き整数A123から2nビット長の第2の積141を計算する。
 第1の上位ビット取得部150は、図2のステップS104の処理を実行し、前記第2の積141に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビット151を取得する。
 第3の乗算部160は、図2のステップS105の処理を実行し、第1の上位ビット151と前記剰余の法P124から2nビット長の第3の積161を計算する。
 第2の上位ビット取得部170は、図2のステップS106の処理を実行し、第3の積161に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得し出力30として出力する。
[第4の実施形態]
次に、本発明の第4の実施形態の符号付き整数の剰余積計算装置について、図面を参照して説明する。図9は、本発明の第4の実施形態の符号付き整数の剰余積計算装置の構成の一例を示す図である。図9において、図7と同一の参照符号を付した構成要素は、同一の構成要素であるものとする。
 図9に記載の、本発明の第4の実施形態の符号付き整数の剰余積計算装置10は、図4に示す本発明の別の一実施形態の符号付き整数の剰余積計算装置による処理の一例を示すフローチャートの各ステップを、それぞれ実行する、入力部100と、第1の乗算実行部145と、第1の上位ビット取得部150と、第2の乗算実行部165と、第2の上位ビット取得部170を含むものである。
 入力部100は、図4のステップS201の処理を実行し、第1の符号付き整数Aと、第1の積

Figure JPOXMLDOC01-appb-I000051

と、剰余の法Pと、正の整数nとを含む入力20を受け取る。
 第1の乗算実行部145は、図4のステップS202の処理を実行し、前記第1の積126と前記第1の符号付き整数A123から2nビット長の第2の積141を計算する。
 第1の上位ビット取得部150は、図4のステップS203の処理を実行し、前記第2の積141に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビット151を取得する。
 第2の乗算実行部165は、図4のステップS204の処理を実行し、第1の上位ビット151と前記剰余の法P124から2nビット長の第3の積161を計算する。
 第2の上位ビット取得部170は、図4のステップS205の処理を実行し、第3の積161に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得し出力30として出力する。
 また、上記した一実施形態から第4の実施形態に示した手順は、符号付き整数の剰余積計算装置10として機能するコンピュータ(図10の9000)に、符号付き整数の剰余積計算装置10としての機能を実現させるプログラムにより実現可能である。このようなコンピュータは、図10のCPU(Central Processing Unit)9010、通信インタフェース9020、メモリ9030、補助記憶装置9040を備える構成に例示される。すなわち、図10のCPU9010にて、符号付き整数の剰余積計算のプログラムを実行し、その補助記憶装置9040等に保持された各計算パラメータの更新処理を実施させればよい。
 メモリ9030は、RAM(Random Access Memory)、ROM(Read Only Memory)等である。
 即ち、上記した一実施形態から第4の実施形態に示した符号付き整数の剰余積計算装置10の各部(処理手段、機能)は、上記コンピュータのプロセッサに、そのハードウェアを用いて、上記した各処理を実行させるコンピュータプログラムにより実現することができる。
 最後に、本発明の好ましい形態を要約する。
[第1の形態]
(上記第1の視点による符号付き整数の剰余積計算装置参照)
[第2の形態]
(上記第2の視点による符号付き整数の剰余積計算装置参照)
[第3の形態]
第1又は第2の形態に記載の符号付き整数の剰余積計算装置は、前記定数Rは、前記剰余の法Pと、前記正の整数nに対して、

Figure JPOXMLDOC01-appb-I000052

を満たす整数であり、

Figure JPOXMLDOC01-appb-I000053

は、符号付き整数に対する22nを法とする剰余計算を示す、ことが好ましい。
[第4の形態]
第3の形態に記載の符号付き整数の剰余積計算装置は、前記整数近似は、小数第1位を四捨五入する、ことが好ましい。
[第5の形態]
(上記第3の視点による符号付き整数の剰余積計算方法参照)
[第6の形態]
(上記第4の視点による符号付き整数の剰余積計算方法参照)
[第7の形態]
(上記第5の視点によるプログラム参照)
[第8の形態]
(上記第6の視点によるプログラム参照)
[第9の形態]
第7又は第8の形態に記載のプログラムは、前記定数Rは、前記剰余の法Pと、前記正の整数nに対して、

Figure JPOXMLDOC01-appb-I000054

を満たす整数であり、

Figure JPOXMLDOC01-appb-I000055

は、符号付き整数に対する22nを法とする剰余計算を示す、ことが好ましい。
[第10の形態]
第9の形態に記載のプログラムは、前記整数近似は、小数第1位を四捨五入する、ことが好ましい。
なお、上記第5又は6の形態は、第3と第4の形態に展開することが可能である。
 なお、上記の特許文献の各開示を、本書に引用をもって繰り込むものとする。本発明の全開示(請求の範囲を含む)の枠内において、さらにその基本的技術思想に基づいて、実施形態ないし実施例の変更・調整が可能である。また、本発明の開示の枠内において種々の開示要素(各請求項の各要素、各実施形態ないし実施例の各要素、各図面の各要素等を含む)の多様な組み合わせ、ないし選択が可能である。すなわち、本発明は、請求の範囲を含む全開示、技術的思想にしたがって当業者であればなし得るであろう各種変形、修正を含むことは勿論である。特に、本書に記載した数値範囲については、当該範囲内に含まれる任意の数値ないし小範囲が、別段の記載のない場合でも具体的に記載されているものと解釈されるべきである。
10 符号付き整数の剰余積計算装置
20 入力
30 出力
100 入力部
121 第2の符号付き整数B
122 定数R
123 第1の符号付き整数A
124 剰余の法P
125 整数n
130 第1の乗算部
140 第2の乗算部
145 第1の乗算実行部
150 第1の上位ビット取得部
160 第3の乗算部
165 第2の乗算実行部
170 第2の上位ビット取得部
200 選択部
210 乗算部
220 上位ビット取得部
230 第1の記憶部
240 第2の記憶部
300 制御部
550 シフトレジスタ
551 上位n(8)ビットレジスタ部
552 下位n(8)ビットレジスタ部
553 少数第1位レジスタ
560 加算器
5001 上位n(8)ビット
5002 下位n(8)ビット
5601~5616 全加算器
9000 コンピュータ
9010 CPU
9020 通信インタフェース
9030 メモリ
9040 補助記憶装置

Claims (10)

  1.  第1の符号付き整数と、第2の符号付き整数と、剰余の法Pと、正の整数nと、定数Rを受け取る入力部と、
     乗算部と、
     上位ビット取得部を含む、符号付き整数の剰余積計算装置であって、
     前記乗算部は、前記第2の符号付き整数と前記定数Rから2nビット長の第1の積を計算し、
     前記乗算部は、前記第1の積と前記第1の符号付き整数から2nビット長の第2の積を計算し、
     前記上位ビット取得部は、前記第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得し、
     前記乗算部は、前記第1の上位ビットと前記剰余の法Pから2nビット長の第3の積を計算し、
     前記上位ビット取得部は、前記第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得し、
     前記定数Rは、符号付き整数に対する22nを法とする剰余計算による前記剰余の法Pの逆数である、符号付き整数の剰余積計算装置。
  2.  第1の符号付き整数と、第2の符号付き整数と定数Rから予め計算された2nビット長の第1の積と、剰余の法Pと、正の整数nを受け取る入力部と、
     乗算部と、
     上位ビット取得部を含む、符号付き整数の剰余積計算装置であって、
     前記乗算部は、前記第1の積と前記第1の符号付き整数から2nビット長の第2の積を計算し、
     前記上位ビット取得部は、前記第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得し、
     前記乗算部は、前記第1の上位ビットと前記剰余の法Pから2nビット長の第3の積を計算し、
     前記上位ビット取得部は、前記第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得し、
     前記定数Rは、符号付き整数に対する22nを法とする剰余計算による前記剰余の法Pの逆数である、符号付き整数の剰余積計算装置。
  3.  前記定数Rは、前記剰余の法Pと、前記正の整数nに対して、

    Figure JPOXMLDOC01-appb-I000001

    を満たす整数であり、

    Figure JPOXMLDOC01-appb-I000002

    は、符号付き整数に対する22nを法とする剰余計算を示す、請求項1又は2に記載の符号付き整数の剰余積計算装置。
  4.  前記整数近似は、小数第1位を四捨五入する、請求項3に記載の符号付き整数の剰余積計算装置。
  5.  入力部が、第1の符号付き整数と、第2の符号付き整数と、剰余の法Pと、正の整数nと、定数Rを受け取るステップと、
     乗算部が、前記第2の符号付き整数と前記定数Rから2nビット長の第1の積を計算するステップと、
     前記乗算部が、前記第1の積と前記第1の符号付き整数から2nビット長の第2の積を計算するステップと、
     上位ビット取得部が、前記第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得するステップと、
     前記乗算部が、前記第1の上位ビットと前記剰余の法Pから2nビット長の第3の積を計算するステップと、
     前記上位ビット取得部が、前記第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得するステップを含み、
     前記定数Rは、符号付き整数に対する22nを法とする剰余計算による前記剰余の法Pの逆数である、符号付き整数の剰余積計算方法。
  6.  入力部が、第1の符号付き整数と、第2の符号付き整数と定数Rから予め計算された2nビット長の第1の積と、剰余の法Pと、正の整数nを受け取るステップと、
     乗算部が、前記第1の積と前記第1の符号付き整数から2nビット長の第2の積を計算するステップと、
     上位ビット取得部が、前記第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得するステップと、
     前記乗算部が、前記第1の上位ビットと前記剰余の法Pから2nビット長の第3の積を計算するステップと、
     前記上位ビット取得部が、前記第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得するステップを含み、
     前記定数Rは、符号付き整数に対する22nを法とする剰余計算による前記剰余の法Pの逆数である、符号付き整数の剰余積計算方法。
  7.  コンピュータに、
     第1の符号付き整数と、第2の符号付き整数と、剰余の法Pと、正の整数nと、定数Rを受け取る処理と、
     前記第2の符号付き整数と前記定数Rから2nビット長の第1の積を計算する処理と、
     前記第1の積と前記第1の符号付き整数から2nビット長の第2の積を計算する処理と、
     前記第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得する処理と、
     前記第1の上位ビットと前記剰余の法Pから2nビット長の第3の積を計算する処理と、
     前記第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得する処理を実行させ、
     前記定数Rは、符号付き整数に対する22nを法とする剰余計算による前記剰余の法Pの逆数である、プログラム。
  8.  コンピュータに、
     第1の符号付き整数と、第2の符号付き整数と定数Rから予め計算された2nビット長の第1の積と、剰余の法Pと、正の整数nを受け取る処理と、
     前記第1の積と前記第1の符号付き整数から2nビット長の第2の積を計算する処理と、
     前記第2の積に符号付きnビット右シフトを行った結果に、整数近似を行って第1の上位ビットを取得する処理と、
     前記第1の上位ビットと前記剰余の法Pから2nビット長の第3の積を計算する処理と、
     前記第3の積に符号付きnビット右シフトを行った結果に、整数近似を行って第2の上位ビットを取得する処理を実行させ、
     前記定数Rは、符号付き整数に対する22nを法とする剰余計算による前記剰余の法Pの逆数である、プログラム。
  9.  前記定数Rは、前記剰余の法Pと、前記正の整数nに対して、

    Figure JPOXMLDOC01-appb-I000003

    を満たす整数であり、

    Figure JPOXMLDOC01-appb-I000004

    は、符号付き整数に対する22nを法とする剰余計算を示す、請求項7又は8に記載のプログラム。
  10.  前記整数近似は、小数第1位を四捨五入する、請求項9に記載のプログラム。
PCT/JP2022/017737 2022-04-13 2022-04-13 符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラム WO2023199440A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/017737 WO2023199440A1 (ja) 2022-04-13 2022-04-13 符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラム

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2022/017737 WO2023199440A1 (ja) 2022-04-13 2022-04-13 符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラム

Publications (1)

Publication Number Publication Date
WO2023199440A1 true WO2023199440A1 (ja) 2023-10-19

Family

ID=88329337

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2022/017737 WO2023199440A1 (ja) 2022-04-13 2022-04-13 符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラム

Country Status (1)

Country Link
WO (1) WO2023199440A1 (ja)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005122141A (ja) * 2003-10-15 2005-05-12 Microsoft Corp モンゴメリ乗算におけるsimd命令の使用
JP2010091913A (ja) * 2008-10-10 2010-04-22 Renesas Technology Corp データ処理装置
WO2011036746A1 (ja) * 2009-09-24 2011-03-31 株式会社東芝 演算装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2005122141A (ja) * 2003-10-15 2005-05-12 Microsoft Corp モンゴメリ乗算におけるsimd命令の使用
JP2010091913A (ja) * 2008-10-10 2010-04-22 Renesas Technology Corp データ処理装置
WO2011036746A1 (ja) * 2009-09-24 2011-03-31 株式会社東芝 演算装置

Similar Documents

Publication Publication Date Title
EP1421472B1 (en) A method and apparatus for carrying out efficiently arithmetic computations in hardware
US7904498B2 (en) Modular multiplication processing apparatus
US20040019622A1 (en) Method and apparatus for modular multiplying and calculating unit for modular multiplying
JP2005250481A (ja) 多重精度を支援する拡張型モンゴメリモジュラ掛け算器
JP4783382B2 (ja) モンゴメリ法用乗算剰余計算装置
US10101970B2 (en) Efficient modulo calculation
Crowe et al. A scalable dual mode arithmetic unit for public key cryptosystems
JP3532860B2 (ja) 剰余系表現を利用した演算装置及び方法及びプログラム
JP3726966B2 (ja) 乗算器及び暗号回路
WO2023199440A1 (ja) 符号付き整数の剰余積計算装置、符号付き整数の剰余積計算方法及び、プログラム
US6807555B2 (en) Modular arithmetic apparatus and method having high-speed base conversion function
JP2006060703A5 (ja)
JP5175983B2 (ja) 演算装置
JPWO2009020216A1 (ja) 演算方法及び演算装置
TWI784406B (zh) 採用迭代計算的模數運算電路
JP3660075B2 (ja) 除算装置
KR101548174B1 (ko) 모듈러스의 음의 역원을 구하는 방법
Kawamura et al. Efficient algorithms for sign detection in RNS using approximate reciprocals
JP3787075B2 (ja) 曲線上の有理点群の部分群上元判定装置、そのプログラム及びその記録媒体
KR101777400B1 (ko) 룩업 테이블을 이용한 타원 곡선의 스칼라 곱셈 연산 장치 및 방법
JP3515462B2 (ja) 剰余系演算装置及び方法
JP3576155B2 (ja) 乗算剰余演算器
JP3563043B2 (ja) 平方根の逆数計算方法、計算回路、及びプログラム
CN117134917B (zh) 一种用于椭圆曲线加密的快速模运算方法和装置
JP2007503036A (ja) モジュラ乗算を行うための方法、および2nビットの数を使用してユークリッド乗算を行うための方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22937419

Country of ref document: EP

Kind code of ref document: A1