Lecture03-modarith

Lecture03-modarith - This work is licensed under a Creative...

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

View Full Document Right Arrow Icon
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
Image of page 1

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

View Full Document Right Arrow Icon
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)
Image of page 2
Objectives § Add the Max Rule to your asymptotic analysis toolbox § Review modular arithmetic § Discuss and analyze algorithms for: § modular arithmetic § modular exponentiation
Image of page 3

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

View Full Document Right Arrow Icon
Max. rule § Another useful rule for Asymptotic analysis. O( f(n) + g(n) ) = O( max( f(n), g(n) ) ) § Examples:
Image of page 4
Max. rule § Another useful rule for Asymptotic analysis. O( f(n) + g(n) ) = O( max( f(n), g(n) ) ) § Examples:
Image of page 5

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

View Full Document Right Arrow Icon
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?
Image of page 6
Algorithms for Integer Arithmetic
Image of page 7

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

View Full Document Right Arrow Icon
Algorithms for Integer Arithmetic § Addition § Multiplication § Division
Image of page 8
Algorithms for Integer Arithmetic
Image of page 9

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

View Full Document Right Arrow Icon
Modular Arithmetic
Image of page 10
Congruency
Image of page 11

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

View Full Document Right Arrow Icon
An important distinction § Congruency § Equality, using the modulus operator
Image of page 12
Properties § Associativity: § Commutativity: § Distributivity:
Image of page 13

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

View Full Document Right Arrow Icon
Substitution Rule
Image of page 14
Substitution Rule
Image of page 15

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

View Full Document Right Arrow Icon
Useful Consequence xy  (x mod z)y (mod z) xy mod z = (x mod z)y mod z § Example:
Image of page 16
Useful Consequence xy  (x mod z)y (mod z) xy mod z = (x mod z)y mod z § Example:
Image of page 17

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

View Full Document Right Arrow Icon
Modular Addition
Image of page 18
Modular Addition
Image of page 19

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

View Full Document Right Arrow Icon
Modular Multiplication
Image of page 20
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern