Practical Lattice-Based Cryptography in Hardware
Total Page:16
File Type:pdf, Size:1020Kb
Practical Lattice-Based Cryptography in Hardware James Victor Howe MSc BSc Supervisor: Professor Máire O’Neill School of Electronics, Electrical Engineering, and Computer Science, Queen’s University Belfast. This dissertation is submitted for the degree of Doctor of Philosophy May 2018 Nomenclature N Defines the security parameter of a given cryptoscheme. λ Defines the arithmetic precision of a given cryptoscheme. µ Defines the message data used with a digital signature scheme. σ The standard deviation of the discrete Gaussian distribution. τ The tail-cut parameter of the discrete Gaussian distribution. AES Advanced encryption standard. ASIC Application-specific integrated circuit. AVX Advanced vector extensions. BDD Bounded distance decoding. BG The lattice-based digital signature scheme of Bai and Galbraith[2014b]. BKZ The Block Korkine-Zolotarev lattice reduction algorithm. BLISS The bimodal lattice-based digital signature scheme of Ducas et al.[2013]. CCA Chosen-ciphertext attack. CPA Chosen-plaintext attack. CPU Central processing unit. Nomenclature iii CVP The closest vector problem. DCK The decisional compact knapsack problem. DDoS Distributed denial of service. DNS Domain name system. DSA Digital signature algorithm. DSS Digital signature scheme. ECC Elliptic-curve cryptography. ECDSA Elliptic-curve digital signature algorithm. EU-CMA Existentially unforgeable under a chosen message attack. FDH Full-domain hash. FF Flip-flop. FFT Fast Fourier transform. FPGA Field-programmable gate array. GapCVP The approximate decision version of the closest vector problem (CVP). GapSVP The approximate decision version of the shortest vector problem (SVP). GGH The Goldreich-Goldwasser-Halevi [Goldreich et al., 1996] lattice-based cryptosystem. GLP The Güneysu-Lyubashevsky-Pöppelmann [Güneysu et al., 2012] lattice- based digital signature scheme. GPU Graphics processing unit. Nomenclature iv GPV The Gentry-Peikert-Vaikuntanathan [Gentry et al., 2008] cryptosystem. IoT Internet of things. LBC Lattice-based cryptography. LUT Lookup table. LWE The learning with errors problem. LYU The lattice-based digital signature scheme of Lyubashevsky[2012]. NP Non-deterministic polynomial-time. NTRU The N th degree truncated polynomial ring lattice-based cryptosystem of Hoffstein et al.[1998]. NTT Number theoretic transform. PAR Post-place and route. PE Processing elements. PKC Public-key cryptography. PKE Public-key encryption. PQC Post-quantum cryptography. PRNG Pseudo-random number generator. PSF Preimage sampleable (trapdoor) function. Ring-LWE The ring variant of the learning with errors (LWE) problem. Ring-SIS The ring variant of the short integer solution (SIS) problem. Nomenclature v Ring-TESLA The lattice-based digital signature scheme of Akleylek et al.[2016]. RSA The Rivest-Shamir-Adleman [Rivest et al., 1978] cryptosystem. SIMD Single instruction, multiple data. SIS The short integer solution problem. SIVP The shortest independent vector problem. SVP The shortest vector problem. TESLA The lattice-based digital signature scheme of Alkim et al.[2015]. V2X Vehicle-to-everything. I would like to dedicate this thesis to my loving parents . Declaration I hereby declare that, except where specific reference is made to the work of others, the contents of this dissertation are original and have not been submitted in whole or in part for consideration for any other degree or qualification in this, or any other university. This dissertation is my own work and contains nothing which is the outcome of work done in collaboration with others, except as specified in the text and Acknowledgements. This dissertation contains fewer than 80,000 words including appendices, bibliography, footnotes, tables and equations and has fewer than 150 figures. James Victor Howe MSc BSc May 2018 Acknowledgements And I would like to acknowledge ... Abstract Secure communications channels have become essential for the transmission of sensitive information over the Internet or between embedded devices, requiring protocols such as public-key encryption and digital signatures. Furthermore, these requirements for data security and privacy are becoming more important with growing numbers of connected devices, due to the popularity of the Internet of Things. So far, practitioners have relied on cryptography based on the hardness of the factoring assumption (RSA) or the discrete logarithm problem (DSA/ECDSA). However, should a quantum computer be realised, the hardness of these related problems will be seriously weakened. This issue not only affects future commu- nications but also secure messages sent today, which could be intercepted and stored, then decrypted by a device built a decade from now. Preparing for this is therefore paramount, and hence quantum-safe alternatives are needed to provide long-term security. This thesis is focused on novel hardware designs of such quantum-safe alterna- tives, proposing architectures for public-key cryptographic schemes whose security is based on hardness problems which are to-date no easier to solve with a quantum computer. More specifically, the hardware designs proposed are for lattice-based cryptography. From a theoretical point-of-view, lattice-based cryptography has been well-studied, but research into improving its performance in hardware is still on-going. The proposed novel hardware designs are for discrete Gaussian Nomenclature x sampling techniques, a lattice-based public-key encryption scheme, and digital signature scheme. Discrete Gaussian samplers are ubiquitously used within lattice-based cryptog- raphy. Novel hardware designs are proposed for all the major discrete Gaussian sampling methods, which are followed by a comprehensive evaluation. The novel hardware architectures proposed are for the Bernoulli, cumulative distribution ta- ble (CDT), and Knuth-Yao sampling techniques, which all operate in independent time. Thus, as well as improving on previous research, the novel designs protect the samplers against timing side-channel analysis. A discrete Gaussian distribution testing suite is also proposed to verify the randomness of these samplers. The proposed hardware design of the lattice-based public-key encryption scheme is based on a stronger security assumption, the standard lattice assumption, in comparison to previous research on ideal lattices. The novel architecture utilises algorithmic and architectural optimisations, designed for the targeted Spartan-6 FPGA platform. When integrated with a constant-time discrete Gaussian sampler, the entire encryption scheme runs in independent time. Previously, standard lattices were thought to be completely impractical in hardware, as such the more practical ideal lattices were viewed as preferable, due to its practicality and smaller key sizes. The results here show that standard lattices are practical, and could be considered, especially for applications that require strong security. The proposed digital signature hardware design is also based on a scheme proven to be more secure than previous research. Multiple hardware designs are investigated for different multipliers, which utilise a number of parallel Comba polynomial multipliers. This was examined since the multiplication stage was found to be the architecture’s bottleneck. Results are provided for design goals of low-area, with higher throughput results provided with the inclusion of additional parallel multipliers. Nomenclature xi Overall, the results show that lattice-based cryptography is not only a viable candidate for quantum-safe cryptography, but also performs well in its own right when compared to current state-of-the-art classical cryptoschemes. Table of contents Nomenclature ii List of figures xvi List of tables xix 1 Introduction1 1.1 Motivation . .1 1.2 Aims and Scope . .7 1.3 Novel Contributions . .9 1.4 Organisation of Thesis . 10 2 Background and Theory 13 2.1 Introduction . 14 2.2 Preliminaries . 16 2.2.1 Notation . 16 2.2.2 Discrete Gaussians and Polynomial Rings . 17 2.2.3 Encryption Definitions . 17 2.2.4 Digital Signature Definitions . 18 2.2.5 Lattice Definitions . 19 2.2.6 Computationally Hard Lattice Problems . 20 2.2.7 The Bases of Lattice-Based Cryptography . 21 2.3 The Paradigms Of Lattice-Based Cryptosystems . 24 Table of contents xiii 2.3.1 GGH and NTRUSign Signatures . 25 2.3.2 Hash-and-Sign Signatures . 25 2.3.3 Fiat-Shamir Signatures . 27 2.4 Lattice-Based Encryption Schemes . 34 2.4.1 Summary and Evaluation of Lattice-Based Encryption Designs 36 2.5 Lattice-Based Digital Signature Schemes . 39 2.5.1 On the Instantiation of GPV Hash-and-Sign Signatures . 39 2.5.2 Practical Instantiations of Ideal Lattice-Based Fiat-Shamir Signatures . 40 2.5.3 Performance Evaluation . 47 2.6 Building Blocks . 53 2.6.1 Polynomial Multiplication . 53 2.6.2 Discrete Gaussian Sampling . 59 2.7 Side-Channel Analysis . 62 2.7.1 Invasive Attacks . 63 2.7.2 Semi-invasive Attacks . 63 2.7.3 Non-Invasive Attacks . 63 2.8 A Discrete Gaussian Testing Suite . 64 2.8.1 Introduction to Statistical Testing in Lattice-Based Cryp- tography . 65 2.8.2 The GLITCH Test Suite . 68 2.8.3 Results . 73 2.9 Conclusion . 73 3 Practical Discrete Gaussian Samplers For Lattice-Based Cryp- tography 77 3.1 Introduction . 78 3.2 Discrete Gaussian & Side Channel Analysis Introduction . 80 Table of contents xiv 3.2.1 Sampling Techniques and Previous Work . 82 3.2.2 Timing Analysis Of Discrete Gaussian Samplers . 93 3.3 Efficient Time-Independent Discrete Gaussian Samplers . 95 3.3.1 Time-Independent Bernoulli Sampling . 95 3.3.2 Time-Independent