# US 2006/0235921 A1 · Device and method for calculating conversion parameter of montgomery modular multiplication and program therefor

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2006/0235921 A1
- Document ID: US20060235921A1
- Status: Published application
- Kind: A1
- Application number: 11/230,592
- Filed: 2005-09-21
- Published: 2006-10-19
- Earliest claimed: 2003-07-31
- Assignees: Fujitsu Limited
- Inventors: Kouichi Itoh; Masahiko Takenaka; Naoya Torii
- Web page: https://patentgrep.com/patent/US20060235921A1

## CPC

- G06F 7/728: {using Montgomery reduction}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method for calculating a conversion parameter of the Montgomery modular multiplication to improve the efficiency of software installation, comprising a first step for calculating H0=2v×R (mod n) (where v is an integer, v≧1, and (m×k)/v is an integer), a second step for calculating Hp=2v×2p×R (mod n) from H0=2v×R (mod n) by repeating Hi=REDC(Hi-1, Hi-1)n with respect to i=1, 2, . . . , p (where p represents an integer satisfying the condition 2p≧(m×k)/v>2p−1, REDC represents the Montgomery modular multiplication REDC(a, b)n=a×b×R−1 (mod n), and xˆi represents exponential computation xi); and a third step for calculating Hp=R2 (mod n) by calculating Hp=REDC(Hp, g)n with respect to Hp obtained in the second step when 2p>(m×k)/v (where g=2k×E(p,m,k), E(p, m, k)=2×m−(v×2p)/k) and finally outputting Hp as R2 (mod n).

## Claims

### Claim 1

A method for computing a conversion parameter R2 (mod n) of Montgomery modular multiplication where the effective word length of the residue modulo n is taken as m, the bit length per 1 word is taken as k, and 2m×k=R, this method comprising:
(A) a first step for calculating H0=2v×R (mod n) (where v is an integer, v≧1, and (m×k)/v is an integer), this step comprising the steps of:
(A-1) initializing two registers REG1, REG2 by REG1=n, REG2=2(m−1)×k (here, REG1 is a register composed of m words and REG2 is a register composed or m or more words), and
(A-2) obtaining 2v×R (mod n) by repeating k+v times the modular squaring computation employing the value of REG1 as a residue modulo with respect to REG2;
(B) a second step for calculating Hp=2v×2p×R (mod n) from H0=2v×R (mod n) by repeating Hi=REDC(Hi-1, Hi-1)n with respect to i=1, 2, . . . , p (where p represents an integer satisfying the condition 2p≧(m×k)/v>2p−1, REDC represents the Mongtomery modular multiplication REDC(a, b)n=a×b×R−1 (mod n), and xˆi represents exponential computation xi); and
(C) a third step for calculating Hp=R2 (mod n) by calculating Hp=REDC(Hp, g)n with respect to Hp obtained in the second step when 2p>(m×k)/v (where g=2k×E(p,m,k), E(p, m, k)=2×m−(v×2p)/k) and finally outputting Hp as R2 (mod n).

### Claim 2

A method for computing a conversion parameter R2 (mod n) of Montgomery modular multiplication where the effective word length of the residue modulo n is taken as m, the bit length per 1 word is taken as k, and 2m×k=R, this method comprising:
(A) a first step for calculating H′=R (mod n), H0=2v×R (mod n) (where v is an integer, v≧1, and (m×k)/v is an integer); and
(B) a second step for calculating and outputting H′=R2 (mod n) by repeating the steps of:
(B-1) calculating H′=REDC(H′, Hi)n if the i-th bit value of (m×k)/v is 1, and
(B-2) calculating Hi=REDC(Hi-1, Hi-1)n
with respect to i=0, 1, . . . , b−1
(here, b is a constant representing the highest-order bit length of (m×k)/v and REDC represents the Mongtomery modular multiplication REDC(a, b)=a×b×R−1 (mod n)).

### Claim 3 (depends on 2)

The method for computing a conversion parameter of Montgomery modular multiplication of claim 2, wherein
said first step comprises the steps of:
(A-1) initializing two registers REG1, REG2 by REG1 :=n, REG2 :=0 (here, REG1 is a register composed of m words, REG2 is a register composed of m words, and k is a bit length per 1 word);
(A-2) obtaining REG1=n′=2q×n by repeating q times the left 1 bit shift with respect to REG1 (here q represents the number of consecutive “0” from the highest-order bit of n represented by m words);
(A-3) calculating REG2=R (mod n′) by calculating REG2 :=REG2−REG1;
(A-4) calculating REG2=2q×R (mod n′) by repeating the modular squaring computation q times with respect to REG2;
(A-5) calculating REG1=n, REG2=R (mod n) by repeating a right 1 bit shift q times with respect to REG1, REG2 and then copying the value of REG2 to H′; and
(A-6) calculating REG2=2v×R (mod n) by further repeating v times the double remainder computation employing the value of REG1 as a modulus with respect to REG2 and then copying it to H0.

### Claim 4 (depends on 2)

