applied cryptography - protocols, algorithms, and source code in c

All rights reserved reproduction whole or in part in

Info iconThis preview shows page 1. Sign up to view the full content.

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

Unformatted text preview: od 7) 32 = 9 a 2 (mod 7) 42 = 16 a 2 (mod 7) 52 = 25 a 4 (mod 7) 62 = 36 a 1 (mod 7) Note that each quadratic residue appears twice on this list. There are no values of x which satisfy any of these equations: x2 a 3 (mod 7) x2 a 5 (mod 7) x2 a 6 (mod 7) The quadratic nonresidues modulo 7, the numbers that are not quadratic residues, are 3, 5, and 6. Although I will not do so here, it is easy to prove that, when p is odd, there are exactly (p1)/2 quadratic residues mod p and the same number of quadratic nonresidues mod p. Also, if a is a quadratic residue mod p, then a has exactly two square roots, one of them between 0 and (p- 1)/2, and the other between (p- 1)/2 and (p- 1). One of these square roots is also a quadratic residue mod p; this is called the principal square root. If n is the product of two primes, p and q, there are exactly (p- 1)(q- 1)/4 quadratic residues mod n. A quadratic residue mod n is a perfect square modulo n. This is because to be a square mod n, the residue must be a square mod p and a square mod q. For example, there are 11 quadratic residues mod 35: 1, 4, 9, 11, 14, 15, 16, 21, 25, 29, and 30. Each quadratic residue has exactly four square roots. Legendre Symbol The Legendre symbol, written L(a,p), is defined when a is any integer and p is a prime greater than 2. It is equal to 0, 1, or -1. L(a,p) = 0 if a is divisible by p. L(a,p) = 1 if a is a quadratic residue mod p. L(a,p) = - 1 is a is a quadratic nonresidue mod p. One way to calculate L(a,p) is: L(a,p) = a(p- 1)/2 mod p Or you can use the following algorithm: 1. If a = 1, then L(a,p) = 1 2. If a is even, then L(a,p) = L(a /2,p)*(- 1)(p2- 1)/8 3. If a is odd (and ` 1), then L(a,p) = L(p mod a,a)*(- 1)(a- 1)*(p- 1)/4 Note that this is also an efficient way to determine whether a is a quadratic residue mod p (when p is prime). Previous Table of Contents Next Products | Contact Us | About Us | Privacy | Ad Info | Home Use of this site is subject to certain Terms & Conditions, Copyright © 1996-2000 EarthWeb Inc. All rights reserved. Reproduction whole or in part in any form or medium without express written permission of EarthWeb is p...
View Full Document

This note was uploaded on 10/18/2010 for the course MATH CS 301 taught by Professor Aliulger during the Fall '10 term at Koç University.

Ask a homework question - tutors are online