Richard Fateman CS 282 Lecture 61 Evaluation/Interpolation (I) Lecture 6.

Slides:



Advertisements
Similar presentations
Richard Fateman CS 282 Lecture eea1 Extended Euclidean Algorithm Lecture eea.
Advertisements

Cryptography and Network Security
Chapter 8 – Introduction to Number Theory. Prime Numbers prime numbers only have divisors of 1 and self –they cannot be written as a product of other.
Section 4.1: Primes, Factorization, and the Euclidean Algorithm Practice HW (not to hand in) From Barr Text p. 160 # 6, 7, 8, 11, 12, 13.
Chapter 8 Introduction to Number Theory. Prime Numbers prime numbers only have divisors of 1 and self –they cannot be written as a product of other numbers.
Primality Testing Patrick Lee 12 July 2003 (updated on 13 July 2003)
Notation Intro. Number Theory Online Cryptography Course Dan Boneh
Information and Coding Theory Finite fields. Juris Viksna, 2015.
Richard Fateman CS 282 Lecture 81 Evaluation/Interpolation Lecture 8.
Richard Fateman CS 282 Lecture 21 Basic Domains of Interest used in Computer Algebra Systems Lecture 2.
Great Theoretical Ideas in Computer Science.
FFT1 The Fast Fourier Transform. FFT2 Outline and Reading Polynomial Multiplication Problem Primitive Roots of Unity (§10.4.1) The Discrete Fourier Transform.
Richard Fateman CS 282 Lecture 31 Operations, representations Lecture 3.
1 Chapter 7– Introduction to Number Theory Instructor: 孫宏民 Room: EECS 6402, Tel: , Fax :
Richard Fateman CS 282 Lecture 101 The Finite-Field FFT Lecture 10.
6/20/2015 5:05 AMNumerical Algorithms1 x x1x
Faster Multiplication, Powering of Polynomials
Polynomial Division, Remainder,GCD
Richard Fateman CS 282 Lecture 51 Faster Multiplication, Powering of Polynomials Lecture 5.
Chapter 4 – Finite Fields Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic Curve, IDEA, Public.
Richard Fateman CS 282 Lecture 31 Operations, representations Lecture 3.
Richard Fateman CS 282 Lecture 2c1 Basic Extensions for Computer Algebra System Domains Lecture 2c.
Lecture 3.2: Public Key Cryptography II CS 436/636/736 Spring 2012 Nitesh Saxena.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Dan Boneh Intro. Number Theory Modular e’th roots Online Cryptography Course Dan Boneh.
Mathematics of Cryptography Part I: Modular Arithmetic, Congruence,
Integers Number Theory = Properties of Integers
Mathematics of Cryptography Part I: Modular Arithmetic
Number Systems - Part II
Module :MA3036NI Cryptography and Number Theory Lecture Week 7
CPSC 3730 Cryptography and Network Security
Information Security and Management 4. Finite Fields 8
Great Theoretical Ideas in Computer Science.
Cryptography Dec 29. This Lecture In this last lecture for number theory, we will see probably the most important application of number theory in computer.
FFT1 The Fast Fourier Transform. FFT2 Outline and Reading Polynomial Multiplication Problem Primitive Roots of Unity (§10.4.1) The Discrete Fourier Transform.
The Integers. The Division Algorithms A high-school question: Compute 58/17. We can write 58 as 58 = 3 (17) + 7 This forms illustrates the answer: “3.
Advanced Algebraic Algorithms on Integers and Polynomials Prepared by John Reif, Ph.D. Analysis of Algorithms.
Richard Fateman CS 282 Lecture 71 Polynomial Division, Remainder,GCD Lecture 7.
Chapter 4 – Finite Fields
Data Security and Encryption (CSE348) 1. Lecture # 12 2.
Great Theoretical Ideas in Computer Science.
The Fast Fourier Transform and Applications to Multiplication
Chinese Remainder Theorem Dec 29 Picture from ………………………
Information Security Lab. Dept. of Computer Engineering 87/121 PART I Symmetric Ciphers CHAPTER 4 Finite Fields 4.1 Groups, Rings, and Fields 4.2 Modular.
Math 3121 Abstract Algebra I Lecture 5 Finish Sections 6 + Review: Cyclic Groups, Review.
Section 5.5 The Real Zeros of a Polynomial Function.
Chinese Remainder Theorem. How many people What is x? Divided into 4s: remainder 3 x ≡ 3 (mod 4) Divided into 5s: remainder 4 x ≡ 4 (mod 5) Chinese Remainder.
1 Fast Polynomial and Integer Multiplication Jeremy R. Johnson.
Cryptography and Network Security Chapter 4. Introduction  will now introduce finite fields  of increasing importance in cryptography AES, Elliptic.
Tuesday’s lecture: Today’s lecture: One-way permutations (OWPs)
COMPSCI 102 Discrete Mathematics for Computer Science.
Lecture 3.1: Public Key Cryptography I CS 436/636/736 Spring 2015 Nitesh Saxena.
Chapter 1 Algorithms with Numbers. Bases and Logs How many digits does it take to represent the number N >= 0 in base 2? With k digits the largest number.
MA/CSSE 473 Day 09 Modular Division Revisited Fermat's Little Theorem Primality Testing.
May 9, 2001Applied Symbolic Computation1 Applied Symbolic Computation (CS 680/480) Lecture 6: Multiplication, Interpolation, and the Chinese Remainder.
Chapter 4 With Question/Answer Animations 1. Chapter Motivation Number theory is the part of mathematics devoted to the study of the integers and their.
Number Theory Lecture 1 Text book: Discrete Mathematics and its Applications, 7 th Edition.
Discrete Mathematics Chapter 2 The Fundamentals : Algorithms, the Integers, and Matrices. 大葉大學 資訊工程系 黃鈴玲.
Agenda Review:  Relation Properties Lecture Content:  Divisor and Prime Number  Binary, Octal, Hexadecimal Review & Exercise.
CS480 Cryptography and Information Security
B504/I538: Introduction to Cryptography
Great Theoretical Ideas in Computer Science
Lecture 3.2: Public Key Cryptography II
Polynomial Division, Remainder,GCD
Evaluation/Interpolation (II)
Lecture 20 Guest lecturer: Neal Gupta
Discrete Math for CS CMPSC 360 LECTURE 12 Last time: Stable matching
Modular Inverses Recall the simple encryption function
Cryptography Lecture 16.
Cryptography Lecture 19.
Presentation transcript:

