A Comparison of Performance Between a CPU and a GPU on Prime Factorization Using Eratosthene's Sieve and Trial Division

Total Page:16

File Type:pdf, Size:1020Kb

A Comparison of Performance Between a CPU and a GPU on Prime Factorization Using Eratosthene's Sieve and Trial Division DEGREE PROJECT IN TECHNOLOGY, FIRST CYCLE, 15 CREDITS STOCKHOLM, SWEDEN 2017 A Comparison of Performance Between a CPU and a GPU on Prime Factorization Using Eratosthene's Sieve and Trial Division CAROLINE W. BORG ERIK DACKEBRO KTH ROYAL INSTITUTE OF TECHNOLOGY SCHOOL OF COMPUTER SCIENCE AND COMMUNICATION A Comparison of Performance Between a CPU and a GPU on Prime Factorization Using Eratosthene’s Sieve and Trial Division CAROLINE W. BORG ERIK DACKEBRO Bachelor in Computer Science Date: June 11, 2017 Supervisor: Mårten Björkman Examiner: Örjan Ekeberg Swedish title: En jämförelse i prestanda mellan en CPU och en GPU avseende primtalsfaktorisering med hjälp av Eratosthenes såll och Försöksdivison School of Computer Science and Communication iii Abstract There has been remarkable advancement in Multi-cored Processing Units over the past decade. GPUs, which were originally designed as a specialized graphics processor, are today used in a wide variety of other areas. Their ability to solve parallel problems is unmatched due to their massive amount of simultaneously running cores. Despite this, most algorithms in use today are still fully sequential and do not utilize the processing power available. The Sieve of Eratosthenes and Trial Division are two very naive algorithms which combined can be used to find a number’s unique combinataion of prime factors. This paper sought to compare the performance of a CPU and a GPU when tasked with prime factorization on seven different data sets. Five different programs were created, two running both algorithms on the CPU, two running both algorithms on the GPU and one program uti- lizing both. Each data set was presented multiple times to each pro- gram in different sizes ranging from one to half a million. The result was uniform in that the CPU greatly outperformed the GPU in every test case for this specific implementation. iv Sammanfattning Flerkärniga processorer har under det senaste årtiondet utvecklats mar- kant. Grafikkorten, designade för att excellera i grafiktunga beräkning- ar, används idag inom flera andra områden. Kortens förmåga att lösa paralleliserbara problem är oöverträffad tack vare deras massiva an- tal kärnor. Trots detta är majoriteten av algoritmer idag fortfarande helt sekventiella. Eratosthenes såll och Försöksdivision är två väldigt naiva algoritmer som tillsammans kan användas för att finna ett tals unika uppsättning primtalsfaktorer. Det här arbetet strävade efter att jämföra prestandan mellan en CPU och en GPU vad gäller uppgiften att faktorisera tal från sju olika uppsättningar data. Fem implementationer skrevs, varav två var be- gränsade till CPU:ns processorkraft, två begränsade till GPU:ns pro- cessorkraft och en som utnyttjade båda. Varje uppsättning data före- kom i olika storlekar i omfånget ental till en halv miljon. Resultatet var entydigt på så sätt att CPU:n markant överträffade GPU:n i samtliga testfall. Contents 1 Introduction1 1.1 Purpose.............................1 1.2 Problem Statement......................2 1.2.1 Constraints......................2 2 Background3 2.1 Prime Numbers........................3 2.2 Finding Primes........................4 2.2.1 Sieve..........................4 2.2.1.1 Sieve of Eratosthenes...........4 2.3 Factorization..........................5 2.3.1 Trial Division.....................6 2.4 CUDA.............................6 3 Method7 3.1 Approach............................7 3.2 Algorithms...........................8 3.3 Implementations.......................9 3.3.1 Sequential Algorithm with Sieve..........9 3.3.2 Sequential Algorithm without Sieve........ 10 3.3.3 Parallel Algorithm with Sieve............ 10 3.3.4 Parallel Algorithm without Sieve.......... 10 3.3.5 Algorithm with Sieve on CPU and Trial Division on GPU........................ 10 3.4 Data............................... 11 3.5 Hardware........................... 11 3.5.1 Central Processing Unit - CPU........... 11 3.5.2 Graphical Processing Unit - GPU.......... 12 3.6 Compilation Tools and Runtime Environments...... 12 v vi CONTENTS 4 Results 13 4.1 Small Prime Numbers.................... 14 4.2 Large Numbers that are Products of Many Small Prime Numbers................. 15 4.3 Large Prime Numbers.................... 16 4.4 Numbers that are Products of Two Larger Prime Numbers 17 4.5 Small Random Numbers................... 18 4.6 Large Random Numbers................... 19 4.7 Mixed Small and Large Random Numbers........ 20 4.8 Baseline Test.......................... 21 5 Discussion 22 5.1 The Parallel Baseline Cost.................. 22 5.2 The Growth of Algorithm D................. 23 6 Conclusion 24 6.1 Future Work.......................... 24 Bibliography 25 Chapter 1 Introduction Multi-core processing units are nowadays considered commonplace in everyday computers. Despite this, relatively few software fully utilize their power. A reason for this could be that many algorithms in use today are either old algorithms themselves or closely related to older algorithms. Multi-cored units are a fairly recent phenomenon, the first dual-core processor being introduced as late as 2001. Algorithms, on the other hand, have been developed and used for thousands of years. These algorithms, as victims of their time, are typically very sequential in their nature. There exists many algorithms for determining whether a number is prime or not. Factorization, more specifically prime factorization, is however a more difficult problem and although there exists some al- gorithms more efficient than exhaustive search, there are no currently available algorithms more efficient than the complexity class SUBEX- PTIME[1]. 1.1 Purpose The purpose of this report is to investigate if simpler tasks, like prime factorization, can be parallelized on GPUs with any gain in perfor- mance. It is interesting to find out if it is possible to improve per- formance by exchanging a more advanced and faster core for a great number of less advanced, slower cores. Especially since this some- times can be achieved without making major changes to the code. 1 2 CHAPTER 1. INTRODUCTION 1.2 Problem Statement This report investigates the usage of GPUs compared to CPUs for the prime factorization of seven different data sets of numbers ranging from in the tens to upwards a couple trillions. The prime factoriza- tion is to be performed using the rather simple approach of Trial Divi- sion. Prime factorization by Trial Division do not necessarily require precalculated primes as input but the exclusion of composite numbers should prove beneficial. These primes can be found in many ways, one of the more straight forward being the Sieve of Eratosthenes. Both the sieve and the actual Trial Division can be parallelized and the results then calculated on multiple cores. The parallelization could in theory give a performance gain if im- plemented correctly. The theory is that if enough threads run in paral- lel it could make up for the difference in clock speed between a CPU and a GPU. This performance gain has the possibility to grow even further if executed on a GPU with its specialization on massive paral- lelism on simple calculations. This leads up to the research question: Using the naive methods, Sieve of Eratosthenes and Trial Divi- sion, how does a parallel implementation running on a GPU fare against a sequential implementation running on a CPU? 1.2.1 Constraints The report is limited by the following constraints. • The integers that we will try to factorize will be smaller than 1:455e+13. The number is a middle ground between integer size and bit length. For comparison, 244 is approximately 1:759e+13. • The data set is limited to seven different types of test data, each with its own way of testing the implementations. See 3.4. • The length of each test it limited by an upper bound. This limit is 500 000 for all test cases except for 4.4 which has a limit of 1 000. Chapter 2 Background This chapter introduces the reader to concepts necessary to under- stand this report. Two major concepts, factorization and prime num- bers, are introduced and then built upon with some background on finding primes. The latter includes general theory about sieves and an introduction to the two algorithms used in this paper. Namely, the Sieve of Eratosthenes and Trial Division. The background concludes with a description of CUDA. 2.1 Prime Numbers The fundamental theorem of arithmetic states that every integer larger than one is either a prime itself or the product of a unique combination of primes. A prime number is a positive integer which has exactly two posi- tive divisors, one and itself [2]. Prime number theory has been around since at least 300 B.C., when Euclid described the greatest common divisor and the least common multiple [3], both of which are based on prime numbers. In the same time period Eratosthenes described a method for calculating all prime numbers up to a user-chosen upper bound, called the sieve of Eratosthenes [4]. After the ancient greeks, little happened in the prime number field until the 17th century, when Pierre de Fermat presented Fermat’s little theorem [5], a well-known primality test. Later in the 18th and 19th centuries, more progress was accomplished in the prime number field by mathematicians such as Leonhard Euler [6], Édouard Lucas and Derrick Henry Lehmer [7]. Until the 1970s, prime numbers were believed to have small appli- 3 4 CHAPTER 2. BACKGROUND ance outside of the mathematical field. However, as first predicted by Jevons [8], large primes can be used in a cryptographic system to per- form a one-way encryption. This is a key concept of an important and common operation in today’s computer systems, namely asymmetric encryption. One of the better known asymmetric protocols is named RSA, which is based on the multiplication of two large primes [9]. The largest factored RSA number to date is 768 bits long, far beyond the scope of this report[10]. Although the public and private key in mod- ern systems are often reused [11], the setup part of the algorithm relies on finding these two large primes to multiply together.
Recommended publications
  • X9.80–2005 Prime Number Generation, Primality Testing, and Primality Certificates
    This is a preview of "ANSI X9.80:2005". Click here to purchase the full version from the ANSI store. American National Standard for Financial Services X9.80–2005 Prime Number Generation, Primality Testing, and Primality Certificates Accredited Standards Committee X9, Incorporated Financial Industry Standards Date Approved: August 15, 2005 American National Standards Institute American National Standards, Technical Reports and Guides developed through the Accredited Standards Committee X9, Inc., are copyrighted. Copying these documents for personal or commercial use outside X9 membership agreements is prohibited without express written permission of the Accredited Standards Committee X9, Inc. For additional information please contact ASC X9, Inc., P.O. Box 4035, Annapolis, Maryland 21403. This is a preview of "ANSI X9.80:2005". Click here to purchase the full version from the ANSI store. ANS X9.80–2005 Foreword Approval of an American National Standard requires verification by ANSI that the requirements for due process, consensus, and other criteria for approval have been met by the standards developer. Consensus is established when, in the judgment of the ANSI Board of Standards Review, substantial agreement has been reached by directly and materially affected interests. Substantial agreement means much more than a simple majority, but not necessarily unanimity. Consensus requires that all views and objections be considered, and that a concerted effort be made toward their resolution. The use of American National Standards is completely voluntary; their existence does not in any respect preclude anyone, whether he has approved the standards or not from manufacturing, marketing, purchasing, or using products, processes, or procedures not conforming to the standards.
    [Show full text]
  • An Analysis of Primality Testing and Its Use in Cryptographic Applications
    An Analysis of Primality Testing and Its Use in Cryptographic Applications Jake Massimo Thesis submitted to the University of London for the degree of Doctor of Philosophy Information Security Group Department of Information Security Royal Holloway, University of London 2020 Declaration These doctoral studies were conducted under the supervision of Prof. Kenneth G. Paterson. The work presented in this thesis is the result of original research carried out by myself, in collaboration with others, whilst enrolled in the Department of Mathe- matics as a candidate for the degree of Doctor of Philosophy. This work has not been submitted for any other degree or award in any other university or educational establishment. Jake Massimo April, 2020 2 Abstract Due to their fundamental utility within cryptography, prime numbers must be easy to both recognise and generate. For this, we depend upon primality testing. Both used as a tool to validate prime parameters, or as part of the algorithm used to generate random prime numbers, primality tests are found near universally within a cryptographer's tool-kit. In this thesis, we study in depth primality tests and their use in cryptographic applications. We first provide a systematic analysis of the implementation landscape of primality testing within cryptographic libraries and mathematical software. We then demon- strate how these tests perform under adversarial conditions, where the numbers being tested are not generated randomly, but instead by a possibly malicious party. We show that many of the libraries studied provide primality tests that are not pre- pared for testing on adversarial input, and therefore can declare composite numbers as being prime with a high probability.
    [Show full text]
  • By Sieving, Primality Testing, Legendre's Formula and Meissel's
    Computation of π(n) by Sieving, Primality Testing, Legendre’s Formula and Meissel’s Formula Jason Eisner, Spring 1993 This was one of several optional small computational projects assigned to undergraduate mathematics students at Cambridge University in 1993. I’m releasing my code and writeup in 2002 in case they are helpful to anyone—someone doing research in this area wrote to me asking for them. My linear-time version of the Sieve of Eratosthenes may be original; I have not seen that algorithm anywhere else. But the rest of this work is straightforward implementation and exposition of well-known methods. A good reference is H. Riesel, Prime Numbers and Computer Methods for Factorization. My Common Lisp implementation is in the file primes.lisp. The standard language reference (now available online for free) is Guy L. Steele, Jr., Common Lisp: The Language, 2nd ed., Digital Press, 1990. Note: In my discussion of running time, I have adopted the usual ideal- ization of a machine that can perform addition and multiplication operations in constant time. Real computers obviously fall short of this ideal; for exam- ple, when n and m are represented in base 2 by arbitrary length bitstrings, it takes time O(log n log m) to compute nm. Introduction: In this project we’ll look at several approaches for find- ing π(n), the numberof primes less than n. Each approach has its advan- tages. • Sieving produces a complete list of primes that can be further analyzed. For instance, after sieving, we may easily identify the 8169 pairs of twin primes below 106.
    [Show full text]
  • Primes and Primality Testing
    Primes and Primality Testing A Technological/Historical Perspective Jennifer Ellis Department of Mathematics and Computer Science What is a prime number? A number p greater than one is prime if and only if the only divisors of p are 1 and p. Examples: 2, 3, 5, and 7 A few larger examples: 71887 524287 65537 2127 1 Primality Testing: Origins Eratosthenes: Developed “sieve” method 276-194 B.C. Nicknamed Beta – “second place” in many different academic disciplines Also made contributions to www-history.mcs.st- geometry, approximation of andrews.ac.uk/PictDisplay/Eratosthenes.html the Earth’s circumference Sieve of Eratosthenes 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 Sieve of Eratosthenes We only need to “sieve” the multiples of numbers less than 10. Why? (10)(10)=100 (p)(q)<=100 Consider pq where p>10. Then for pq <=100, q must be less than 10. By sieving all the multiples of numbers less than 10 (here, multiples of q), we have removed all composite numbers less than 100.
    [Show full text]
  • Primality Testing for Beginners
    STUDENT MATHEMATICAL LIBRARY Volume 70 Primality Testing for Beginners Lasse Rempe-Gillen Rebecca Waldecker http://dx.doi.org/10.1090/stml/070 Primality Testing for Beginners STUDENT MATHEMATICAL LIBRARY Volume 70 Primality Testing for Beginners Lasse Rempe-Gillen Rebecca Waldecker American Mathematical Society Providence, Rhode Island Editorial Board Satyan L. Devadoss John Stillwell Gerald B. Folland (Chair) Serge Tabachnikov The cover illustration is a variant of the Sieve of Eratosthenes (Sec- tion 1.5), showing the integers from 1 to 2704 colored by the number of their prime factors, including repeats. The illustration was created us- ing MATLAB. The back cover shows a phase plot of the Riemann zeta function (see Appendix A), which appears courtesy of Elias Wegert (www.visual.wegert.com). 2010 Mathematics Subject Classification. Primary 11-01, 11-02, 11Axx, 11Y11, 11Y16. For additional information and updates on this book, visit www.ams.org/bookpages/stml-70 Library of Congress Cataloging-in-Publication Data Rempe-Gillen, Lasse, 1978– author. [Primzahltests f¨ur Einsteiger. English] Primality testing for beginners / Lasse Rempe-Gillen, Rebecca Waldecker. pages cm. — (Student mathematical library ; volume 70) Translation of: Primzahltests f¨ur Einsteiger : Zahlentheorie - Algorithmik - Kryptographie. Includes bibliographical references and index. ISBN 978-0-8218-9883-3 (alk. paper) 1. Number theory. I. Waldecker, Rebecca, 1979– author. II. Title. QA241.R45813 2014 512.72—dc23 2013032423 Copying and reprinting. Individual readers of this publication, and nonprofit libraries acting for them, are permitted to make fair use of the material, such as to copy a chapter for use in teaching or research. Permission is granted to quote brief passages from this publication in reviews, provided the customary acknowledgment of the source is given.
    [Show full text]
  • The Pollard's Rho Method for Factoring Numbers
    Foote 1 Corey Foote Dr. Thomas Kent Honors Number Theory Date: 11-30-11 The Pollard’s Rho Method for Factoring Numbers We are all familiar with the concepts of prime and composite numbers. We also know that a number is either prime or a product of primes. The Fundamental Theorem of Arithmetic states that every integer n ≥ 2 is either a prime or a product of primes, and the product is unique apart from the order in which the factors appear (Long, 55). The number 7, for example, is a prime number. It has only two factors, itself and 1. On the other hand 24 has a prime factorization of 2 3 × 3. Because its factors are not just 24 and 1, 24 is considered a composite number. The numbers 7 and 24 are easier to factor than larger numbers. We will look at the Sieve of Eratosthenes, an efficient factoring method for dealing with smaller numbers, followed by Pollard’s rho, a method that allows us how to factor large numbers into their primes. The Sieve of Eratosthenes allows us to find the prime numbers up to and including a particular number, n. First, we find the prime numbers that are less than or equal to √͢. Then we use these primes to see which of the numbers √͢ ≤ n - k, ..., n - 2, n - 1 ≤ n these primes properly divide. The remaining numbers are the prime numbers that are greater than √͢ and less than or equal to n. This method works because these prime numbers clearly cannot have any prime factor less than or equal to √͢, as the number would then be composite.
    [Show full text]
  • The I/O Complexity of Computing Prime Tables 1 Introduction
    The I/O Complexity of Computing Prime Tables Michael A. Bender1, Rezaul Chowdhury1, Alex Conway2, Mart´ın Farach-Colton2, Pramod Ganapathi1, Rob Johnson1, Samuel McCauley1, Bertrand Simon3, and Shikha Singh1 1 Stony Brook University, Stony Brook, NY 11794-2424, USA. fbender,rezaul,pganapathi,rob,smccauley,shiksinghg @cs.stonybrook.edu 2 Rutgers University, Piscataway, NJ 08854, USA. ffarach,[email protected] 3 LIP, ENS de Lyon, 46 allee´ d’Italie, Lyon, France. [email protected] Abstract. We revisit classical sieves for computing primes and analyze their performance in the external-memory model. Most prior sieves are analyzed in the RAM model, where the focus is on minimizing both the total number of operations and the size of the working set. The hope is that if the working set fits in RAM, then the sieve will have good I/O performance, though such an outcome is by no means guaranteed by a small working-set size. We analyze our algorithms directly in terms of I/Os and operations. In the external- memory model, permutation can be the most expensive aspect of sieving, in contrast to the RAM model, where permutations are trivial. We show how to implement classical sieves so that they have both good I/O performance and good RAM performance, even when the problem size N becomes huge—even superpolynomially larger than RAM. Towards this goal, we give two I/O-efficient priority queues that are optimized for the operations incurred by these sieves. Keywords: External-Memory Algorithms, Prime Tables, Sorting, Priority Queues 1 Introduction According to Fox News [21], “Prime numbers, which are divisible only by themselves and one, have little mathematical importance.
    [Show full text]
  • THE SIEVE of ERATOSTHENES an Ancient Greek Mathematician by the Name of Eratosthenes of Cyrene (C
    THE SIEVE OF ERATOSTHENES An ancient Greek mathematician by the name of Eratosthenes of Cyrene (c. 200 B.C.) developed an algorithm for finding prime numbers that has come to be known as the Sieve of Eratosthenes. Eratosthenes’s Sieve 1. Create a sieve containing all the integers from 2 through n. 2. Remove the nonprime integers from the sieve by removing the multiples of 2, of 3, of 5, and so on, until reaching n . 3. Only primes will remain in the sieve. Let’s design a Java program that uses this algorithm. We’ll follow the programming methodology How to Invent an Algorithm.1 How to Invent an Algorithm Step What? How? 1 Understand the problem Use pencil and paper to solve the problem by hand. by solving it Let n = 35. Create a sieve containing 2 through 35: 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 Remove the multiples of 2: 2 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 The multiples of 3: 2 3 5 7 11 13 17 19 23 25 29 31 35 The multiples of 5: 2 3 5 7 11 13 17 19 23 29 31 7 > 5.92 = 35 , so we’re done. The numbers left are all prime. 1 Programming 101 ‒ Algorithm Development → How to Invent an Algorithm, p. 1. And Programming 101 ‒ Algorithm Development → Help for Beginners, p.
    [Show full text]
  • Prime Number Sieves Utrecht University
    Prime number sieves Utrecht University Guido Reitsma Supervisor: Lasse Grimmelt January 17th 2020 Acknowledgements First I want to thank Lasse for being a great supervisor, especially given that it was his first bachelor's thesis that he supervised and I'm definitely not the easiest person. Secondly I want to thank all my friends, family and other people, who supported me and listened to my thoughts for the last three months and before. 2 Contents 1 Introduction 4 1.1 Sieve of Eratosthenes Historically . .4 1.2 The way many people know the Sieve of Eratosthenes . .4 1.3 Estimating primes via Eratosthenes' Sieve . .5 1.4 RSA . .8 2 Combinatorial Sieve 10 2.1 Notation . 10 2.2 Sieve weights . 10 2.3 Buchstab's Identity . 11 2.4 Brun's sieve . 12 3 The General Number Field Sieve 14 3.1 Difference of Squares Factorization method . 14 3.2 Free parameters in GNFS . 14 3.3 Z[θ]........................................ 15 3.4 Finding two squares . 15 3.5 Smoothness over a factor base . 16 3.6 Verifying squares in Z and Z[θ]......................... 17 3.7 Combine everything . 18 4 Discussion and Conclusion 20 4.1 How to go further with sieves . 20 4.2 Number of calculations using GNFS . 21 4.3 Is RSA really safe? . 21 4.4 Conclusion . 21 3 Chapter 1 Introduction In this thesis there are two applications from the Sieve of Eratosthenes The two sieves that are mentioned in this thesis are the combinatorial sieve and the General Number field Sieve. We will then compare both of the methods which each other and look how these methods coincide or differ.
    [Show full text]
  • Sequences of Numbers Obtained by Digit and Iterative Digit Sums of Sophie Germain Primes and Its Variants
    Global Journal of Pure and Applied Mathematics. ISSN 0973-1768 Volume 12, Number 2 (2016), pp. 1473-1480 © Research India Publications http://www.ripublication.com Sequences of numbers obtained by digit and iterative digit sums of Sophie Germain primes and its variants 1Sheila A. Bishop, *1Hilary I. Okagbue, 2Muminu O. Adamu and 3Funminiyi A. Olajide 1Department of Mathematics, Covenant University, Canaanland, Ota, Nigeria. 2Department of Mathematics, University of Lagos, Akoka, Lagos, Nigeria. 3Department of Computer and Information Sciences, Covenant University, Canaanland, Ota, Nigeria. Abstract Sequences were generated by the digit and iterative digit sums of Sophie Germain and Safe primes and their variants. The results of the digit and iterative digit sum of Sophie Germain and Safe primes were almost the same. The same applied to the square and cube of the respective primes. Also, the results of the digit and iterative digit sum of primes that are not Sophie Germain are the same with the primes that are notSafe. The results of the digit and iterative digit sum of prime that are either Sophie Germain or Safe are like the combination of the results of the respective primes when considered separately. Keywords: Sophie Germain prime, Safe prime, digit sum, iterative digit sum. Introduction In number theory, many types of primes exist; one of such is the Sophie Germain prime. A prime number p is said to be a Sophie Germain prime if 21p is also prime. A prime number qp21 is known as a safe prime. Sophie Germain prime were named after the famous French mathematician, physicist and philosopher Sophie Germain (1776-1831).
    [Show full text]
  • Cryptanalysis of Public Key Cryptosystems Abderrahmane Nitaj
    Cryptanalysis of Public Key Cryptosystems Abderrahmane Nitaj To cite this version: Abderrahmane Nitaj. Cryptanalysis of Public Key Cryptosystems. Cryptography and Security [cs.CR]. Université de Caen Normandie, 2016. tel-02321087 HAL Id: tel-02321087 https://hal-normandie-univ.archives-ouvertes.fr/tel-02321087 Submitted on 20 Oct 2019 HAL is a multi-disciplinary open access L’archive ouverte pluridisciplinaire HAL, est archive for the deposit and dissemination of sci- destinée au dépôt et à la diffusion de documents entific research documents, whether they are pub- scientifiques de niveau recherche, publiés ou non, lished or not. The documents may come from émanant des établissements d’enseignement et de teaching and research institutions in France or recherche français ou étrangers, des laboratoires abroad, or from public or private research centers. publics ou privés. MEMOIRE D'HABILITATION A DIRIGER DES RECHERCHES Sp´ecialit´e: Math´ematiques Pr´epar´eau sein de l'Universit´ede Caen Normandie Cryptanalysis of Public Key Cryptosystems Pr´esent´eet soutenu par Abderrahmane NITAJ Soutenu publiquement le 1er d´ecembre 2016 devant le jury compos´ede Mr Thierry BERGER Professeur, Universit´ede Limoges Rapporteur Mr Marc GIRAULT Chercheur HDR, Orange Labs, Caen Examinateur Mr Marc JOYE Chercheur HDR, NXP Semiconductors Rapporteur Mr Fabien LAGUILLAUMIE Professeur, Universit´ede Lyon 1 Rapporteur Mr Denis SIMON Professeur, Universit´ede Caen Examinateur Mme Brigitte VALLEE Directrice de Recherche, CNRS Examinatrice M´emoirepr´epar´eau Laboratoire de Math´ematiquesNicolas Oresme (LMNO) Contents Remerciements ix List of Publications xi 1 Introduction 1 2 Cryptanalysis of RSA 9 2.1 Introduction . .9 2.2 Continued Fractions .
    [Show full text]
  • Primality Testing
    Syracuse University SURFACE Electrical Engineering and Computer Science - Technical Reports College of Engineering and Computer Science 6-1992 Primality Testing Per Brinch Hansen Syracuse University, School of Computer and Information Science, [email protected] Follow this and additional works at: https://surface.syr.edu/eecs_techreports Part of the Computer Sciences Commons Recommended Citation Hansen, Per Brinch, "Primality Testing" (1992). Electrical Engineering and Computer Science - Technical Reports. 169. https://surface.syr.edu/eecs_techreports/169 This Report is brought to you for free and open access by the College of Engineering and Computer Science at SURFACE. It has been accepted for inclusion in Electrical Engineering and Computer Science - Technical Reports by an authorized administrator of SURFACE. For more information, please contact [email protected]. SU-CIS-92-13 Primality Testing Per Brinch Hansen June 1992 School of Computer and Information Science Syracuse University Suite 4-116, Center for Science and Technology Syracuse, NY 13244-4100 Primality Testing1 PER BRINCH HANSEN Syracuse University, Syracuse, New York 13244 June 1992 This tutorial describes the Miller-Rabin method for testing the primality of large integers. The method is illustrated by a Pascal algorithm. The performance of the algorithm was measured on a Computing Surface. Categories and Subject Descriptors: G.3 [Probability and Statistics: [Proba­ bilistic algorithms (Monte Carlo) General Terms: Algorithms Additional Key Words and Phrases: Primality testing CONTENTS INTRODUCTION 1. FERMAT'S THEOREM 2. THE FERMAT TEST 3. QUADRATIC REMAINDERS 4. THE MILLER-RABIN TEST 5. A PROBABILISTIC ALGORITHM 6. COMPLEXITY 7. EXPERIMENTS 8. SUMMARY ACKNOWLEDGEMENTS REFERENCES 1Copyright@1992 Per Brinch Hansen Per Brinch Hansen: Primality Testing 2 INTRODUCTION This tutorial describes a probabilistic method for testing the primality of large inte­ gers.
    [Show full text]