Performance Comparison of Projective Elliptic- Curve Point Multiplication in 64-Bit X86 Runtime Environment Ninh Winson Nova Southeastern University, [email protected]
Total Page:16
File Type:pdf, Size:1020Kb
Nova Southeastern University NSUWorks CEC Theses and Dissertations College of Engineering and Computing 2014 Performance Comparison of Projective Elliptic- curve Point Multiplication in 64-bit x86 Runtime Environment Ninh Winson Nova Southeastern University, [email protected] This document is a product of extensive research conducted at the Nova Southeastern University College of Engineering and Computing. For more information on research and degree programs at the NSU College of Engineering and Computing, please click here. Follow this and additional works at: https://nsuworks.nova.edu/gscis_etd Part of the Computer Sciences Commons, and the Mathematics Commons Share Feedback About This Item NSUWorks Citation Ninh Winson. 2014. Performance Comparison of Projective Elliptic-curve Point Multiplication in 64-bit x86 Runtime Environment. Doctoral dissertation. Nova Southeastern University. Retrieved from NSUWorks, Graduate School of Computer and Information Sciences. (11) https://nsuworks.nova.edu/gscis_etd/11. This Dissertation is brought to you by the College of Engineering and Computing at NSUWorks. It has been accepted for inclusion in CEC Theses and Dissertations by an authorized administrator of NSUWorks. For more information, please contact [email protected]. Performance Comparison of Projective Elliptic-curve Point Multiplication in 64-bit x86 Runtime Environment by Winston Ninh A dissertation submitted in partial fulfillment of the requirements for the degree of Doctor of Philosophy in Computer Science Graduate School of Computer and Information Sciences Nova Southeastern University 2014 We hereby certify that this dissertation, submitted by Winston Ninh, conforms to acceptable standards and is fully adequate in scope and quality to fulfill the dissertation requirements for the degree of Doctor of Philosophy. __________________________________________ _________________________ Wei Li, Ph.D. Date Chairperson of Dissertation Committee __________________________________________ _________________________ James Cannady, Ph.D. Date Dissertation Committee Member __________________________________________ _________________________ Junping Sun, Ph.D. Date Dissertation Committee Member Approved: __________________________________________ _________________________ Eric S. Ackerman, Ph.D. Date Dean, Graduate School of Computer and Information Sciences Graduate School of Computer and Information Sciences Nova Southeastern University 2014 An Abstract of a Dissertation Submitted to Nova Southeastern University in Partial Fulfillment of the Requirements for the Degree of Doctor of Philosophy Performance Comparison of Projective Elliptic-curve Point Multiplication in 64-bit x86 Runtime Environment by Winston Ninh September 2014 For over two decades, mathematicians and cryptologists have evaluated and presented the theoretical performance of Elliptic-curve scalar point-multiplication in projective geometry. Because computation in projective domain is composed of a wide array of formulations and computing optimizations, there is not a comprehensive performance comparison of point-multiplication using projective transformation available to verify its realistic efficiency in 64-bit x86 computing platforms. Today, research on explicit mathematical formulations in projective domain continues to excel by seeking higher computational efficiency and ease of realization. An explicit performance evaluation will help implementers choose better implementation methods and improve Elliptic-curve scalar point-multiplication. This paper was founded on the practical solution that obtaining realistic performance figures should be based on more precise computational cost metrics and specific computing platforms. As part of that solution, an empirical performance benchmark comparison between two approaches implementing projective Elliptic-curve scalar point-multiplication will be presented to provide the selection of, and subsequently ways to improve scalar point-multiplication technology executing in a 64-bit x86 runtime environment. Acknowledgements I offer my sincere gratitude to my dissertation chair, Dr. Wei Li, who patiently guided me throughout this entire endeavor. I could not have completed this without his advice. I would like to thank my committee members, Dr. James Cannady and Dr. Junping Sun, who also provided me invaluable input throughout this process. I would also like to thank my wonderful wife, Lan. She has always encouraged and supported me in my academic pursuits, often taking the reins on household matters (not to mention sacrificing many vacations and trips to the shopping mall) in order to allow me to focus on school work. I would also like to acknowledge our two daughters, Kimberly and Amie, for spending countless hours pointing out awkward sentences and misspellings. I am so thankful for having such eloquent children. Last but not least, I would like to express the utmost thanks to my adorable cat, Timmy, who spent many late nights cuddling around my feet and keeping me company while I worked on this dissertation. Table of Contents 1. Introduction 1 Projective Elliptic-curve Point Multiplication Preliminary 2 Point Doubling and Point Adding 6 Associated Environments of PEPMA 9 System Architecture 10 Run-time Domain Parameters 11 The Empirical Performance Evaluation 13 Latency of PEPMA 14 Coarse Estimates Efficiency of PEPMA 16 Fine Estimates Efficiency of PEPMA 18 Program Profiling through Virtualization and Emulation 19 Accurate and Precise Efficiency Evaluation of PEPMA 20 Motivation and Direct Application 21 Problem Statement, Goal and Objectives 22 Barriers and Issues 23 Qualifications of Quantifiable Metrics 23 Mathematical Optimization Factors 23 Selection Criteria 23 Mathematical Traceability 24 Research Questions 24 Relevance, Significance and the Need to Evaluate 24 Definition of Terminology 30 Mathematical Symbol 34 Acronym 35 Chapter Summary 36 2. Literature Review 37 Performance Evaluation Standards 38 Efficiency Measurement 40 Elliptic-Curve Principles in PEPMA 42 Concept of Point Computation in Projective Domain 46 Point at Infinity 53 Computation in Mixed Coordinate 54 PEPMA Domain Parameters 54 Research in Numeric Presentation and Computation 55 Modulo Reduction 59 Inversion 59 Prior Research in Evaluating PEPMA 60 Explicit Formulation 62 Chapter Summary 66 3. Methodology 67 Overview 67 Unit of Analysis 70 Compliance Metric 72 Static Complexity Metric 72 Weighted Information Flow Complexity 73 v Module Maturity Index 73 Functionality Metric 74 Efficiency Metric and Formulation 74 NSS PEPMA 75 OpenSSL PEPMA 79 Point at Infinity 81 Performance Hardware Counter 82 Program Profiling and Emulation 82 Run-time Factors 84 Efficiency Formulation Analysis 86 Method for Verification 89 Projected Outcome 89 Proposition of Format for Presenting the Results 90 Combined Key Performance Indicator 91 Resource Requirements 92 Timeline 92 Chapter Summary 93 4. Results 94 Introduction 94 Systematic Software Reviews and Selection of Unit of Analysis 95 Concept of Instrumentation 102 Overview of the Finding in General 103 Overview of the Findings of Efficiency Metric and Formulation 104 Finding of NSS Affine to Projective Transformation 107 Findings of APT in OpenSSL 109 Analysis of Affine to Projective Transformation 111 Finding of NSS Exponentiation Function 112 Analysis of NSS Exponentiation Function 116 Finding of NSS Point-Doubling 119 Analysis of NSS Point-Doubling 119 Finding of NSS Point-Adding 120 Analysis of NSS Point-Adding 120 Analysis of NSS Exponentiation Function, Revisited 121 Finding of OpenSSL Exponentiation Function 122 Analysis of NSS vs. OpenSSL Exponentiation Function 126 Finding of NSS Pre-computation 129 Analysis of Pre-computation 130 Finding of NSS/OpenSSL Projective to Affine Transformation 133 Analysis of NSS/OpenSSL Projective to Affine Transformation 133 Finding of the Compliance Metric 134 Analysis of Compliance Metric 136 Finding of Cyclomatic Complexity Metric 142 Finding of Cyclomatic Complexity Metric 142 Analysis of Cyclomatic Complexity Metric 144 Findings of Weighted Information Flow Complexity 146 Analysis of Weighted Information Flow Complexity (WIFC) 147 vi Finding of Module Maturity Index 149 Analysis of Module Maturity Index 150 Finding of Functionality Metric 150 Analysis of Functional Metric 150 Summary of Key Performance Indicators 151 Finding of Combined Key Performance Indicator 152 Chapter Summary 154 5. Conclusion, Implications, Recommendations, and Summary 155 Objective and Goal Review 155 Conclusion 157 Implications 160 Practical Applications 160 Recommendations 162 Future Work 164 Appendix A. Counting CPU Instructions 165 Appendix B. ECDH Protocol 167 Appendix C. An ECDH Transaction 169 Appendix D. Modulus m, Order m 171 Appendix E. Point Adding of NSA Test Vectors 172 Appendix F. NIST Test Vectors 173 Appendix G. NSS Exponentiation Procedure 175 Appendix H. OpenSSL Exponentiation Procedure 178 Appendix I. Description of Clock() Function 180 Appendix J. Selection of Operational Parameters for P-521 181 Appendix K. Operation of BOCHS 183 Appendix L. Operation of PAPI 191 Appendix M. Configuration and Compilation of NSS 193 Appendix N. Configuration and Compilation of OpenSSL 194 Appendix O. Test Vector Type A 195 Appendix P. Test Vector Type B 196 Appendix Q. Test Vector Type B 197 Appendix R. Computing Platform Type A 198 Appendix S. Computing Platform Type B 201 Appendix T. Computing Platform Type C, CPU Resource Busy 204 Appendix U. Description of Metrics TOT_CYC and TOT_INS