C2. Introduction To Number Theory and Finite Fields
C2. Introduction To Number Theory and Finite Fields
and Network
Security
Sixth Edition
by William Stallings
• If a | 1, then a = ±1
• If a | b and b | a, then a = ±b
• Any b ≠ 0 divides 0
• If a | b and b | c, then a | c
b = 7; g = 14; h = 63; m = 3; n = 2
7 | 14 and 7 | 63.
To show 7 (3 * 14 + 2 * 63),
we have (3 * 14 + 2 * 63) = 7(3 * 2 + 2 * 9),
and it is obvious that 7 | (7(3 * 2 + 2 * 9)).
a = qn + r 0 ≤ r < n; q = [a/n]
11 mod 7 = 4; - 11 mod 7 = 3
23 = 8 (mod 5) because 23 - 8 = 15 = 5 * 3
- 11 = 5 (mod 8) because - 11 - 5 = - 16 = 8 * (- 2)
81 = 0 (mod 27) because 81 - 0 = 81 = 27 * 3
11 mod 8 = 3; 15 mod 8 = 7
[(11 mod 8) + (15 mod 8)] mod 8 = 10 mod 8 = 2
(11 + 15) mod 8 = 26 mod 8 = 2
[(11 mod 8) - (15 mod 8)] mod 8 = - 4 mod 8 = 4
(11 - 15) mod 8 = - 4 mod 8 = 4
[(11 mod 8) * (15 mod 8)] mod 8 = 21 mod 8 = 5
(11 * 15) mod 8 = 165 mod 8 = 5
Additive
and
Multiplicative
Inverses
Modulo 8
a
b
1.
• Find integers k, q, with k > 0, q odd, so that (n – 1)=2kq ;
2.
• Select a random integer a, 1 < a < n – 1 ;
3.
• if aq mod n = 1 then return (“inconclusive") ;
4.
• for j = 0 to k – 1 do
5.
• if (a2jq mod n = n – 1) then return (“inconclusive") ;
6.
• return (“composite") ;
Vietnam – Korea University
of Information and Communication Technology
Deterministic Primality Algorithm
• Prior to 2002 there was no known method of
efficiently proving the primality of very large
numbers
• All of the algorithms in use produced a
probabilistic result
• In 2002 Agrawal, Kayal, and Saxena developed
an algorithm that efficiently determines whether a
given large number is prime
• Known as the AKS algorithm
• Does not appear to be as efficient as
the Miller-Rabin algorithm