The method for computing a conversion parameter of Montgomery modular multiplication of claim 2, wherein
said first step comprises the steps of:
(A-1) initializing two registers REG1, REG2 by REG1 :=n, REG2 :=2(m−1)×k (here, REG1 is a register composed of m words, REG2 is a register composed of m or more words, and k is a bit length per 1 word);
(A-2) calculating REG2=2m×k (mod n)=R (mod n) by repeating k times the modular squaring computation employing the value of REG1 as a residue modulo with respect to REG2 and copying the calculation result to H′; and
(A-3) calculating REG2=2v×R (mod n) by further repeating the modular squaring computation v times with respect to REG2 and copying the calculation result to H0.

### Claim 5

A program for a method for computing a conversion parameter R2 (mod n) of Montgomery modular multiplication where the effective word length of the residue modulo n is taken as m, the bit length per 1 word is taken as k, and 2m×k=R, this program serving to execute on a computer a method for computing a conversion parameter of Montgomery modular multiplication comprising:
(A) a first step for calculating H0=2v×R (mod n) (where v is an integer, v≧1, and (m×k)/v is an integer), this step comprising the steps of:
(A-1) a step for initializing two registers REG1, REG2 by REG1=n, REG2=2(m−1)×k (here, REG1 is a register composed of m words and REG2 is a register composed or m or more words), and
(A-2) a step for obtaining 2v×R (mod n) by repeating k+v times the modular squaring computation employing the value of REG1 as a residue modulo with respect to REG2;
(B) a second step for calculating Hp=2v×2p×R (mod n) from H0=2v×R (mod n) by repeating Hi=REDC(Hi-1, Hi-1)n with respect to i=1, 2, . . . , p (where p represents an integer satisfying the condition 2p≧(m×k)/v>2p−1, REDC represents the Mongtomery modular multiplication REDC(a, b)n=a×b×R−1 (mod n), and xˆi represents exponential computation xi); and
(C) a third step for calculating Hp=R2 (mod n) (where g=2k×E(p,m,k), E(p, m, k)=2×m−(v×2p)/k) by calculating Hp=REDC(Hp, g)n with respect to Hp obtained in the second step when 2p>(m×k)/v and finally outputting Hp as R2 (mod n).

### Claim 6

A program for a method for computing a conversion parameter R2 (mod n) of Montgomery modular multiplication where the effective word length of the residue modulo n is taken as m, the bit length per 1 word is taken as k, and 2m×k=R, this program serving to execute on a computer a method for computing a conversion parameter of Montgomery modular multiplication comprising:
(A) a first step for calculating H′=R (mod n), H0=2v×R (mod n) (where v is an integer, v≧1, and (m×k)/v is an integer); and
(B) a second step for calculating and outputting H′=R2 (mod n) by repeating the steps of:
(B-1) calculating H′=REDC(H′, Hi)n if the i-th bit value of (m×k)/v is 1, and
(B-2) calculating Hi=REDC(Hi-1, Hi-1)n with respect to
i=0, 1, . . . , b−1
(here, b is a constant representing the highest-order bit length of (m×k)/v and REDC represents the Mongtomery modular multiplication REDC(a, b)n=a×b×R−1 (mod n)).

### Claim 7

A device for computing a conversion parameter R2 (mod n) of Montgomery modular multiplication where the effective word length of the residue squaring n is taken as m, the bit length per 1 word is taken as k, and 2m×k=R, this device comprising:
a first register REG1 composed of m words;
a second register REG2 composed of m or more words;
an initialization processing unit for initializing the two registers REG1, REG2 by REG1=n, REG2=2(m−1)×k;
an H0 computation unit for computing H0=2v×R (mod n) (where v is an integer, v≧1, and (m×k)/v is an integer) by repeating k+v times the modular squaring computation employing the value of the first register REG1 as a residue modulo with respect to the second register REG2;
an Hp computation unit for calculating Hp=2v×2p×R (mod n) from H0=2v×R (mod n) by repeating Hi=REDC(Hi-1, Hi-1)n with respect to i=1, 2, . . . , p (where p represents integer satisfying the condition 2p≧(m×k)/v>2p−1, REDC represents the Mongtomery modular multiplication REDC(a, b)n=a×b×R−1 (mod n), and xˆi represents exponential computation xi); and
a parameter output unit for calculating Hp=R2 (mod n) by calculating Hp=REDC(Hp, g)n with respect to Hp obtained with the Hp computation unit when 2p>(m×k)/v (where g=2k×E(p,m,k), E(p, m, k)=2×m−(v×2p)/k) and finally outputting the obtained Hp as R2 (mod n).

### Claim 8

A device for computing a conversion parameter R2 (mod n) of Montgomery modular multiplication where the effective word length of the residue modulo n is taken as m, the bit length per 1 word is taken as k, and 2m×k=R, this device comprising:
an H0 computation unit for calculating H′=R (mod n), H0=2v×R (mod n) (where v is an integer, v≧1, and (m×k)/v is an integer); and
a H′ computation unit for calculating and outputting H′=R2 (mod n) by repeating a step for calculating H′=REDC(H′, Hi)n if the i-th bit value of (m×k)/v is 1 and a step for calculating Hi=REDC(Hi-1, Hi-1)n with respect to i=0, 1, . . . , b−1 (here, b is a constant representing the highest-order bit length of (m×k)/v and REDC represents the Mongtomery modular multiplication computation REDC(a, b)=a×b×R−1 (mod n)).
