WO2007080652A1 - モンゴメリ法用乗算剰余計算装置 - Google Patents

モンゴメリ法用乗算剰余計算装置 Download PDF

Info

Publication number
WO2007080652A1
WO2007080652A1 PCT/JP2006/300396 JP2006300396W WO2007080652A1 WO 2007080652 A1 WO2007080652 A1 WO 2007080652A1 JP 2006300396 W JP2006300396 W JP 2006300396W WO 2007080652 A1 WO2007080652 A1 WO 2007080652A1
Authority
WO
WIPO (PCT)
Prior art keywords
digit
value
product
output
sum
Prior art date
Application number
PCT/JP2006/300396
Other languages
English (en)
French (fr)
Inventor
Kazuyoshi Furukawa
Masahiko Takenaka
Original Assignee
Fujitsu Limited
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Limited filed Critical Fujitsu Limited
Priority to PCT/JP2006/300396 priority Critical patent/WO2007080652A1/ja
Priority to JP2007553818A priority patent/JP4783382B2/ja
Priority to EP06711681A priority patent/EP1975906B1/en
Publication of WO2007080652A1 publication Critical patent/WO2007080652A1/ja
Priority to US12/218,060 priority patent/US8352529B2/en

Links

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/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

Definitions

  • the present invention relates to a multiplication residue calculation apparatus that performs multiplication multiplication at high speed using Montgomery algorithm, for example, in public key cryptosystem RSA encryption processing.
  • encryption is an essential technology in computer networks.
  • One of such cryptographic techniques is a public key cryptosystem suitable for digital signature, that is, authentication.
  • the public key cryptosystem requires a large amount of arithmetic processing for encryption / decryption, so high-speed encryption is desired, and various high-speed encryption algorithms have been announced.
  • Encryption methods can be broadly classified into two types: secret key cryptosystems and public key cryptosystems.
  • the secret key cryptosystem is a method of performing cryptographic communication when the sender and the receiver have the same encryption key.
  • a message is encrypted based on a secret encryption key and sent to the other party, and the recipient decrypts the ciphertext using this encryption key and returns it to the original message to obtain information.
  • Public key cryptography is a method in which a sender encrypts a message with the public key of the receiver that is made public and sends it, and the receiver performs communication by decrypting the encrypted message with his / her private key. It is.
  • the public key is a key for encryption
  • the secret key is encrypted by the public key. This is a key for decrypting the encrypted code.
  • the cipher encrypted with the public key can be decrypted only with the private key.
  • a key management center that can distribute the public key is set up, and the user's public key is registered in the public list to obtain the public key of the other party. The method is used.
  • the center only needs to prevent the public key from being falsified and need to keep it secret.
  • the public key method has a larger number of key bits than the secret key method, the file size required for storage increases.
  • the secret key cryptosystem a message to be transmitted is compressed and converted with a secret key, added to the transmitted text, sent, and similarly compressed and converted on the receiving side for comparison.
  • the receiver can forge the authentication data.
  • the sender compresses the message and encrypts it with the private key, adds the public key to the transmitted text and sends it, the receiver decrypts the data added with the sender's public key, Similarly, a method of comparing with the compressed and converted one is taken. In this case, the recipient cannot be cheated.
  • public key cryptosystem technology is indispensable in the authentication system.
  • public key cryptosystems have a major drawback in that a large amount of computation processing is required for encryption and decryption, so in general, a secret key cryptosystem that is fast in processing is disclosed for message encryption.
  • Key cryptosystems are often used in combination for authentication purposes.
  • the basic principle of this RSA cipher is as follows.
  • e and N are public keys
  • d is a secret key
  • e, d, M, N, etc. are large integers of about 1024 bits, so even if the fast exponential calculation method is used, an average of about 1500 times of multiple precision multiplication and remainder calculation is performed with one RSA operation. And have to do! /.
  • N, N ′, R, R— 1 and T are integers, and the remainder number is 0 ⁇ ⁇ 1 ⁇ ? ⁇ ,
  • REDC In one REDC, only TR-od N is calculated instead of the remainder Tmod N. Therefore, in order to obtain the remainder Tmod N, REDC may be performed again with the product of REDC (T) and R 2 mod N obtained in advance as shown below.
  • the algorithm that extends REDC to multiple precision is as follows.
  • the remainder ⁇ , the parameter ⁇ ', and the output variable ⁇ ⁇ are all in r,
  • N (n, n, ..., n),
  • () indicates that the number is expressed in r-adic.
  • single precision means one digit of r-ary number. When the same character is used, the position of the digit is basically upper-case letters in multiple precision, lower-case letters in single precision, and lower-case subscripts in multiple precision.
  • input T is a value that satisfies 0 ⁇ T ⁇ R'N.
  • input T is the result of multiplication of integers A, B (0 ⁇ A, B ⁇ N). Often. In this case, since multiplication of the integers A and B is also a multi-precision integer operation, iterative calculation similar to the multi-precision extended RED C is performed.
  • algorithm 3 is shown that has been expanded so that multiplication and REDC can be performed in the same iteration loop.
  • REDC (AX B), which is an extension of REDC to a multiprecision multiplication remainder, is as follows.
  • A (a, a, ..., a)
  • N (n, n, ..., n)
  • a and N are multiple precision, b and n 'are single precision, and A
  • the operation is performed as a multi-precision X single-precision calculation.
  • Algorithm 3 makes it possible to achieve multiprecision Montgomery multiplication remainder with multiprecision X single precision! /, But this multiprecision X single precision calculation part can be combined with single precision X single precision calculations. Expand.
  • Algorithm 4 has been extended to allow two multiplications to be performed in the same iteration loop. (Algorithm 4)
  • REDC (A X B), which extends REDC to single precision X single precision, is as follows.
  • A (a, a, ..., a),
  • N (n, n, ..., n)
  • Y (y, y
  • ABR— ⁇ od N can be obtained by single precision X single precision calculation by the following iterative processing of i and j. it can.
  • tmpl is a single precision value represented by the lower half of the result of the single precision sum-of-products calculation y + a 'b
  • tmp2 is This is a single precision value represented by the upper half bits of the calculation result of the product-sum calculation.
  • tmp 3 is a 1-bit value representing the force content expressed as one digit in the r base.
  • the outer loop is called the j loop and the inner loop is called the i / rape
  • the starting force of the j loop up to i / rape is the pre-core processing
  • the processing inside the i loop is the core processing
  • the end of the i / rape is the end of the j loop as core post-processing.
  • FIG. 1 is a configuration diagram of a modular multiplication apparatus that executes the core processing of algorithm 4 described above.
  • k-bit k is the number of bits in which a single-precision value is represented. In the case of a 32-bit processor, k is 32.
  • the multiplication remainder calculation apparatus shown in FIG. 1 includes an ⁇ product-sum circuit 10 and a j8 product-sum circuit 11 that internally perform multiplication and addition, and one of the numbers A: (a, a,..., A0 )
  • B register 13 holding (b, b,..., BO) and the modulus N
  • N register 14 that holds (n, ⁇ , ⁇ , ⁇ ) and the lower k of the output of j8 product-sum circuit 11 g-l g-2 0
  • Y register 15 for storing the output
  • m register 16 for holding Montgomery parameter m
  • An adder circuit 17 as a carry calculating unit to add
  • a C register 18 for storing the addition result of the adder circuit 17, and a selection circuit 19 for comparing the value of j with 0 and selecting an output.
  • a product-sum circuit 10 consists of k-bit multiplier 20 that multiplies the outputs from A register 12 and B register 13, and 2k bits that adds the output of k-bit multiplier 20 and the output of selection circuit 19 (Y register 15)
  • An adder 21 and a 2 k + 1 bit adder 22 for adding the output of the 2k bit adder 21 and the output of the C register 18 are provided.
  • the ⁇ product-sum circuit 11 includes a k-bit multiplier 23 that multiplies the outputs from the ⁇ register 14 and the m register 16, and the output of the k-bit multiplier 23 and the lower k bits from the ⁇ product-sum circuit 10. 2k-bit adder 24 for adding outputs.
  • FIG. 3 is an explanatory diagram showing the contents of the core processing of algorithm 4. Multiplying the output a (k bits) of the register 12 and the output b (k bits) of the B register 13 within the ⁇ product-sum circuit 10, and the multiplication result (2k bits; 30) is multiplied by the selection circuit. 19 Adds the output of the Y register 15 (k bit; 31) and the output of the C register 18 (k + 1 bit; 32).
  • the selection circuit 19 compares the value of j with 0. If the value of j is 0, the selection circuit 19 outputs 0 to the ⁇ product-sum circuit 1 0, and if the value of j is not ⁇ ⁇ Outputs the stored value y of register 15 to ⁇ product-sum circuit 10.
  • the ⁇ product-sum circuit 10 outputs the higher-order (k + 1) bits (34) of the operation result (2k + 1 bits; 33) to the calorie arithmetic circuit 17, and the lower-order k bits (35) of the product-sum circuit Output to 11.
  • 8 product-sum circuit 11 outputs the upper k bits (38) of the operation result (2k bits; 37) to adder circuit 17 and outputs the lower k bits (39) to Y register 15.
  • Y register 15 stores the k-bit data as value y.
  • the adder circuit 17 adds the output from the ⁇ product-sum circuit 10 (k + 1 bit; 34) and the output from the j8 product-sum circuit 11 (k bit; 38), and the addition result (k + 1 bit) ) Is output to C register 18.
  • the C register 18 stores this.
  • Algorithm 5 A modification of Algorithm 4 will be described as Algorithm 5.
  • A (a, a, ..., a)
  • N (n, n, ..., n)
  • the temporary variable with one digit of the r base is tmpl, tmp2, tmp4, and the carry variable is c, c.
  • ABR-imod N can be obtained as a single precision X single precision calculation by the following iterative processing of i and j.
  • the carry variable c is a 1-bit value representing the force content represented by one r-digit number.
  • FIG. 4 is a configuration diagram of a modular multiplication apparatus that executes the core processing of algorithm 5 described above.
  • the multiplication remainder calculation apparatus shown in FIG. 4 includes a first product-sum circuit 10a and a second product-sum circuit 11a that perform multiplication and addition internally, and one of the numbers A: (a, a, ..., a )
  • the B register 13 as the second register and the previous lower k-bit output of the second product-sum circuit 11a are retained.
  • Y register 15 as the third register to store the next low-order k-bit output
  • c register 18a as the fourth register holding the carry variable c
  • the modulus of the remainder N ( ⁇ , ⁇ ,
  • M register 16 as the 6th register holding the parameter m
  • c2 register 18b as the 7th register holding the carry variable c2
  • the upper k-bit output of the first product-sum circuit 10a the second product-sum circuit 11a
  • an adder circuit 17a as a carry calculating unit for adding the output of the higher-order k bits and the output of the c2 register 18b
  • a selector circuit 19 for comparing the value of j with 0 and selecting the output.
  • FIGS. 5A and 5B show the internal configurations of the first product-sum circuit 10a and the second product-sum circuit 11a, respectively.
  • the first product-sum circuit 10a includes a k-bit multiplier 20, a 2k-bit adder 21, and a 2k-bit adder 22a.
  • the k-bit multiplier 20 multiplies the outputs from the A register 12 and B register 13, and the 2 k-bit adder 21 adds the output of the k-bit multiplier 20 and the output of the selection circuit 19 (Y register 15).
  • 2k bit adder 22a is connected to the output of 2k bit adder 21 and the output of c register 18a.
  • the output of the selection circuit 19 (Y register 15) is added to the multiplication result first, and then the output of the c register 18a is added.
  • the second product-sum circuit 11a includes a k-bit multiplier 23 that multiplies the outputs from the N register 14 and the m register 16, and the output of the k-bit multiplier 23 and the lower k bits from the first product-sum circuit 10a. And a 2 kbit adder 24 for adding the outputs of.
  • FIG. 6 is an explanatory diagram showing the contents of the core processing of algorithm 5.
  • the output a (k bits) of the A register 12 is multiplied by the output b (k bits) of the B register 13, and the multiplication result (2k bits; 30) is multiplied by the selection circuit 19 (Y register 15) output (k bit; 31) c Register 18a output (k bit; 32a) is added.
  • the path 19 compares the value of j with 0, and if j has the value power ⁇ , outputs 0 to the first product-sum circuit 10a, and if not j, the value stored in the Y register 15
  • the value y is output to the first product-sum circuit 10a.
  • the first product-sum circuit 10a adds the upper k bits (34) of the operation result (2k bits; 33) Output to path 17a, and output the lower k bits (35) to the second product-sum circuit 11a.
  • the output n (k bits) of the N register 14 is multiplied by the output (k bits) of the m register 16, and the multiplication result (2k bits; 36) 1 Add the lower k bits (35) of the output from the product-sum circuit 10a.
  • the second product-sum circuit 11a outputs the upper k bits (38) of the operation result (2k bits; 37) to the counting circuit 17a and outputs the lower k bits (39) to the Y register 15. .
  • Y register 15 stores the k-bit data as value V.
  • the adder circuit 17a includes an output (k bits; 34) from the first product-sum circuit 10a, an output (k bits; 38) from the second product-sum circuit 11a, and an output (1 bit) from the c register 18b. ; Add 32b).
  • the upper 1 bit of the addition result (k + 1 bit) is stored in c register 18b.
  • the lower k bits are output to the c register 18a.
  • Each c register 18a, c register 1 is output to the c register 18a.
  • A (a, a,-
  • N (n, n, ..., n)
  • ABR— iod N can be obtained as a single precision X single precision calculation by iterative processing of i and j.
  • FIG. 7 is a configuration diagram of a modular multiplication apparatus that executes the core processing of algorithm 6 described above.
  • the modular multiplication apparatus shown in FIG. 7 includes a third product-sum circuit 10b and a fourth product-sum circuit l ib that internally perform multiplication and addition, and a first register similar to that shown in FIG. A register 12, B register as second register 13, Y register as third register 15, N register as fifth register 14, m register 16 as sixth register, selection circuit 19, and carry variable c C register 18c as the fourth register to hold and carry variable c to
  • the internal configuration of the third product-sum circuit 10b and the fourth product-sum circuit l ib is the same as the internal configuration of the first product-sum circuit 10a shown in FIG. 5A. Is composed of a k-bit multiplier 20, a 2k-bit adder 21, and a 2k-bit adder 22a.
  • the k-bit multiplier 20 of the third product-sum circuit 10b multiplies the outputs from the A register 12 and the B register 13, and the 2k-bit adder 21 outputs the output of the k-bit multiplier 20 and the selection circuit 19 2k bit adder 22a is added to the output of 2k bit adder 21 and register c.
  • the output of the selection circuit 19 (Y register 15) is added to the multiplication result.
  • the power to add first, and then add the output of c register 18c.
  • the k-bit multiplier 20 of the fourth product-sum circuit l ib multiplies the outputs from the N register 14 and the m register 16, and the 2k-bit adder 21
  • the sum of the low-order k bits of the 3 product-sum circuit 10b is added, and the 2k bit adder 22a adds the output of the 2k bit adder 21 and the output of the c register 18d.
  • It may be configured to add the output of the network.
  • FIG. 8 is an explanatory diagram showing the contents of the core processing of algorithm 6.
  • the output a (k bits) of the A register 12 is multiplied by the output b (k bits) of the B register 13, and the multiplication result (2k bits; 30) is multiplied by the selection circuit 19 (Y register 15) output (k bit; 31) and c register 18c output (k bit; 32c) are added.
  • the selection circuit 19 compares the value of j with 0, and when the value of j is 0, outputs 0 to the third product-sum circuit 10b, and when the value of j is not 0 Outputs the value y. Stored in the Y register 15 to the third sum-of-products circuit 10b.
  • the third sum-of-products circuit 10b uses the upper k bits (34) of the operation result (2k bits) as the c register 18c.
  • the k bits are stored as a carry variable for the next operation.
  • Fourth product-sum circuit l ib stores the upper k bits (38) of the operation result (2 k bits; 37) as c register
  • FIG. 9 is an overview of a flowchart showing an example of a modular multiplication process using the Montgomery method.
  • the j loop corresponds to the loop processing of (Algorithm 3).
  • a X b and m X N multi-precision X single-precision partial multiplication is performed.
  • the i loop is a part obtained by performing multi-precision X single-precision calculations of A X b and m X N by single-precision X single-precision partial multiplication.
  • partial multiplication of a X b and m X n is performed.
  • FIG. 10 is a diagram illustrating an example of a configuration for performing core preprocessing.
  • the register 41 holds a parameter n, for Montgomery calculation.
  • Multiplier circuit 40 is the third product
  • the third product-sum circuit 10b first multiplies the inputs a and b from the A register 12 and B register 13.
  • the multiplication result and the input y from the Y register 15 are added.
  • the upper 32 bits of the result are stored in c register 18c, and the lower 32 bits are stored in the fourth product-sum circuit.
  • the multiplication circuit 40 multiplies the output of the third product-sum circuit 10b and the output n ′ of the register 41, and
  • the lower 32 bits of the multiplication result are output to m register 16a.
  • the fourth product-sum circuit l ib multiplies the input n from the N register 14 and the value of the m register 16a, and the multiplication result is multiplied by the third product-sum circuit 10
  • the upper 32 bits of the result are stored in the c register 29.
  • the lower 32 bits are not used.
  • FIG. 11 is a diagram illustrating an example of a configuration for performing core processing, which is i-loop internal processing.
  • the Y register 15 is a register for holding the previous processing result and outputting the current processing result.
  • the third product-sum circuit 10b first multiplies the inputs a and b from the A register 12 and B register 13, adds the multiplication result and the input y from the Y register 15, and further adds the addition result and the c register. 18c
  • the fourth product-sum circuit l ib first multiplies the input n from the N register 14 and the value in the m register 16a, and adds the multiplication result to the output from the third product-sum circuit 10b. Further, the addition result and the value of the c register 18d are calculated. The upper 32 bits of the result are stored in c register 18d.
  • Y YZr processing of Algorithm 3 is realized by storing the i-th calculation result in yi_l.
  • FIG. 12 is a diagram illustrating an example of a configuration for performing core post-processing.
  • the adder circuit 45 outputs the output of the c register 18c, the output of the c register 18d,
  • the selection circuit 46 compares the carry output from the addition circuit 45 with 0 and 1, and outputs 0 to the Y register 15 if 0, and 1 to 1 if 1. In this core post-processing, the values of the carry variables c and c after the completion of the core processing are processed.
  • the addition result fits in the range of 32 bits + carry.
  • FIG. 13 is a diagram showing an example of the configuration of the product-sum circuit used in the above configuration example.
  • all processing units are configured to be 32 bits.
  • the product-sum circuit includes one 32-bit multiplier 51 and four 32-bit adders 52, 53, 54, 55. Have.
  • the input values of A and B are multiplied by a 32-bit multiplier 51, and output by two of upper 32 bits and lower 32 bits.
  • the 32-bit adder 53 adds the lower 32 bits of the output of the 32-bit multiplier 51 and the value of the input R, and outputs the resulting 32-bit to the 32-bit adder 55, and the carry to the 32-bit adder 52 To each output.
  • the 32-bit adder 52 adds the upper 32 bits of the output of the 32-bit multiplier 51 and the carry output of the 32-bit adder 53, and outputs the output 32 bits of the addition result to the 32-bit adder 54. This addition proves theoretically that no carry occurs.
  • the 32-bit adder 55 adds the output of the 32-bit adder 53 and the value of the input C, and outputs the output 32 bits as the L output (lower 32 bits) of the product-sum circuit. It is output to the bit adder 54.
  • the 32-bit adder 54 adds the output of the 32-bit adder 52 and the carry output of the 32-bit adder 55, and outputs the result 32 bits as the H output (higher 32 bits) of the multiply-add circuit To do. This addition does not generate a carry! It has been proved theoretically! RU
  • the product-sum circuit used in the conventional modular multiplication apparatus described above was a 4-input 2-output product-sum circuit.
  • This sum-of-products circuit multiplies two inputs and adds the result to the remaining two inputs.
  • a general processor does not have a 4-input 2-output product-sum circuit, and the problem is that the two product-sum circuits in Fig. 12 cannot be simplified.
  • a Pentiurn (registered trademark) processor is usually equipped with a 2-input 2-output multiplier. Nevertheless, when using 2-input 2-output multipliers and adders to achieve the same functions as the 4-input 2-output product-sum circuit, performance degradation was not a problem.
  • 1S recent processors such as the Itanium2 processor have a 3-input 2-output multiply-accumulate circuit.
  • the Itanium2 processor has two 3-input 2-output multiply-accumulate circuits.
  • the conventional algorithm that uses the conventional 4-input 2-output multiply-accumulate operation cannot make full use of the ability of a processor equipped with such a 3-input 2-output multiply-accumulate circuit.
  • Patent Document 1 Japanese Patent Laid-Open No. 11-212456
  • An object of the present invention is to provide an efficient multiplication residue calculation apparatus using 3-input 2-output product-sum operation suitable for the Montgomery method, and a method therefor.
  • the Montgomery method multiplication remainder calculation apparatus is a Montgomery method multiplication residue calculation apparatus that multiplies a value A and B, performs a remainder calculation by a modulus N, and calculates a result Y. 3 values, 1 digit value with B, and carry value are input, 1 digit value with A and 1 digit value with B are multiplied, and the carry value is added to this
  • the first product-sum calculation means that outputs the result divided into two values of the upper digit and the lower digit as its new carry value, a one-digit value with N, and a single-digit value m
  • the three values of the carry value are input, the one-digit value of N is multiplied by a certain value m, and the result of adding the carry value to the higher-order digit as its own new carry value
  • a second sum-of-products calculation means for outputting the binary value of the lower digits separately; a lower-order digit of the output of the first sum-of-products calculation means;
  • FIG. 1 is a block diagram of a modular multiplication apparatus for executing core processing of conventional algorithm 4.
  • FIG. 2A is a block diagram (part 1) of a conventional product-sum circuit in the case of FIG.
  • FIG. 2B is a configuration diagram (part 2) of the conventional product-sum circuit in the case of FIG.
  • FIG. 3 is an explanatory diagram showing the contents of core processing of conventional algorithm 4.
  • FIG. 4 is a configuration diagram of a modular multiplication apparatus for executing core processing of conventional algorithm 5
  • FIG. 5A is a configuration diagram (No. 1) of a conventional product-sum circuit in the case of FIG.
  • FIG. 5B is a configuration diagram (No. 2) of the conventional product-sum circuit in the case of FIG.
  • FIG. 6 is an explanatory diagram showing the contents of core processing of conventional algorithm 5.
  • FIG. 7 is a configuration diagram of a modular multiplication apparatus for executing core processing of conventional algorithm 6
  • FIG. 8 is an explanatory diagram showing the contents of core processing of conventional algorithm 6.
  • FIG. 9 is an overview of a flowchart showing an example of multiplication remainder processing by the Montgomery method.
  • FIG. 10 is a diagram illustrating an example of a configuration for performing core preprocessing.
  • FIG. 11 is a diagram showing an example of a configuration for performing core processing which is 1 / rape internal processing.
  • FIG. 12 shows an example of a configuration for performing core post-processing.
  • FIG. 13 is a diagram illustrating an example of a configuration of a conventional product-sum circuit.
  • FIG. 14 is a configuration diagram of a modular multiplication apparatus that executes the core processing of the algorithm according to the embodiment of the present invention.
  • FIG. 15 is a diagram showing a device configuration for performing core preprocessing in the algorithm of the embodiment of the present invention.
  • FIG. 16 is a diagram showing a device configuration for performing core post-processing in the algorithm of the embodiment of the present invention.
  • an arithmetic circuit for using the Montgomery method that effectively uses a 3-input 2-output product-sum circuit.
  • the algorithm is executed by using the two 3-input 2-output product-sum circuits in the core processing unit of the algorithm 6.
  • the upper k bits output from the first product-sum circuit are returned to the first product-sum circuit as the carry variable c, and the upper k bits output from the second product-sum circuit.
  • the bits are returned to the second sum-of-products circuit as carry variable c, and the (k + 2) bits that are the output result of the adder circuit are the upper 2 bits
  • A (a, a,-
  • N (n, n, ..., n)
  • ABR— ⁇ od N can be obtained as a single-precision X-single-precision calculation by the following iterative processing of i and j.
  • the carry variable c is a 1-bit value representing the force content represented by one r-digit number.
  • FIG. 14 is a configuration diagram of a modular multiplication apparatus that executes the core processing of the algorithm according to the embodiment of the present invention.
  • the modular multiplication apparatus shown in FIG. 14 includes a product-sum circuit 60 that internally performs multiplication and addition, and Multiply the product-sum circuit 61, the adder circuit 62, and the A register 63 as the first register that holds the number A: (a, a, ..., a) gl g-2 0 One number B: (b, b, ...,!)) Gl g-2 0 Holds B register 64 as the second register and the lower k bit output of the previous operation result of adder 62 Y register 65 as the third register to store the lower k-bit output of the next operation, m register 66 as the fourth register to hold the parameter m in the Montgomery algorithm, and the modulus of the remainder N: ( ⁇ , gl g-2 0 as the fifth register holding ⁇ , ..., n)
  • A, B, C, H, and L of product-sum circuit 60 and product-sum circuit 61 are all k bits.
  • the k-bit k is the number of bits used when the processor used for the operation expresses a single precision number. In the case of a 32-bit processor, k is 32.
  • AX B + C product-sum 2k bits are expressed as (H, L), where H is the upper k bits and L is the lower k bits.
  • the adder circuit 62 has k bits for A, B, C, D, and L, and 2 bits for H only (H is also k bits for software).
  • the addition result of A + B + C + D (k + 2) bits are expressed as (H, L), where H is the upper 2 bits (k bits in software) and L is the lower k bits.
  • the adder circuit 62 need not use a 4-input 2-output adder circuit. In other words, the addition operation has a smaller amount of calculation than the multiplication operation, and thus has less influence on the time and load required for the operation by the Mongomery method. Therefore, for example, even if a 2-input 2-output addition circuit is combined to form the addition circuit 62, the performance of the algorithm of the present invention is not greatly affected. Therefore, in Fig. 14, the adder circuit uses a 4-input 2-output adder circuit, but the configuration method is not specified here. If three 2-input 2-output additions are used, a circuit similar to the addition circuit 62 can be realized, and there is a method using an addition instruction with carry, and this addition has various configuration methods.
  • the adder circuit 62 inputs the lower k bits of the operation result of the product-sum circuit 60, the lower k bits of the operation result of the product-sum circuit 61, one digit of Y, and one digit of the carry.
  • the product-sum circuits 60 and 61 are preferably performed in parallel using two three-input two-output product-sum circuits, and while the calculation by the adder circuit 62 is being performed, It is preferable that the sum circuits 60 and 61 perform the next operation.
  • FIG. 15 is a diagram showing a device configuration for performing core preprocessing in the algorithm of the embodiment of the present invention.
  • Register 41 holds parameters n, for Montgomery calculation.
  • Multiplier circuit 40 is multiply-accumulate
  • the product-sum circuit 60 first multiplies the inputs a and b from the A register 63 and B register 64.
  • the multiplication result and the input y from the Y register 65 are added.
  • the upper k bits of the result are stored in the c register 68, and the lower k bits are output to the product-sum circuit 61 and the multiplication circuit 40 for calculating the parameter m.
  • the multiplication circuit 40 multiplies the output of the product-sum circuit 60 and the output n of the register 41, and multiplies the multiplication.
  • the lower k bits of the result are output to m register 66.
  • the multiply-accumulate circuit 61 multiplies the input n from the N register 67 by the value of the m register 66, and the multiplication result and the output from the multiply-accumulate circuit 60 are obtained.
  • the arithmetic unit for core preprocessing also uses a 3-input 2-output product-sum circuit.
  • the product-sum circuit used for core processing when used in the core preprocessing, one of the four inputs is set to 0.
  • the product-sum circuit to be used since the product-sum circuit to be used has 3 inputs and 2 outputs, such setting is unnecessary.
  • the product-sum circuit 61 needs to be processed after the product-sum circuit 60, the product-sum circuits 60 and 61 are executed in parallel as in the core processing. I can't. Therefore, even if you have two 3-input 2-output multiply-accumulate circuits, core pre-processing is not as effective as core processing, but you can still use 3-input 2-output multiply-accumulate circuits effectively.
  • FIG. 16 is a diagram showing a device configuration for performing core post-processing in the algorithm of the embodiment of the present invention.
  • the adder circuit 45 outputs the output of the c register 68, the output of the c register 69, and the output of the c register 70.
  • the selection circuit 46 compares the carry output from the addition circuit 45 with 0 and 1, and outputs 0 to the Y register 65 if it is 0 and 1 if it is 1. In this core post-processing, the values of carry variables c, c, c after the completion of core processing are processed.
  • 1 2 3 g is input to adder circuit 45, and the addition result is output to y of Y register 15 to process the carry.
  • the value of y is a force that is treated as k bits in Y register 65.
  • the result of the addition falls within the range of k bits + carry.
  • the processor represented by the Itaniu m2 processor, has achieved a speed that is four times faster than the conventional one. This is because the product-sum circuits 61 and 62 are parallelized and the propagation delay time is shortened by this parallelization.
  • the 3-input 2-output multiply-accumulate circuit of the present invention can also be applied to a product-sum circuit 61, 62 connected in series as usual.

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

 モンゴメリのアルゴリズムREDCによって、r進数のAとBについて、REDC(A×B)を計算する。プロセッサには、3入力2出力の積和回路が設けられているものを用いる。REDCをr進数の1桁ずつの演算に分解した場合の、A×Bにあたる部分を、3入力2出力の積和回路に行わせる。積和回路には、r進数で表されたAの1桁aiと、Bの1桁bjと、キャリー値c1とを入力し、ai×bj+c1を計算させ、結果のr進数2桁の上位桁をキャリー値c1とし、下位桁を後の計算に使用する。また、積和回路には、REDCのための法Nの1桁niと、所定の値mと、キャリー値c2を入力し、m×ni+c2を計算させ、上位桁をキャリー値c2とし、下位桁を後の計算に用いる。アルゴリズムが3入力2出力の積和計算で構成されているので、積和回路を有効利用して高速に処理できると共に、積和回路が2つ設けられている場合には、更に、演算を高速化できる。

Description

明 細 書
モンゴメリ法用乗算剰余計算装置
技術分野
[0001] 本発明は、例えば、公開鍵暗号系の RSA暗号処理において、モンゴメリのアルゴリ ズムを用いて乗算剰余計算を高速に行う乗算剰余計算装置に関する。
背景技術
[0002] 近年におけるコンピュータネットワークの発達により、データベースを検索する機会 、電子メール,電子-ユース等の電子化された情報をネットワークを経由して送受す る機会が急速に増加してきている。更に、これらを利用して、オンラインショッピング等 のサービスも提供されつつある。しかし、それに伴って、ネットワーク上の電子化され たデータを盗聴する、改竄する、他人になりすましてサービスを無償で受ける等の問 題も指摘されている。特に、無線を利用したネットワークにおいては、傍受が容易なた めに、これらの問題を防止する対策が望まれている。
[0003] これらの問題に対して暗号技術を応用した暗号ィ匕電子メール,利用者認証システ ムが提案され、種々のネットワークにも導入されつつある。
この意味で、コンピュータネットワークにおいては暗号ィ匕が必須の技術であるといえ る。このような暗号技術の中の一つにディジタル署名即ち認証に適した公開鍵暗号 方式がある。公開鍵暗号方式は、暗号化 Z復号に大量の演算処理が必要なために 高速ィ匕が望まれており、様々な高速ィ匕アルゴリズムが発表されている。
[0004] 暗号化方式は、大別すると秘密鍵暗号系と公開鍵暗号系との二つに分類できる。
秘密鍵暗号系は、送信者と受信者とが同じ暗号鍵を持つことにより暗号通信を行う方 式である。即ち、秘密鍵暗号系では、あるメッセージを秘密の暗号鍵に基づいて暗号 化して相手に送り、受け手はこの暗号鍵を用いて暗号文を復号して元のメッセージに 戻して情報を入手する。公開鍵暗号系は、送信者が公開されている受信者の公開鍵 でメッセージを暗号ィ匕して送信し、受信者が自分の秘密鍵でその暗号化メッセージを 復号することにより通信を行う方式である。
[0005] 即ち、公開鍵暗号系では、公開鍵は暗号ィ匕のための鍵、秘密鍵は公開鍵により暗 号ィ匕された暗号を復号するための鍵であり、公開鍵で暗号ィ匕した暗号は秘密鍵での み復号することができる。
[0006] 秘密鍵暗号系では、個人が秘密に保管しなければならない鍵が通信相手の数だ け必要であり、必要な総鍵数は n人のネットワークの場合 n(n— 1) Z2個である。また 、初めて通信する相手に対しては、何らかの方法で秘密鍵の配送が必要であるという 欠点がある。
[0007] この欠点を解消するために、大規模なネットワークでは、鍵管理センタを設置し、セ ンタとの間の秘密鍵のみを保管し、暗号通信を行う場合は、センタカゝら送信相手との 秘密鍵を得る方法が用いられる。
[0008] 一方、公開鍵暗号系では、個人が秘密に保管する鍵は自分の秘密鍵のみであり、 必要な総秘密鍵数も n人のネットワークの場合 n個である。
また、初めて通信する相手に対しては、公開鍵の配送を行えば良ぐ鍵管理センタ を設置して、ユーザの公開鍵を n個公開簿に登録し、センタ力 送信相手の公開鍵 を得る方法が用いられる。
[0009] この場合、センタは公開鍵の改竄を防ぐだけで、秘密に保管する必要がな 、。但し 、公開鍵方式は秘密鍵方式に比べて鍵のビット数が大きいため保管に要するフアイ ルサイズは大きくなる。また、認証の場合、秘密鍵暗号系では、例えば送信するメッ セージを秘密鍵で圧縮変換し、送信文に付加して送り、受信側では同様に圧縮変換 して比較する方式がとられて ヽる。
[0010] しかし、送受信が同じ鍵であるため、受信者は認証データを偽造することができる。
これに対して、公開鍵暗号系では、秘密鍵で暗号ィ匕することができるのは本人だけ であるので、偽造することはできない。公開鍵暗号系では、送信者はメッセージを圧 縮変換して秘密鍵で暗号化し、公開鍵を送信文に付加して送り、受信者は送信者の 公開鍵で付加されたデータを復号し、同様に圧縮変換したものと比較する方式がとら れている。この場合、受信者は不正ができない。
[0011] このように認証系では公開鍵暗号系の技術は必要不可欠であるといえる。しかし、 公開鍵暗号系には、暗号ィ匕 Z復号に大量の演算処理が必要であるという大きな欠 点があるため、一般には、処理が速い秘密鍵暗号系をメッセージの暗号化に、公開 鍵暗号系は認証用にと 、うように組み合わせて用いられる場合が多 、。
[0012] 公開鍵暗号系の中で、現在最も有力なものが 1977年にリヴエス HRivest) ,シャミア
(Shamir)及びエイドルマン (Adlman)の三人によって発明された RSA暗号である。 この RSA暗号の基本原理は次のようなものである。
(RSAの基本アルゴリズム)
暗号鍵 (e, N)と対応する復号鍵 (d, N)とにおいて、 eと Nとは公開鍵であり、 dは秘 密鍵である。
[0013] 平文を M,暗号文を Cとすると、暗号化 Eと復号 Dとのアルゴリズムは次のようにあら わされる。
C = E (M) =M° mod N
M = D (C) =Cd mod N
但し、 d'e= lmod LCM{ (p— 1) , (q— 1) }
N = p -q
LCM:最小公倍数 (lowest common multiple)
p, qは大きな素数
通常、 e, d, M, Nなどは 1024ビット程度の大きな整数が用いられているので、高速 指数計算法を使用しても 1回の RSA演算で平均 1500回程度の多重精度乗算と剰余 算とを行わなければならな!/、。
[0014] 特に剰余計算については、演算処理を高速化するために、近似法,剰余テーブル 方式,モンゴメリのアルゴリズム等、多くの高速ィ匕手法が提案されている。
このような、 RSA暗号に代表される公開鍵暗号系の多くで利用される、べき乗剰余 アルゴリズムを高速に処理するためには、 1回あたりの剰余アルゴリズムの高速化が 要求される。
[0015] この剰余演算の高速ィ匕を実現する一方法であるモンゴメリのアルゴリズムについて 説明する。モンゴメリのアルゴリズムについては、 Modulo Multiplication Without Trial Division, Peter L. Montgomery, Mathematics of computation, Volume 44, Number 170, April 1985 pp. 519〜528を参照されたい。
(モンゴメリのァノレゴリズム) モンゴメリのアルゴリズムは、剰余の法 N (N> 1)と、剰余の法 Nと互いに素である基 数 R (R>N)とを用いると、被剰余数 Tから TR— Wxi Nの計算が基数 Rによる除算の みで行えることを利用して、 Nによる除算を用いることなく剰余計算を行うアルゴリズム である。
[0016] 以下において、 N, N' , R, R—1及び Tは整数であり、被剰余数丁は0≤丁<1^?^、
R—1は剰余の法 Nの上での基数 Rの逆数であり、 R'R— i— Ν·Ν' = 1 (0≤R— 1く Ν, 0
≤Ν' く R)の関係を満たす。
[0017] 更に、この基数 Rに 2のべキ乗数を使用した場合、基数 Rによる除算をシフト操作に 置き換えることができるため、 T→TR— od Nの計算の高速処理が可能となる。 次に、アルゴリズム 1として、 T→TR— od Nのアルゴリズム REDC (T)を示す。
[0018] 但し、アルゴリズム 1において (T+m'N) ZRは必ず割り切れることが証明されてい る。
(アルゴリズム
T→TR_1mod Nのアルゴリズム Y=REDC (T)は次のようにあらわされる。
M= (Tmod R) 'N' mod R
Υ= (Τ+Μ·Ν) ZR
if Y≥N then Y=Y— N
if Y<N then return Y
1回の REDCでは、剰余 Tmod Nではなく TR— od Nが求められるだけである。 よって、剰余 Tmod Nを求めるためには、次に示すように REDC (T)と、予め求めて おいた R2mod Nとの積で、再び REDCを行えば良い。
REDC (REDC (T) · (R2 mod N) )
= (TR_1mod N) · (R2 mod N) -R' mod N
=TR_1 -R2 -R' mod N
=Tmod N
このようにして、剰余 Tmod Nを求めることができる。
(REDCの多重精度計算への拡張)
次に、剰余の法 Nまたは基数 Rが多倍長即ち多重精度である場合について、 RED cのアルゴリズムを拡張する。
剰余の法 N,基数 Rが多重精度である場合、 REDCの (Tmod R) ·Ν' 及び Μ·Ν の計算は、多重精度 X多重精度の処理となり、汎用の計算機では非常に大きな処理 量と処理時間とが必要となる。そこで、この部分を多重精度 X単精度の処理で行える ように拡張したアルゴリズム 2を示す。
(ァノレゴリズム 2)
REDCを多重精度へ拡張したアルゴリズムは次に示すようになる。被剰余数 Τ, ノ ラメータ Ν' ,出力用変数 Υが何れも r進数で、
T= (t , t , · ··, t ) ,
g-l -2 O r
N= (n , n , · · ·, n ) ,
g-l g-2 O r
Y= (yg , y , · ··, y ) ,
g-l 0 r
n' ,
0
r= 2 ,
R=rg
とあらわされる場合、次に示す j = 0〜g—lの繰り返し処理により TR— odNを多重精 度 X単精度として、以下のアルゴリズムによって求めることができる。なお、ここで、( )は、 r進数で表された数であることを示す。また、ここで単精度とは r進数 1桁のことと し、同じ文字を使用した場合、基本的に大文字を多重精度、小文字を単精度、小文 字の添字を多重精度での桁の位置とする。
Y=T
for j = 0 to g— 1
m=y ·η' mod r
0 0
Y=Y+m-N
Y=Y/r
next
if Y≥N then Y=Y— N
if Y<N then return Y
このようにして得られる TR_1mod Nと、上述したように予め求めておいた R2 mod Nと の積で再び REDCを行うことにより、 Tmod Nを求めることができる。
(REDCの多重精度乗算剰余への拡張)
次に、 REDCのアルゴリズムを乗算剰余演算に拡張する。
[0020] 上記のアルゴリズムにおいて、入力 Tは 0≤T<R'Nを満たす値である力 実際の R SA演算では、入力 Tが整数 A, B (0≤A, B<N)の乗算結果であることが多い。 その場合、整数 A, Bの乗算も多重精度整数演算であるため、多重精度拡張 RED Cと同様の繰り返し計算が行われる。
[0021] この場合、乗算と REDCとを別々に繰り返し計算すると、繰り返し計算制御による口 スが 2倍になってしまう。
そこで、乗算と REDCとを同一の繰り返しループで行えるように拡張したァルゴリズ ム 3を示す。
(ァノレゴリズム 3)
REDCを多重精度乗算剰余へ拡張したアルゴリズム REDC (AX B)は次に示すよ うになる。
[0022] 乗算する 2数 A, B,パラメータ N' ,モンゴメリ乗算のパラメータ η, ,出力用変数 Y が何れも r進数で、
A= (a , a , · ··, a )
B = (b , b , · ··, b )
N = (n , n , · ··, n )
Y= (y , y , · ·' ', y ) ,
n ,
r= 2,
R=rg
とあらわされる場合、次に示す j = 0〜g—lの繰り返し処理により、 ABR mod Nを多 重精度 X単精度の計算として求めることができる。
Y=0
for j = 0 to g—上
Y=Y+A-b m=y ·η' mod r
0 0
Y=Y+m-N
Y=Y/r
next
if Y≥N then Y=Y— N
if Y<N then return Y
上記のアルゴリズム 3においては、 A、 Nが多重精度で、 b、 n' が単精度であり、 A
j o
と の乗算を行って 、るので、多重精度 X単精度の計算として演算が行われて 、る。
[0023] このようにして得られる ABR_1mod Nと、上述したように予め求めておいた R2 mod N との積で再び REDCを行うことにより、 ABmod Nを求めることができる。
(REDCの単精度 X単精度処理への拡張)
アルゴリズム 3では、多重精度のモンゴメリ乗算剰余を多重精度 X単精度で実現可 能として!/、るが、この多重精度 X単精度の計算部分をさらに単精度 X単精度の計算 を組み合わせて行えるよう拡張する。
[0024] この場合、 AX bの計算部分と mX Nの計算部分とが繰り返し計算となり、上述の 場合と同様に 2つの乗算を別々に繰り返し計算すると、繰り返し計算制御によるロス 力 倍になってしまう。
[0025] そこで、 2つの乗算を同一の繰り返しループで行えるようにすれば、ロスの低減が可 能である。
2つの乗算を同一の繰り返しループで行えるように拡張したアルゴリズム 4を示す。 (アルゴリズム 4)
REDCを単精度 X単精度へ拡張したアルゴリズム REDC (A X B)は次に示すよう になる。
[0026] 乗算する 2数 A, B,パラメータ N' ,モンゴメリ乗算のパラメータ η, ,出力用変数 Y
0
,キャリー変数 Cが何れも r進数で、
A= (a , a , · ··, a ) ,
g-l g-2 O r
B= (b , b , · ··, b ) ,
g-l g-2 O r
N= (n , n , · ··, n ) , Y= (y , y
g -l,…, y )
O r,
C= (c , c ) ,
1 0 r
n, ,
0
r= 2,
R=rg
とあらわされ、 r進 1桁の一時変数を tmpl, tmp2, tmp3, tmp4とする場合、次に示す i, jの繰り返し処理により ABR— ^od Nを単精度 X単精度の計算で求めることができる。
Y=0
for j = 0 to g— 1
(tmp2, tmpl) =y +a eb
r 0 0 j
m=tmpl ·η' mod r
o
(tmp4, tmpl) =tmpl +men コア刖処理
r 0
(c , c ) =tmp2+tmp4
1 0 r
for i=0 to g— 1
(tmp3, tmp2, tmpl) =y.+ (c c ) +a eb
(tmp4, y ) =tmpl +m-n コア処理
i— 1 r i
(cl , cO ) =tmp4+ (tmp3, tmp2)
next i
(c , c ) = (c , c ) +y
1 0 r 1 0 r g
y =c コア後処理
g-l 0
y =c
g 1
next j
if Y≥N then Y=Y—N 補正処理
if Y<N then return Y
ここで、( は、括弧内の r進数 1桁の変数を多重精度として扱うことを示している。 tmpl〜tmp4、 c、 cは、 r進数で表された多重精度の数を複数のビットに列に分割し
0 1
、それぞれを単精度の値として表したものである。たとえば、 tmplは、単精度の積和 計算 y +a 'bの計算結果の下半分のビットで表される単精度の値であり、 tmp2は、 当該積和計算の計算結果の上半分のビットで表される単精度の値である。また、 tmp 3, clは r進数 1桁で表現している力 内容は 1ビットの値である。
[0028] 出力用変数 Yについて、計算に使用する値が yのとき、出力が y に格納されるの
i i-1
は、アルゴリズム 3における Y=YZrの機能をこれにより実現しているためである。 また、便宜上、外側のループを jループ、内側のループを i/レープと呼び、 jループの 始め力 i/レープまでをコア前処理、 iループ内の処理をコア処理、 i/レープの終わりか ら jループの終わりまでをコア後処理と呼ぶこととする。
[0029] 図 1は、上述したアルゴリズム 4のコア処理を実行する乗算剰余計算装置の構成図 である。
なお、以下のすべての説明において、 kビットの kとは、単精度の値が表されるビット 数であり、 32ビットプロセッサの場合であれば、 kは 32となる。
[0030] 図 1に示す乗算剰余計算装置は、内部で乗算及び加算を行う α積和回路 10及び j8積和回路 11と、乗算する一方の数 A : (a , a , · · · , a0)を保持する Aレジスタ 12
g-l g-2
と、乗算する一方の数 B : (b , b , · · · , bO )を保持する Bレジスタ 13と、剰余の法 N
g-l g-2
: (n , η , · · · , η )を保持する Νレジスタ 14と、 j8積和回路 11の出力の下位 kビ g-l g-2 0
ットを格納する Yレジスタ 15と、モンゴメリのパラータ mを保持する mレジスタ 16と、 a 積和回路 10の出力の上位 (k + 1)ビット及び β積和回路 11の出力の上位 kビットを 加算するキャリー計算部としての加算回路 17と、加算回路 17の加算結果を格納する Cレジスタ 18と、 jの値と 0とを比較して出力を選択する選択回路 19とを有する。
[0031] また、 α積和回路 10, |8積和回路 11の内部構成を図 2Α, Βに夫々示す。
a積和回路 10は、 Aレジスタ 12及び Bレジスタ 13からの出力を乗算する kビット乗算 器 20と、 kビット乗算器 20の出力及び選択回路 19 (Yレジスタ 15)の出力を加算する 2kビット加算器 21と、 2kビット加算器 21の出力及び Cレジスタ 18の出力を加算する 2 k+ 1ビット加算器 22とを有する。
[0032] β積和回路 11は、 Νレジスタ 14及び mレジスタ 16からの出力を乗算する kビット乗 算器 23と、 kビット乗算器 23の出力及び α積和回路 10からの下位 kビットの出力を 加算する 2kビット加算器 24とを有する。
[0033] 図 3は、アルゴリズム 4のコア処理の内容を示す説明図である。 α積和回路 10内にて、 Αレジスタ 12の出力 a (kビット)と Bレジスタ 13の出力 b (kビ ット)とを乗算し、その乗算結果 (2kビット; 30)に、選択回路 19 (Yレジスタ 15)の出 力(kビット;31)と Cレジスタ 18の出力(k+ 1ビット; 32)とを加算する。
[0034] なお、選択回路 19は、 jの値と 0とを比較し、 jの値が 0である場合には α積和回路 1 0へ 0を出力し、 jの値力 ^でない場合には Υレジスタ 15の格納値 yを α積和回路 10 へ出力する。
[0035] α積和回路 10は、その演算結果(2k+ lビット; 33)の上位 (k+ 1)ビット(34)をカロ 算回路 17へ出力し、その下位 kビット(35)を 積和回路 11へ出力する。
[0036] j8積和回路 11内にて、 Nレジスタ 14の出力 n (kビット)と mレジスタ 16の出力(kビ ット)とを乗算し、その乗算結果 (2kビット; 36)に α積和回路 10からの下位 kビット出 力(35)を加算する。
[0037] |8積和回路 11は、その演算結果(2kビット; 37)の上位 kビット(38)を加算回路 17 へ出力し、その下位 kビット(39)を Yレジスタ 15へ出力する。 Yレジスタ 15は、その k ビットのデータを値 y として格納する。
i-l
[0038] 加算回路 17は、 α積和回路 10からの出力(k+ 1ビット; 34)と j8積和回路 11から の出力(kビット; 38)とを加算し、その加算結果 (k+ 1ビット)を Cレジスタ 18へ出力す る。 Cレジスタ 18は、これを格納する。
[0039] アルゴリズム 4の変形例をアルゴリズム 5として説明する。
(ァノレゴリズム 5)
乗算する 2数 A, B,パラメータおモンゴメリ乗算のパラメータ η' ,出力用変数 Yが 何れも r進数で、
A= (a , a , · ··, a )
B = (b , b , · ··, b )
N = (n , n , · ··, n )
Y= (y , y , · ·' ', y ) ,
η , とあらわされ、 r進数 1桁の一時変数を tmpl, tmp2, tmp4,キャリー変数を c , cとする
1 2 場合、次に示す i, jの繰り返し処理により ABR— imod Nを単精度 X単精度の計算とし て求めることができる。
[0040] Y=0
for j = 0 to g— 1
(tmp2, tmpl) =y +a eb
r 0 0 j
m=tmpl ·η' mod r
o
(tmp4, tmpl) =tmpl +men コア刖処理
r 0
(c , c ) =tmp2+tmp4
2 1 r
for i= 1 to g— 1
(tmp2, tmpl) =y +c +a eb
r i 1 i j
(tmp4, y ) =tmpl +m-n コア処理
i— 1 r i
(c , c ) = tmp4 + tmp2 + c
2 1 r 2
next i
(c , c ) = (c , c ) +y
2 1 r 2 1 r g
y C コア後処理
g-1 1
y =c
g
next j
if Y≥N then Y=Y—N 補正処理
if Y<N then return Y
ここで、 ( は、括弧内の r進数 1桁の変数を多重精度として扱うことを示している。 またキャリー変数 c は r進数 1桁で表現している力 内容は 1ビットの値である。
2
[0041] 図 4は、上述したアルゴリズム 5のコア処理を実行する乗算剰余計算装置の構成図 である。
図 4に示す乗算剰余計算装置は、内部で乗算及び加算を行う第 1積和回路 10a及 び第 2積和回路 11aと、乗算する一方の数 A: (a , a , · ··, a )を保持する第 1レ
g-1 g-2 0
ジスタとしての Aレジスタ 12と、乗算する一方の数 B : (b , b ,…, b )を保持する
g-1 g-2 0
第 2レジスタとしての Bレジスタ 13と、第 2積和回路 11aの前回の下位 kビット出力を保 持し、次回の下位 kビット出力を格納する第 3レジスタとしての Yレジスタ 15と、キヤリ 一変数 cを保持する第 4レジスタとしての cレジスタ 18aと、剰余の法 N : (η , η ,
1 1 g-1 g-2
· · ·, n )を保持する第 5レジスタとしての Nレジスタ 14と、モンゴメリアルゴリズムにおけ
0
るパラータ mを保持する第 6レジスタとしての mレジスタ 16と、キャリー変数 c2を保持 する第 7レジスタとしての c2レジスタ 18bと、第 1積和回路 10aの上位 kビット出力,第 2積和回路 11aの上位 kビット出力及び c2レジスタ 18bの出力を加算するキャリー計 算部としての加算回路 17aと、 jの値と 0とを比較してその出力を選択する選択回路 1 9とを有する。
[0042] また、第 1積和回路 10a,第 2積和回路 11aの内部構成を図 5A, Bに夫々示す。
第 1積和回路 10aは、 kビット乗算器 20と 2kビット加算器 21と 2kビット加算器 22aと を有する。 kビット乗算器 20は、 Aレジスタ 12及び Bレジスタ 13からの出力を乗算し、 2kビット加算器 21は、 kビット乗算器 20の出力と選択回路 19 (Yレジスタ 15)の出力と を加算し、 2kビット加算器 22aは、 2kビット加算器 21の出力と cレジスタ 18aの出力と
1
を加算する。
[0043] なお、図 5Aに示す構成例では、乗算結果に選択回路 19 (Yレジスタ 15)の出力を 先に加算し、その後に cレジスタ 18aの出力を加算するようになっている力 これとは
1
逆に、先に cレジスタ 18aの出力、その後に選択回路 19 (Yレジスタ 15)の出力を加
1
算するように構成しても良い。
[0044] 第 2積和回路 11aは、 Nレジスタ 14及び mレジスタ 16からの出力を乗算する kビット 乗算器 23と、 kビット乗算器 23の出力及び第 1積和回路 10aからの下位 kビットの出 力を加算する 2kビット加算器 24とを有する。
[0045] 図 6は、アルゴリズム 5のコア処理の内容を示す説明図である。
第 1積和回路 10a内にて、 Aレジスタ 12の出力 a (kビット)と Bレジスタ 13の出力 b ( kビット)とを乗算し、その乗算結果(2kビット; 30)に、選択回路 19 (Yレジスタ 15)の 出力(kビット; 31) cレジスタ 18aの出力(kビット; 32a)とを加算する。なお、選択回
1
路 19は、 jの値と 0とを比較し、 jの値力^である場合には第 1積和回路 10aへ 0を出力 し、 jの値力^でない場合には Yレジスタ 15の格納値 yを第 1積和回路 10aへ出力す る。第 1積和回路 10aは、その演算結果 (2kビット; 33)の上位 kビット(34)を加算回 路 17aへ出力し、その下位 kビット(35)を第 2積和回路 11aへ出力する。
[0046] 第 2積和回路 11a内にて、 Nレジスタ 14の出力 n (kビット)と mレジスタ 16の出力(k ビット)とを乗算し、その乗算結果 (2kビット; 36)に、第 1積和回路 10aからの出力下 位 kビット(35)を加算する。第 2積和回路 11aは、その演算結果 (2kビット; 37)の上 位 kビット(38)をカ卩算回路 17aへ出力し、その下位 kビット(39)を Yレジスタ 15へ出 力する。 Yレジスタ 15は、その kビットのデータを値 V として格納する。
i-l
[0047] 加算回路 17aは、第 1積和回路 10aからの出力(kビット; 34)と第 2積和回路 11aか らの出力(kビット; 38)と cレジスタ 18bからの出力(1ビット; 32b)とを加算する。そし
2
て、次回の演算用として、その加算結果 (k+ 1ビット)の上位 1ビットを cレジスタ 18b
2
へ、その下位 kビットを cレジスタ 18aへ夫々出力する。各 cレジスタ 18a, cレジスタ 1
1 1 2
8bは、これを格納する。
[0048] アルゴリズム 5を更に変形したアルゴリズムをアルゴリズム 6として説明する。
(アルゴリズム 6)
乗算する 2数 A, B,パラメータおモンゴメリ乗算のパラメータ η' ,出力用変数 Yが
0
何れも r進数で、
A= (a , a , - ··, a
g-i g-2 0 ) r
B = (b , b , · ··, b )
g-i g-2 0 r
N = (n , n , · ··, n )
g-i g-2 0 l
Y= (y , y , · ·· ', y ) ,
g-i 0 r
n ,
0
r= 2 ,
R=rg
とあらわされ、 r進 1桁の一時変数を tmpl,キャリー変数を c , cとする場合、次に示
3 4
す i, jの繰り返し処理により ABR— iod Nを単精度 X単精度の計算として求めること ができる。
Y=0
for j = 0 to g— 1
(c , tmpl) =y +a 'b m=tmpl 'n' mod r コア前処理
o
(c , tmpl) =tmpl +m'n
4 r 0
for i= 1 to g— 1
(c , tmpl) =yi +c +a -b
3 r 3 i j
(c , y ) =tmpl +m-n +c コア処理
4 i-1 r i 4
next i
(c , c ) =c +c +y
4 3 r 3 4 g
y =c コア後処理
g-l 3
y =c
g 4
next j
if Y≥N then Y=Y—N 補正処理
if Y<N then return Y
図 7は、上述したアルゴリズム 6のコア処理を実行する乗算剰余計算装置の構成図 である。
[0050] 図 7に示す乗算剰余計算装置は、内部で乗算及び加算を行う第 3積和回路 10b及 び第 4積和回路 l ibと、図 4に示すものと同様の第 1レジスタとしての Aレジスタ 12, 第 2レジスタとしての Bレジスタ 13,第 3レジスタとしての Yレジスタ 15,第 5レジスタと しての Nレジスタ 14,第 6レジスタとしての mレジスタ 16及び選択回路 19と、キャリー 変数 cを保持する第 4レジスタとしての cレジスタ 18cと、キャリー変数 cを保持する第
3 3 4
7レジスタとしての c レジスタ 18dとを有する。
4
[0051] なお、第 3積和回路 10b及び第 4積和回路 l ibの内部構成は、図 5Aに示す第 1積 和回路 10aの内部構成と同じであり、各積和回路 10b及び l ibは、 kビット乗算器 20 と 2kビット加算器 21と 2kビット加算器 22aとから構成されている。
[0052] 第 3積和回路 10bの kビット乗算器 20は、 Aレジスタ 12及び Bレジスタ 13からの出 力を乗算し、 2kビット加算器 21は、 kビット乗算器 20の出力と選択回路 19 (Yレジスタ 15)の出力とを加算し、 2kビット加算器 22aは、 2kビット加算器 21の出力と cレジスタ
3
18cの出力とを加算する。
[0053] なお、図 5Aに示す構成例では、乗算結果に選択回路 19 (Yレジスタ 15)の出力を 先に加算し、その後に cレジスタ 18cの出力を加算するようになっている力 これとは
3
逆に、先に cレジスタ 18cの出力、その後に選択回路 19 (Yレジスタ 15)の出力を加
3
算するように構成しても良い。
[0054] 一方、第 4積和回路 l ibの kビット乗算器 20は、 Nレジスタ 14及び mレジスタ 16から の出力を乗算し、 2kビット加算器 21は、 kビット乗算器 20の出力と第 3積和回路 10b 力 の下位 kビットの出力とを加算し、 2kビット加算器 22aは、 2kビット加算器 21の出 力と cレジスタ 18dの出力とを加算する。
4
[0055] なお、図 5Aに示す構成例では、乗算結果に第 3積和回路 10bからの下位 kビットの 出力を先に加算し、その後に cレジスタ 18dの出力を加算するようになっている力 こ
4
れとは逆に、先に c レジスタ 18dの出力、その後に第 3積和回路 10bからの下位 kビ
4
ットの出力を加算するように構成しても良 、。
[0056] 図 8は、アルゴリズム 6のコア処理の内容を示す説明図である。
第 3積和回路 10b内にて、 Aレジスタ 12の出力 a (kビット)と Bレジスタ 13の出力 b ( kビット)とを乗算し、その乗算結果(2kビット; 30)に、選択回路 19 (Yレジスタ 15)の 出力(kビット; 31)と cレジスタ 18cの出力(kビット; 32c)とを加算する。
3
[0057] なお、選択回路 19は、 jの値と 0とを比較し、 jの値が 0である場合には第 3積和回路 10bへ 0を出力し、 jの値が 0でない場合には Yレジスタ 15の格納値 y.を第 3積和回路 10bへ出力する。
[0058] 第 3積和回路 10bは、その演算結果(2kビット)の上位 kビット(34)を cレジスタ 18c
3
へ出力し、その下位 kビット(35)を第 4積和回路 l ibへ出力する。 cレジスタ 18cは、
3
この kビットを次回の演算用のキャリー変数として格納する。
[0059] 第 4積和回路 l ib内にて、 Nレジスタ 14の出力 n (kビット)と mレジスタ 16の出力 m
(kビット)とを乗算し、その乗算結果 (2kビット; 36)に、第 3積和回路 10bからの下位 kビット出力(35)と、 cレジスタ 18dの kビット出力(32d)を加算する。
4
[0060] 第 4積和回路 l ibは、その演算結果(2kビット; 37)の上位 kビット(38)を cレジスタ
4
18dへ出力し、その下位 kビット(39)を Yレジスタ 15へ出力する。 cレジスタ 18dは、
4
この kビットを次回の演算用のキャリー変数として格納する。また、 Yレジスタ 15は、そ の kビットのデータを値 y として格納する。 [0061] 図 9は、モンゴメリ法による乗算剰余処理の一例を示すフローチャートの概観図であ る。
このフローチャートにおいて、 jループが(アルゴリズム 3)のループ処理に当たる。 j ループの内側では、 A X b及び m X Nの多重精度 X単精度の部分乗算を行ってい る。 iループは、 A X b及び m X Nの多重精度 X単精度の計算を単精度 X単精度の 部分乗算で行って 、る部分である。 1/レープの内部では a X bと m X nとの部分乗算 を行っている。
[0062] 以下に、アルゴリズム 6における、コア処理以外の処理も含めた全体の処理の流れ の具体例にっ 、て説明する。
以下の例では、 N, A, Bのビット長を 1024ビット、 g = 32、処理単位 k=32、 R= 21024 、r= 232とする。
(コア前処理)
図 10は、コア前処理を行う構成の一例を示す図である。
[0063] レジスタ 41はモンゴメリ計算用のパラメータ n, を保持する。乗算回路 40は第 3積
0
和回路 10bの出力とレジスタ 41の出力とを乗算する。このコア前処理では、コア処理 で使用する cレジスタ 18c, cレジスタ 18d及び mレジスタ 16aの初期化を行っている
3 4
。第 3積和回路 10bは、まず、 Aレジスタ 12, Bレジスタ 13からの入力 a , bを乗算し
0 j
、その乗算結果と Yレジスタ 15からの入力 y とを加算する。
0
[0064] なお、コア処理と同じ積和回路を使用する場合は、更にその結果と 0とを加算する。
そして、結果の上位 32ビットを cレジスタ 18cに格納し、下位 32ビットを第 4積和回路
3
1 lbとパラメータ mを計算するための乗算回路 40とへ出力する。
[0065] 乗算回路 40は、第 3積和回路 10bの出力とレジスタ 41の出力 n' とを乗算し、その
0
乗算結果の下位 32ビットを mレジスタ 16aに出力する。第 4積和回路 l ibは、 Nレジス タ 14からの入力 nと mレジスタ 16aの値とを乗算し、その乗算結果と第 3積和回路 10
0
bからの出力とを加算する。
[0066] なお、コア処理と同じ積和回路を使用する場合は、更にその結果と 0とを加算する。
そして、結果の上位 32ビットを cレジスタ 29に格納する。下位 32ビットは使用しない。
4
(コア処理) 図 11は、 iループ内部処理であるコア処理を行う構成の一例を示す図である。
[0067] Yレジスタ 15は前回の処理結果の保持及び今回の処理結果の出力用レジスタであ る。選択回路 19は、アルゴリズム 3における Y=0の処理に相当するものである。第 3 積和回路 10bは、まず、 Aレジスタ 12, Bレジスタ 13からの入力 a , bを乗算し、その 乗算結果と Yレジスタ 15からの入力 yとを加算し、更にその加算結果と cレジスタ 18c
i 3
の値とを加算する。そして、結果の上位 32ビットを cレジスタ 18cに格納し、下位 32ビ
3
ットを第 4積和回路 1 lbへ出力する。
[0068] 第 4積和回路 l ibは、まず、 Nレジスタ 14からの入力 nと mレジスタ 16aの値とを乗 算し、その乗算結果と第 3積和回路 10bからの出力とを加算し、更にその加算結果と cレジスタ 18dの値とをカ卩算する。そして、結果の上位 32ビットを cレジスタ 18dに格
4 4
納し、下位 32ビットを Yレジスタ 15の y に格納する。
i-l
[0069] アルゴリズム 3の Y= YZrの処理は、 i回目の計算結果を yi_lに格納することで実 現している。
(コア後処理)
図 12は、コア後処理を行う構成の一例を示す図である。
[0070] 加算回路 45は、 cレジスタ 18cの出力と、 cレジスタ 18dの出力と、選択回路 19の
3 4
出力とを加算する。選択回路 46は、加算回路 45からのキャリー出力を 0, 1と比較し 、 0であれば 0を、 1であれば 1を、 Yレジスタ 15へ出力する。このコア後処理では、コ ァ処理終了後のキャリー変数 c , c の値の処理を行っている。
3 4
[0071] cレジスタ 18c, cレジスタ 18dの値、及び、 Yレジスタ 15からの入力 y を加算回路
3 4 32
45〖こ入力し、その加算結果を Yレジスタ 15の y に出力し、キャリーを処理単位である
31
32ビットの値に変換して Yレジスタ 15の y に出力する。ここで、出力からもわ力るよう
32
に、 y の値は Yレジスタ 15では 32ビットとして扱われている力 実際は 1ビットの値で
32
あるので、加算結果は 32ビット +キャリーの範囲で収まる。
(積和回路の構成)
図 13は、上述の構成例で用いた積和回路の構成の一例を示す図である。
[0072] ここでは、全ての処理単位を 32ビットになるように構成している。
積和回路は、 1個の 32ビット乗算器 51と、 4個の 32ビット加算器 52, 53, 54, 55とを 有する。
[0073] A, Bの入力値は 32ビット乗算器 51で乗算され、上位 32ビットと下位 32ビットとの 2つ で出力される。 32ビット加算器 53は、 32ビット乗算器 51の出力の下位 32ビットと入力 Rの値とを加算し、その加算結果の出力 32ビットを 32ビット加算器 55へ、キャリーを 32 ビット加算器 52へそれぞれ出力する。 32ビット加算器 52は、 32ビット乗算器 51の出 力上位 32ビットと 32ビット加算器 53のキャリー出力とを加算し、その加算結果の出力 3 2ビットを 32ビット加算器 54へ出力する。この加算ではキャリーが発生しないことが理 論的に証明されている。 32ビット加算器 55は、 32ビット加算器 53の出力と入力 Cの値 とを加算し、その加算結果の出力 32ビットを積和回路の L出力(下位 32ビット)として 出力し、キャリーは 32ビット加算器 54へ出力される。 32ビット加算器 54は、 32ビットカロ 算器 52の出力と 32ビット加算器 55のキャリー出力とを加算し、その加算結果の出力 3 2ビットを積和回路の H出力(上位 32ビット)として出力する。この加算ではキャリーが 発生しな!ヽことが理論的に証明されて!、る。
[0074] 上記したすべてのアルゴリズム及び回路は特許文献 1に記載されて 、る。
上述した従来の乗算剰余装置に使用した積和回路は、図 13に示されるように、 4入 力 2出力の積和回路であった。この積和回路は、 2入力の乗算及びその結果と残る 2 入力との加算を行う。一般的なプロセッサには 4入力 2出力積和回路が搭載されてお らず、図 12の 2つの積和回路を単純ィ匕できないという問題がある。また、通常、 Penti urn (登録商標)プロセッサにお 、ては、 2入力 2出力の乗算器し力搭載されて 、な ヽ 。それでも、 2入力 2出力の乗算器と加算器を使って、上記 4入力 2出力の積和回路 と同等の機能を実現する場合には、あまり性能劣化は問題にはならなかった。ところ 1S 最近の Itanium2プロセッサに代表されるプロセッサには、 3入力 2出力の積和回 路が搭載されている。特に、 Itanium2プロセッサには、 3入力 2出力の積和回路が 2 台搭載されている。しかし、上記従来の 4入力 2出力の積和演算を使用するアルゴリ ズムでは、このような 3入力 2出力の積和回路を搭載したプロセッサの能力を最大限 生かすことはできない。
特許文献 1:特開平 11— 212456号公報
発明の開示 [0075] 本発明の課題は、モンゴメリ法に適した、 3入力 2出力の積和演算を用いた、効率 の良い乗算剰余計算装置、及び、その方法を提供することである。
本発明のモンゴメリ法用乗算剰余計算装置は、ある値 Aと Bの乗算をし、法 Nによる 剰余算を行って、結果 Yを計算するモンゴメリ法用乗算剰余計算装置において、 Aの ある 1桁の値と、 Bのある 1桁の値と、キャリー値との 3値を入力とし、 Aのある 1桁の値 と Bのある 1桁の値の乗算を行い、これにキャリー値を加算した結果を、自身の新たな キャリー値としての上位桁と、下位桁の 2値に分けて出力する第 1の積和計算手段と 、 Nのある 1桁の値と、ある 1桁の値 mと、キャリー値との 3値を入力とし、 Nのある 1桁 の値とある値 mとの乗算を行い、これにキャリー値を加算した結果を、自身の新たな キャリー値としての上位桁と、下位桁の 2値に分けて出力する第 2の積和計算手段と 、第 1の積和計算手段の出力の下位桁と、第 2の積和計算手段の出力の下位桁と、 変数 Yのある 1桁と、キャリー値とを加算した結果を、自身の新たなキャリー値としての 上位桁と、下位桁の 2値に分けて出力し、該下位桁を変数 Yのある 1桁に格納する加 算手段とを備えることを特徴とする。
図面の簡単な説明
[0076] [図 1]従来のアルゴリズム 4のコア処理を実行する乗算剰余計算装置の構成図である [図 2A]図 1の場合の従来の積和回路の構成図(その 1)である。
[図 2B]図 1の場合の従来の積和回路の構成図(その 2)である。
[図 3]従来のアルゴリズム 4のコア処理の内容を示す説明図である。
[図 4]従来のアルゴリズム 5のコア処理を実行する乗算剰余計算装置の構成図である
[図 5A]図 4の場合の従来の積和回路の構成図(その 1)である。
[図 5B]図 4の場合の従来の積和回路の構成図(その 2)である。
[図 6]従来のアルゴリズム 5のコア処理の内容を示す説明図である。
[図 7]従来のアルゴリズム 6のコア処理を実行する乗算剰余計算装置の構成図である
[図 8]従来のアルゴリズム 6のコア処理の内容を示す説明図である。
[図 9]モンゴメリ法による乗算剰余処理の一例を示すフローチャートの概観図である。 [図 10]コア前処理を行う構成の一例を示す図である。
[図 11]1/レープ内部処理であるコア処理を行う構成の一例を示す図である。
[図 12]コア後処理を行う構成の一例を示す図である。
[図 13]従来の積和回路の構成の一例を示す図である。
[図 14]本発明の実施形態のアルゴリズムのコア処理を実行する乗算剰余計算装置の 構成図である。
[図 15]本発明の実施形態のアルゴリズムにおけるコア前処理を行うための装置構成 を示す図である。
[図 16]本発明の実施形態のアルゴリズムにおけるコア後処理を行うための装置構成 を示す図である。
発明を実施するための最良の形態
[0077] 本発明の実施形態においては、 3入力 2出力の積和回路を有効に使用した、モン ゴメリ法の使用のための演算回路を提供する。
以下に、 3入力 2出力の積和回路に適した本発明の実施形態について説明する。
[0078] 本発明の実施形態では、上記アルゴリズム 6のコア処理部において、 2つの 3入力 2 出力積和回路を用いてアルゴリズムを実行する。本発明の実施形態のアルゴリズム を実行する演算回路においては、第 1積和回路が出力する上位 kビットはキャリー変 数 cとして第 1積和回路に戻し、第 2積和回路が出力する上位 kビットはキャリー変数 cとして第 2積和回路に戻し、加算回路の出力結果である (k+ 2)ビットを上位 2ビット
2
と下位 kビットとに分離し、上位 2ビットをキャリー変数 cとして加算回路に戻す。
3
この場合のアルゴリズムを以下に示す。
(アルゴリズム)
乗算する 2数 A, B,剰余の法 N,モンゴメリ乗算のパラメータ η ,出力用変数 Yが
0
何れも r進数で、
A= (a , a , - ··, a
g-i g-2 0 ) r
B = (b , b , · ··, b )
g-i g-2 0 r
N = (n , n , · ··, n )
g-i g-2 0 l
Y= (y , y , · ·· ', y ) , n ,
0
r=2 ,
R=rg
とあらわされ、 r進 1桁の一時変数を tmpl, tmp2,キャリー変数を c , c , cとする場合
1 2 3
、次に示す i, jの繰り返し処理により ABR— ^od Nを単精度 X単精度の計算として求 めることができる。
[0079] Y=0
for j = 0 to g— 1
(c, tmpl) =a eb +y
1 r 0 j 0
m=tmpl ·η' mod r
o
(c , tmpl) =tmpl+m-n コア前処理
2 r 0
c =0
3
for i= 1 to g— 1
(c^, tmpl) = a eb
(c , tmp2 ) = m-n+c コア処理
2 r i 2
(c, y ) = tmpl+tmp2 + c +y
3 i-1 r 3 i
next i
(c , c ) =c +c +c +y
2 1 r 1 2 3 g
y c コア後処理
g-l 1
y =c
g
next j
if Y≥N then Y=Y—N 補正処理
if Y<N then return Y
ここで、( は、括弧内の r進数 1桁の変数を多重精度として扱うことを示している。 またキャリー変数 c は r進数 1桁で表現している力 内容は 1ビットの値である。
2
[0080] 図 14は、本発明の実施形態のアルゴリズムのコア処理を実行する乗算剰余計算装 置の構成図である。
図 14に示す乗算剰余計算装置は、内部で乗算及び加算を行う積和回路 60及び 積和回路 61と、加算回路 62と、乗算する一方の数 A: (a , a , · ··, a )を保持す g-l g-2 0 る第 1レジスタとしての Aレジスタ 63と、乗算する一方の数 B: (b , b , · ··, !) )を g-l g-2 0 保持する第 2レジスタとしての Bレジスタ 64と、加算回路 62の前回の演算結果の下位 kビット出力を保持し、次回の演算の下位 kビット出力を格納する第 3レジスタとしての Yレジスタ 65と、モンゴメリアルゴリズムにおけるパラータ mを保持する第 4レジスタとし ての mレジスタ 66と、剰余の法 N: (η , η , · ··, n )を保持する第 5レジスタとして g-l g-2 0
の Nレジスタ 67と、キャリー変数 cを保持する第 6レジスタとしての cレジスタ 68と、キ
1 1
ャリー変数 cを保持する第 7レジスタとしての cレジスタ 69と、キャリー変数 cを保持
2 2 3 する第 8レジスタとしての cレジスタ 70と、 jの値と 0とを比較してその出力を選択する
3
選択回路 71とを有する。
[0081] なお、図 14中、積和回路 60、積和回路 61の A,B,C,H,Lは全て kビットである。 kビッ トの kとは、演算に使用するプロセッサが単精度の数を表現する場合に用いるビット数 であり、 32ビットプロセッサの場合には、 kは 32である。 AX B+Cの積和結果 2kビット を (H,L)と表現し、 Hが上位 kビット、 Lが下位 kビットとなる。図 14中、加算回路 62は、 A,B,C,D,Lは全て kビット、 Hのみ 2ビット(ソフトウェアの場合には Hも kビット)。 A+B+C +Dの加算結果 (k+2)ビットを (H,L)と表現し、 Hが上位 2ビット(ソフトウェアの場合には kビット)、 Lが下位 kビットとなる。なお、加算回路 62は、 4入力 2出力の加算回路を用 いなくても良い。すなわち、加算演算は、乗算演算に比べ、計算量が少ないので、モ ンゴメリ法による演算に要する時間や負荷に与える影響は少ない。したがって、たと えば、 2入力 2出力の加算回路を組み合わせて加算回路 62としても、本発明のアル ゴリズムの性能には大きな影響は与えない。よって、図 14では、加算回路は 4入力 2 出力加算回路を使っているが、その構成法はここでは規定しない。 2入力 2出力加算 を 3個使用すれば、加算回路 62と同様の回路は実現可能であるし、キャリー付加算 命令を使用する方法もあり、この加算は多種の構成法がある。
[0082] 図 14において、積和回路 60は、 Aの 1桁と Bの 1桁と、キャリー 1桁とを入力し、積和 計算をし、答えを (H、 L)として出力している。すなわち、積和回路 60では、前述の本 発明の実施形態のアルゴリズムのコア処理の内、(c , tmpl) = a -b +cを計算し ている。積和回路 61は、 1桁の mと、 Nの 1桁と、キャリー 1桁を入力し、積和計算を行 い、答えを (H、 L)として出力している。すなわち、積和回路 61では、前述の本発明 の実施形態のアルゴリズムのコア処理の内、(c , tmp2 ) = m-n +cを行っている
2 r i 2
[0083] 加算回路 62では、積和回路 60の演算結果の下位 kビットと積和回路 61の演算結 果の下位 kビットと、 Yの 1桁と、キャリー 1桁を入力し、演算結果の下位 kビットを Yに 格納している。すなわち、加算回路 62では、(c , y ) = tmpl +tmp2 + c +yを行
3 i-1 r 3 i つている。
[0084] なお、積和回路 60と 61は、 2つの 3入力 2出力の積和回路を用いて並列に行うの が好ましぐまた、加算回路 62の演算が行われている間に、積和回路 60と 61は、次 回の演算を行って 、ることが好まし 、。
[0085] 更に、以下に、コア前処理とコア後処理を行う乗算剰余計算装置の構成を示すが、 本発明の実施形態のアルゴリズムが、従来技術のアルゴリズム 6の変形構成であるた め、アルゴリズム 6の場合とほぼ同じである。
[0086] 図 15は、本発明の実施形態のアルゴリズムにおけるコア前処理を行うための装置 構成を示す図である。
レジスタ 41はモンゴメリ計算用のパラメータ n, を保持する。乗算回路 40は積和回
0
路 60の出力とレジスタ 41の出力とを乗算する。このコア前処理では、コア処理で使 用する cレジスタ 68, cレジスタ 69、 cレジスタ 70及び mレジスタ 66の初期化を行つ
1 2 3
ている。積和回路 60は、まず、 Aレジスタ 63, Bレジスタ 64からの入力 a , bを乗算し
0 j
、その乗算結果と Yレジスタ 65からの入力 yとを加算する。
[0087] そして、結果の上位 kビットを cレジスタ 68に格納し、下位 kビットを積和回路 61とパ ラメータ mを計算するための乗算回路 40とへ出力する。
乗算回路 40は、積和回路 60の出力とレジスタ 41の出力 n とを乗算し、その乗算
0
結果の下位 kビットを mレジスタ 66に出力する。積和回路 61は、 Nレジスタ 67からの 入力 nと mレジスタ 66の値とを乗算し、その乗算結果と積和回路 60からの出力とを
0
加算する。そして、結果の上位 kビットを cレジスタ 69に格納する。下位 kビットは使用
2
しない。
[0088] 以上のコア前処理の演算装置においても、 3入力 2出力の積和回路を使っている。 従来のアルゴリズム 6の場合には、コア前処理で、コア処理のときに使用する積和回 路と同じ積和回路を使用する場合には、 4入力の内、 1つを 0としたが、本発明の実 施形態においては、使用する積和回路が 3入力 2出力であるので、このような設定は 不要である。
[0089] また、コア前処理においては、積和回路 60の処理の後に、積和回路 61の処理を 行う必要があるため、コア処理のように、積和回路 60と 61を並列に実行することがで きない。したがって、 3入力 2出力の積和回路を 2つ持っていても、コア前処理では、 コア処理ほど効果は出ないが、それでも、 3入力 2出力の積和回路を有効に使うこと はできる。
[0090] 図 16は、本発明の実施形態のアルゴリズムにおけるコア後処理を行うための装置 構成を示す図である。
加算回路 45は、 cレジスタ 68の出力と、 cレジスタ 69の出力と、 cレジスタ 70の出
1 2 3
力と、選択回路 19の出力とを加算する。選択回路 46は、加算回路 45からのキャリー 出力を 0, 1と比較し、 0であれば 0を、 1であれば 1を、 Yレジスタ 65へ出力する。この コア後処理では、コア処理終了後のキャリー変数 c , c , cの値の処理を行っている
1 2 3
[0091] cレジスタ 68, cレジスタ 69, cレジスタ 70の値、及び、 Yレジスタ 65からの入力 y
1 2 3 g を加算回路 45に入力し、その加算結果を Yレジスタ 15の y に出力し、キャリーを処
g-i
理単位である kビットの値に変換して Yレジスタ 65の yに出力する。ここで、出力から
g
もわ力るように、 yの値は Yレジスタ 65では kビットとして扱われている力 実際は 1ビ
g
ットの値であるので、加算結果は kビット +キャリーの範囲で収まる。
[0092] 以上の、本発明の実施形態によれば、 3つの変数を入力とし、 2つの出力で演算結 果を返すような積和命令を持ち、同時に積和命令を 2つ処理することの出来る Itaniu m2プロセッサに代表されるプロセッサにおいて、従来法で構成したものに比べ、 4倍 の高速化を実現した。これは、積和回路 61、 62を並列化したこと、更に、この並列化 により伝播遅延時間が短縮されたことによる。本発明の 3入力 2出力の積和演算回路 は積和回路 61、 62を従来どおりに直列に接続したものにも適用できる。
[0093] 以上、本発明によれば、 3入力 2出力の積和演算回路を有する演算装置に適した モンゴメリ法用乗算剰余計算装置を実現できる。同様に、同じような積和回路を持つ DSPに実装する場合に高速ィ匕が可能であると期待できる。

Claims

請求の範囲
[1] ある値 Aと Bの乗算をし、法 Nによる剰余算を行って、結果 Yを計算するモンゴメリ法 用乗算剰余計算装置において、
Aのある 1桁の値と、 Bのある 1桁の値と、キャリー値との 3値を入力とし、 Aのある 1桁 の値と Bのある 1桁の値の乗算を行い、これにキャリー値を加算した結果を、自身の新 たなキャリー値としての上位桁と、下位桁の 2値に分けて出力する第 1の積和計算手 段と、
Nのある 1桁の値と、ある 1桁の値 mと、キャリー値との 3値を入力とし、 Nのある 1桁 の値とある値 mとの乗算を行い、これにキャリー値を加算した結果を、自身の新たな キャリー値としての上位桁と、下位桁の 2値に分けて出力する第 2の積和計算手段と 第 1の積和計算手段の出力の下位桁と、第 2の積和計算手段の出力の下位桁と、 変数 Yのある 1桁と、キャリー値とを加算した結果を、自身の新たなキャリー値としての 上位桁と、下位桁の 2値に分けて出力し、該下位桁を変数 Yのある 1桁に格納する加 算手段と、
を備えることを特徴とするモンゴメリ法用乗算剰余計算装置。
[2] 前記第 1の積和計算手段の演算と、前記第 2の積和計算手段の演算とは、並列に 行われることを特徴とする請求項 1に記載のモンゴメリ法用乗算剰余計算装置。
[3] 前記モンゴメリ法用乗算剰余計算装置は、公開鍵暗号方式の演算に使用されるこ とを特徴とする請求項 1に記載のモンゴメリ法用乗算剰余計算装置。
[4] 前記演算の入力及び出力の 1桁の値は、プロセッサが単精度の数値を表す場合に 用いられるビット数力 なることを特徴とする請求項 1に記載のモンゴメリ法用乗算剰 余計算装置。
[5] 前記加算手段が演算を行っている間に、前記第 1の積和計算手段と、前記第 2の 積和計算手段が次回の演算を行うことを特徴とする請求項 1に記載のモンゴメリ法用 乗算剰余計算装置。
[6] Aの最下位の 1桁の値と、 Bのある 1桁の値と、結果を格納する変数 Yの 1桁とを入 力とし、 Aの最下位の 1桁の値と、 Bのある 1桁の値とを乗算し、これに変数 Yの 1桁を 加算した結果を、前記第 1の積和計算手段へのキャリー値の初期値としての上位桁 の値と、下位桁の 2値として出力する第 3の積和計算手段と、
該第 3の積和計算手段の出力の内の下位桁と、モンゴメリ法用のパラメータとを入 力し、これらを乗算して出力する乗算手段と、
該第 3の積和計算手段の出力の内の下位桁と、該乗算手段の出力と、 Nのある 1桁 の 3値を入力として、 Nのある 1桁の値と該乗算手段の出力とを乗算し、これらに該第 3の積和計算手段の出力の内の下位桁を加算し、加算結果の上位桁を前記第 2の 積和計算手段へのキャリー値の初期値として出力する第 4の積和計算手段と、 を更に備えることを特徴とする請求項 1に記載のモンゴメリ法用乗算剰余計算装置。
[7] 前記第 1の積和計算手段と、前記第 2の積和計算手段と、前記加算手段のそれぞ れの出力であるキャリー値と、前記加算手段の演算後の変数 Yの最上位桁値を入力 し、これらを加算した結果の上位桁を変数 Yの最上位桁に、下位桁を変数 Yの上位 力 2番目の桁に格納する第 2の加算手段を更に備えることを特徴とする請求項 1に 記載のモンゴメリ法用乗算剰余計算装置。
[8] ある値 Aと Bの乗算をし、法 Nによる剰余算を行って、結果 Yを計算するモンゴメリ法 用乗算剰余計算方法において、
(a) Aのある 1桁の値と、 Bのある 1桁の値と、キャリー値との 3値を入力とし、 Aのある 1桁の値と Bのある 1桁の値の乗算を行い、これにキャリー値を加算した結果を、自身 の新たなキャリー値としての上位桁と、下位桁の 2値に分けて出力し、
(b) Nのある 1桁の値と、ある 1桁の値 mと、キャリー値との 3値を入力とし、 Nのある 1 桁の値とある値 mとの乗算を行い、これにキャリー値を加算した結果を、自身の新た なキャリー値としての上位桁と、下位桁の 2値に分けて出力し、
(c)ステップ (a)の出力の下位析と、ステップ (b)の出力の下位析と、変数 Yのある 1 桁と、キャリー値とを加算した結果を、自身の新たなキャリー値としての上位桁と、下 位桁の 2値に分けて出力し、該下位桁を変数 Yのある 1桁に格納する、
ことを特徴とするモンゴメリ法用乗算剰余計算方法。
[9] ある値 Aと Bの乗算をし、法 Nによる剰余算を行って、結果 Yを計算するモンゴメリ法 用乗算剰余計算方法をコンピュータに実現させるプログラムにおいて、 (a) Aのある 1桁の値と、 Bのある 1桁の値と、キャリー値との 3値を入力とし、 Aのある 1桁の値と Bのある 1桁の値の乗算を行い、これにキャリー値を加算した結果を、自身 の新たなキャリー値としての上位桁と、下位桁の 2値に分けて出力し、
(b) Nのある 1桁の値と、ある 1桁の値 mと、キャリー値との 3値を入力とし、 Nのある 1 桁の値とある値 mとの乗算を行い、これにキャリー値を加算した結果を、自身の新た なキャリー値としての上位桁と、下位桁の 2値に分けて出力し、
(c)ステップ (a)の出力の下位析と、ステップ (b)の出力の下位析と、変数 Yのある 1 桁と、キャリー値とを加算した結果を、自身の新たなキャリー値としての上位桁と、下 位桁の 2値に分けて出力し、該下位桁を変数 Yのある 1桁に格納する、
ことを特徴とするモンゴメリ法用乗算剰余計算方法をコンピュータに実行させるプログ ラム。
モンゴメリのアルゴリズムを用いて、プロセッサの単精度 (kビット)演算による乗算剰 余計算を行う装置において、
積和演算を行い、その演算結果を上位 kビットと下位 kビットとに分けて出力する第 1 積和回路と、
積和演算を行いその演算結果を上位 kビットと下位 kビットとに分けて出力する第 2 積和回路と、
加算演算を行いその演算結果を上位 2ビットと下位 kビットとに分けて出力する加算 回路と、
前記第 1積和回路で乗算される 2数を保持する第 1及び第 2レジスタと、
前記加算回路の下位 kビット出力を保持し、前記加算回路のその次の回の kビット 入力を格納する第 3レジスタと、
モンゴメリのアルゴリズムにおけるパラメータの値を保持する第 4レジスタと、 剰余の法を保持する第 5レジスタと、
前記第 1積和回路の上位 kビット出力を保持し、同第 1積和回路のその次の回の加 算される入力となる数を格納する第 6レジスタと、
前記第 2積和回路の上位 kビット出力を保持し、同第 2積和回路のその次の回の加 算される入力となる数を格納する第 7レジスタと、 前記加算回路の上位 2ビット出力を保持し、同加算回路のその次の回の入力となる 数を格糸内する第 8レジスタとを備え、
前記第 1積和回路は、前記第 1及び第 2レジスタに保持された 2数の所定ビットの値 を乗算し、その乗算結果に前記第 6レジスタに保持された値を加算する演算を行い、 前記第 2積和回路は、前記第 4レジスタに保持された値と前記第 5レジスタに保持さ れた数の所定ビットの値とを乗算し、その乗算結果に前記第 7レジスタに保持された 値を加算する演算を行い、前記加算回路は、前記第 1積和回路の下位 kビット出力と 前記第 2積和回路の下位 kビット出力と前記第 3レジスタに保持された所定ビットの値 と前期第 8レジスタに保持された値を加算する演算を行うように構成したことを特徴と するモンゴメリ法による乗算剰余計算装置。
[11] 前記第 1積和回路は、前記第 1及び第 2レジスタに保持された 2数の所定ビットの値 を乗算し、その乗算結果に前記第 6レジスタに保持された値を加算するように構成し た請求項 10に記載のモンゴメリ法による乗算剰余計算装置。
[12] 前記第 2積和回路は、前記第 4レジスタに保持された値と第 5レジスタに保持された 所定ビットの値を乗算し、その乗算結果に前記第 7レジスタに保持された値を加算す るように構成した請求項 10に記載のモンゴメリ法による乗算剰余計算装置。
[13] 前記加算回路による演算中に、前記第 1及び第 2積和回路によりその次の回の演 算を行うように構成した請求項 10〜 12の何れか一つに記載のモンゴメリ法による乗 算剰余計算装置。
[14] 前記加算回路が演算を行う間、前記第 1積和回路及び前記第 2積和回路で次の回 の演算を行うように、パイプライン処理すべく構成したことを特徴とする請求項 10に記 載のモンゴンメリ法による乗算剰余計算装置。
[15] 前記第 1積和回路及び第 2積和回路にあって、各自身の上位出力を各自身の次の 回のキャリア入力とするようにした請求項 10に記載のモンゴンメリ法による乗算剰余 計算装置。
[16] 前記第 1積和回路及び第 2積和回路は、 2つの kビットの数を乗算する手段と、その 乗算結果に 1つの kビットの数を加算する手段とを有する請求項 10に記載のモンゴン メリ法による乗算剰余計算装置。
PCT/JP2006/300396 2006-01-13 2006-01-13 モンゴメリ法用乗算剰余計算装置 WO2007080652A1 (ja)

Priority Applications (4)

Application Number Priority Date Filing Date Title
PCT/JP2006/300396 WO2007080652A1 (ja) 2006-01-13 2006-01-13 モンゴメリ法用乗算剰余計算装置
JP2007553818A JP4783382B2 (ja) 2006-01-13 2006-01-13 モンゴメリ法用乗算剰余計算装置
EP06711681A EP1975906B1 (en) 2006-01-13 2006-01-13 Montgomery s algorithm multiplication remainder calculator
US12/218,060 US8352529B2 (en) 2006-01-13 2008-07-11 Modular multiplication calculation apparatus used for montgomery method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2006/300396 WO2007080652A1 (ja) 2006-01-13 2006-01-13 モンゴメリ法用乗算剰余計算装置

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US12/218,060 Continuation US8352529B2 (en) 2006-01-13 2008-07-11 Modular multiplication calculation apparatus used for montgomery method

Publications (1)

Publication Number Publication Date
WO2007080652A1 true WO2007080652A1 (ja) 2007-07-19

Family

ID=38256068

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2006/300396 WO2007080652A1 (ja) 2006-01-13 2006-01-13 モンゴメリ法用乗算剰余計算装置

Country Status (4)

Country Link
US (1) US8352529B2 (ja)
EP (1) EP1975906B1 (ja)
JP (1) JP4783382B2 (ja)
WO (1) WO2007080652A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020140120A (ja) * 2019-02-28 2020-09-03 ルネサスエレクトロニクス株式会社 演算処理方法、演算処理装置、及び半導体装置

Families Citing this family (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7765458B1 (en) * 2005-09-29 2010-07-27 Marvell International Ltd. Error pattern generation for trellis-based detection and/or decoding
US8321771B1 (en) 2008-10-13 2012-11-27 Marvell International Ltd. Modified trace-back using soft output viterbi algorithm (SOVA)
US8438208B2 (en) * 2009-06-19 2013-05-07 Oracle America, Inc. Processor and method for implementing instruction support for multiplication of large operands
US8626811B2 (en) 2010-04-30 2014-01-07 Certicom Corp. Method and apparatus for providing flexible bit-length moduli on a block Montgomery machine
EP2385461A1 (en) * 2010-04-30 2011-11-09 Certicom Corp. Method and apparatus for providing flexible bit-length moduli on a block Montgomery machine
US8555038B2 (en) 2010-05-28 2013-10-08 Oracle International Corporation Processor and method providing instruction support for instructions that utilize multiple register windows
US9513870B2 (en) * 2014-04-22 2016-12-06 Dialog Semiconductor (Uk) Limited Modulo9 and modulo7 operation on unsigned binary numbers
JP6863907B2 (ja) * 2018-01-05 2021-04-21 日本電信電話株式会社 演算回路
JP7114321B2 (ja) * 2018-04-26 2022-08-08 キヤノン株式会社 データ処理装置及びその方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11212456A (ja) 1998-01-27 1999-08-06 Fujitsu Ltd モンゴメリ法による乗算剰余計算装置
JP2001318785A (ja) * 2000-05-10 2001-11-16 Toshiba Corp モンゴメリ乗算装置及び方法
JP2002215386A (ja) * 2001-01-19 2002-08-02 Toshiba Corp 剰余演算装置、剰余演算方法、および、べき乗剰余演算方法
JP2003114618A (ja) * 2001-10-04 2003-04-18 Hitachi Ltd データ処理装置
JP2005209095A (ja) * 2004-01-26 2005-08-04 Fujitsu Ltd 多倍長データ積和演算処理回路及びモンゴメリ積和剰余演算回路

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3302043B2 (ja) 1992-05-18 2002-07-15 キヤノン株式会社 暗号通信方法及びそのシステム
JPH08265313A (ja) * 1995-03-27 1996-10-11 Toshiba Corp データスクランブル装置
EP1008026B1 (en) 1997-05-04 2007-09-05 M-Systems Flash Disk Pioneers Ltd. Improved apparatus & method for modular multiplication & exponentiation based on montgomery multiplication
US6026421A (en) * 1997-11-26 2000-02-15 Atmel Corporation Apparatus for multiprecision integer arithmetic
US7509486B1 (en) * 1999-07-08 2009-03-24 Broadcom Corporation Encryption processor for performing accelerated computations to establish secure network sessions connections
US6662201B1 (en) * 1999-11-01 2003-12-09 Kabushiki Kaisha Toshiba Modular arithmetic apparatus and method having high-speed base conversion function
US7266577B2 (en) * 2002-05-20 2007-09-04 Kabushiki Kaisha Toshiba Modular multiplication apparatus, modular multiplication method, and modular exponentiation apparatus
JP2004258141A (ja) * 2003-02-24 2004-09-16 Fujitsu Ltd モンゴメリ乗算剰余の多倍長演算のための演算装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11212456A (ja) 1998-01-27 1999-08-06 Fujitsu Ltd モンゴメリ法による乗算剰余計算装置
JP2001318785A (ja) * 2000-05-10 2001-11-16 Toshiba Corp モンゴメリ乗算装置及び方法
JP2002215386A (ja) * 2001-01-19 2002-08-02 Toshiba Corp 剰余演算装置、剰余演算方法、および、べき乗剰余演算方法
JP2003114618A (ja) * 2001-10-04 2003-04-18 Hitachi Ltd データ処理装置
JP2005209095A (ja) * 2004-01-26 2005-08-04 Fujitsu Ltd 多倍長データ積和演算処理回路及びモンゴメリ積和剰余演算回路

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
PETER L. MONTGOMERY: "Modulo Multiplication Without Trial Division", MATHEMATICS OF COMPUTATION, vol. 44, no. 170, April 1985 (1985-04-01), pages 519 - 528, XP000747434
See also references of EP1975906A4

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2020140120A (ja) * 2019-02-28 2020-09-03 ルネサスエレクトロニクス株式会社 演算処理方法、演算処理装置、及び半導体装置
JP7286239B2 (ja) 2019-02-28 2023-06-05 ルネサスエレクトロニクス株式会社 演算処理方法、演算処理装置、及び半導体装置

Also Published As

Publication number Publication date
US20100023571A1 (en) 2010-01-28
EP1975906B1 (en) 2012-07-04
JPWO2007080652A1 (ja) 2009-06-11
JP4783382B2 (ja) 2011-09-28
EP1975906A4 (en) 2011-06-15
EP1975906A1 (en) 2008-10-01
US8352529B2 (en) 2013-01-08

Similar Documents

Publication Publication Date Title
JP4783382B2 (ja) モンゴメリ法用乗算剰余計算装置
JP3014391B2 (ja) 暗号法及びこの方法の実施のための暗号プロセツサ
CN109039640B (zh) 一种基于rsa密码算法的加解密硬件系统及方法
JP3939658B2 (ja) モジュラー乗算を行うための装置、および、モジュラー乗算を行うための算術演算装置
CN101216754B (zh) 基于模乘运算的数据加解密处理的方法及装置
Gutub et al. Hybrid crypto hardware utilizing symmetric-key and public-key cryptosystems
CN109067538B (zh) 安全协议方法、计算机设备及存储介质
JPH0720778A (ja) 剰余計算装置、テーブル作成装置および乗算剰余計算装置
JP2005215688A (ja) S−box演算を用いるハードウェア暗号化/復号化装置及び、その方法
US20020126838A1 (en) Modular exponentiation calculation apparatus and modular exponentiation calculation method
CN113032848A (zh) 一种数据处理方法和用于数据处理的芯片
US7050579B1 (en) Cryptographic methods and apparatus using word-wise montgomery multiplication
JP3616897B2 (ja) モンゴメリ法による乗算剰余計算装置
JP4177526B2 (ja) 乗算剰余演算方法および乗算剰余回路
JP2004258141A (ja) モンゴメリ乗算剰余の多倍長演算のための演算装置
Moon et al. Fast VLSI arithmetic algorithms for high-security elliptic curve cryptographic applications
CN1392472A (zh) Vlsi用的蒙格玛丽模乘算法及智能卡模乘器的vlsi结构
JP3615405B2 (ja) 素体上楕円曲線上の点の演算方法およびその装置
KR100330510B1 (ko) 고속의 모듈라 멱승 연산기
US7403965B2 (en) Encryption/decryption system for calculating effective lower bits of a parameter for Montgomery modular multiplication
KR100406138B1 (ko) 엔티알유 암/복호화 장치
Lisha et al. Analysis of cryptographic algorithms based on vedic-mathematics
Nedjah et al. Simulation model for hardware implementation of modular multiplication
JP2002139995A (ja) 公開鍵生成装置、暗号化装置および復号装置
JP2022117083A (ja) 演算システム、演算方法およびプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application
WWE Wipo information: entry into national phase

Ref document number: 2007553818

Country of ref document: JP

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2006711681

Country of ref document: EP

WWP Wipo information: published in national office

Ref document number: 2006711681

Country of ref document: EP