Professional Documents
Culture Documents
a r ⋅ b r′ mod p = p − 1
}
/ / Now r is odd, r′ is even, and a r ⋅ b r′ mod p = 1
while r is even do{
a r ⋅ b r′ mod p = 1
a r ⋅ b r′ mod p = p − 1
}
/ / Now r is odd, r′ is even, and a r ⋅ b r′ mod p = 1
= a a r ⋅ b r′ = ± a
EXAMPLE
while r is even do
EXAMPLE
p = 43, a = 16
while r is even do
EXAMPLE
p = 43, a = 16
b = -1
while r is even do
EXAMPLE
p = 43, a = 16
b = -1
r := (p-1)/2 = 21, r’:= 0
while r is even do
EXAMPLE
p = 43, a = 16
b = -1
r := (p-1)/2 = 21, r’:= 0
return ±1611 mod 43 (= ±4)
while r is even do
EXAMPLE
while r is even do
EXAMPLE
p = 37, a = 16
while r is even do
EXAMPLE
p = 37, a = 16
b=2
while r is even do
EXAMPLE
p = 37, a = 16
b=2
r := (p-1)/2 = 18, r’:= 0
while r is even do
EXAMPLE
p = 37, a = 16
b=2
r := (p-1)/2 = 18, r’:= 0
r := r/2 =9, r’:= 0
while r is even do
EXAMPLE
p = 37, a = 16
b=2
r := (p-1)/2 = 18, r’:= 0
r := r/2 =9, r’:= 0
return ±165 mod 37 (= ±4)
while r is even do
EXAMPLE
while r is even do
EXAMPLE
p = 41, a = 16
while r is even do
EXAMPLE
p = 41, a = 16
b=3
while r is even do
EXAMPLE
p = 41, a = 16
b=3
r := (p-1)/2 = 20, r’:= 0
while r is even do
EXAMPLE
p = 41, a = 16
b=3
r := (p-1)/2 = 20, r’:= 0
r := r/2 = 10, r’:= 0
while r is even do
EXAMPLE
p = 41, a = 16
b=3
r := (p-1)/2 = 20, r’:= 0
r := r/2 = 10, r’:= 0
r := r/2 = 5, r’:= 0
while r is even do
EXAMPLE
p = 41, a = 16
b=3
r := (p-1)/2 = 20, r’:= 0
r := r/2 = 10, r’:= 0
r := r/2 = 5, r’:= 0
return ±163 mod 41 (= ±4)
while r is even do
EXAMPLE
while r is even do
EXAMPLE
p = 41, a = 8
while r is even do
EXAMPLE
p = 41, a = 8
b=3
while r is even do
EXAMPLE
p = 41, a = 8
b=3
r := (p-1)/2 = 20, r’:= 0
while r is even do
EXAMPLE
p = 41, a = 8
b=3
r := (p-1)/2 = 20, r’:= 0
r := r/2 = 10, r’ := r’/2 +20 = 20
while r is even do
EXAMPLE
p = 41, a = 8
b=3
r := (p-1)/2 = 20, r’:= 0
r := r/2 = 10, r’ := r’/2 +20 = 20
r := r/2 = 5, r’:= r’/2 +20 = 30
while r is even do
EXAMPLE
p = 41, a = 8
b=3
r := (p-1)/2 = 20, r’:= 0
r := r/2 = 10, r’ := r’/2 +20 = 20
r := r/2 = 5, r’:= r’/2 +20 = 30
return ±83x315 mod 41 (= ±7)
while r is even do
Extracting Square Roots modulo N
rp2 ≡ a (mod p)
rq2 ≡ a (mod q) .
Proof idea:
The previous construction shows that if we know the factorization of N,
we can extract square roots modulo each prime factor and then
recombine using the Chinese Remainder Theorem.
Proof idea:
The previous construction shows that if we know the factorization of N,
we can extract square roots modulo each prime factor and then
recombine using the Chinese Remainder Theorem.
Proof idea:
The previous construction shows that if we know the factorization of N,
we can extract square roots modulo each prime factor and then
recombine using the Chinese Remainder Theorem.
a = 477,
EXAMPLE
N = 37*43 = 1591,
a = 477,
a2 mod 1591 = 16
EXAMPLE
N = 37*43 = 1591,
a = 477,
a2 mod 1591 = 16
√(a2) mod 1591 = 4
EXAMPLE
N = 37*43 = 1591,
a = 477,
a2 mod 1591 = 16
√(a2) mod 1591 = 4
477 ≢ ±4 (mod 1591)
EXAMPLE
N = 37*43 = 1591,
a = 477,
a2 mod 1591 = 16
√(a2) mod 1591 = 4
477 ≢ ±4 (mod 1591)
EXAMPLE
N = 37*43 = 1591,
a = 477,
a2 mod 1591 = 16
√(a2) mod 1591 = 4
477 ≢ ±4 (mod 1591)
u = gcd(477+4, 1591) = 37
EXAMPLE
N = 37*43 = 1591,
a = 477,
a2 mod 1591 = 16
√(a2) mod 1591 = 4
477 ≢ ±4 (mod 1591)
u = gcd(477+4, 1591) = 37
v = gcd(477-4, 1591) = 43
Prime numbers
Theorem
π(N)log N
lim =1
N→∞ N
Theorem
π(N)log N
lim =1
N→∞ N
Theorem
π(N)log N
lim =1
N→∞ N
p′ ← {0,1}n−2
p := 1 ∥ p′ ∥ 1
Multiples of 3 (base 2)
𝟘
𝟘
q1
𝟙
𝟙
𝟙
q0
q2
𝟘
9.34
p′ ← {0,1}n−2
p := 1 ∥ p′ ∥ 1
Primality à la Fermat
9.35
Primality à la Miller-Rabin
9.44
(x + a)N ≡ x N + a (mod N) .