| Preface | p. xv |
| Introduction | p. 1 |
| Multiple Precision Arithmetic | p. 1 |
| What Is Multiple Precision Arithmetic? | p. 1 |
| The Need for Multiple Precision Arithmetic | p. 2 |
| Benefits of Multiple Precision Arithmetic | p. 3 |
| Purpose of This Text | p. 4 |
| Discussion and Notation | p. 5 |
| Notation | p. 5 |
| Precision Notation | p. 5 |
| Algorithm Inputs and Outputs | p. 6 |
| Mathematical Expressions | p. 6 |
| Work Effort | p. 7 |
| Exercises | p. 7 |
| Introduction to LibTomMath | p. 9 |
| What Is LibTomMath? | p. 9 |
| Goals of LibTomMath | p. 9 |
| Choice of LibTomMath | p. 10 |
| Code Base | p. 10 |
| API Simplicity | p. 11 |
| Optimizations | p. 11 |
| Portability and Stability | p. 12 |
| Choice | p. 12 |
| Getting Started | p. 13 |
| Library Basics | p. 13 |
| What Is a Multiple Precision Integer? | p. 14 |
| The mp_int Structure | p. 15 |
| Argument Passing | p. 17 |
| Return Values | p. 18 |
| Initialization and Clearing | p. 19 |
| Initializing an mp_int | p. 19 |
| Clearing an mp_int | p. 22 |
| Maintenance Algorithms | p. 24 |
| Augmenting an mp_int's Precision | p. 24 |
| Initializing Variable Precision mp_ints | p. 27 |
| Multiple Integer Initializations and Clearings | p. 29 |
| Clamping Excess Digits | p. 31 |
| Basic Operations | p. 35 |
| Introduction | p. 35 |
| Assigning Values to mp_int Structures | p. 35 |
| Copying an mp_int | p. 35 |
| Creating a Clone | p. 39 |
| Zeroing an Integer | p. 41 |
| Sign Manipulation | p. 42 |
| Absolute Value | p. 42 |
| Integer Negation | p. 43 |
| Small Constants | p. 44 |
| Setting Small Constants | p. 44 |
| Setting Large Constants | p. 46 |
| Comparisons | p. 47 |
| Unsigned Comparisons | p. 47 |
| Signed Comparisons | p. 50 |
| Basic Arithmetic | p. 53 |
| Introduction | p. 53 |
| Addition and Subtraction | p. 54 |
| Low Level Addition | p. 54 |
| Low Level Subtraction | p. 59 |
| High Level Addition | p. 63 |
| High Level Subtraction | p. 66 |
| Bit and Digit Shifting | p. 69 |
| Multiplication by Two | p. 69 |
| Division by Two | p. 72 |
| Polynomial Basis Operations | p. 75 |
| Multiplication by x | p. 75 |
| Division by x | p. 78 |
| Powers of Two | p. 81 |
| Multiplication by Power of Two | p. 82 |
| Division by Power of Two | p. 85 |
| Remainder of Division by Power of Two | p. 88 |
| Multiplication and Squaring | p. 91 |
| The Multipliers | p. 91 |
| Multiplication | p. 92 |
| The Baseline Multiplication | p. 92 |
| Faster Multiplication by the "Comba" Method | p. 97 |
| Even Faster Multiplication | p. 104 |
| Polynomial Basis Multiplication | p. 107 |
| Karatsuba Multiplication | p. 109 |
| Toom-Cook 3-Way Multiplication | p. 116 |
| Signed Multiplication | p. 126 |
| Squaring | p. 128 |
| The Baseline Squaring Algorithm | p. 129 |
| Faster Squaring by the "Comba" Method | p. 133 |
| Even Faster Squaring | p. 137 |
| Polynomial Basis Squaring | p. 138 |
| Karatsuba Squaring | p. 138 |
| Toom-Cook Squaring | p. 143 |
| High Level Squaring | p. 144 |
| Modular Reduction | p. 147 |
| Basics of Modular Reduction | p. 147 |
| The Barrett Reduction | p. 148 |
| Fixed Point Arithmetic | p. 148 |
| Choosing a Radix Point | p. 150 |
| Trimming the Quotient | p. 151 |
| Trimming the Residue | p. 152 |
| The Barrett Algorithm | p. 153 |
| The Barrett Setup Algorithm | p. 156 |
| The Montgomery Reduction | p. 158 |
| Digit Based Montgomery Reduction | p. 160 |
| Baseline Montgomery Reduction | p. 162 |
| Faster "Comba" Montgomery Reduction | p. 167 |
| Montgomery Setup | p. 173 |
| The Diminished Radix Algorithm | p. 175 |
| Choice of Moduli | p. 177 |
| Choice of k | p. 178 |
| Restricted Diminished Radix Reduction | p. 178 |
| Unrestricted Diminished Radix Reduction | p. 184 |
| Algorithm Comparison | p. 189 |
| Exponentiation | p. 191 |
| Exponentiation Bascis | p. 191 |
| Single Digit Exponentiation | p. 193 |
| k-ary Exponentiation | p. 195 |
| Optimal Values of k | p. 196 |
| Sliding Window Exponentiation | p. 197 |
| Modular Exponentiation | p. 198 |
| Barrett Modular Exponentiation | p. 203 |
| Quick Power of Two | p. 214 |
| Higher Level Algorithms | p. 217 |
| Integer Division with Remainder | p. 217 |
| Quotient Estimation | p. 219 |
| Normalized Integers | p. 220 |
| Radix-&gb Division with Remainder | p. 221 |
| Single Digit Helpers | p. 231 |
| Single Digit Addition and Subtraction | p. 232 |
| Single Digit Multiplication | p. 235 |
| Single Digit Division | p. 237 |
| Single Digit Root Extraction | p. 241 |
| Random Number Generation | p. 245 |
| Formatted Representations | p. 247 |
| Reading Radix-n Input | p. 247 |
| Generating Radix-n Output | p. 252 |
| Number Theoretic Algorithms | p. 255 |
| Greatest Common Divisor | p. 255 |
| Complete Greatest Common Divisor | p. 258 |
| Least Common Multiple | p. 263 |
| Jacobi Symbol Computation | p. 265 |
| Jacobi Symbol | p. 266 |
| Modular Inverse | p. 271 |
| General Case | p. 273 |
| Primality Tests | p. 279 |
| Trial Division | p. 279 |
| The Fermat Test | p. 282 |
| The Miller-Rabin Test | p. 284 |
| Bibliography | p. 289 |
| Index | p. 291 |
| Table of Contents provided by Ingram. All Rights Reserved. |