Richard Fateman CS 282 Lecture 61 Evaluation/Interpolation (I) Lecture 6

Richard Fateman CS 282 Lecture 62 Backtrack from the GCD ideas a bit We can do some operations faster in a simpler domain, even if we need to do them repeatedly GCD(F(x,y,z),G(x,y,z)) GCD(F p (x,0,0),G p (x,0,0)) GCD(F p (x,y,z),G p (x,y,z)) H(x,y,z) H p (x,y,z) H p (x,0,0)

Richard Fateman CS 282 Lecture 63 Backtrack from the GCD ideas a bit Some of the details GCD(F(x,y,z),G(x,y,z)) GCD(F p (x,0,0),G p (x,0,0)) GCD(F p (x,y,z),G p (x,y,z)) H(x,y,z) H p (x,y,z) H p (x,0,0) reduce mod p 1, p 2,... evaluate at z=0,1,2,... evaluate at y=0,1,2,... compute (many) GCDs interpolate OR sparse interpolate CRA p 1, p 2,...

Richard Fateman CS 282 Lecture 64 How does this work in some more detail How many primes p 1, p 2,...? –Bound the coeffs by p 1 *p 2 *...p n ? (or +/- half that) bad idea, the bounds are poor. given ||f|| what is ||h|| where h is factor of ||f|| ? Try an answer and test to see if it divides? See if WHAT divides? –compute cofactors A, B, A*H=F, B*H=G, and when A*H= F or B*H=G, you are done. –The process doesn’t recover the leading coefficient since F modulo p etc might as well be monic. –The inputs F and G are assumed primitive; restore the contents. –There may be unlucky primes or evaluation points.

Richard Fateman CS 282 Lecture 65 Chinese Remainder Theorem (Integer) Chinese Remainder Theorem: We can represent a number x by its remainders modulo some collection of relatively prime integers n 1 n 2 n 3... Let N = n 0 *n 1 *...*n k. Then the Chinese Remainder Thm. tells us that we can represent any number x in the range -(N-1)/2 to +(N-1)/2 by its residues modulo n 0, n 1, n 2,..., n k. {or some other similar sized range, 0 to N-1 would do}

Richard Fateman CS 282 Lecture 66 Chinese Remainder Example Example n 0 =3, n 2 =5, N=3*5=15 x x mod 3 x mod note: if you hate balanced notation -7+15=8. mod 3 is 2-> note: x mod 5 agrees with x, for small x 2 [-2,2], +-(n-1)/ note: 000 note: 111 note: note: symmetry with note: also 22, 37,.... and -8,...

Richard Fateman CS 282 Lecture 67 Conversion to modular CRA form Converting from normal notation to modular representation is easy in principle; you do remainder computations (one instruction if x is small, otherwise a software routine simulating long division)

Richard Fateman CS 282 Lecture 68 Conversion to Normal Form (Garner’s Alg.) Converting to normal rep. takes k 2 steps. Beforehand, compute inverse of n 1 mod n 0, inverse of n 2 mod n 0 *n 1, and also the products n 0 *n 1, etc. Aside: how to compute these inverses: These can be done by using the Extended Euclidean Algorithm. Given r= n 0, s= n 1, or any 2 relatively prime numbers, EEA computes a, b such that a*r+b*s=1 = gcd(r,s) Look at this equation mod s: b*s is 0 (s is 0 mod s) and so we have a solution a*r=1 and hence a = inverse of r mod s. That’s what we want. It’s not too expensive since in practice we can precompute all we need, and computing these is modest anyway. (Proof of this has occupied quite a few people..)

Richard Fateman CS 282 Lecture 69 Conversion to Normal Form (Garner’s Alg.) Here is Garner's algorithm: Input: x as a list of residues {u i }: u 0 = x mod n 0, u 1 = x mod n 1,... Output: x as an integer in [-(N-1)/2,(N-1)/2]. (Other possibilities include x in another range, also x as a rational fraction!) Consider the mixed radix representation x = v 0 + v 1 *n 0 + v 2 *(n 0 *n 1 )+... +v k *(n 0 *...n k-1 ) [G] if we find the v i, we are done, after k more mults.

Richard Fateman CS 282 Lecture 610 Conversion to Normal Form (Garner’s Alg.) x = v 0 + v 1 *n 0 + v 2 *(n 0 *n 1 )+... +v k *(n 0 *...n k-1 ) [G] It should be clear that v 0 = u 0, each being x mod n 0 Next, computing remainder mod n 1 of each side of [G] u 1 = v 0 +v 1 *n 0 mod n 1, with everything else dropping out so v 0 = (u 1 -v 0 )* n 0 -1 all mod n 1 in general, v k = ( u k - [v 0 +v 1 *n v k-1 * (n 0...n k-2 ) ]) * (n 0 *...n k-1 ) -1 mod n k. mod n k Note that all the v k are “small” numbers and the items in green are precomputed. So if we find all these values in sequence, we have k 2 operations.

Richard Fateman CS 282 Lecture 611 Conversion to Normal Form (Garner’s Alg.) Note that all the v k are “small” numbers and the items in green are precomputed. Cost: if we find all these values in sequence, we have k 2 multiplication operations, where k is the number of primes needed. In practice we pick the k largest single-precision primes, and so k is about 2* log (SomeBound/2 31 )

Richard Fateman CS 282 Lecture 612 Interpolation Abstractly THE SAME AS CRA –change primes p 1, p 2,... to (x-x 1 )... –change residues u 1 = x mod p 1 for some integer x to y k =F(x k ) for a polynomial F in one variable –eh, we don’t usually program it that way, though.

Richard Fateman CS 282 Lecture 613 To factor a polynomial h(x) Evaluate h(0); find all factors. h 0,0, h 0,1 … –E.g. if h(0)=8, factors are –8,-4,-2,-1,1,2,4,8 Repeat … until Factor h(n) Find a factor: What polynomial f(x) assumes the value h 0,k at 0, h 1,j at 1, …. ? Questions: –Does this always work? –What details need to be resolved? –How much does this cost?