sol2 - CS346 Cryptography, Fall 2009 Homework 2, SOLUTIONS...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS346 Cryptography, Fall 2009 Homework 2, SOLUTIONS 1. (5 points) Give an algorithm that on input integers x and m computes x 37 mod m . As a primitive step you may assume an algorithm for modular multiplication: on input y and z it computes ( y · z ) mod m . Your algorithm should use as few modular multiplications as possible (7 is the best possible). You may write the algorithm informally. Solution: x 2 = x × x (mod m ) x 4 = x 2 × x 2 (mod m ) x 8 = x 4 × x 4 (mod m ) x 16 = x 8 × x 8 (mod m ) x 32 = x 16 × x 16 (mod m ) x 36 = x 32 × x 4 (mod m ) x 37 = x 36 × x (mod m ) Note that x i = x i (mod m ) 2. (6 points) Find the greatest common divisors of the following pairs, without factoring. Use the Euclidean algorithm instead. For each pair, give the sequence of r i -s produced by the algorithm. NOTE: you should be able to do this by hand, without a computer or calculator. A. gcd (103927 , 102313) Solution: r 0 = 103927, r 1 = 102313, r 2 = 1614, r 3 = 631, r 4 = 352, r 5 = 279, r 6 = 73, r 7 = 60, r 8 = 13, r 9 = 8, r 10 = 5, r 11 = 3, r 12 = 2, r 13 = 1, r 14
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/07/2010 for the course C S 52475 taught by Professor Gal during the Fall '10 term at University of Texas at Austin.

Page1 / 3

sol2 - CS346 Cryptography, Fall 2009 Homework 2, SOLUTIONS...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online