

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


(a + b) mod n = ((a mod n) + (b mod n)) mod n
(a − b) mod n = ((a mod n) − (b mod n)) mod n
(a ∗ b) mod n = ((a mod n) ∗ (b mod n)) mod n
xy^ mod n =
y ︷ ︸︸ ︷ x ∗ x ∗ · · · ∗ x modn
xaxb^ = x(a+b) xaya^ = (xy)a (xa)b^ = x(ab) x(^
a b ) = b
xa
x(a−b)^ = xa xb x−a^ =
xa
y = logb (x) iffx = by logb (1) = 0 logb (b) = 1 logb (xy) = logb (x) + logb (y)
logb
x y
= logb (x) − logb (y)
logb (xn) = n logb (x)
logb (x) = logb (c) logc (x) =
logc (x) logc (b)
Theorem 1 (Euler) Let x be any positive in- teger that’s relatively prime to the integer n > 0 , then xφ(n)^ mod n = 1.
Theorem 2 (Corollary to Euler’s theorem) Let x be any positive integer that’s relatively prime to the integer n > 0 , and let k be any posi- tive integer, then xk^ mod n = xk^ mod^ φ(n)^ mod n.
Theorem 3 (Bezout’s identity) Given any integers a and b, not both zero, there exist in- tegers i and j such that GCD(a, b) = ia + jb.
Theorem 4 (Corollary to Euler’s theorem) Given two prime numbers p and q, integers n = pq and 0 < m < n, and an arbi- trary integer k, then mkφ(n)+1^ mod n = mk(p−1)(q−1)+1^ mod n = m mod n.
Theorem 5 (Fermat’s Little Theorem) Let p be a prime number and g any positive integer g < p, then gp−^1 mod p = 1.
f u n c gcd ( i n t a , i n t b ) : ( i n t , i n t , i n t ) = i f b = 0 then r e t u r n (a, 1 , 0) q ← ⌊a/b⌋ (d, k, l) ← gcd(b, a mod b) r e t u r n (d, l, k − lq)
a = gk^ mod p b = M yk^ mod p