380 likes | 1.07k Views
Montgomery multiplication Algorithm. Under supervision of : Dr. S. Bayat-sarmadi. Mohammad Farmani. 2 nd . Semister,1392-93. Main Topic. Montgomery modular multiplication algorithm Main Article: “ Montgomery Multiplication in GF(2 k ) ”
E N D
Montgomery multiplication Algorithm Under supervision of : Dr. S. Bayat-sarmadi Mohammad Farmani 2nd. Semister,1392-93 Sharif University of Technology
Main Topic • Montgomery modular multiplication algorithm • Main Article: “Montgomery Multiplication in GF(2k)” • Written by: Cetin K. KOC and Tolga Acar,1998 Sharif University of Technology
Montgomery multiplication algorithm Outline • Introduction • Montgomery modular multiplication of integers • Montgomery modular multiplication in GF(2k) • Conclusion Sharif University of Technology
Montgomery multiplication algorithm Introduction • The importance and applications of the arithmetic operations in the Galois field GF(2k) in : • Coding theory • Computer algebra • Cryptography • …. • Importance of the exponentiation • Using a series of multiplication for The exponentiation Sharif University of Technology
Montgomery multiplication algorithm Introduction • Cryptographic applications require fast arithmetic operations • Proposed an effective modular multiplication of integers by P.L. Montgomery 1985 • Conversion to the Montgomery domain : a : an intger M : modulus r : Radix Sharif University of Technology
Montgomery multiplication algorithm Introduction • Example: M = 11 , r = 24 = 16 • There is a one-to-one correspondence between integers and Montgomery residues for 0 < a < M-1 Sharif University of Technology
Montgomery multiplication algorithm Outline • Introduction • Montgomery modular multiplication of integers • Montgomery modular multiplication in GF(2k) • Conclusion Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication of Integers • Define: • r-1is the inverse of r mod M: • r-1r= 1 (mod M) Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication of Integers • Example : Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication of Integers • Montgomery multiplication algorithm • requires no hard division just shifting • In radix 2 Input: X,Y,M Output: Z = 0 for i = 0 to n-1 Z = Z + xi•Y if Z is odd then Z = Z + M Z = Z/2 if Z ≥ M then Z = Z – M Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication of Integers • X = 7 = 0111 • Y = 5 = 0101 • M = 11 = 1011 • Example : • Z initially 0 • Z = (0 + 5 + 11) / 2 = 8 • Z = (8 + 5 + 11) / 2 = 12 • Z = (12 + 5 + 11) / 2 = 14 • Z = (14 + 0) / 2 = 7 (final result) • Z = 0 • for i = 0 to n-1 • Z = Z + xi•Y • if Z is odd then Z = Z + M • Z = Z/2 • if Z ≥ M then Z = Z – M Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication of Integers • Conversion using MM Conversion of integers to/from Montgomery residues with one MM operation Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication of Integers x r2 X’ 1 MM MM X’ X Sharif University of Technology
Montgomery multiplication algorithm Outline • Introduction • Montgomery modular multiplication of integers • Montgomery modular multiplication in GF(2k) • Conclusion Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication in GF(2k) • Based on polynomial representation • is a polynomial of length k and degree less than or equal to : • + • Need an irreducible polynomial of degree • Instead of computing in propose to compute in Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication in GF(2k) • r : element of the field, presented by the polynomial : • i.e. if , then • very useful in obtaining fast implementations • If , then there exist and that : • and can be computed using EEA algorithm.(taught in class) Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication in GF(2k) • Definition: • Can be computed using the following algorithm Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication in GF(2k) • Algorithm for Montgomery Multiplication Input : Output : Step 1. Step 2. Step 3. Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication in GF(2k) • The proposed algorithm is similar to MM of integers • Only difference : the final subtraction step in the integer case is not necessary in the polynomial case • Proof: • Thus, c(x) is already reduced Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication in GF(2k) • The modular Mult. and Div. in Step 2, 3 are fast operations • Since • The remainder operation : simply ignoring the term • Div. by : shifting the polynomial to the right by places • Precompute for step 2 • Avoided if the coefficients of are scanned one bit at a time. Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication in GF(2k) • Recall : • Can be written : Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication in GF(2k) • Starting from MSB to LSB : Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication in GF(2k) • The shift factor reverses the direction of summation(LSB to MSB) Sharif University of Technology
Montgomery multiplication algorithm Montgomery multiplication in GF(2k) Bit-Level Algorithm for Montgomery Multiplication Input: Output: Step 1. Step 2. Step 3. Step 4. Step 5. Sharif University of Technology
Montgomery multiplication algorithm Outline • Introduction • Montgomery modular multiplication of integers • Montgomery modular multiplication in GF(2k) • Conclusion Sharif University of Technology
Montgomery multiplication algorithm Conclusion • We have described the bit-level algorithm for computing the product in the • The MMM operation would be significantly faster in SW and HW • Since, • Division changes to simple shifting • Remainder operation simply done by ignoring • We can speed up more if we use Word-level algorithm for SW implementation Sharif University of Technology