Numbers, Groups and Cryptography Gordan Savin

Total Page:16

File Type:pdf, Size:1020Kb

Numbers, Groups and Cryptography Gordan Savin Numbers, Groups and Cryptography Gordan Savin Contents Chapter 1. Euclidean Algorithm 5 1. Euclidean Algorithm 5 2. Fundamental Theorem of Arithmetic 9 3. Uniqueness of Factorization 13 4. Efficiency of the Euclidean Algorithm 16 Chapter 2. Groups and Arithmetic 19 1. Groups 19 2. Congruences 23 3. Modular arithmetic 26 4. Theorem of Lagrange 28 5. Chinese Remainder Theorem 31 Chapter 3. Rings and Fields 37 1. Fields and Wilson’s Theorem 37 2. Field Characteristic and Frobenius 40 3. Quadratic Numbers 43 Chapter 4. Primes 47 1. Infinitude of primes 47 2. Primes in progression 50 3. Perfect Numbers and Mersenne Primes 53 4. The Lucas Lehmer test 56 Chapter 5. Roots 61 1. Roots 61 2. Property of the Euler Function 64 3. Primitive roots 65 4. Discrete logarithm 68 5. Cyclotomic Polynomials 70 Chapter 6. Quadratic Reciprocity 75 1. Squares modulo p 75 2. When is −1 or 2 a square modulo p? 79 3. Quadratic Reciprocity 82 Chapter 7. Applications of Quadratic Reciprocity 85 1. Fermat primes 85 3 4 CONTENTS 2. Quadratic Fields and the Circle Group 87 3. Lucas Lehmer test revisited 90 Chapter 8. Sums of two squares 95 1. Sums of two squares 95 2. Gaussian integers 99 3. Method of descent revisited 104 Chapter 9. Pell’s Equations 107 1. Shape numbers and Induction 107 2. Square-Triangular Numbers and Pell Equation 110 3. Dirichlet’s approximation 113 4. Pell Equation: classifying solutions 116 5. Continued Fractions 118 Chapter 10. Cryptography 123 1. Diffie-Hellman key exchange 123 2. RSA Code 126 3. ElGamal Code 130 Chapter 11. Primality testing 135 1. Miller Rabin test 135 2. p − 1 method 139 3. p + 1 method 142 4. Quadratic sieve 145 Chapter 12. Elliptic curves 149 1. Cubic curves 149 2. Degenerate curves 153 3. Curves modulo p 158 4. The curve y2 = x3 + bx 162 Chapter 13. Factoring and testing using elliptic curves 165 1. Lenstra’s factoring method 165 2. Degenerate curves modulo p 169 3. Elliptic curve test for Mersenne primes 172 CHAPTER 1 Euclidean Algorithm 1. Euclidean Algorithm Euclid was a Greek mathematician who lived in Alexandria around 300 B.C. He devised a clever and fast algorithm to find the greatest common divisor of two integers. In a modern language, the Euclidean Algorithm is simply division with remainder. Recall that dividing two positive integers a, b means finding a positive integer q, called a quotient, such that a = qb + r with 0 ≤ r < b. The number r is called a remainder. If r = 0 then we say that b divides a, and write b|a. For example, 3 | 6 whereas 4 - 6. Dividing two integers is probably the most difficult of the four standard binary operations. However, some of the most fundamental properties, such as the uniqueness of factorization, are based on the Euclidean Algorithm. But how is this related to finding the Greatest Common Divisor (or simply gcd) of two integers m and n? If factorizations of m and n into prime factors are known, then it is easy to figure out what the gcd is. Consider, for example, m = 756 and n = 360. Then 756 = 22 · 33 · 7 and 360 = 23 · 32 · 5. We see that 2 and 3 are the only primes appearing in factorizations of both numbers. Moreover, 22 and 32 are the greatest powers of 2 and 3, respectively, which divide both 500 and 600. It follows that gcd(756, 360) = 22 · 32 = 36. There are two issues here, however. First, we have secretly assumed the uniqueness of factorization. The second issue, also very important, is that factoring into primes is a very difficult process, in general. A much better way was discovered by Euclid. Assume, for example, that we want to find the greatest common divisor of 60 and 22. Subtract 60 − 22 = 38. Notice that any number dividing 60 and 22 also divides 22 and 38. Conversely, any number that divides 22 and 38 also divides 22 + 38 = 60 and 22. Thus, instead of looking for common divisors of 60 and 22, we can look at common divisors of 22 and 38 instead. Since the later pair of numbers is smaller, the 5 6 1. EUCLIDEAN ALGORITHM problem of finding the greatest common divisor of 60 and 22 has just become easier, and we have accomplished that without ever dividing or multiplying two numbers. In fact, we can do even better. Instead of subtracting 22 from 60 once, we can subtract it twice, to get 60 − 2 × 22 = 16. Thus we get that gcd(60, 22) = gcd(22, 16). Of course, we do not stop here. Since 22 − 16 = 6, it follows that gcd(22, 16) = gcd(16, 6) and so on. At every step we replace a pair (a, b) by a pair (b, r) where r is the reminder of the division of a by b. The whole division process in this case is given here: 60 = 2 · 22 + 16 22 = 1 · 16 + 6 16 = 2 · 6 + 4 6 = 1 · 4 + 2 4 = 2 · 2 + 0 This shows that gcd(60, 22) = gcd(22, 16) = ··· = gcd(4, 2) = 2. The last statement is obvious since 2 divides 4. In general, starting with a pair of numbers a and b we use the division algorithm to generate a sequence of numbers (b > r1 > r2 > . .) as follows. First, we divide a by b: a = q1b + r1, then divide b by r1 , and so on... b = q2r1 + r2 r1 = q3r2 + r3 . rn−2 = qnrn−1 + rn rn−1 = qn+1rn + 0. This process stops when the remainder is 0. Since b > r1 > r2 ... it stops in less then b steps. We claim that the last non-zero remainder rn is equal to the greatest common divisor of a and b. In order to verify this, notice that the first equation a = qb + r1 implies that any common divisor of b and r1 also divides a. Likewise, if we rewrite the first equation as a − qb = r1, it is clear that any common divisor of a and b also divides r1. This shows that gcd(a, b) = gcd(b.r1). Arguing in this fashion, we see that gcd(a, b) = gcd(b, r1) = ... = gcd(rn−1, rn) = rn 1. EUCLIDEAN ALGORITHM 7 where, of course, the last statement is obvious since rn divides rn−1. We can summarize what we have discovered: Euclidean Algorithm gives an effective way to compute the greatest com- mon divisor of two integers. Moreover, the algorithm does not rely on the uniqueness of factorization. The Euclidean Algorithm can be viewed as a special case of the Contin- ued Fractions algorithm. We need some notation before proceeding to the definition of the algorithm. If α is a real number then let√ [α] denote the greatest integer less than or equal to α√. For example, since 2 = 1.4 ... the greatest integer less than or equal to 2 is 1: √ [ 2] = 1. Note that [α] = α if α is an integer. The Continued Fraction algorithm is defined as follows: (1) Let α > 1, and put β = α − [α]. (2) If β = 0 stop, else put α1 = 1/β and go to (1). In order to illustrate the relation between the two algorithms, let us work out the case when α = 60/22. Then the Continued Fraction Algorithm generates the following numerical data. i [αi] βi αi+1 0 2 16/22 22/16 1 1 6/16 16/6 2 2 4/6 6/4 3 1 2/4 4/2 4 2 0 STOP Here, of course, we put α0 = α and β0 = β. As it can be seen from the table, the Continued Fraction Algorithm generates the same numbers as the Euclidean Algorithm starting with the pair (60, 22). More precisely, if α = a/b and b > r1 > r2 ... are non-negative integers generated by the Euclidean Algorithm applied to the pair (a, b), then r1 r2 r3 β = , β1 = , β2 = ... b r1 r2 and [α] = q1, [α1] = q2, [α2] = q3 ... Since rn+1 = 0 for some n, βn = 0 and we are out of the loop, eventually, for every rational number (fraction). The name (continued fraction) come from the fact the process can be recorded as 60 16 1 = 2 + = 2 + 6 = ... 22 22 1 + 22 8 1. EUCLIDEAN ALGORITHM 1 ... = 2 + 1 . 1 + 1 2+ 1 1+ 2 The continued fraction, in turn, gives a series of - so called - partial conver- gents: 1 1 1 1 2, 2 + , 2 + 1 , 2 + 1 and 2 + 1 . 1 1 + 2 1 + 1 1 + 1 2+ 1 2+ 1 1+ 2 An easy calculation gives that these five partial convergents are equal to, respectively, 8 11 30 60 2, 3, , and = . 3 4 11 22 A√ rather different phenomenon occurs when we apply the algorithm to α = 2. Then going through the loop for the first time yields √ √ √ √ (1) α = 2, β = 2 − [ 2] = 2 − 1. (2) 1 1 √ α1 = = √ = 2 + 1. β 2 − 1 Going through the loop for the second time yields √ √ √ √ (1) α1 = 2 + 1, β1 = 2 + 1 − [ 2 + 1] = 2 − 1. (2) 1 1 √ α2 = = √ = 2 + 1. β1 2 − 1 √ In words, the second output is α2 = 2 + 1, the same as the first output of the algorithm. Of course, the third output will be the same, and so on: √ α1 = α2 = α3 = ... = 2 + 1. We see that the Continued Fraction√ algorithm is stuck in the loop in this√ case. In particular, this shows that 2 is not a fraction. We can write 2 as a continued fraction √ 1 2 = 1 + .
Recommended publications
  • LNCS 7215, Pp
    ACoreCalculusforProvenance Umut A. Acar1,AmalAhmed2,JamesCheney3,andRolyPerera1 1 Max Planck Institute for Software Systems umut,rolyp @mpi-sws.org { 2 Indiana} University [email protected] 3 University of Edinburgh [email protected] Abstract. Provenance is an increasing concern due to the revolution in sharing and processing scientific data on the Web and in other computer systems. It is proposed that many computer systems will need to become provenance-aware in order to provide satisfactory accountability, reproducibility,andtrustforscien- tific or other high-value data. To date, there is not a consensus concerning ap- propriate formal models or security properties for provenance. In previous work, we introduced a formal framework for provenance security and proposed formal definitions of properties called disclosure and obfuscation. This paper develops a core calculus for provenance in programming languages. Whereas previous models of provenance have focused on special-purpose languages such as workflows and database queries, we consider a higher-order, functional language with sums, products, and recursive types and functions. We explore the ramifications of using traces based on operational derivations for the purpose of comparing other forms of provenance. We design a rich class of prove- nance views over traces. Finally, we prove relationships among provenance views and develop some solutions to the disclosure and obfuscation problems. 1Introduction Provenance, or meta-information about the origin, history, or derivation of an object, is now recognized as a central challenge in establishing trust and providing security in computer systems, particularly on the Web. Essentially, provenance management in- volves instrumenting a system with detailed monitoring or logging of auditable records that help explain how results depend on inputs or other (sometimes untrustworthy) sources.
    [Show full text]
  • Sabermetrics: the Past, the Present, and the Future
    Sabermetrics: The Past, the Present, and the Future Jim Albert February 12, 2010 Abstract This article provides an overview of sabermetrics, the science of learn- ing about baseball through objective evidence. Statistics and baseball have always had a strong kinship, as many famous players are known by their famous statistical accomplishments such as Joe Dimaggio’s 56-game hitting streak and Ted Williams’ .406 batting average in the 1941 baseball season. We give an overview of how one measures performance in batting, pitching, and fielding. In baseball, the traditional measures are batting av- erage, slugging percentage, and on-base percentage, but modern measures such as OPS (on-base percentage plus slugging percentage) are better in predicting the number of runs a team will score in a game. Pitching is a harder aspect of performance to measure, since traditional measures such as winning percentage and earned run average are confounded by the abilities of the pitcher teammates. Modern measures of pitching such as DIPS (defense independent pitching statistics) are helpful in isolating the contributions of a pitcher that do not involve his teammates. It is also challenging to measure the quality of a player’s fielding ability, since the standard measure of fielding, the fielding percentage, is not helpful in understanding the range of a player in moving towards a batted ball. New measures of fielding have been developed that are useful in measuring a player’s fielding range. Major League Baseball is measuring the game in new ways, and sabermetrics is using this new data to find better mea- sures of player performance.
    [Show full text]
  • Epiglass ® and Other International Paint Products
    Epiglass® Multipurpose Epoxy Resin ABOUT THE AUTHORS ROGER MARSHALL For eight years award winning author Roger Marshall has been the technical editor for Soundings magazine where his articles are read by about 250,000 people each month. Marshall’s experience as a writer spans for many years. His work has appeared worldwide as well as the New York Times, Daily Telegraph (UK), Sports illustrated, Sail, Cruising World, Motor Boating and sailing, Yachting and many other newspapers and magazines. Marshall is also the author of twelve marine related books, two of which were translated into Italian and Spanish. His last book All about Powerboats was published by International Marine in the spring of 2002. He has another book Rough Weather Seamanship due in the fall of 2003 and is currently working on a new book, Elements of Powerboat Design for International Marine. But writing is only a small part of Marshall’s talents. He is also a designer of boats, both power and sail. After completing a program in small craft design at Southampton College in England, Marshall, who still holds a British passport, moved to the United States in 1973 to take a position at Sparkman & Stephens, Inc. in New York. He worked there as a designer for nearly 5 years and then left to establish his own yacht design studio in Jamestown, Rhode Island. As an independent designer he has designed a wide range of boats and was project engineer for the Courageous Challenge for the 1987 America’s Cup campaign in Australia. In 1999 one of his cruising yacht designs was selected for inclusion in Ocean Cruising magazine’s American Yacht Review.
    [Show full text]
  • Problems in Relating Various Tasks and Their Sample Solutions to Bloomâ
    The Mathematics Enthusiast Volume 14 Number 1 Numbers 1, 2, & 3 Article 4 1-2017 Problems in relating various tasks and their sample solutions to Bloom’s taxonomy Torsten Lindstrom Follow this and additional works at: https://scholarworks.umt.edu/tme Part of the Mathematics Commons Let us know how access to this document benefits ou.y Recommended Citation Lindstrom, Torsten (2017) "Problems in relating various tasks and their sample solutions to Bloom’s taxonomy," The Mathematics Enthusiast: Vol. 14 : No. 1 , Article 4. Available at: https://scholarworks.umt.edu/tme/vol14/iss1/4 This Article is brought to you for free and open access by ScholarWorks at University of Montana. It has been accepted for inclusion in The Mathematics Enthusiast by an authorized editor of ScholarWorks at University of Montana. For more information, please contact [email protected]. TME, vol. 14, nos. 1,2&3, p. 15 Problems in relating various tasks and their sample solutions to Bloom’s taxonomy Torsten Lindstr¨om Linnaeus University, SWEDEN ABSTRACT: In this paper we analyze sample solutions of a number of problems and relate them to their level as prescribed by Bloom’s taxonomy. We relate these solutions to a number of other frameworks, too. Our key message is that it remains insufficient to analyze written forms of these tasks. We emphasize careful observations of how different students approach a solution before finally assessing the level of tasks used. We take the arithmetic series as our starting point and point out that the objective of the discussion of the examples here in no way is to indicate an optimal way towards a solution.
    [Show full text]
  • 21 Pintura.Pdf
    Paint 1247 Marpro Super-B Gold™ with SCX™-Slime Control Xtra Marpro Superkote Gold™ with SCX™ - Slime Control Xtra Black Blue Red Green Black Blue Red • SUPER-B GOLD is the highest performance ablative copolymer on the market today. • The highest copper content (67%) in our line. • SUPERKOTE GOLD is the highest performance • Performance booster SCX (Slime Control Xtra) modified hard epoxy performance products on the provides outstanding protection against slime, market today. grass and weed. • The highest copper content (67%) in our line. Paint & Paint Acc. & Paint Paint • Continual release of biocide makes this self-polishing copolymer most • Performance booster SCX (Slime Control Xtra) provides outstanding effective for anti-fouling protection, with only minimal paint buildup. protection against slime, grass and weed. • Tough, multi-season paint for superior protection against hard and soft • Continual release of biocide makes this modified hard epoxy most effective growth in extreme fouling conditions. for antifouling protection. • Can re-launch after extended haul-out and retain original antifouling • Superior protection against hard and soft growth in extreme fouling Fun & properties. conditions. Flotation • Perfect for powerboats and sailboats. • Perfect for powerboats and sailboats. Anchor • Can be applied directly over properly prepared ablatives, epoxies and vinyl’s, • Can be applied directly over properly prepared epoxies and vinyls, and most & Dock and most any other hard or ablative bottom paints. any other hard bottom paints.
    [Show full text]
  • On Terms of Generalized Fibonacci Sequences Which Are Powers of Their Indexes
    mathematics Article On Terms of Generalized Fibonacci Sequences which are Powers of their Indexes Pavel Trojovský Department of Mathematics, Faculty of Science, University of Hradec Králové, 500 03 Hradec Králové, Czech Republic, [email protected]; Tel.: +42-049-333-2860 Received: 29 June 2019; Accepted: 31 July 2019; Published: 3 August 2019 (k) Abstract: The k-generalized Fibonacci sequence (Fn )n (sometimes also called k-bonacci or k-step Fibonacci sequence), with k ≥ 2, is defined by the values 0, 0, ... , 0, 1 of starting k its terms and such way that each term afterwards is the sum of the k preceding terms. This paper is devoted to the proof of the fact that the (k) t (2) 2 (3) 2 Diophantine equation Fm = m , with t > 1 and m > k + 1, has only solutions F12 = 12 and F9 = 9 . Keywords: k-generalized Fibonacci sequence; Diophantine equation; linear form in logarithms; continued fraction MSC: Primary 11J86; Secondary 11B39. 1. Introduction The well-known Fibonacci sequence (Fn)n≥0 is given by the following recurrence of the second order Fn+2 = Fn+1 + Fn, for n ≥ 0, with the initial terms F0 = 0 and F1 = 1. Fibonacci numbers have a lot of very interesting properties (see e.g., book of Koshy [1]). One of the famous classical problems, which has attracted a attention of many mathematicians during the last thirty years of the twenty century, was the problem of finding perfect powers in the sequence of Fibonacci numbers. Finally in 2006 Bugeaud et al. [2] (Theorem 1), confirmed these expectations, as they showed that 0, 1, 8 and 144 are the only perfect powers in the sequence of Fibonacci numbers.
    [Show full text]
  • Elementary Number Theory
    Elementary Number Theory Peter Hackman HHH Productions November 5, 2007 ii c P Hackman, 2007. Contents Preface ix A Divisibility, Unique Factorization 1 A.I The gcd and B´ezout . 1 A.II Two Divisibility Theorems . 6 A.III Unique Factorization . 8 A.IV Residue Classes, Congruences . 11 A.V Order, Little Fermat, Euler . 20 A.VI A Brief Account of RSA . 32 B Congruences. The CRT. 35 B.I The Chinese Remainder Theorem . 35 B.II Euler’s Phi Function Revisited . 42 * B.III General CRT . 46 B.IV Application to Algebraic Congruences . 51 B.V Linear Congruences . 52 B.VI Congruences Modulo a Prime . 54 B.VII Modulo a Prime Power . 58 C Primitive Roots 67 iii iv CONTENTS C.I False Cases Excluded . 67 C.II Primitive Roots Modulo a Prime . 70 C.III Binomial Congruences . 73 C.IV Prime Powers . 78 C.V The Carmichael Exponent . 85 * C.VI Pseudorandom Sequences . 89 C.VII Discrete Logarithms . 91 * C.VIII Computing Discrete Logarithms . 92 D Quadratic Reciprocity 103 D.I The Legendre Symbol . 103 D.II The Jacobi Symbol . 114 D.III A Cryptographic Application . 119 D.IV Gauß’ Lemma . 119 D.V The “Rectangle Proof” . 123 D.VI Gerstenhaber’s Proof . 125 * D.VII Zolotareff’s Proof . 127 E Some Diophantine Problems 139 E.I Primes as Sums of Squares . 139 E.II Composite Numbers . 146 E.III Another Diophantine Problem . 152 E.IV Modular Square Roots . 156 E.V Applications . 161 F Multiplicative Functions 163 F.I Definitions and Examples . 163 CONTENTS v F.II The Dirichlet Product .
    [Show full text]
  • Number Systems and Radix Conversion
    Number Systems and Radix Conversion Sanjay Rajopadhye, Colorado State University 1 Introduction These notes for CS 270 describe polynomial number systems. The material is not in the textbook, but will be required for PA1. We humans are comfortable with numbers in the decimal system where each po- sition has a weight which is a power of 10: units have a weight of 1 (100), ten’s have 10 (101), etc. Even the fractional apart after the decimal point have a weight that is a (negative) power of ten. So the number 143.25 has a value that is 1 ∗ 102 + 4 ∗ 101 + 3 ∗ 0 −1 −2 2 5 10 + 2 ∗ 10 + 5 ∗ 10 , i.e., 100 + 40 + 3 + 10 + 100 . You can think of this as a polyno- mial with coefficients 1, 4, 3, 2, and 5 (i.e., the polynomial 1x2 + 4x + 3 + 2x−1 + 5x−2+ evaluated at x = 10. There is nothing special about 10 (just that humans evolved with ten fingers). We can use any radix, r, and write a number system with digits that range from 0 to r − 1. If our radix is larger than 10, we will need to invent “new digits”. We will use the letters of the alphabet: the digit A represents 10, B is 11, K is 20, etc. 2 What is the value of a radix-r number? Mathematically, a sequence of digits (the dot to the right of d0 is called the radix point rather than the decimal point), : : : d2d1d0:d−1d−2 ::: represents a number x defined as follows X i x = dir i 2 1 0 −1 −2 = ::: + d2r + d1r + d0r + d−1r + d−2r + ::: 1 Example What is 3 in radix 3? Answer: 0.1.
    [Show full text]
  • Simple High-Level Code for Cryptographic Arithmetic - with Proofs, Without Compromises
    Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without Compromises The MIT Faculty has made this article openly available. Please share how this access benefits you. Your story matters. Citation Erbsen, Andres et al. “Simple High-Level Code for Cryptographic Arithmetic - With Proofs, Without Compromises.” Proceedings - IEEE Symposium on Security and Privacy, May-2019 (May 2019) © 2019 The Author(s) As Published 10.1109/SP.2019.00005 Publisher Institute of Electrical and Electronics Engineers (IEEE) Version Author's final manuscript Citable link https://hdl.handle.net/1721.1/130000 Terms of Use Creative Commons Attribution-Noncommercial-Share Alike Detailed Terms http://creativecommons.org/licenses/by-nc-sa/4.0/ Simple High-Level Code For Cryptographic Arithmetic – With Proofs, Without Compromises Andres Erbsen Jade Philipoom Jason Gross Robert Sloan Adam Chlipala MIT CSAIL, Cambridge, MA, USA fandreser, jadep, [email protected], [email protected], [email protected] Abstract—We introduce a new approach for implementing where X25519 was the only arithmetic-based crypto primitive cryptographic arithmetic in short high-level code with machine- we need, now would be the time to declare victory and go checked proofs of functional correctness. We further demonstrate home. Yet most of the Internet still uses P-256, and the that simple partial evaluation is sufficient to transform such initial code into the fastest-known C code, breaking the decades- current proposals for post-quantum cryptosystems are far from old pattern that the only fast implementations are those whose Curve25519’s combination of performance and simplicity. instruction-level steps were written out by hand.
    [Show full text]
  • Cheat Sheet of SSE/AVX Intrinsics, for Doing Arithmetic Ll F(Int Ind, Int K) { Return Dp[Ind][K]; } on Several Numbers at Once
    University of Bergen Garbage Collectors Davide Pallotti, Jan Soukup, Olav Røthe Bakken NWERC 2017 Nov 8, 2017 UiB template .bashrc .vimrc troubleshoot 1 tan v + tan w Contest (1) Any possible infinite recursion? tan(v + w) = Invalidated pointers or iterators? 1 − tan v tan w template.cpp Are you using too much memory? v + w v − w 15 lines Debug with resubmits (e.g. remapped signals, see Various). sin v + sin w = 2 sin cos #include <bits/stdc++.h> 2 2 using namespace std; Time limit exceeded: v + w v − w Do you have any possible infinite loops? cos v + cos w = 2 cos cos #define rep(i, a, b) for(int i = a; i < (b); ++i) What is the complexity of your algorithm? 2 2 #define trav(a, x) for(auto& a : x) Are you copying a lot of unnecessary data? (References) #define all(x) x.begin(), x.end() How big is the input and output? (consider scanf) (V + W ) tan(v − w)=2 = (V − W ) tan(v + w)=2 #define sz(x) (int)(x).size() Avoid vector, map. (use arrays/unordered_map) typedef long long ll; What do your team mates think about your algorithm? where V; W are lengths of sides opposite angles v; w. typedef pair<int, int> pii; typedef vector<int> vi; Memory limit exceeded: a cos x + b sin x = r cos(x − φ) What is the max amount of memory your algorithm should need? int main() { Are you clearing all datastructures between test cases? a sin x + b cos x = r sin(x + φ) cin.sync_with_stdio(0); cin.tie(0); cin.exceptions(cin.failbit); p 2 2 } Mathematics (2) where r = a + b ; φ = atan2(b; a).
    [Show full text]
  • Composite Numbers That Give Valid RSA Key Pairs for Any Coprime P
    information Article Composite Numbers That Give Valid RSA Key Pairs for Any Coprime p Barry Fagin ID Department of Computer Science, US Air Force Academy, Colorado Springs, CO 80840, USA; [email protected]; Tel.: +1-719-339-4514 Received: 13 August 2018; Accepted: 25 August 2018; Published: 28 August 2018 Abstract: RSA key pairs are normally generated from two large primes p and q. We consider what happens if they are generated from two integers s and r, where r is prime, but unbeknownst to the user, s is not. Under most circumstances, the correctness of encryption and decryption depends on the choice of the public and private exponents e and d. In some cases, specific (s, r) pairs can be found for which encryption and decryption will be correct for any (e, d) exponent pair. Certain s exist, however, for which encryption and decryption are correct for any odd prime r - s. We give necessary and sufficient conditions for s with this property. Keywords: cryptography; abstract algebra; RSA; computer science education; cryptography education MSC: [2010] 11Axx 11T71 1. Notation and Background Consider the RSA public-key cryptosystem and its operations of encryption and decryption [1]. Let (p, q) be primes, n = p ∗ q, f(n) = (p − 1)(q − 1) denote Euler’s totient function and (e, d) the ∗ Z encryption/decryption exponent pair chosen such that ed ≡ 1. Let n = Un be the group of units f(n) Z mod n, and let a 2 Un. Encryption and decryption operations are given by: (ae)d ≡ (aed) ≡ (a1) ≡ a mod n We consider the case of RSA encryption and decryption where at least one of (p, q) is a composite number s.
    [Show full text]
  • Girls' Elite 2 0 2 0 - 2 1 S E a S O N by the Numbers
    GIRLS' ELITE 2 0 2 0 - 2 1 S E A S O N BY THE NUMBERS COMPARING NORMAL SEASON TO 2020-21 NORMAL 2020-21 SEASON SEASON SEASON LENGTH SEASON LENGTH 6.5 Months; Dec - Jun 6.5 Months, Split Season The 2020-21 Season will be split into two segments running from mid-September through mid-February, taking a break for the IHSA season, and then returning May through mid- June. The season length is virtually the exact same amount of time as previous years. TRAINING PROGRAM TRAINING PROGRAM 25 Weeks; 157 Hours 25 Weeks; 156 Hours The training hours for the 2020-21 season are nearly exact to last season's plan. The training hours do not include 16 additional in-house scrimmage hours on the weekends Sep-Dec. Courtney DeBolt-Slinko returns as our Technical Director. 4 new courts this season. STRENGTH PROGRAM STRENGTH PROGRAM 3 Days/Week; 72 Hours 3 Days/Week; 76 Hours Similar to the Training Time, the 2020-21 schedule will actually allow for a 4 additional hours at Oak Strength in our Sparta Science Strength & Conditioning program. These hours are in addition to the volleyball-specific Training Time. Oak Strength is expanding by 8,800 sq. ft. RECRUITING SUPPORT RECRUITING SUPPORT Full Season Enhanced Full Season In response to the recruiting challenges created by the pandemic, we are ADDING livestreaming/recording of scrimmages and scheduled in-person visits from Lauren, Mikaela or Peter. This is in addition to our normal support services throughout the season. TOURNAMENT DATES TOURNAMENT DATES 24-28 Dates; 10-12 Events TBD Dates; TBD Events We are preparing for 15 Dates/6 Events Dec-Feb.
    [Show full text]