60 chapter 10 computational problems related to

Info icon This preview shows pages 65–68. Sign up to view the full content.

View Full Document Right Arrow Icon
60
Image of page 65

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

View Full Document Right Arrow Icon
Chapter 10 Computational Problems Related to Quadratic Residues 10.1 Computing the Jacobi Symbol Suppose we are given an odd, positive integer n , along with an integer a , and we want to compute the Jacobi symbol ( a | n ). Theorem 9.8 suggests the following algorithm: t 1 repeat — loop invariant: n is odd and positive a a rem n if a = 0 if n = 1 return t else return 0 compute a 0 , h such that a = 2 h a 0 and a 0 is odd if h 6≡ 0 (mod 2) and n 6≡ ± 1 (mod 8) then t ← - t if a 0 6≡ 1 (mod 4) and n 6≡ 1 (mod 4) then t ← - t ( a, n ) ( n, a 0 ) forever That this algorithm correctly computes the Jacobi symbol ( a | n ) follows directly from Theo- rem 9.8. Using an analysis similar to that of Euclid’s algorithm, one easily sees that the running time of this algorithm is O ( L ( a ) L ( n )). 10.2 Testing quadratic residuosity 10.2.1 Prime modulus For an odd prime p , we can test if a is a quadratic residue modulo p by either performing the exponentiation a ( p - 1) / 2 rem p or by computing the Legendre symbol ( a | p ). Using a standard repeated squaring algorithm, the former method takes time O ( L ( p ) 3 ), while using the Euclidean- like algorithm of the previous section, the latter method takes time O ( L ( p ) 2 ). So presumably, the latter method is to be preferred. 61
Image of page 66
10.2.2 Prime-power modulus For an odd prime p , we know that a is a quadratic residue modulo p e if and only if a is a quadratic residue modulo p . So this case immediately reduces to the previous case. 10.2.3 Composite modulus For odd, composite n , if we know the factorization of n , then we can also determine if a is a quadratic residue modulo n by determining if it is a quadratic residue modulo each prime divisor p of n . However, without knowledge of this factorization (which is in general believed to be hard to compute), there is no efficient algorithm known. We can compute the Jacobi symbol ( a | n ); if this is - 1 or 0, we can conclude that a is not a quadratic residue; otherwise, we cannot conclude much of anything. 10.3 Computing modular square roots 10.3.1 Prime modulus Let p be an odd prime, and suppose that ( a | p ) = 1. Here is one way to compute a square root of a modulo p , assuming we have at hand an integer y such that ( y | p ) = - 1. Let α = [ a mod p ] Z * p and γ = [ y mod p ] Z * p . The above problem is equivalent to finding β Z * p such that β 2 = α . Let us write p - 1 = 2 h m , where m is odd. For any δ Z * p , δ m has order dividing 2 h . Since α 2 h - 1 m = 1, α m has order dividing 2 h - 1 . Since γ 2 h - 1 m = [ - 1 mod p ], γ m has order precisely 2 h . Since there is only one subgroup in Z * p of order 2 h , it follows that γ m generates this subgroup, and that α m = γ mx for 0 x < 2 h and x is even. We can find x by computing the discrete logarithm of α m to the base γ m , using the algorithm in § 8.2.3. Setting κ = γ mx/ 2 , we have κ 2 = α m . We are not quite done, since we now have a square root of α m , and not of α . However, because gcd( m, 2) = 1, we can find integers s, t such that ms + 2 t = 1. In fact, s = 1 and t = -b m/ 2 c do the job. It then follows that ( κ s α t ) 2 = κ 2 s α 2 t = α ms α 2 t = α ms +2 t = α.
Image of page 67

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

View Full Document Right Arrow Icon
Image of page 68
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern