Lecture03-modarith

This preview shows pages 1–22. Sign up to view the full content.

CS 312: Algorithm Analysis Lecture #3: Algorithms for Modular Arithmetic, Modular Exponentiation This work is licensed under a Creative Commons Attribution-Share Alike 3.0 Unported License. Slides by: Eric Ringger, with contributions from Mike Jones, Eric Mercer, Sean Warnick

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Announcements § HW #1 Due Now § FERPA and waiver § Issue: if you can’t run VS in the CS lab, § Backup important data in ~/.windows_profile § Then remove it (from a Linux machine on the command line)
Objectives § Add the Max Rule to your asymptotic analysis toolbox § Review modular arithmetic § Discuss and analyze algorithms for: § modular arithmetic § modular exponentiation

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Max. rule § Another useful rule for Asymptotic analysis. O( f(n) + g(n) ) = O( max( f(n), g(n) ) ) § Examples:
Max. rule § Another useful rule for Asymptotic analysis. O( f(n) + g(n) ) = O( max( f(n), g(n) ) ) § Examples:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Goal for Ch. 1 § Appreciate the role of theoretical analysis in the security of RSA. § Requires: Solve, analyze, and use (!) two important and related problems: § Factoring : Given a number N, express it as a product of its prime numbers § Primality Testing : Given a number N, determine whether it is prime § Which one is harder?
Algorithms for Integer Arithmetic

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Algorithms for Integer Arithmetic § Addition § Multiplication § Division
Algorithms for Integer Arithmetic

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Modular Arithmetic
Congruency

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
An important distinction § Congruency § Equality, using the modulus operator
Properties § Associativity: § Commutativity: § Distributivity:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Substitution Rule
Substitution Rule

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Useful Consequence xy  (x mod z)y (mod z) xy mod z = (x mod z)y mod z § Example:
Useful Consequence xy  (x mod z)y (mod z) xy mod z = (x mod z)y mod z § Example:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Modular Multiplication
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern