Full text
Lattice-Based Zero-Knowledge Proofs of Knowledge Ramiro Mart´ ınez
Lattice-Based Zero-Knowledge Proofs of Knowledge A thesis submitted to the Universitat Politècnica de Catalunya for the degree of Doctor of Philosophy by Ramiro Martínez Pinilla Paz Morillo, Advisor Department of Mathematics July 2023 This work is licensed under a Creative Commons “Attribution-ShareAlike 4.0 International” license.
Abstract The main goal of this dissertation is to develop new lattice-based cryptographic schemes. Most of the cryptographic protocols that each and every one of us use on a daily basis are only secure under the assumption that two mathematical problems, namely the discrete logarithm on elliptic curves and the factorization of products of two primes, are computationally hard. That is believed to be true for classical computers, butquantumcomputerswould beabletosolvetheseproblemsmuchmore efficiently, demolishing the foundations of plenty of cryptographic constructions. This reveals the importance of post-quantum alternatives, cryptographic schemes whose security relies on different problems intractable for both classical and quantum computers. The most promising family of problems widely believed to be hard for quantum computers are lattice-based problems. We increase the supply of lattice-based tools providing new Zero-Knowledge Proofs of Knowledge for the Ring Learning With Errors (RLWE) problem, perhaps the most popular lattice-based problem. Zero-knowledge proofs are protocols between a prover and a verifier where the prover convinces the verifier of the validity of certain statements without revealing any additional relevant information. Our proofs extend the literature of Stern-based proofs, following the techniques presented by Jacques Stern in 1994. His original idea involved a code-based problem, but it has been reiteratedly improved and generalized to be used with lattices. We illustrate our proposal defining a variant of the commitment scheme, a cryptographic primitive that allows us to ensure some message was already determined at some point without revealing it until a future time, defined by Benhamouda et al. in ESORICS 2015, and proving in zero-knowledge the knowledge of a valid opening. Most importantly we also show how to prove that the message committed in one commitment is a linear combination, with some public coefficients, of the committed messages from two other commitments, again without revealing any further information about the messages. Finally, we also present a zero-knowledge proof analogous to the previous one but for multiplicative relations, something much more involved that allows us to prove any arithmetic circuit. We give first an interactive version of these proofs and then show how to construct a non-interactive one. We diligently prove that both the commitment and the companion Zero- Knowledge Proofs of Knowledge are secure under the assumption of the hardness of the underlying lattice problems. Furthermore, we specifically develop such proofs so that the arising conditions can be directly used to compute parameters that satisfy
ii them. This way we provide a general method to instantiate our commitment and proofs with any desired security level. Thanks to this practical approach we have been able to implement all the proposed schemes and benchmark the prototype implementation with actually secure parameters, which allows us to obtain meaningful results and compare its performance with the existing alternatives. Moreover, provided that multiplication of polynomials in the quotient ring Z𝑝[𝑥]/⟨𝑥𝑛+1⟩ , with 𝑝 prime and 𝑛 a power of two, is the most basic operation when working with ideal lattices we comprehensively study what are the necessary and sufficient conditions needed for applying (a generalized version of) the Fast Fourier Transform (FFT) to obtain an efficient multiplication algorithm in quotient rings as Z𝑚[𝑥]/⟨𝑥𝑛−𝑎⟩ (where we consider any positive integer 𝑚 and generalize the quotient), as we think it is of independent interest. We believe such a theoretical analysis is fundamental to be able to determine when a given generalization can also be applied to design an efficient multiplication algorithm when the FFT is not defined for the ring we are considering. That is the case of the rings used for the commitment and proofs described before, where only a partial FFT is available.
Contents 1 Introduction 1 1.1 Motivation.................................. 1 1.2 (Post-Quantum) Cryptography . . . . . . . . . . . . . . . . . . . . . . 7 1.2.1 Encryption Schemes . . . . . . . . . . . . . . . . . . . . . . . . 8 1.2.2 Commitment Schemes . . . . . . . . . . . . . . . . . . . . . . . 11 1.2.3 Interactive Proof Systems . . . . . . . . . . . . . . . . . . . . . 15 1.2.4 Zero-Knowledge Proofs . . . . . . . . . . . . . . . . . . . . . . 16 1.2.5 Pseudorandomness . . . . . . . . . . . . . . . . . . . . . . . . . 21 1.3 Lattices.................................... 23 1.3.1 Notation............................... 24 1.3.2 BasicDefinitions .......................... 25 1.3.3 Fundamental Problems . . . . . . . . . . . . . . . . . . . . . . 26 1.3.4 Lattice Basis Reduction . . . . . . . . . . . . . . . . . . . . . . 26 1.3.5 Additional Definitions . . . . . . . . . . . . . . . . . . . . . . . 34 1.3.6 Lattice Problems and Cryptography . . . . . . . . . . . . . . . 37 1.3.7 IdealLattices ............................ 42 1.3.8 Zero-Knowledge Proofs of Knowledge with Lattices . . . . . . 47 1.4 Probability Preliminaries . . . . . . . . . . . . . . . . . . . . . . . . . . 54 1.4.1 The Advantage of an Adversary . . . . . . . . . . . . . . . . . 54 1.4.2 Advantage in an Indistinguishability Game . . . . . . . . . . . 54 1.4.3 Dismissing Events with Negligible Probability . . . . . . . . . 64 1.4.4 Multidimensional Gaussians . . . . . . . . . . . . . . . . . . . 68 1.5 Contributions ................................ 71 2 Partial FFT Multiplication 73 2.1 Introduction................................. 73 2.1.1 Polynomial Multiplication Related Work . . . . . . . . . . . . 75 2.1.2 Conventions............................. 78 2.2 PointwiseProduct.............................. 78 iii
iv Contents 2.2.1 General Invertibility of 𝑇...................... 79 2.2.2 Pointwise Product of Evaluations Modulo 𝑓(𝑥)......... 80 2.3 EfficientTransforms............................. 81 2.3.1 Efficient Evaluation of 𝑇...................... 81 2.3.2 Efficient Evaluation of 𝑇−1..................... 84 2.3.3 Efficient Multiplication Algorithm in 𝑅[𝑥]/⟨𝑥𝑛−𝑎⟩...... 86 2.4 Characterization of suitable sets of evaluation points in the ring Z𝑚[𝑥]/⟨𝑥𝑛−𝑎⟩................................ 87 2.4.1 Existence and Construction of Suitable Roots in Z𝑚...... 94 2.5 FFTGeneralizations............................. 99 2.5.1 Fast Chinese Remaindering . . . . . . . . . . . . . . . . . . . . 101 2.6 Conclusions .................................106 3 Commitment scheme and companion ZKPoKs 107 3.1 Introduction.................................107 3.1.1 Lattice-Based Zero-Knowledge Proofs Related Work . . . . . . 108 3.1.2 OurContribution..........................109 3.1.3 Structure of the Chapter . . . . . . . . . . . . . . . . . . . . . . 111 3.2 Stern-BasedSchemes............................111 3.3 Lattice-Based Commitment Scheme . . . . . . . . . . . . . . . . . . . 118 3.3.1 The Commitment Scheme . . . . . . . . . . . . . . . . . . . . . 118 3.3.2 Security Proofs of the Commitment Scheme . . . . . . . . . . 119 3.4 Interactive Zero-Knowledge Proofs of Knowledge . . . . . . . . . . . 127 3.4.1 Knowledge of a Valid Opening . . . . . . . . . . . . . . . . . . 128 3.4.2 Knowledge of a Linear Relation . . . . . . . . . . . . . . . . . . 138 3.4.3 Knowledge of a Multiplicative Relation . . . . . . . . . . . . . 142 3.5 Conclusions .................................151 Appendices 3 153 3.A Differences with the Published Version . . . . . . . . . . . . . . . . . . 153 4 Commitment and NIZKPoKs Implementation 157 4.1 Introduction.................................157 4.1.1 Structure of the Chapter . . . . . . . . . . . . . . . . . . . . . . 158 4.2 Non-Interactive Zero-Knowledge Proofs of Knowledge . . . . . . . . 159 4.2.1 Pseudocode.............................161 4.3 Non-Interactive Security Proofs . . . . . . . . . . . . . . . . . . . . . . 166 4.3.1 Multiple vs. Single Challenge Set . . . . . . . . . . . . . . . . . 168 4.3.2 The Fiat-Shamir Transform . . . . . . . . . . . . . . . . . . . . 172
Contents v 4.3.3 KnownAttacks ...........................175 4.3.4 Zero-Knowledge ..........................184 4.3.5 Completeness............................184 4.4 Implementation...............................185 4.4.1 Language and Libraries of the Implementation . . . . . . . . . 186 4.4.2 Main Computational Tasks . . . . . . . . . . . . . . . . . . . . 187 4.5 Instantiation.................................189 4.6 Results ....................................193 4.6.1 Sizes and Running Times . . . . . . . . . . . . . . . . . . . . . 194 4.6.2 Most Efficient Secure Sets of Parameters . . . . . . . . . . . . . 196 4.7 Conclusions .................................200 Appendices 4 204 4.A Special Unsoundness Adversaries . . . . . . . . . . . . . . . . . . . . . 204 4.B Script for Finding Parameters . . . . . . . . . . . . . . . . . . . . . . . 215 4.C AdditionalResults..............................220 Acronyms 223 Bibliography 225
List of Algorithms 1.1 Public-Coin ZKPoK example ....................... 19 1.2 Attempt of an ISIS protocol ....................... 48 1.3 Stern’s protocol .............................. 52 2.1 Karatsuba ................................. 76 2.2 Karatsuba (mod 𝑥𝑛±1)......................... 77 2.3 FFT ..................................... 83 2.4 IFFT ..................................... 86 2.5 Efficient FFT Multiplication ...................... 87 2.6 Tonelli–Shanks .............................. 97 2.7 Computation of 𝛼and 𝜔......................... 98 2.8 Generalized Efficient FFT Multiplication ..............101 2.9 FFT (CRT) .................................105 2.10 IFFT (CRT).................................105 3.1 Knowledge of a Valid Opening .....................131 3.2 Knowledge of a Linear Relation ....................140 3.3 Knowledge of a Multiplicative Relation ...............145 4.1 Non-Interactive Proof of a Valid Opening ..............162 4.2 Non-Interactive Verification of a Valid Opening ..........162 4.3 Non-Interactive Proof of a Linear Relation .............163 4.4 Non-Interactive Proof of a Multiplicative Relation ........164 4.5 Non-Interactive Verification of a Linear Relation .........165 4.6 Non-Interactive Verification of a Multiplicative Relation . . . . 165 4.7 Multiple from Single Challenge Set Adversary ...........170 4.A.1 Unsoundness Adversary (Γ1≔{e 𝛼}) ..................205 4.A.2 Unsoundness Adversary (passive mode if 𝛼=e 𝛼)...........205 4.A.3 Unsoundness Adversary (𝛼∉ Γ1and Γ2≔{0})............206 4.A.4 Unsoundness Adversary (𝛼∉ Γ1and Γ2≔{1})............206 vi
List of Algorithms vii 4.A.5 Unsoundness Adversary mult. (Γ1≔{(e 𝛼,e𝛽)}) ............207 4.A.6 Unsoundness Adversary mult. (passive mode if (𝛼,𝛽)=(e 𝛼,e𝛽)) . . . 208 4.A.7 Unsoundness Adversary mult. ((𝛼,𝛽)∉ Γ1and Γ2≔{0}) . . . . . . 209 4.A.8 Unsoundness Adversary mult. ((𝛼,𝛽)∉ Γ1and Γ2≔{1}) . . . . . . 210 4.A.9 Unsoundness Adv. mult. special case (Γ1≔{(𝛼,e𝛽)|𝛼∈Z𝑞}) . . . . . 211 4.A.10 Unsoundness Adv. mult. special case (passive mode if 𝛽=e𝛽) . . . . 212 4.A.11 Unsoundness Adv. mult. special case ((𝛼,𝛽)∉ Γ1and Γ2≔{0}) . . . 213 4.A.12 Unsoundness Adv. mult. special case ((𝛼,𝛽)∉ Γ1and Γ2≔{1}) . . . 214
4 1.1. Motivation know establishes a lower bound on the time required to successfully misbehave) also take an exponential (or at least superpolynomial) amount of time on the size of the keys. Then we can use an argument equivalent to the above, as we are going to latter formalize in Section 1.2. The fact that in the previous example the malicious approach scales exponentially worse than the honest executions means we can hopefully select reasonable parameters that make any attack completely infeasible. Let us grasp how fast is the exponential growth of powers of 2that we obtain doubling the number of keys with each additional bit. To get an idea of the magnitude of current standard security levels such as 128 security bits, meaning a successful attack would need 2 128 operations, we just have to mention that the current age of the universe in seconds is less than 2 59 and according to the TOP500 list * the most powerful supercomputer can now perform 2 60 floating point operations per second, which amount for a total of 2 119 if it started running at the Big Bang. That is, it would have not been enough to break a cryptographic scheme with 128 security bits. Most of the cryptographic standards currently in use rely on the hardness of two well studied problems, the Discrete Logarithm (DLog) problem and prime factorization, or related assumptions as Decisional Diffie-Hellman (DDH) [ 26 ] or Rivest-Shamir-Adelman (RSA) [ 102 ]. Computing a discrete logarithm on certain groups or factorizing products of large primes are difficult problems for which no efficient algorithm is currently known, and this allows the existence of a myriad of cryptographic applications. But, unfortunately, that statement is only true if we limit ourselves to classical algorithms, excluding quantum algorithms. Everyday computers work using binary logic, having a bit as the most basic unit of information storing two possible states usually represented as a 0or a 1. However, taking advantage of the quantum nature of this universe, a completely different model of computation called quantum computing can be built having qubits, the quantum analogous of a bit, as basic units. Leveraging that quantum mechanics allows a particle to be in superposition of different states a qubit is allowed to be in a superposition of two basic states. Mathematically speaking a qubit is a unitary linear combination of the two states with complex coefficients. When considering more than one qubit (in a Hilbert space of 2 𝑁 dimensions) this allows special states, entangled states, that are not the product of individual classical states, and from this emerge new possibilities for computation. It is important to remark that these new operations that are possible with a quantum computer do not add anything new in terms of computability. We say a decisional problem is decidable if there exists an algorithm guaranteed to compute the *https://top500.org
Chapter 1. Introduction 5 answer in a finite amount of steps. Every problem decidable with a Quantum Turing Machine (the theoretical model for a quantum computer) is also decidable with a classical Turing Machine (the theoretical model for classical computers). That is the case because a quantum computer can be fully emulated with a classical computer. This means that the Church-Turing thesis (the conjecture stating that any function defined over the natural numbers can be computed by any effective method if and only if it is computable by a Turing Machine, implying that it is the right model for computation) also applies to quantum computation. The relevant difference comes when we take into account the time-complexity of the algorithms. The possibility of emulating the quantum computations with a classical computer that we have already mentioned comes, as far as we know, at the expense of an exponential slow down (i.e. requiring exponentially many more computations). We already have examples of problems solvable in polynomial-time (the amount of operations can be bounded as a polynomial evaluated on the size of the input) with a quantum computer that have no known classical polynomial algorithm. Unfortunately, two of these problems are precisely DLog and integer factorization, because an efficient quantum algorithm for solving these two problems was developed in 1994 by Peter Shor in [ 109 ], making most of the cryptographic primitives we still use today quantum vulnerable. There is a passionate discussion regarding the feasibility of Cryptographically Relevant Quantum Computers, that is, quantum computers able to compromise the security of cryptographic primitives based on problems related to the DLog and integer factorization. Even if Shor’s algorithm is theoretically efficient we have had a limited success actually building quantum computers able to implement it (it has been recently used to factor 21 = 3 × 7using 5qubits [ 112 ]). It might be the case that the problems regarding scalability involving the number of qubits, the propensity to errors combined with the limited ability to correct them, or the difficulties that arise from keeping the quantum computer running for a prolonged period of time (the quantum states are very delicate and the probability of decoherence, the process from which any disturbance collapses the quantum states into a classical state, increases over time) make it infeasible to build a quantum computer that can be an actual threat to the cryptographic security of the theoretically vulnerable schemes. However, it is a very prolific research field, quantum computers with an increasing number of qubits are presented each year and new methods are developed continuously, for example combining the computational capabilities of a quantum computer and a classical one so that a much less powerful quantum computer already provides an advantage [112]. In any case this represents a colossal risk because even if we cannot precisely
6 1.1. Motivation answer if or when a quantum computer will be able to solve these problems we do know that the consequences could be chaotic unless we have substituted these vulnerable schemes. Furthermore, this issue should be addressed at the earliest convenience. That is the case because signature schemes based on the RSA assumption will become untrustworthy whenever there is a quantum computer that might have forged them, so we have to transition to a resistant scheme when a powerful enough quantum computer becomes available, but encryption schemes have to be replaced now because we expect the encrypted information to remain private for a long period of time and some malicious entity could be collecting now current communications so that they can decrypt them in the future. We can wait for primitives ensuring the integrity of messages or operations, but we have to act now regarding anything related with privacy. There are to completely different alternatives to face this challenge. Quantum Cryptography encompasses the methods that try to base the security of new schemes on the quantum mechanical properties of nature. Quantum random generators and quantum key distribution schemes have been proposed using the non-deterministic nature of quantum statesfor the former and the properties of quantum measurements for the latter, as these properties allow two users to detect if a third party has measured the individual photons (or whatever quantum particle is used) they have been exchanging and therefore can share a key knowing no eavesdropper has been involved. The previous approach is then based on a completely different paradigm, and requires specialized expensive hardware to be implemented. The alternative that we follow through this dissertation, called Post-Quantum Cryptography, is to keep the approach basing the security on the computational hardness of mathematical problems but using alternative problems that are believed to be hard for both classical and quantum computers. It might be the case that a quantum computer is more efficient than a classical one, but we are fine if the difference between the number of classical computations performed by the honest parties is still significantly smaller than the infeasible amount of computation that would be required for a malicious adversary in order to break the scheme. There exist multiple alternative candidates, lattice-based, code-based, hash-based and multivariate-based cryptography, each basing its security on a different family of problems. Lattices are the most promising source of problems for post-quantum cryptography (we are going to extensively discuss their advantages in Section 1.3). The greatest effort to standardize post-quantum cryptographic primitives its being conducted by the National Institute of Standards and Technology (NIST) from the United States of America. A competition was launched in 2016 asking for public
Chapter 1. Introduction 7 key encryption and digital signature proposals * , and from the many applications submitted by teams from all around the globe, after three rounds of submissions three of the four candidates that have been chosen to be standardized are latticebased proposals (the key encapsulation mechanism Kyber and the digital signatures Dilithium and Falcon) and one is hash-based (the digital signature SPHINCS+). Besides the existence of asymptotic formal proofs that guarantee that sufficiently large key sizes would make the scheme secure against quantum computers we also aspire, to the best of our knowledge, to obtain concrete security and try to quantitatively bound the success probability of an adversary with a specific amount of resources. We believe this is also important if we intend our research to be trusted and yield to practical applications. 1.2 (Post-Quantum) Cryptography As we have mentioned, cryptography goes far beyond encryption and signature schemes. We introduce in this section all the primitives that we are going to use as examples or to present our contributions. We also introduce here the notation we are going to use regarding probabilistic algorithms. Given an algorithm 𝒜 we use 𝑎← 𝒜 to denote that 𝑎 is the output of 𝒜 . If the algorithm 𝒜 is probabilistic and the output is not deterministically determined by the input we might then use 𝑎←r𝒜 to indicate that some randomness is involved. Given a set 𝑋 we also use 𝑥←r𝑋 to denote that 𝑥 is sampled uniformly at random from 𝑋 . Finally, given a probability distribution 𝐷 we analogously use 𝑑←r𝐷 to denote that 𝑑is sampled following the distribution 𝐷. The usual convention is to assume the time-complexity of an algorithm is reasonable if the number of operations it needs to finish is bounded by a polynomial on the size of its input. Given that we use probabilistic algorithms we want this property to be true independently of the internal random coins. This class of algorithms is usually known as Probabilistic Polynomial-Time (PPT). We generally consider the possibility of these algorithms being quantum algorithms and not only classical ones. We want the success probability of adversaries trying to break the security of our schemes to be insignificant. This can be formalized asymptotically with the following two definitions. Definition 1.1 (Negligible function). A function 𝑓is negligible if |𝑓(𝑛)|∈O𝑛−𝑐,∀𝑐∈Z>0. We denote it writing 𝑓∈negl(𝑛). *https://csrc.nist.gov/projects/post-quantum-cryptography
8 1.2. (Post-Quantum) Cryptography Definition 1.2 (Overwhelming function). A function 𝑓is overwhelming if |𝑓(𝑛)−1|∈O𝑛−𝑐,∀𝑐∈Z>0. The level of security can then be controlled by the variable of these negligible functions, usually known as security parameter. Through this dissertation 𝜆 is going to be our security parameter in all security proofs. We might sometimes want to bound the probabilities of the undesired events by some given probability, usually 2 −𝜆 (and not only asymptotically). If this bound is specifically indicated we might also use the word negligible to refer to this specific value because, in particular, 2−𝜆is negligible in 𝜆. 1.2.1 Encryption Schemes In this work we are going to mainly focus on other than encryption primitives, but we start defining a public key encryption scheme because we are going to use them as examples of applications of lattice-based cryptography, and we need this definition to motivate the other primitives. Through this section we are going to always include all input and output elements necessary to define the involved algorithms. However, in some cases some of these inputs, for example the public parameters that define the length of the messages in the considered message space, are unambiguously implicitly defined from the context. We use a semicolon instead of a comma to separate this kind of parameters that, in the following sections, we might later omit in order to simplify notation when leaving them out does not introduce any possible ambiguity. Definition 1.3 (Public Key Encryption Scheme).Apublic key encryption scheme, designed to hide a message so that only the designated receiver can then read it, consists on three efficient algorithms: • Gen: the generator algorithm takes a security parameter 1 𝜆 and outputs a pair of keys, sk and pk , the secret and the public key respectively. It also defines the message space ℳ𝜆 and the ciphertext space 𝒞𝜆 , via some public parameters pp . These public parameters can be seen as part of the public key, but we prefer to treat them separately. (sk,pk;pp)←rGen1𝜆 • Enc: the encryption algorithm takes as input a message 𝑚∈ ℳ𝜆 , a public key pk and the public parameters pp and produces a ciphertext 𝑐∈ 𝒞𝜆. 𝑐←rEnc𝑚;pk,pp
Chapter 1. Introduction 9 • Dec: the decryption algorithm takes as input a ciphertext 𝑐 and a secret key sk , possibly together with the public key pk and the public parameters pp , and outputs a message 𝑚′. 𝑚′←Dec𝑐, sk;pk,pp These algorithms should satisfy the following two properties: • Correctness: knowing the private key the decryption algorithm should recover the encrypted message. (sk,pk;pp) ←rGen(1𝜆) 𝑚∈ ℳ𝜆 𝑐←rEnc(𝑚;pk,pp) 𝑚′←rDec (𝑐, sk;pk,pp) =⇒𝑚′=𝑚. In some occasions we might be content with this property happening except with negligible probability, allowing the possibility of some errors if they happen with sufficiently low probability. Pr 𝑚′≠𝑚 (sk,pk;pp) ←rGen(1𝜆), 𝑚∈ ℳ𝜆, 𝑐←rEnc(𝑚;pk,pp), 𝑚′←Dec(𝑐, sk;pk,pp) ∈negl(𝜆). • Security: we also expect the encryption algorithm to hide the message 𝑚 , that should not be recoverable from the ciphertext 𝑐 and the public key pk alone, without the secret key sk . Depending on how we formalize this notion, rigorously defining what we want to prevent and specifying the capabilities of the adversary, we might obtain different security definitions, involving the security parameter 𝜆. This definition ensures that, on the one hand, anyone can encrypt messages, as the algorithms and the public key are, indeed, publicly known. On the other hand, people knowing the secret key can recover, always or with overwhelming probability, the secret message that is encrypted in the ciphertext. The first intuition about the security of a public key encryption scheme tells us that besides this we also need that the original message should not be efficiently obtainable without knowing the secret key. Notice the key generator algorithm takes 1 𝜆 as input because we measure this difficulty as the efficiency of the algorithms with respect to the length of its input, and this way the input has length 𝜆 . The same
10 1.2. (Post-Quantum) Cryptography is going to apply for the adversary, so we can define its computational power as a function of 𝜆 (notice also that the size of the output of a polynomial algorithm is necessarily polynomial too). This can be formalized with the following definition. Definition 1.4 (Public Key Encryption One Way Chosen Plaintext Attack Secure – OW-CPA).A public key encryption scheme is said to be OW-CPA secure if for all PPT adversaries 𝒜the following holds. Pr 𝑚′=𝑚 (sk,pk;pp) ←rGen(1𝜆), 𝑚←rℳ𝜆, 𝑐 ←rEnc(𝑚;pk,pp), 𝑚′←r𝒜(𝑐, pk,pp,1𝜆)∈negl(𝜆). However, this is usually not enough. An encryption scheme that only modifies the second half of the message may be OW-CPA secure if it is hard enough to recover this second half, but reveals a lot of information about the message. For that reason the following standard stronger security definition is usually considered. Definition 1.5 (Public Key Encryption Indistinguishable Chosen Plaintext Attack Secure – IND-CPA).A public key encryption scheme is said to be IND-CPA secure if for all PPT adversaries (𝒜1,𝒜2)the following holds. Pr 𝑏𝒜=𝑏 (sk,pk;pp) ←rGen(1𝜆), (𝑚0, 𝑚1,aux) ←r𝒜1(pk,pp,1𝜆), 𝑏←r{0,1}, 𝑐 ←rEnc(𝑚𝑏;pk,pp), 𝑏𝒜←r𝒜2(𝑐, pk,pp,aux,1𝜆) −1/2∈negl(𝜆). That is, the encryptions of two different messages should not be computationally distinguishable (the advantage over a random guess has to be negligible), even if we allow the adversary to choose those messages. Note that this definition implies that the algorithm has to be probabilistic. Observe we have defined two separated algorithms for the adversary, in order to separate its two main tasks. However, an adversary trying to learn some information from the encryption could always use their prior knowledge from the moment selecting the two messages. For this reason we include an auxiliary variable aux that stores any information 𝒜1considers that 𝒜2could use to guess the message. Weprovesecurity ofan encryptionschemeunder certainhypothesis (the hardness of some computational problem) proving the existence of a reduction that implies that a PPT algorithm breaking the security of the encryption could be used to disprove the hypothesis. In particular, we are interested in public key encryption schemes whose security is based in hypothesis believed to be true in a quantum scenario. Some examples are going to be presented in Section 1.3.
Chapter 1. Introduction 11 1.2.2 Commitment Schemes Sometimes we want to hide some information not to restrict who should access it but when should it become public. Just publishing it latter might not be an option if the fact that the decision was already made in a prior moment is important. Let us consider a simple scenario where a group of people votes to choose an option among several possibilities. There is no privacy need and everyone agrees to make their own decision public. However, disclosing their options one by one would make the process unfair, because as more and more options are revealed the following participants have more information and can choose to change their mind in a strategic way (for example voting for their second preferred option if they already consider their first option has a little chance of winning). That would provide more control over the final outcome to the last participants, making the process biased. Enumerating the options and raising hands has similar issues, this time related with the order of the options. In a physical meeting this could be easily solved by asking the participants to write down their option on a piece of paper, so then each participant can reveal their own choice once all the other votes have already been fixed. Being able to obtain the same functionality with a cryptographic primitive is a very versatile tool, but requires a different security model than encryption. For example, imaging an IND-CPA secure public key encryption scheme (Gen,Enc,Dec) that encrypts a single bit for a yes or no vote. A participant can sample a pair of keys and public parameters (sk,pk ; pp) ←rGen( 1 𝜆) , encrypt their option 𝑏∈ { 0 , 1 }=ℳ𝜆 with 𝑐←rEnc(𝑏 ; pk,pp) and reveal 𝑐 , because the IND-CPA property ensures no adversary can correctly guess the value of 𝑏 as encryptions of 0are indistinguishable from encryptions of 1. However, without any further consideration, this would not be enough to later convince others that their vote has already been fixed. Of course the participant could reveal sk so that anyone can check 𝑏←Dec(𝑐, sk ; pk,pp) . But that would be meaningless because, if the participant wishes to change their mind (and choose the other option 𝑏 ), they can also sample new sk′ so that 𝑏←Dec(𝑐, sk′ ; pk,pp) (and this is always possible because if sampling different keys we cannot efficiently find one such that 𝑏←Dec(𝑐, sk′ ; pk,pp) then we would be able to know the value of 𝑏and break the security of the encryption scheme). A cryptographic primitive that could solve these problems does not only need to guarantee that it hides the secret. Whatever is disclosed should be bound to the original message and no other, as the user wants to show that they have committed to that value. The primitive we need for this scenario is called a commitment scheme. Definition 1.6 (Commitment Scheme).Acommitment scheme is a cryptographic
12 1.2. (Post-Quantum) Cryptography primitive with two phases that allows one party to commit to a value that will only be revealed to other parties showing an opening in the future. It consists on three efficient algorithms: • Gen: the generator algorithm takes as input the security parameter 1 𝜆 and outputs a public key pk and the public parameters pp that define the commitment and message spaces and the specifications of the other two algorithms. (pk;pp) ←rGen1𝜆 • Com: the commitment algorithm takes as input a message 𝑚 and a public key pk , together with the public parameters pp , and outputs both a commitment 𝑐 and an opening 𝑜. (𝑐, 𝑜) ←rCom𝑚;pk,pp • Ver: the verification algorithm takes as input a commitment 𝑐 , a message 𝑚 , an opening 𝑜 and the public key pk with the public parameters pp , and accepts or rejects that opening. Ver :𝑐, 𝑚, 𝑜;pk,pp→accept,reject These algorithms have to satisfy the following three properties: • Correctness: if the commitment has been built correctly and the original message and the opening are published then the verification algorithm always accepts. (pk;pp) ←rGen 1𝜆 (𝑐, 𝑜)←rCom (𝑚;pk,pp))=⇒accept ←Ver(𝑐, 𝑚, 𝑜;pk,pp). Analogously as before we might accept correctness except with negligible probability for every message. Pr "reject ←Ver(𝑐, 𝑚, 𝑜;pk,pp)(pk;pp) ←rGen(1𝜆) (𝑐, 𝑜) ←rCom(𝑚;pk,pp)#∈negl(𝜆). • Hiding: a well constructed commitment 𝑐 does not leak any relevant information about the message 𝑚 . This property can be perfect or only computational. – Perfectly Hiding: it is perfectly hiding if this property is absolute and unconditional, meaning that for any commitment to a message there
Chapter 1. Introduction 13 exists a valid opening to any other message. (pk;pp) ←rGen(1𝜆) (𝑐, 𝑜) ←rCom(𝑚;pk,pp))=⇒∀𝑚′∃𝑜′such that accept ←Ver(𝑐, 𝑚′, 𝑜′;pk,pp). – Computationally Hiding: for any PPT adversary (𝒜1,𝒜2) the advantage distinguishing two commitments, even if the messages are chosen by the adversary themself, is negligible compared with a random guess. Pr 𝑏𝒜=𝑏 (pk;pp) ←rGen(1𝜆) (𝑚0, 𝑚1,aux) ←r𝒜1(pk,pp,1𝜆) 𝑏←r{0,1},(𝑐, 𝑜) ←rCom(𝑚𝑏;pk,pp) 𝑏𝒜←r𝒜2(𝑐, pk,pp,aux,1𝜆) −1/2∈negl(𝜆). • Binding: it should be infeasible for the sender to output a commitment that can be opened to two different values. This property can again be perfect or computational. – Perfectly Binding: a commitment can only be opened to one message. accept ←Ver (𝑐, 𝑚, 𝑜;pk,pp) accept ←Ver (𝑐, 𝑚′, 𝑜′;pk,pp))=⇒𝑚=𝑚′. We might admit again the possibility of this property holding except with negligible probability, in this case in the selection of the public key. Pr "Ver (𝑐, 𝑚, 𝑜;pk,pp) Ver (𝑐, 𝑚′, 𝑜′;pk,pp))=⇒𝑚=𝑚′(pk;pp) ←rGen(1𝜆)#∈negl(𝜆). – Computationally Binding: noPPTadversary 𝒜 canoutputacommitment 𝑐 and two valid openings 𝑜 and 𝑜′ to two different messages 𝑚≠𝑚′ except with negligible probability. Pr Ver(𝑐, 𝑚, 𝑜;pk,pp), Ver(𝑐, 𝑚′, 𝑜′;pk,pp), 𝑚≠𝑚′(pk;pp) ←rGen(1𝜆), (𝑐, 𝑚, 𝑚′, 𝑜, 𝑜′) ←r𝒜(pk,pp,1𝜆)∈negl(𝜆). Observe the hiding and binding properties cannot be both perfect for the same scheme. In this work we are always going to consider computationally hiding commitment schemes, either perfect or computationally binding. We sometimes abuse notation to include the randomness of the commitment
20 1.2. (Post-Quantum) Cryptography to be followed by honest provers and verifiers, but a malicious prover can arbitrary deviate. For that matter when in a protocol an honest prover tries to convince a verifier that they know some element 𝑎 satisfying some relations we denote by e𝑎 the element disclosed by a possibly malicious prover, because e𝑎 might not satisfy the same relations the honestly computed 𝑎 does. We can only use whatever relation is actually verified by the verifier. An honest prover will always use e𝑎=𝑎. Equivalently, to prove that the conversations between a prover and a verifier do not reveal any relevant information we will show the existence of a simulator that can output conversations indistinguishable from the real ones. If an original conversation contains an element 𝑎 , for the same reasons as before, we will call b𝑎 to the element alleged to play the same role in the simulated conversation. This b𝑎 could be computed differently, and we have to check that it follows the same distribution as the original 𝑎. In the particular case with 𝜇= 1, i.e. only 3moves, we can define special soundness as the property meaning that a valid witness can be computed from 2accepting conversations, which directly implies soundness. Such a protocol with 3moves and special soundness is called a Σ -protocol. Provided that we have defined a more general interactive ZKPoK we have to work with generalized versions of properties usually defined for Σ-protocols. The most direct use of an interactive ZKPoK is as authentication mechanism working as an identification scheme. An instance of a difficult problem can be used as a public key and only the one who generated it, knowing the solution, can use it as a secret key and execute the protocol to convince anyone that they are who they claim to be. The main drawback of this approach for other scenarios is that it requires interaction, because only the fact that the conversation has been produced in the right order with the challenges selected by the verifier convinces the verifier of the truthiness of the statement. Anyone else who does not necessarily trust the verifier would then not have any reason to trust the proof (as it could be simulated). To solve these issues when we need a universally verifiable proof the notion of non-interactive proofs is then introduced. There are different approaches to obtain this goal, but we focus on proofs that come from an interactive version where the role of the verifier has been substituted by a random oracle 𝒪 (formally defined in the following subsection), i.e. with the Fiat-Shamir transform [52]. Definition 1.11 (Non-Interactive Zero-Knowledge Proof of Knowledge).ANon- Interactive Zero-Knowledge Proof of Knowledge (NIZKPoK), denoted as (𝒫,𝒱) , allows a prover 𝒫 to convince a verifier 𝒱 that a certain statement 𝑥 is true because they know some secret information, a witness 𝑤 , that satisfies a given relation (𝑥, 𝑤) ∈ ℜ ,
Chapter 1. Introduction 21 while preserving confidentiality of such secret. Unlike the interactive variant each participant executes their part on their own, 𝒫 takes 𝑥 and 𝑤 as input and produces a proof Π←r𝒫(𝑥, 𝑤) , while 𝒱 accepts or rejects the proof by looking at 𝑥 and Π . We denote the response given by the verifier as 𝒱(𝑥, Π) . Every NIZKPoK system must satisfy the following properties: • Completeness: if an honest prover knows the witness, then an honest verifier will always accept the proof provided that the protocol was followed. • (Knowledge) Soundness: a protocol is said to be sound if no computationally bounded (for example with a limited number of oracle queries) dishonest adversary can produce a valid proof for a false statement ( 𝑥∉ ℜ ), except with negligible probability. A protocol is said to have the stronger property of Knowledge-Soundness if there is an extractor such that provided 𝒫∗ is an adversary that produces valid proofs for a statement 𝑥 then the extractor is able to use it to obtain a valid witness such that (𝑥, 𝑤) ∈ ℜwith a similar success probability. • Zero-Knowledge: the proof itself should not reveal any additional information about the witness besides the fact that it exists. In this case we are going to extensibly discuss formal ways to achieve these properties in Chapter 4. Particularly Definitions 4.4 and 4.5 formalize the concepts of soundness and knowledge-soundness for NIZKPoKs that come from interactive proofs, where we use the number of oracle calls as a measure of the computational power of the adversary. As the transform and the particular details are going to be introduced in this chapter we leave there these definitions. 1.2.5 Pseudorandomness Pseudorandom generators, deterministic algorithms that expand short seeds into apparently random longer bit sequences, are fundamental for cryptography. We ask these pseudorandom sequences to be computationally indistinguishable from truly random sequences by efficient algorithms, and then call them Cryptographically Secure Pseudorandom Number Generators (CSPRNGs). Definition 1.12 (Hash Function).Ahash function is a function that maps a message of arbitrary length to a fixed length hash or digest. 𝐻:{0,1}∗↦→ {0,1}𝑠
22 1.2. (Post-Quantum) Cryptography We usually want hash functions to satisfy additional properties, as collision resistance, preimage resistance or second preimage resistance (it should be computationally infeasible to find two messages with the same image, compute a preimage or compute an additional preimage of a known message hash). In our implementation in Chapter 4, we use the SHA-3 family of hash functions. Definition 1.13 (eXtendable Output Function).An eXtendable Output Function (XOF) is a generalization of a hash function. While a hash function produces an output of fixed length, an XOF can produce a digest of arbitrary length. Moreover, the extension of the length of the output (requesting more digest bits) only costs the generation of these extra bits. Abusing notation we can write the following. XOF :({0,1}∗, 𝑛) ↦→ {0,1}𝑛 In Chapter 4 we use an XOF (SHAKE-128) this time to obtain an appropriate length buffer to store the cryptographically secure pseudorandom bytes used to sample an integer uniformly at random from a given interval. Sometimes we need a perfect source of pseudorandomness to be able to formalize the security proofs. This is modeled as a random oracle and the approach is called the Random Oracle Model (ROM). Definition 1.14 (Random Oracle).Arandom oracle is an ideal oracle 𝒪 that can be queried with arbitrary messages and answers a uniformly random element from the output domain if the message has not been queried before or returns the previous answer otherwise. AQuantum Random Oracle follows the same idea regarding quantum computation, and for that matter queries are allowed to be a quantum superposition of different messages, answering too with a quantum superposition of the classical answers. We can use the ROM to define a simple commitment scheme, that we then use as auxiliary commitment scheme to design ZKPoKs of more versatile commitments. Let aGen,aCom and aVer be the following algorithms: • aGen: on input a security parameter 1 𝜆 output as a public key a random oracle 𝒪 with { 0 , 1 }𝜆 as output domain, and the security parameter 𝜆 as public parameter. (pk ≔𝒪;pp ≔𝜆) ←raGen(1𝜆) • aCom: given a message 𝑚∈ { 0 , 1 }∗ sample a random bit string 𝑟←r{ 0 , 1 }𝜆 and query the random oracle with the concatenation of the message and the
Chapter 1. Introduction 23 randomness 𝑚∥𝑟 . The answer 𝑐← 𝒪(𝑚∥𝑟) would work as commitment and the randomness as opening. (𝑐≔𝒪(𝑚∥𝑟), 𝑜 ≔𝑟) ←raCom(𝑚;𝒪,𝜆) • aVer: given a commitment 𝑐 , a message 𝑚 and an opening 𝑜≔𝑟 , together with the public key and the public parameters, the verifier checks if 𝑟? ∈ { 0 , 1 }𝜆 and if 𝑐 is the answer from the random oracle to the concatenation of the message and the opening. aVer(𝑐, 𝑚, 𝑟;𝒪,𝜆)outputs accept if 𝑟? ∈ {0,1}𝜆 𝑐? ← 𝒪(𝑚∥𝑟) reject otherwise This scheme is a well known construction, we can informally check that it satisfies the properties needed to be a secure commitment scheme. Correctness property holds by construction, because the random oracle always returns the same answer when queried with the same message. It is computationally hiding because the oracle answer of 𝑚∥𝑟 is independent of 𝑚∥𝑟′ if 𝑟≠𝑟′ , and the randomness comes from a sufficiently large space. It is also computationally binding, because the fact that the answers from the oracle are uniformly distributed in an exponentially large space makes it infeasible to find a collision. 1.3 Lattices Lattice-based cryptography is currently a prolific research topic as it allows building many cryptographic primitives from post-quantum assumptions, as lattice problems are widely believed to be computationally hard even for quantum computers. Besides that, an important property of the lattice-problems used for cryptography is that they enjoy worst-case to average-case reductions. That means we know how to solve the most difficult instance of a lattice problem just being able to break with sufficient probability a random instance of our cryptographic construction. This is important because it implies that the hardness assumption works on average, and not only in some special cases, which is a desirable but uncommon property. Another reason explaining why the cryptographic community has great confidence on lattice assumptions is the fact that lattices have long been used for cryptographic purposes, being used as a tool for cryptanalysis against RSA schemes before lattice-based cryptography itself was first proposed [43, 27].
24 1.3. Lattices Lattices have also become a celebrated alternative because they permit the realization of Fully Homomorphic Encryption (FHE), allowing anyone to perform computations on encrypted data. However, sometimes we do not need such a strong feature, and we are going to see how to prove in zero-knowledge that some element is the result of applying an arithmetic circuit to some secret inputs, which might still be useful for many applications. In any case we describe in this section the basic notions we need to define the lattice problems of interest and start discussing the main challenges we face when trying to build ZKPoKs for such problems. 1.3.1 Notation We usually follow the standard notation in which column vectors are denoted by lower-case bold-faced roman letters, 𝒂 or 𝒃 , and row vectors are denoted as transposed column vectors 𝒂T . Unless it is specifically mentioned otherwise uppercase bold-faced roman letters, 𝑴 or 𝑨 , are going to represent matrices. We denote the binary logarithm simply as log , and use ln for the natural logarithm. We denote by ⌊𝑥⌋ the largest integer not greater than 𝑥 and by ⌊𝑥⌉ the closest integer to 𝑥 , with ties broken upwards. Regarding lattices, we mostly follow the notation from [ 96 ]. Throughout the rest of the dissertation we will mainly work over the quotient ring of polynomials 𝑅𝑞=Z𝑞[𝑥]/⟨𝑥𝑛+ 1 ⟩ , where 𝑛 is a power of two and 𝑞 is an odd prime. For the sake of being able to define norms of polynomials and vectors of polynomials, we choose {−⌊𝑞/ 2 ⌋, . . . , ⌊𝑞/ 2 ⌋} as representatives for Z𝑞 . We denote the representative of 𝑎∈Z𝑞as 𝑎rem 𝑞∈Z. It is important to remark the need for unique representatives. Intermediate results of operations in Z𝑞 can be computed using any equivalent integer from Z , as long as we always use the same representatives for the final outcome. That is important because even if we have a theoretical proof ensuring that some element follows a uniform distribution in Z𝑞 , independent of any secret, a bad implementation could be leaking relevant information if the representative does depend on the secret. This way given a vector 𝒗∈Z𝑛 𝑞 we define the infinity norm as ∥𝒗∥∞≔ max1≤𝑖≤𝑛|𝑣𝑖| , where 𝑣𝑖 are the coordinates of vector 𝒗 taking the mentioned elements as representatives. We identify a polynomial 𝑝∈𝑅𝑞 with the vector 𝒑∈Z𝑛 𝑞 that has its coefficients as elements, and define the norm of a polynomial as the norm of the related vector ∥𝑝∥∞≔∥𝒑∥∞ . The infinity norm of a vector of polynomials is analogously defined. We denote the Hamming weight of a vector 𝒗 , the number of non-zero coordinates, as ∥𝒗∥H. Lattice-based cryptography deals with noisy equations, where the noise terms
Chapter 1. Introduction 25 come from an error distribution 𝜒 . The tightest security guarantees are obtained choosing these errors following Gaussian distributions. The discrete Gaussian distribution of parameter 𝜎 over the integers, denoted as 𝐷𝜎 , assigns to 𝑥∈Za probability which is proportional to 𝜌𝜎(𝑥)=exp −1 2𝑥2/𝜎2. Sometimes we need to ensure that such errors are small enough, and for that reason we truncate the distribution disregarding the tails so that the errors are indeed bounded. We denote by 𝐷𝜎,𝐵 the truncated discrete Gaussian distribution over Z obtained by sampling an element from a discrete Gaussian 𝐷𝜎 conditioned to be in the interval [−𝐵, 𝐵) , where the bound 𝐵 is usually going to be another power of two. We define the interval like this for convenience, as it characterizes errors that can be described with a fixed number of bits. We sometimes abuse notation writing ∥𝑝∥∞≤𝐵 while what we are going to check is whether all the coefficients from 𝑝 belong to the interval [−𝐵, 𝐵). 1.3.2 Basic Definitions Definition 1.15 (Lattice).Alattice ℒ is a set of points in an 𝑛 -dimensional space, usually R𝑛, with a periodic structure. That is, the following two conditions hold: •It is an additive subgroup: 0∈ ℒ and ∀𝑥, 𝑦 ∈ ℒ we have −𝑥, 𝑥 +𝑦∈ ℒ. •It is discrete: ∀𝑥∈ ℒ there exists a neighborhood of 𝑥in R𝑛such that 𝑥is the only point of the lattice. Usually a lattice is defined by a basis of vectors. An example of a 2-dimensional lattice is presented in Figure 1.1. Definition 1.16 (Generated lattice).Given 𝑘 linearly independent vectors 𝒃1, . . . , 𝒃𝑘∈R𝑛, the lattice generated by them is the set defined as follows. ℒ(𝒃1, . . . , 𝒃𝑘)≔(𝑘 Õ 𝑖=1 𝑧𝑖𝒃𝑖𝑧𝑖∈Z)=𝑩𝒛 𝒛∈Z𝑘=ℒ(𝑩). We have called 𝑩 to the matrix whose columns are vectors 𝒃𝑖 . We say 𝒃1, . . . , 𝒃𝑘 form abasis of the lattice ℒ(𝑩). We additionally say the lattice is full-rank if 𝑘=𝑛. Definition 1.17 (Minimum 𝜆𝑖 ).We define the minimum 𝜆𝑖(ℒ) as the radius of the smallest hypersphere centered in the origin that contains at least 𝑖 linearly independent points of the lattice ℒ.
26 1.3. Lattices As an example we have drawn 𝜆2 for the previously presented lattice in Figure 1.2. 1.3.3 Fundamental Problems Now we can define some of the problems whose hardness will be used as hypothesis for our cryptographic constructions. Definition 1.18 (Approximate Shortest Vector Problem – 𝛾9SVP ).Given a basis 𝑩 of a lattice ℒ(𝑩) the Approximate Shortest Vector Problem ( 𝛾9SVP ) consists on finding a non-zero vector 𝒗∈ ℒ(𝑩)such that ∥𝒗∥≤𝛾·𝜆1(ℒ(𝑩)). If 𝛾= 1it is called the Shortest Vector Problem (SVP). We represent the solution of the SVP for the lattice generated by 𝑩 in Figure 1.3. The difficulty of this problem depends on the approximating factor 𝛾 . Our problems involve a 𝛾(𝑛) that is a polynomial of the dimension of the lattice. It has been proven to be an NP-hard problem in its exact version and also for some subpolynomial approximations [ 5 ]. The best algorithms for the approximated versions have exponential cost [ 57 ], and it is believed that no successful PPT algorithm exists. Definition 1.19 (Approximate Closest Vector Problem – 𝛾9CVP ).Given a basis 𝑩 of a lattice ℒ(𝑩) and a target vector 𝒕∈R𝑛 , the Approximate Closest Vector Problem ( 𝛾9CVP ) consists on finding a vector 𝒖∈ ℒ(𝑩)such that ∥𝒖−𝒕∥≤𝛾min𝒘∈ℒ(𝑩)∥𝒘−𝒕∥. Analogously as before it is called Closest Vector Problem (CVP) if the approximation factor is 1. An example of a solution for a CVP can be found in Figure 1.4. 1.3.4 Lattice Basis Reduction A lattice can be defined by different basis. Multiplying 𝑩 by a unimodular matrix 𝑼 gives us another basis for the same lattice. In fact, all basis defining the same lattice can be obtained this way. Theorem 1.20. ℒ(𝑩)=ℒ(𝑩′)if and only if there exist a unimodular matrix 𝑼such that 𝑩′=𝑩𝑼. Proof. Assume 𝑩′=𝑩𝑼 . As 𝑼 is unimodular its inverse 𝑼−1 is unimodular too. In particular, they are both integer matrices, and we also have 𝑩=𝑩′𝑼−1 . Columns of 𝑩′ are integer combinations of columns of 𝑩 (therefore ℒ(𝑩′) ⊂ ℒ(𝑩) ) and columns of 𝑩 are integer combinations of columns of 𝑩′ (therefore ℒ(𝑩) ⊂ ℒ(𝑩′) ). Consequently, ℒ(𝑩)=ℒ(𝑩′). Assume ℒ(𝑩)=ℒ(𝑩′) . Then each column 𝒃′ 𝑖 of 𝑩′ is a point of the lattice ℒ(𝑩) , generated by the columns of 𝑩 . Then 𝒃′ 𝑖=𝑩𝒖𝑖 , where 𝒖𝑖∈Z𝑘 are the corresponding
Chapter 1. Introduction 27 Figure 1.1 Lattice generated by 𝑩 𝒃1 𝒃1 𝒃2 𝒃2 Figure 1.2 Minimum 𝜆2for the lattice generated by 𝑩 𝒃1 𝒃1 𝒃2 𝒃2
28 1.3. Lattices Figure 1.3 Solution of the SVP for the lattice generated by 𝑩 𝒃1 𝒃1 𝒃2 𝒃2 𝒂 Figure 1.4 Solution of the CVP for a lattice generated by 𝑩 𝒃1 𝒃1 𝒃2 𝒃2 𝒕𝒕𝒖𝒖
Chapter 1. Introduction 29 coefficients of the columns of 𝑩 . We have 𝑩′=𝑩𝑼 where 𝑼 is an integer matrix. And by the same argument 𝑩=𝑩′𝑽 , where 𝑽 is another integer matrix. Combining the two expressions we get 𝑩′=𝑩′𝑽𝑼 . Then 𝑩′(𝑽𝑼 −Id)=0 . Since 𝑩′ is non-singular 𝑽𝑼 =Id and 𝑼is unimodular. □ Corollary 1.21. The lattice determinant of a full-rank lattice, defined as the absolute value of the determinant of a basis, det(ℒ(𝑩))≔|det(𝑩)| , is well-defined and a lattice invariant. We can use this invariant to find bounds for 𝜆1 . It is important to find invariants as some problems over lattices are hard or easy depending on some properties of the basis defining the lattice that is given as input. Informally, a basis is said to be good if it has short highly orthogonal vectors, and bad if it has low orthogonality. We can attempt to solve the CVP by just rounding the coordinates of a point 𝒕 , given in basis 𝑩 , to get a lattice point 𝒖 . As we can see in Figures 1.5 and 1.6 the space is then divided in regions that would go to the same lattice point, and the fact that we are using the vectors from 𝑩 to define the coordinates means that these regions are shaped into 𝑛 -dimensional parallelepipeds defined by 𝑩 . Given a target 𝒕 the point 𝒖 that we obtain would be the lattice point in the center of the parallelepiped containing 𝒕 , gray colored in the figures. This parallelepiped is called the fundamental parallelepiped, and has volume det ℒ(𝑩) , independent of the basis. Nevertheless, following this approach with a bad basis (as in Figure 1.5) yields worse results than with a good basis (as in Figure 1.6). That is because all points in the gray area would go to the same 𝒖 at its center when rounding their coordinates, but a more skewed parallelepiped means that we are rounding to 𝒖 points that are much further apart. It is known that better results are obtained if before starting this procedure the basis is orthogonalized and the space is divided into boxes. This approach is followed by Babai’s Nearest Plane algorithm for solving the approximated CVP, but we see in Figures 1.7 and 1.8 that the quality of the outcome heavily depends too on the quality of the basis. We can formalize this notion of good and bad basis. Some algorithms work well with highly orthogonal basis, but have a very low probability of success (or can only guarantee a worse approximation factor) if the basis has low orthogonality. We also say that a highly orthogonal basis has a low orthogonality defect and vice versa. Definition 1.22 (Orthogonality defect). The orthogonality defect of a full-rank lattice basis 𝑩is given by 𝛿(𝑩)≔Î𝑛 𝑖=1∥𝒃𝑖∥ det(𝑩).
36 1.3. Lattices We can safely ignore this second part because its contribution has been already taken into account by the 𝑞Z𝑚term. Notice that, since 𝑨1 is non-singular, integer combinations of its columns can be any integer vector of Z𝑛 . The final conclusion is that we can assume the first block of the matrix is just an 𝑛×𝑛identity matrix. = 1 1 ··· 𝑨2𝑨−1 1 𝑨2𝑨−1 1 𝑨1 𝑨1 ·Z𝑛+𝑞Z𝑚= 1 1 ··· ·Z𝑛+𝑞Z𝑚 We can consider that the multiples of 𝑞 part is a linear integer combination of the columns of a 𝑞 scalar matrix. Observe the leftmost 𝑛 columns with a 𝑞 in the first 𝑛 rows are integer linear combinations of the other columns, and can be omitted. That is the case because the 𝑞 ’s and the zeroes in the first 𝑛 elements of any of these columns can be obtained multiplying 𝑞 by the corresponding column from the first 𝑛 ones that has a 1in the same position. The bottom 𝑚−𝑛 elements obtained multiplying this column by 𝑞 would be non-zero, but, as all of them would be multiples of 𝑞 , we can subtract the linear integer combination of the rightmost 𝑚−𝑛 columns that equals to this 𝑚−𝑛vector. = 1 1 ··· 𝑞 𝑞 ··· 𝑛+𝑚 ·Z𝑛+𝑚= 1 1 ··· 𝑞 𝑞 ··· 𝑛+𝑚−𝑛 ·Z𝑚
Chapter 1. Introduction 37 We finally obtain that a 𝑞 -ary lattice in its Λ form is generated by a full-rank lower triangular matrix of dimension 𝑚 , and we can directly compute its determinant because it is the product of its diagonal, that is, det(Λ𝑞(𝑨)) =𝑞𝑚−𝑛.□ The fact that we have a deep understanding of this particular class of lattices makes them suitable for our purposes. For example, as we have mentioned, there are known results relating bounds for 𝜆1(ℒ) with det(ℒ) , and in this case we have seen that det(Λ𝑞(𝑨)) does only depend on the dimensions of 𝑨. 1.3.6 Lattice Problems and Cryptography Short Integer Solution Definition 1.27 (Short Integer Solution – SIS𝑛 𝑞 𝑚 𝛽 ).Let 𝑨∈Z𝑛×𝑚 𝑞 be a uniformly random matrix. The Short Integer Solution (SIS) problem consists on finding a non-zero vector 𝒙∈Z𝑚such that ∥𝒙∥≤𝛽and 𝑨𝒙 =0. Observe we can see this as finding short vectors in the lattice Λ⊥ 𝑞(𝑨T) . The problem is usually defined with the Euclidean norm ∥𝒙∥2 , but can also be defined with the infinity norm ∥𝒙∥∞ , possibly adapting the bound, provided these two norms are equivalent and ∥𝒙∥2≤√𝑚∥𝒙∥∞. We can also define an inhomogeneous version of the previous problem. Definition 1.28 (Inhomogeneous Short Integer Solution – ISIS𝑛 𝑞 𝑚 𝛽 ).Let 𝑨∈Z𝑛×𝑚 𝑞 be a uniformly random matrix and 𝒚∈Z𝑛 𝑞 a vector. The Inhomogeneous Short Integer Solution (ISIS) problem consists on finding a vector 𝒙∈Z𝑚 such that ∥𝒙∥≤𝛽 and 𝑨𝒙 =𝒚. Notice that finding two different solutions to the ISIS problem implies finding a solution to the SIS problem, satisfying a slightly larger bound, given by the difference of the solutions. The main point to remark about this problem is that there exists a reduction from any instance of the approximated SVP on any lattice ℒ ⊆ R𝑛 to a random instance of the SIS problem on a Λ⊥ 𝑞(𝑨) lattice, as was proven by Ajtai in [ 4 ] for a specific polynomial approximation factor that has been later improved. This worse-case to average case reduction we already mentioned significantly simplifies the task of selecting secure public keys. Recall we classify an algorithm as efficient when we can bound the number of operations it takes until finishing with a polynomial evaluated at the size of its input. Then, this bound is going to be determined by the running time of the worst-case
38 1.3. Lattices instance of each input size. The fact that we can not find any polynomial bound only means that some instances are going to be hard, but does not guarantee the hardness of the others, not even on average. Only the existence of a reduction from the worst case of another problem to a random instance of the one we use guarantees a hardness level on average (under the assumption that the original problem was hard on the worst-case, which is a much milder and reasonable assumption). Learning With Errors Definition 1.29 (Learning With Errors – LWE𝑛 𝑞 𝑚 𝜒).Let 𝑛,𝑞be integers (𝑞usually prime), 𝜒 a discrete probability distribution in Z (usually a discrete Gaussian distribution) and 𝒔a secret vector from Z𝑛 𝑞. We denote ℒ𝒔,𝜒 the probability distribution over Z𝑛 𝑞×Z𝑞 obtained by choosing 𝒂∈Z𝑛 𝑞 uniformly at random, choosing 𝑒←r𝜒 and considering it in Z𝑞 and finally calculating (𝒂, 𝑏 ≔⟨𝒂,𝒔⟩+𝑒)∈Z𝑛 𝑞×Z𝑞 . There are two variants of the Learning With Errors (LWE) problem. The Decisional Learning With Errors problem, Decisional- LWE𝑛 𝑞 𝜒 , consists on deciding if pairs (𝒂, 𝑏) are samples of ℒ𝒔,𝜒 or come from the uniform distribution of Z𝑛 𝑞×Z𝑞. The Search Learning With Errors problem, Search- LWE𝑛 𝑞 𝜒 , consists on recovering 𝒔from samples (𝒂, 𝑏)obtained from ℒ𝒔,𝜒. We generally consider a polynomial adversary has access to polynomially many samples. If we restrict the problem to a fixed number of samples 𝑚 we denote it as LWE𝑛 𝑞 𝑚 𝜒. This problem, introduced by Regev in [ 101 ], is again as hard as the approximated SVP [ 84 ], even if the secret 𝒔 is chosen component by component from the error distribution 𝜒 [ 103 ]. Some of these reductions involve continuous error terms over the reals, and not discrete Gaussians. We encourage any reader interested in the non-trivial relations among the LWE variants when defined with continuous, rounded or discrete Gaussians, to read the interesting discussions from [95, 59]. It is clear that we can reduce the decisional version to the search version. It is also possible to reduce the search version to the decisional version [101, 94]. We can observe the direct relation of these problems with lattices. Considering 𝑚 samples from ℒ𝒔,𝜒 we can stack vectors 𝒂T 𝑖 as rows in a matrix 𝑨 and the problem can be defined as solving a linear system of equations with noise (𝑨,𝑨𝒔 +𝒆) . If we see 𝑨 as a matrix that defines Λ𝑞(𝑨) then the search-LWE problem becomes recovering the coordinates of a lattice point in its Λ𝑞 form after adding some error 𝒆 , while the decisional-LWE problem is to distinguish uniformly random points in Z𝑚
Chapter 1. Introduction 39 from perturbed lattice points. Cryptographic Applications As a first example we can see how a good basis with short vectors allows us to build a trapdoor function. Let 𝑨∈Z𝑚×𝑛 𝑞 be a random matrix and 𝑻∈Z𝑚×𝑚 a full rank matrix such that all columns of 𝑻 have a small norm and 𝑨T𝑻=0 . That is, 𝑻 is a good basis of Λ⊥(𝑨). Notice that we require 𝑻 to be full-rank and at the same time we impose that 𝑨 belongs to the cokernel of 𝑻 , which seems contradictory. However, this second property works modulo 𝑞 , and the first condition we need is 𝑻 to be full-rank over the integers, where the lattice really lives. The matrix 𝑨 is public and everybody can compute LWE samples 𝒃=𝑨𝒔 + 𝒆mod 𝑞 with its own secret 𝒔 . The LWE hardness assumption tells us that in general it is difficult to recover 𝒔 . However, using the good basis we could compute 𝑻T𝒃=𝑻T𝑨𝒔 +𝑻T𝒆=𝑻T𝒆∈Z𝑚 𝑞. Usually we would be stuck here since we know that 𝑻 is invertible over the integers but not over Z𝑞 . However, if elements of 𝑻 and 𝒆 are small enough then the coefficients of 𝑻T𝒆∈Z𝑚 would be much smaller than 𝑞 , and therefore taking the representatives we obtain the equality 𝑻T𝒃rem 𝑞=𝑻T𝒆∈Z𝑚 over the integers. Once we have the equation over the integers we can invert 𝑻T , recover 𝒆 and finally solve the overdetermined system of equations 𝑨𝒔 =𝒃−𝒆mod 𝑞. It is possible to build more advanced public key cryptographic primitives using a good basis as a secret key, but we can also directly use the secret of the LWE problem as secret key. Proposition 1.30. The following folklore encryption scheme is secure under the assumption of the hardness of the decisional-LWE problem. • Gen: the generator algorithm takes as input the security parameter 1 𝜆 and defines the public parameters pp ≔(𝑛, 𝑞, 𝜒) . It then chooses a matrix 𝑨←rZ𝑛×𝑛 𝑞 , and small vectors 𝒔,𝒆←r𝜒𝑛 . The public key is pk ≔(𝑨,𝒚T≔𝒔T𝑨+𝒆T) and the secret key is sk ≔𝒔. (sk ≔𝒔,pk ≔(𝑨,𝒚T≔𝒔T𝑨+𝒆T);pp ≔(𝑛, 𝑞, 𝜒)) ←rGen(1𝜆) • Enc: in order to encrypt a single bit 𝑚∈ { 0 , 1 } we sample 𝒓,𝒙←r𝜒𝑛 , 𝑥′←r𝜒 and compute a vector of LWE samples 𝒂≔𝑨𝒓 +𝒙 and an integer that hides the secret message bit 𝑎≔𝒚T𝒓+𝑥′+𝑚⌊𝑞/2⌉rem 𝑞. 𝑐≔(𝒂≔𝑨𝒓 +𝒙, 𝑎 ≔𝒚T𝒓+𝑥′+𝑚⌊𝑞/2⌉rem 𝑞) ←rEnc(𝑚;(𝑨,𝒚T),pp)
40 1.3. Lattices • Dec: the decryption method recovers the message computing 𝑎−𝒔T𝒂rem 𝑞 , as it should be equal to 𝑚⌊𝑞/2⌉ plus some errors that only involve small elements. For that matter it outputs 0if the result is closer to 0or 1if it is closer to 𝑞/ 2(taking into account that we are working in Z𝑞). Dec((𝒂, 𝑎),𝒔;pp)= 0if 𝑎−𝒔T𝒂rem 𝑞<𝑞/4 1otherwise Since we are rounding elements from Z𝑞 to 0or 𝑞/ 2we denote this operation as ⌊·⌉𝑞/2 and write 𝑎−𝒔T𝒂𝑞/2←Dec((𝒂, 𝑎),𝒔;pp). Proof. Correctness follows if 𝜒 is bounded by a sufficiently small bound, since 𝑎−𝒔T𝒂=(𝒔T𝑨+𝒆T)𝒓+𝑥′+𝑚⌊𝑞/2⌉−𝒔T(𝑨𝒓 +𝒙)=𝒆T𝒓+𝑥′−𝒔T𝒙+𝑚⌊𝑞/2⌉≈𝑚⌊𝑞/2⌉ . If the bound only holds except with a negligible probability we would then obtain a scheme with correctness except with a negligible probability. Security as defined in Definition 1.5 follows from the LWE hardness assumption. We can prove it following the sequence of games approach, which we will further formalize in Section 1.4. We consider a sequence of games starting from the INDCPA challenge and slightly modify it in each step in a way that we can ensure the difference between the success probability of the adversary compared with success probability of a random guess is not significantly different among two consecutive games. We proceed this way until we end up with a game for which we can ensure any adversary has exactly the same success probability than a random guess. • Game 0: the adversary 𝒜 plays the IND-CPA game and tries to guess which message has been encrypted. We write every step of the encryption algorithm because we are going to later modify that part of the game. Pr 𝑏𝒜=𝑏 (𝒔,(𝑨,𝒚T);(𝑛, 𝑞, 𝜒)) ←rGen(1𝜆), (𝑚0, 𝑚1,aux) ←r𝒜1((𝑨,𝒚T),(𝑛, 𝑞, 𝜒),1𝜆), 𝑏←r{0,1}, 𝒓,𝒙←r𝜒𝑛, 𝑥′←r𝜒, 𝒂≔𝑨𝒓 +𝒙, 𝑎 ≔𝒚T𝒓+𝑥′+𝑚𝑏⌊𝑞/2⌉rem 𝑞, 𝑏𝒜←r𝒜2((𝒂, 𝑎),(𝑨,𝒚T),(𝑛, 𝑞, 𝜒),aux,1𝜆) • Game 1: we substitute the public key by a fake one that is just a uniformly sampled matrix and vector pair (𝑨,𝒚T) ←rZ𝑛×𝑛 𝑞×Z𝑛 𝑞 . Let g Gen be a new generator algorithm that executes the original Gen and just outputs the public
Chapter 1. Introduction 41 parameters. Pr 𝑏𝒜=𝑏 (𝑛, 𝑞, 𝜒) ←rg Gen(1𝜆),(𝑨,𝒚T) ←rZ𝑛×𝑛 𝑞×Z𝑛 𝑞, (𝑚0, 𝑚1,aux) ←r𝒜1((𝑨,𝒚T),(𝑛, 𝑞, 𝜒),1𝜆), 𝑏←r{0,1}, 𝒓,𝒙←r𝜒𝑛, 𝑥′←r𝜒, 𝒂≔𝑨𝒓 +𝒙, 𝑎 ≔𝒚T𝒓+𝑥′+𝑚𝑏⌊𝑞/2⌉rem 𝑞, 𝑏𝒜←r𝒜2((𝒂, 𝑎),(𝑨,𝒚T),(𝑛, 𝑞, 𝜒),aux,1𝜆) The success probability of the adversary in game 1 is at negligible distance from the success probability of the adversary in game 0. Otherwise, we could use it to break the decisional LWE assumption for 𝑛 samples, as this adversary would correctly guess 𝑏 with a significantly different probability when (𝑨T,𝒚) comes from a LWE distribution or when both elements are uniformly and independently distributed, and we could use it to distinguish the two scenarios with a probability greater than a random guess by a non-negligible amount. • Game 2: the adversary 𝒜 receives both a fake public key (𝑨,𝒚T) ←rZ𝑛×𝑛 𝑞×Z𝑛 𝑞 and a partially fake encryption (𝒂, 𝑎) , where 𝒂←rZ𝑛 𝑞 and 𝑎≔𝑎′+𝑚⌊𝑞/2⌉ rem 𝑞with 𝑎′←rZ𝑞. Pr 𝑏𝒜=𝑏 (𝑛, 𝑞, 𝜒) ←rg Gen(1𝜆),(𝑨,𝒚T) ←rZ𝑛×𝑛 𝑞×Z𝑛 𝑞, (𝑚0, 𝑚1,aux) ←r𝒜1((𝑨,𝒚T),(𝑛, 𝑞, 𝜒),1𝜆), 𝑏←r{0,1}, 𝒂←rZ𝑛 𝑞, 𝑎′←rZ𝑞, 𝑎≔𝑎′+𝑚𝑏⌊𝑞/2⌉mod 𝑞, 𝑏𝒜←r𝒜2((𝒂, 𝑎),(𝑨,𝒚T),(𝑛, 𝑞, 𝜒),aux,1𝜆) Notice that in game 2 the vector 𝒚 was already uniformly random, so the element that plays the role of the encryption, 𝑨 𝒚T!𝒓+ 𝒙 𝑥′!+ 0 𝑚𝑏⌊𝑞/2⌉!rem 𝑞, was constructed from 𝑛+ 1LWE samples, while in game 3 it involves a uniformly random vector from Z𝑛+1, 𝒂 𝑎′!+ 0 𝑚𝑏⌊𝑞/2⌉!rem 𝑞. Analogously as before, under the assumption that the LWE problem with 𝑛+ 1
42 1.3. Lattices samples is hard, the difference between the success probability in games 2 and 3 is negligible. • Game 3: the adversary 𝒜 receives a fake (𝑨,𝒚) ←rZ𝑛×𝑛 𝑞×Z𝑛 𝑞 and a completely random fake encryption (𝒂, 𝑎) ←rZ𝑛 𝑞×Z𝑞. Pr 𝑏𝒜=𝑏 (𝑛, 𝑞, 𝜒) ←rg Gen(1𝜆),(𝑨,𝒚T) ←rZ𝑛×𝑛 𝑞×Z𝑛 𝑞, (𝑚0, 𝑚1,aux) ←r𝒜1((𝑨,𝒚T),(𝑛, 𝑞, 𝜒),1𝜆), 𝑏←r{0,1}, 𝒂←rZ𝑛 𝑞, 𝑎 ←rZ𝑞, 𝑏𝒜←r𝒜2((𝒂, 𝑎),(𝑨,𝒚T),(𝑛, 𝑞, 𝜒),aux,1𝜆) It is immediate to check that the success probability of the adversary is the same in games 2 and 3 since anything plus a uniformly random distribution follows a uniformly random distribution, and therefore the adversary obtains the same information. Since, except for a negligible difference, the adversary has the same advantage on game 0 than on game 3, where the inputs they get are completely independent of 𝑏 , we can conclude that the presented encryption scheme has semantic security, that is, is IND-CPA secure, as long as the Gen algorithm outputs parameters that make the LWE problem hard. □ 1.3.7 Ideal Lattices The main downside of the LWE problem is that matrix 𝑨 has a size quadratic in the dimension 𝑛 , and this yields to a high communication cost for parameters that make the problem difficult enough. The good news is that this cost can be reduced to something linear in 𝑛if we restrict ourselves to a particular class of lattices. Fixed a vector 𝒇=(𝑓0, . . . , 𝑓𝑛−1)T∈Z𝑛 we define the transformation matrix 𝑭 as 0··· 0−𝑓0 ...−𝑓1 Id𝑛−1. . . ...−𝑓𝑛−1 . Definition 1.31 (Ideal Lattice).An ideal lattice is a lattice ℒ(𝑨) generated by a block matrix 𝑨=𝑨(1). . .𝑨(𝑚) whose blocks 𝑨(𝑖) are constructed from a vector 𝒂(𝑖)∈Z𝑛
Chapter 1. Introduction 43 and a transformation matrix 𝑭in the following way. 𝑨(𝑖)=h𝒂(𝑖),𝑭𝒂(𝑖), . . . , 𝑭𝑛−1𝒂(𝑖)i. These lattices are called ideal lattices as they can be seen as principal ideals in the polynomial ring 𝑅=Z[𝑥]/⟨𝑓(𝑥)⟩ , where 𝑓(𝑥)=𝑥𝑛+𝑓𝑛−1𝑥𝑛−1+···+ 𝑓0∈Z[𝑥] is the monic polynomial given by the vector of the transformation matrix. As we said, we identify any other vector 𝒗=(𝑣1, 𝑣2, . . . , 𝑣𝑛)∈Z𝑛 with a polynomial 𝑣=𝑣1+𝑣2𝑥+ ··· + 𝑣𝑛𝑥𝑛−1∈𝑅 . It can be easily checked that, by construction, multiplying two polynomials 𝑎 and 𝑏 in the ring 𝑅 is equivalent to multiply the matrix 𝑨 constructed from the vector 𝒂 with the vector 𝒃 . Then, vectors {𝒗|𝒗=𝑨𝒃} are, when considered as polynomials, elements of the principal ideal ⟨𝑎⟩⊂𝑅. We choose 𝑓 to be (1,0, . . . , 0) , so that 𝑓(𝑥)=𝑥𝑛+ 1, with 𝑛 a power of 2, and work with the 𝑞 -ary lattices 𝑅𝑞=Z𝑞[𝑥]/⟨𝑥𝑛+1⟩ , as it gives us nice security reductions [84]. Using this particular polynomial each block of the matrix 𝑨 is an anti-cyclic integer matrix. 𝑨(𝑖)=©« 𝑎1−𝑎𝑛−𝑎𝑛−1··· −𝑎2 𝑎2𝑎1−𝑎𝑛··· −𝑎3 𝑎3𝑎2𝑎1··· −𝑎4 . . .. . .. . ..... . . 𝑎𝑛𝑎𝑛−1𝑎𝑛−2··· 𝑎1 ª®®®®®®®¬ . No algorithm is known to be able to take significant advantage of the structure in ideal lattices of this family to efficiently solve the problems presented before when restricted to their ideal cases [84]. Ring Short Integer Solution Definition 1.32 (Ring Short Integer Solution – Ring9SIS𝑛 𝑞 𝑚 𝛽 ).Let 𝒂=(𝑎1, . . . , 𝑎𝑚) ∈ 𝑅𝑚 𝑞 be a uniformly random vector of polynomials. The Ring Short Integer Solution (Ring-SIS) problem consists on finding a short not-zero vector of polynomials 𝒆=(𝑒1, . . . , 𝑒𝑚) ∈ 𝑅𝑚 𝑞such that ∥𝒆∥≤𝛽and ⟨𝒂,𝒆⟩=Í𝑚 𝑖=1𝑎𝑖𝑒𝑖=0. Definition 1.33 (Ring Inhomogeneous Short Integer Solution – Ring9ISIS𝑛 𝑞 𝑚 𝛽 ).Let 𝒂=(𝑎1, . . . , 𝑎𝑚) ∈ 𝑅𝑚 𝑞 be a uniformly random vector of polynomials and 𝑦∈𝑅𝑞 . The Ring Inhomogeneous Short Integer Solution (Ring-ISIS) problem consists on finding a short not-zero vector of polynomials 𝒆=(𝑒1, . . . , 𝑒𝑚) ∈ 𝑅𝑚 𝑞 such that ∥𝒆∥≤𝛽 and ⟨𝒂,𝒆⟩=Í𝑚 𝑖=1𝑎𝑖𝑒𝑖=𝑦.
44 1.3. Lattices There are again efficient reductions from the ideal version of the SVP to Ring- SIS [97]. Ring Learning With Errors The LWE problem can also be particularized to a ring version, called Ring Learning With Errors (RLWE) [84]. Definition 1.34 (Ring Learning With Errors – RLWE𝑛 𝑞 𝑚 𝜒 ).Let 𝑛 , 𝑞 be integers ( 𝑞 usually prime), 𝜒 a discrete probability distribution in 𝑅=Z[𝑥]/⟨𝑥𝑛+1⟩ (usually a discrete Gaussian distribution) and 𝑠a secret polynomial from 𝑅𝑞. The RLWE distribution ℛ𝑠,𝜒 over 𝑅𝑞×𝑅𝑞 is sampled choosing 𝑎←r𝑅𝑞 uniformly at random, a small error term 𝑒←r𝜒 from the noise distribution, and outputting the pair of polynomials (𝑎, 𝑏 ≔𝑎·𝑠+𝑒) ∈ 𝑅𝑞×𝑅𝑞. Analogously to LWE, the goal of the decisional-RLWE problem will be to distinguish random linear equations, perturbed by a small amount of noise {(𝑎𝑖, 𝑎𝑖·𝑠+ 𝑒𝑖)} ←rℛ𝑠,𝜒 , from truly uniform pairs {(𝑎𝑖, 𝑢𝑖)} ←r𝑅𝑞×𝑅𝑞 . The goal of the search- RLWE problem will be to recover the secret 𝑠∈𝑅𝑞 from arbitrarily (or depending on the version polynomially or finitely) many noisy products {(𝑎𝑖, 𝑎𝑖·𝑠+𝑒𝑖)} ←rℛ𝑠,𝜒 . If the number of available samples is limited to 𝑚 we denote the problem as RLWEn qm 𝜒 . Usually the error distribution 𝜒 is a discrete Gaussian distribution on Z𝑛 , that is 𝜒=𝐷𝑛 𝜎 , for a given parameter 𝜎 (recall we identify vectors with polynomials, so 𝑒∈𝑅𝑞 sampled from 𝐷𝑛 𝜎 would just mean that we have its coefficients independently sampled from a discrete Gaussian 𝐷𝜎and then considered modulo 𝑞). Certain instantiations of RLWE are supported by worst-case hardness theorems [ 83 ], related to the ideal version of the SVP. Taking as error distribution a Gaussian with parameter 𝜎≥𝜔(plog 𝑛) , and for any ring, there exist a quantum reduction from the 𝛾(𝑛) -SVP to the RLWE problem to within 𝛾(𝑛)=O√𝑛·𝑞/𝜎 . Additionally, the RLWE problem becomes no easier to solve even if the secret 𝑠 is chosen from the error distribution, rather than uniformly [83]. Additional variants of the LWE exist, as the Module Learning With Errors (MLWE) problem, where the LWE problem is generalized over modules (problems are described using matrices whose elements are polynomials), showed to be polynomially equivalent to the RLWE problem in [7]. Cryptographic Applications of Ideal Lattices Proposition 1.35. Lyubashevsky, Peikert and Regev proposed in [ 84 ] the following encryption scheme based on the hardness of the RLWE problem.
Chapter 1. Introduction 45 • Gen: the key generator algorithm takes the security parameter 1 𝜆 as input and outputs as public parameters a prime 𝑞 , a power of two 𝑛 and a parameter 𝜎 so that the RLWE𝑛 𝑞 𝐷𝑛 𝜎 problem is hard enough and errors are small with sufficient probability. Then a RLWE sample is defined as a public key, with 𝑎←r𝑅𝑞 obtained uniformly at random, 𝑠, 𝑒 ←r𝐷𝑛 𝜎 small elements obtained from the error distribution and 𝑏 computed as 𝑏≔𝑎·𝑠+𝑒. The secret key is therefore the secret 𝑠. (sk ≔𝑠, pk ≔(𝑎, 𝑏 ≔𝑎·𝑠+𝑒);pp ≔(𝑛, 𝑞, 𝜎)) ←rGen(1𝜆) • Enc: the encryption algorithm takes as input a message 𝑚∈{0,1}𝑛 encoded as a polynomial in 𝑅𝑞 with 0or 1coefficients, a public key (𝑎, 𝑏) , and the public parameters pp . It chooses small random elements 𝑟, 𝑒𝑢, 𝑒𝑣←r𝐷𝑛 𝜎 and computes the ciphertext as two polynomials following the structure of RLWE samples, adding the escalated message to the second one, (𝑢, 𝑣)≔(𝑎·𝑟+𝑒𝑢, 𝑏 ·𝑟+𝑒𝑣+⌊𝑞/2⌉𝑚) ∈ 𝑅𝑞×𝑅𝑞. (𝑢≔𝑎·𝑟+𝑒𝑢, 𝑣 ≔𝑏·𝑟+𝑒𝑣+⌊𝑞/2⌉𝑚) ←rEnc(𝑚;(𝑎, 𝑏),pp) • Dec: the decryption algorithm takes as input a ciphertext (𝑢, 𝑣) and uses the secret key 𝑠 to compute a noisy message 𝑣−𝑠·𝑢 that can then be rounded to the original message. ⌊𝑣−𝑠·𝑢⌉𝑞/2←Dec((𝑢, 𝑣), 𝑠;pp) The above cryptosystem is IND-CPA secure assuming the hardness of the decisional- RLWE problem. Proof. Correctness comes from the fact that 𝑎 and 𝑏 are not random independent polynomials, which would make 𝑎·𝑟+𝑒𝑢 and 𝑏·𝑟+𝑒𝑣 two samples from ℛ𝑟,𝐷𝑛 𝜎 and the message irrecoverable. Provided that (𝑎, 𝑏) is a RLWE sample and the secret is the secret key we can remove the polynomials masking the message, except for some small error terms. 𝑣−𝑠·𝑢=𝑏·𝑟+𝑒𝑣+j𝑞 2m𝑚−𝑠(𝑎·𝑟+𝑒𝑢) =𝑠·𝑎·𝑟+𝑒·𝑟+𝑒𝑣+j𝑞 2m𝑚−𝑠·𝑎·𝑟−𝑠·𝑒𝑢 =𝑒·𝑟+𝑒𝑣−𝑠·𝑒𝑢+j𝑞 2m𝑚 ≈j𝑞 2m𝑚. If 𝜎 is small enough that ∥𝑒·𝑟+𝑒𝑣−𝑠·𝑒𝑢∥∞<𝑞/4 , except with negligible probability, when we round we recover the original message, again except with
52 1.3. Lattices Protocol 1.3 Stern’s protocol 𝒫(𝑯,𝒚;𝒆)𝒱(𝑯,𝒚) 1: 𝜋←r𝔖𝑛,𝒙←rF𝑛 2 2: (𝑐1, 𝑜1) ←rCom𝜋,𝑯𝒙 3: (𝑐2, 𝑜2) ←rCom𝜋(𝒙) 4: (𝑐3, 𝑜3) ←rCom𝜋(𝒙+𝒆)𝑐1,𝑐2,𝑐3 −−−−−−−−−−−→ 5: 𝑏←r{0,1,2} 𝑏 ←−−−−−−−−−−− 6: if 𝑏=0then 7: e 𝜋=𝜋 8: e𝒙=𝜋(𝒙) 9: e𝑜1=𝑜1,e𝑜2=𝑜2 10: ans =(e 𝜋,e𝒙,e𝑜1,e𝑜2) 11: end if 12: if 𝑏=1then 13: e 𝜋=𝜋 14: e𝒛=𝜋(𝒙+𝒆) 15: e𝑜1=𝑜1,e𝑜3=𝑜3 16: ans =(e 𝜋,e𝒛,e𝑜1,e𝑜3) 17: end if 18: if 𝑏=2then 19: e𝒙=𝜋(𝒙) 20: e𝒛=𝜋(𝒙+𝒆) 21: e𝑜2=𝑜2,e𝑜3=𝑜3 22: ans =(e𝒙,e𝒛,e𝑜2,e𝑜3) 23: end if ans −−−−−−−−−−−→ 24: if 𝑏=0then 25: ? Ver𝑐1,(e 𝜋,𝑯e 𝜋−1(e𝒙)),e𝑜1 26: ? Ver𝑐2,e𝒙,e𝑜2 27: end if 28: if 𝑏=1then 29: ? Ver𝑐1,(e 𝜋,𝑯e 𝜋−1(e𝒛)−𝒚),e𝑜1 30: ? Ver𝑐3,e𝒛,e𝑜3 31: end if 32: if 𝑏=2then 33: ? Ver𝑐2,e𝒙,e𝑜2 34: ? Ver𝑐3,e𝒛,e𝑜3 35: ∥e𝒛−e𝒙∥H ? =𝑤 36: end if
Chapter 1. Introduction 53 We can see how the commitments could be computed in each case following this strategy. (a) & (b) Obtainb𝒆∈F𝑛 2such that 𝑯b𝒆=𝒚,𝒙←rF𝑛 2and 𝜋←r𝔖𝑛, then 𝑐1←rCom(𝜋,𝑯𝒙), 𝑐2←rCom(𝜋(𝒙)), 𝑐3←rCom(𝜋(𝒙+b𝒆)). (a) & (c) Obtain b𝒆←r𝒛∈F𝑛 2∥𝒛∥H=𝑤,𝒙←rF𝑛 2and 𝜋←r𝔖𝑛, then 𝑐1←rCom(𝜋,𝑯𝒙), 𝑐2←rCom(𝜋(𝒙)), 𝑐3←rCom(𝜋(𝒙+b𝒆)). (b) & (c) Obtainb𝒆←r𝒛∈F𝑛 2∥𝒛∥H=𝑤,𝒙←rF𝑛 2and 𝜋←r𝔖𝑛, then 𝑐1←rCom(𝜋,𝑯(𝒙+b𝒆)−𝒚), 𝑐2←rCom(𝜋(𝒙)), 𝑐3←rCom(𝜋(𝒙+b𝒆)). We know each of the three properties can be verified opening two commitments, but for every pair of properties we have shown a strategy that would allow a malicious prover to open these two pairs of commitments verifying the relations (it would fail for the remaining pair of commitments related to the third condition). This means there are adversaries with at least 2/3 cheating probability. We can however prove this is the maximum success probability of a malicious adversary via a generalization of the previously mentioned special soundness. The 𝑘 -Special Soundness property means that a prover able to answer 𝑘 challenges is honest, as in this case a witness could be extracted. This particular protocol is 3-special sound because from answers to all the challenges we could directly reconstruct the witness, as properties (a), (b) and (c) specifically characterize a witness and the response to each challenge verifies one of them (and the binding property of the commitment used ensures that the opened elements for each of the challenges are the same). It is not 2-special sound because we already know that a malicious prover can perfectly prepare its initial messages to correctly answer (any) two challenges. It can be seen that a 3-special sound protocol with 3challenges is sound with a soundness error of 2/3 . To convince the verifier of the fact that the prover is not cheating, the same protocol can be repeated as many times as the verifier considers. We are going to present more detailed and formal arguments of this kind of soundness notion in Chapter 3 where we are introducing yet another soundness definition that generalizes the concept of 𝑘 -special soundness for ( 2 𝜇+ 1 ) -moves interactive protocols. Many ideas have been later proposed to adapt this scheme to different purposes, either a dual version with the generator matrix of the code, more efficient schemes with a particular subset of codes, 𝑞 -ary codes and lattices. As we present a further improvement of the existing techniques in Chapter 3 we then devote Section 3.2 in its entirety to detail the variants from which we specifically benefit.
54 1.4. Probability Preliminaries 1.4 Probability Preliminaries We have already mentioned in Section 1.2 the main strategies to prove a scheme is secure, identifying the event that we want to avoid and ensuring the success probability of any PPT adversary is as small as we want. If we are only interested in proving security asymptotically we can disregard constant factors from the definitions, but given that we wouldx like to faithfully compare our proposals with other schemes we need to take these details into account. For that reason we formalize here all the definitions and strategies that allow us to ensure the security of our schemes, using statistical properties or computational assumptions. 1.4.1 The Advantage of an Adversary We have previously mentioned the concept of advantage of an adversary, measuring the event that we want to avoid. For example, the advantage could just be the probability of the undesired event. Definition 1.41 (𝐴𝑑𝑣𝐾𝑅). The advantage of an adversary 𝒜in a key recovery attack is defined as follows. 𝐴𝑑𝑣𝐾𝑅(𝒜) ≔Pr hsk =sk𝒜(sk,pk;pp) ←rGen(1𝜆),sk𝒜←r𝒜(pk,pp,1𝜆)i. In other occasions the advantage is not defined as the probability of some event, because we are interested in the difference of the probabilities of two alternative scenarios. That is what happens with the indistinguishability games we use to prove that an encryption scheme is IND-CPA, a commitment is hiding or a ZKPoK is zero-knowledge. The natural way of defining these properties is ensuring that the adversary has a success probability that is not significantly better than a purely random guess that succeeds with probability 1/2 . We bound this distance to 1/2 in absolute value because an adversary that almost always chooses the wrong answer can be used to break the security, as we would only need to define another adversary that simply does the contrary. 1.4.2 Advantage in an Indistinguishability Game We have already mentioned all these indistinguishability properties, but we can properly name the advantages here to see that all of them follow the same approach. Recall that whenever we allow the adversary to define the two scenarios they would later try to distinguish we divide it into two algorithms (𝒜1,𝒜2) , so that the
Chapter 1. Introduction 55 first sets the information that determines the scenarios and the second outputs the bit with their guess (modeling with an auxiliary variable aux all the information the adversary might have precomputed in the first phase). Definition 1.42 ( 𝐴𝑑𝑣IND−CPA ).Advantage of (𝒜1,𝒜2) in an IND-CPA attack against an encryption scheme, compared with a random guess. 𝐴𝑑𝑣IND−CPA(𝒜) ≔ Pr 𝑏𝒜=𝑏 (sk,pk;pp) ←rGen(1𝜆), (𝑚0, 𝑚1,aux) ←r𝒜1(pk,pp,1𝜆), 𝑏←r{0,1}, 𝑐←rEnc(𝑚𝑏;pk,pp), 𝑏𝒜←r𝒜2(𝑐, pk,pp,aux,1𝜆) −1/2 . The same kind of advantage can be defined for commitment schemes. Definition 1.43 ( 𝐴𝑑𝑣Com ).Advantage of (𝒜1,𝒜2) in an attack against the computational hiding property of a commitment scheme, compared with a random guess. 𝐴𝑑𝑣Com(𝒜) ≔ Pr 𝑏𝒜=𝑏 (pk;pp) ←rGen(1𝜆), (𝑚0, 𝑚1,aux) ←r𝒜1(pk,pp,1𝜆), 𝑏←r{0,1}, (𝑐, 𝑜) ←rCom(𝑚𝑏;pk,pp), 𝑏𝒜←r𝒜2(𝑐, pk,pp,aux,1𝜆) −1/2 . And also for the zero-knowledge property of a ZKPoK. Consider in this case a challenger Cha that has oracle access to the prover 𝒫 , the verifier 𝒱 and the simulator 𝒮 , and computes both a real transcript tr0 executing the protocol with 𝒫 and 𝒱 and a simulated transcript tr1 with 𝒮 . As usual all public information is going to be contained in our model in some public parameters pp outputted by a generator Gen that would define the statement 𝑥 . Additionally, the generator also outputs the witness 𝑤we are going to use for the studied ZKPoK. Definition 1.44 ( 𝐴𝑑𝑣ZK ).Advantage of an adversary (𝒜1,𝒜2) in an attack against the Zero-Knowledge property of a ZKPoK, compared with a random guess. 𝐴𝑑𝑣ZK(𝒜) ≔ Pr 𝑏𝒜=𝑏 (pp, 𝑤) ←rGen(1𝜆), tr0←rCha𝒫,𝒱(pp, 𝑤), tr1←rCha𝒮(pp), 𝑏←r{0,1}, 𝑏𝒜←r𝒜(tr𝑏,pp,1𝜆) −1/2 .
56 1.4. Probability Preliminaries Generic Indistinguishability Game In order to simplify the analysis and to be able to prove general propositions that we could latter use with the previous definitions we define an additional generic indistinguishability game, where all the relevant information is generated by a generator Gen that outputs the public parameters pp . From this point let as also assume that 1 𝜆 is always part of the public parameters 𝑝𝑝 , this way we can keep formalities without adding it as supplementary input to every adversary. The goal of the adversary 𝒜 (to simplify the proofs we now consider a single algorithm, but we keepin mindthe possibilityof allowing the adversary toparticipate defining the game) is then to distinguish between two challengers, Cha0 and Cha1 . One of the challengers is selected at random and produces a challenge 𝑐 that 𝒜 analyzes to try to determine if it was produced by Cha0or Cha1. Definition 1.45 ( 𝐴𝑑𝑣IND ).Advantage of (𝒜) in a generic indistinguishability game, compared with a random guess. 𝐴𝑑𝑣IND(Cha0,Cha1)(𝒜) ≔ Pr 𝑏𝒜=𝑏 pp ←rGen(1𝜆), 𝑏←r{0,1}, 𝑐←rCha𝑏(pp), 𝑏𝒜←r𝒜(𝑐, pp) −1/2 . Alternatively, we can also deal with the indistinguishability of two scenarios if we ensure that the output of any adversary is essentially the same in both of them. We can formalize this idea asking the adversary to output a bit 𝑏𝒜∈ { 0 , 1 } and comparing the probability of 𝑏𝒜=1in both cases. Definition 1.46 ( Adv′ IND ).Alternative definition of the advantage of an adversary 𝒜 in a generic indistinguishability game, comparing both scenarios. Adv′ IND(Cha0,Cha1) (𝒜) ≔Pr 𝑏𝒜=1 pp ←rGen(1𝜆), 𝑐←rCha0(pp), 𝑏𝒜←r𝒜(𝑐, pp)−Pr 𝑏𝒜=1 pp ←rGen(1𝜆), 𝑐←rCha1(pp), 𝑏𝒜←r𝒜(𝑐, pp). This definition also captures the notion of advantage against indistinguishability, because we understand that an adversary is able to distinguish between the two scenarios if the probability distribution of its output depends on the scenario. We measure this dependency as the difference of probabilities for outputting 1, but notice it is also the difference of probabilities of outputting 0. Both Definitions 1.45 and 1.46 are useful, as there are propositions more naturally defined with each of them. We can always choose which to use because they are equivalent except for a constant, in this case Adv′ IND =2AdvIND.
Chapter 1. Introduction 57 Lemma 1.47 ( Adv′ IND = 2 AdvIND ).Thealternativedefinitionof theindistinguishability advantage Adv′ IND(Cha0,Cha1)is exactly twice the original advantage 𝐴𝑑𝑣IND(Cha0,Cha1). Adv′ IND(Cha0,Cha1) (𝒜) =2·Adv IND(Cha0,Cha1) (𝒜) Proof. We can directly prove AdvIND =1/2Adv′ IND using the law of total probability applied to 𝑏, knowing that it would be 0or 1with probability 1/2. Pr 𝑏𝒜=𝑏 pp ←rGen(1𝜆), 𝑏←r{0,1}, 𝑐←rCha𝑏(pp), 𝑏𝒜←r𝒜(𝑐, pp) = =1 2Pr 𝑏𝒜=0 pp ←rGen(1𝜆), 𝑐←rCha0(pp), 𝑏𝒜←r𝒜(𝑐, pp)+1 2Pr 𝑏𝒜=1 pp ←rGen(1𝜆), 𝑐←rCha1(pp), 𝑏𝒜←r𝒜(𝑐, pp) =1 2©« 1−Pr 𝑏𝒜=1 pp ←rGen(1𝜆), 𝑐←rCha0(pp), 𝑏𝒜←r𝒜(𝑐, pp)ª®®¬+1 2Pr 𝑏𝒜=1 pp ←rGen(1𝜆), 𝑐←rCha1(pp), 𝑏𝒜←r𝒜(𝑐, pp) =1 2+1 2©« Pr 𝑏𝒜=1 pp ←rGen(1𝜆), 𝑐←rCha1(pp), 𝑏𝒜←r𝒜(𝑐, pp)−Pr 𝑏𝒜=1 pp ←rGen(1𝜆), 𝑐←rCha0(pp), 𝑏𝒜←r𝒜(𝑐, pp)ª®®¬ From which we can immediately deduce what we wanted subtracting 1/2 on both sides and taking the absolute value. Adv IND(Cha0,Cha1) (𝒜) =1 2Adv′ IND(Cha0,Cha1) (𝒜) □ Computational Indistinguishability Game The most usual strategy is to relate these probabilities (via reductions or sequences of games) with a probability that (possibly under certain assumptions) is negligible in the security parameter. It might be the case that we precisely assume it is computationally hard to distinguish the distributions (pp, 𝑐0) and (pp, 𝑐1) , where 𝑐𝑏←rCha𝑏 is the output of the challenger in the 𝑏 case. For example the decisional RLWE𝑛 𝑞 𝑚 𝜒 assumption
58 1.4. Probability Preliminaries means precisely that the advantage of any PPT adversary is negligible in the security parameter in a game where 𝑐0←rℛ𝑚 𝑠,𝜒 and 𝑐1←r𝒰 , where 𝒰 is the uniform distribution in the appropriate space (𝑅𝑚 𝑞)2. Using the language of advantages of adversaries we can reformulate the decisional-RLWE assumption. Let pp be the public parameters that contain all the information regarding the specifications of the ring, the number of samples, the secret element and noise distribution. We denote the dependence of the distributions on these parameters as ℛpp and 𝒰pp. Definition 1.48 (Adv′ RLWE). Advantage of an adversary 𝒜against the decisional-RLWE problem. Adv′ RLWE(𝒜) ≔Pr 𝑏𝒜=1 pp ←rGen(1𝜆), 𝑟←rℛpp, 𝑏𝒜←r𝒜(𝑟, pp)−Pr 𝑏𝒜=1 pp ←rGen(1𝜆), 𝑟←r𝒰pp, 𝑏𝒜←r𝒜(𝑟, pp). Sometimes the reduction we need involves two similar games but with a different nature. That is the case of the IND-CPA property of encryption schemes and the hiding property of commitment schemes, that reflect the inability of efficient adversaries for extracting any information about the messages from its impotence distinguishing two encryptions or commitments to two messages (even if the messages have been chosen by themselves), as it has been described in Definitions 1.42 and 1.43. The most common strategy in lattice-based cryptography is to mask the message with a LWE/RLWE/MLWE sample. Without entering into details about how the message is encoded for each application we can define an example abusing notation and letting 𝑐≔𝑚+𝑟 , with 𝑟←rℛpp , be the output of some general primitive Alg that we want to either prove IND-CPA secure or hiding. Security for this simplified scheme would be based on the pseudorandomness of RLWE samples (in the encryption scheme we have already mentioned in Section 1.3 that this is used two consecutive times, but, for example, the commitment scheme [ 19 ] directly follows the idea behind this simplified example). Proposition 1.49 (Reduction to the advantage of decisional-RLWE).The advantage against the indistinguishability of the previously defined example, compared with a random guess, is bounded by the advantage of a similarly powerful adversary against the decisional- RLWE, comparing the two scenarios. 𝐴𝑑𝑣Alg(𝒜) ≤ max ℬAdv′ RLWE(ℬ).
Chapter 1. Introduction 59 Proof. We can prove it just manipulating the absolute values and the probabilities. 𝐴𝑑𝑣Alg(𝒜) = = Pr 𝑏𝒜=𝑏 pp ←rGen(1𝜆), 𝑚0, 𝑚1, aux !←r𝒜1(pp), 𝑏←r{0,1}, 𝑟←rℛpp, 𝑐 ≔𝑚𝑏+𝑟, 𝑏𝒜←r𝒜2(𝑐, aux,pp) −1/2 We can subtract and add the probability of guessing the scenario when 𝑟←r𝒰pp , and then apply the triangular inequality. ≤ Pr 𝑏𝒜=𝑏 pp ←rGen(1𝜆), 𝑚0, 𝑚1, aux !←r𝒜1(pp), 𝑏←r{0,1}, 𝑟←rℛpp, 𝑐 ≔𝑚𝑏+𝑟, 𝑏𝒜←r𝒜2(𝑐, aux,pp) −Pr 𝑏𝒜=𝑏 pp ←rGen(1𝜆), 𝑚0, 𝑚1, aux !←r𝒜1(pp), 𝑏←r{0,1}, 𝑟←r𝒰pp, 𝑐 ≔𝑚𝑏+𝑟, 𝑏𝒜←r𝒜2(𝑐, aux,pp) + Pr 𝑏𝒜=𝑏 pp ←rGen(1𝜆), 𝑚0, 𝑚1, aux !←r𝒜1(pp), 𝑏←r{0,1}, 𝑟←r𝒰pp, 𝑐 ≔𝑚𝑏+𝑟, 𝑏𝒜←r𝒜2(𝑐, aux,pp) −1/2 Then we introduce a new adversary ℬ against the decisional-RLWE game. This adversary, on input 𝑟 , gets 𝑚0, 𝑚1,aux from 𝒜1 , adds 𝑚𝑏+𝑟 , for a uniformly sampled 𝑏←r{ 0 , 1 } , computes 𝑏𝒜←r𝒜2(𝑚𝑏+𝑟, aux) and returns 𝑏ℬ= 1if 𝑏=𝑏𝒜 or 𝑏ℬ= 0 otherwise. The first term is precisely the advantage of this adversary against the decisional-RLWE problem comparing both scenarios. We can also ensure the second item is 0because aux and 𝑐 are independent of 𝑏 given that 𝑟is uniformly random, so the probability of 𝑏𝒜=𝑏is exactly 1/2. =Pr 𝑏ℬ=1 pp ←rGen(1𝜆), 𝑟←rℛpp, 𝑏ℬ←rℬ(𝑟, pp)−Pr 𝑏ℬ=1 pp ←rGen(1𝜆), 𝑟←r𝒰pp, 𝑏ℬ←rℬ(𝑟, pp)+0 =Adv′ RLWE(ℬ) □
60 1.4. Probability Preliminaries It should be noted that 𝒜 and ℬ are adversaries playing different games, and their running times are not exactly the same. That would be irrelevant for an asymptotic proof, as the reduction is polynomial, but if we wanted to bound the advantage of any adversary that is guaranteed to end in a specific time 𝑡 then we would get that for any 𝒜 with running time bounded by this 𝑡 there is an adversary ℬwith running time 𝑡′for which max ∥𝒜∥≤𝑡𝐴𝑑𝑣Alg(𝒜)≤2 max ∥ℬ∥≤𝑡′{𝐴𝑑𝑣RLWE(ℬ)}, where 𝑡′ is slightly greater than 𝑡 because it includes a sum and a comparison (and we are omitting the details about how the message is encoded, which could again add a few more operations). Observe too that a factor 2arises when using the same kind of definition for the advantage Adv , as we were previously bounding Adv against the Adv′for the RLWE problem. We can not go far beyond this, because Adv′ RLWE(ℬ) is something we do not know how to properly quantify. The hardness hypothesis just gives us an asymptotic bound, not specific probabilities. In particular every polynomial adversary has a running time bounded by a polynomial applied to the size of its input, but these polynomials can be different. For each adversary and every constant 𝑐 there exists a 𝜆0 such that for every 𝜆 > 𝜆0 the advantage is smaller than 𝜆−𝑐 , but such 𝜆0 depends on the adversary. We simply assume that, if some analysis (as the lattice estimator from Albrecht et al. [ 8 ]) tells us that solving the problem takes 2 𝜆 operations then that would imply that any real adversary bounded to polynomially many 𝑡′ operations would have a tiny advantage. We do not estimate any particular advantage for adversaries with running time 𝑡′< 2 𝜆 , as there is always a trade of between success probability and running time, but it is hard to quantify. An adversary with twice the running time might not exactly obtain a doubled success probability, so it makes no sense to finely characterize the relation between 𝑡′ and the original 𝑡 . For the same reasons as above we might just ignore the factor 2. Statistical Indistinguishability Game The other main reason that prevents an adversary from distinguishing (pp, 𝑐0) and (pp, 𝑐1) is far more simple and does not involve any computational problem. It is hard to differentiate two distributions if they are too similar. In this case, as there is no assumption involved, it does not matter if the adversary has an unbounded computational power. The only option a more powerful adversary would have to amplify its success probability would be having access to multiple samples. Sometimes we assume the
Chapter 1. Introduction 61 number of samples is polynomial and some other times a finite fixed number of samples is determined by design of the scheme because the distributions depend on a secret freshly obtained for each use. The main notion we use to quantify this similarity among distributions is the statistical distance. There are other alternatives, as the Rényi divergence, that can be used for the same purpose and have been useful to determine more efficient parameters for some lattice-based constructions, but this kind of considerations are out of the scope of this dissertation [72, 16]. Definition 1.50 (Statistical Distance).The Statistical Distance (SD) between two discrete probability distributions 𝒳 and 𝒴 defined over a countable support 𝒩 , denoted as Δ(𝒳,𝒴), is Δ(𝒳,𝒴) ≔1 2Õ 𝑛∈𝒩 𝒳(𝑛)−𝒴(𝑛). We have denoted by 𝒳(𝑛) the probability of sampling 𝑛 when following the distribution 𝒳 . Equivalently for any event 𝐸⊆ 𝒩 we denote by 𝒳(𝐸) the probability of sampling any element from 𝐸. This distance is a useful tool because it allows us to prove that the probability of an event is similar if two distributions have a small distance. Proposition 1.51 (Probability preserving property of the SD). Given an arbitrary event 𝐸⊆ 𝒩 we have that 𝒴(𝐸) ≥ 𝒳(𝐸)−Δ(𝒳,𝒴). Proof. It can be directly deduced from the definition of the SD. Δ(𝒳,𝒴) =1 2Õ 𝑛∈𝒩 𝒳(𝑛)−𝒴(𝑛) =1 2Õ 𝑛∈𝐸𝒳(𝑛)−𝒴(𝑛)+1 2Õ 𝑛∈𝒩\𝐸𝒳(𝑛)−𝒴(𝑛) ≥1 2Õ 𝑛∈𝐸𝒳(𝑛)−𝒴(𝑛)+1 2Õ 𝑛∈𝒩\𝐸𝒴(𝑛)−𝒳(𝑛) =1 2Õ 𝑛∈𝐸𝒳(𝑛)−𝒴(𝑛)+1 2 1−Õ 𝑛∈𝐸𝒴(𝑛)−1+Õ 𝑛∈𝐸𝒳(𝑛)! =𝒳(𝐸)−𝒴(𝐸) □
68 1.4. Probability Preliminaries identically 0because 𝑏𝒜is independent of 𝑏. Adv IND(Cha0,Cha1) (𝒜) = Pr 𝑏𝒜=𝑏 𝑐0←rCha0, 𝑐1←rCha1, 𝑏←r{0,1}, 𝑏𝒜≔𝑐𝑏← 𝒜(𝑐𝑏) −1/2 =1/2−1/2=0. Now the advantage distinguishing Cha′ 0 and Cha1 would be 1/4 , because the adversary would always guess Cha′ 0 correctly and would also guess Cha1 half the time, for a total success probability of 3/4which is 1/4above a random guess. Adv IND(Cha′ 0,Cha1) (𝒜) = Pr 𝑏𝒜=𝑏 𝑐0≔0←Cha′ 0, 𝑐1←rCha1, 𝑏←r{0,1}, 𝑏𝒜≔𝑐𝑏← 𝒜(𝑐𝑏) −1/2 =3/4−1/2=1/4. We can consider again that this scenario is equivalent to the previous one but conditioning 𝐶0 to be 0, so this time the advantage would be 1/2Pr 𝐸 , which is consistent with Adv(𝒜) =1/2Adv′(𝒜) as seen in Lemma 1.47. However, provided that the output of Cha′ 0 does not have any effect if 𝑏= 1we can also see this game as an instance of the previous one conditioned by the event 𝐸′ given by 𝑐0= 0or 𝑏= 1. The probability of 𝐸′ is 3/4 , so the advantage now would be equal to Pr 𝐸′ , satisfying the equality. These subtleties mean that we have to be very careful defining the events and the probability spaces, so we can always use the tightest bound to obtain the best reductions possible. 1.4.4 Multidimensional Gaussians As we have been mentioning the hardness of lattice problems is well understood for discrete Gaussians 𝐷𝜎 , but the schemes need bounded distributions, as truncated Gaussians 𝐷𝜎,𝐵 . An important question is then how to bound the probability of the tails, considering that we are usually sampling errors 𝒆∈𝑅𝑚 𝑞 from truncated multidimensional Gaussians 𝒆←r(𝐷𝑛 𝜎,𝐵)𝑚 . We then consider the distribution 𝒆←r𝐷𝑑 𝜎,𝐵 with 𝑑≔𝑛·𝑚. Let Pr𝑒←r𝐷𝜎|𝑒|>𝐵≤ 2 −𝑎 , we can then discuss how likely is that a tuple of independent samples is also bounded.
Chapter 1. Introduction 69 We have that Pr 𝑒←r𝐷𝜎|𝑒|>𝐵≤2−𝑎, Pr 𝑒←r𝐷𝜎|𝑒|≤𝐵≥1−2−𝑎. Then, Pr 𝑒𝑖←r𝐷𝜎|𝑒𝑖|≤𝐵∀𝑖∈ {1, . . . , 𝑑}≥ (1−2−𝑎)𝑑, Pr 𝒆←r𝐷𝑑 𝜎∥𝒆∥∞>𝐵≤1−(1−2−𝑎)𝑑. We would like to find the 𝑏such that 1−(1−2−𝑎)𝑑=2−𝑏. −𝑏=log(1−(1−2−𝑎)𝑑) 𝑏=−log(1−(1−2−𝑎)𝑑) 𝑏=−log 1− 𝑑 Õ 𝑖=0(−1)𝑖𝑑 𝑖2−𝑎𝑖 ! 𝑏=−log − 𝑑 Õ 𝑖=1(−1)𝑖𝑑 𝑖2−𝑎𝑖 ! We expand the binomial power because it allows us to remove one of the steps where rounding errors could be produced, subtracting something close to 1from 1. Observe inside the logarithm we are adding negative powers of 2that decrease really fast. If we keep only the first term we get a very reasonable approximation. 𝑏≈ −log(𝑑·2−𝑎)=𝑎−log(𝑑) Depending on what we want to obtain it could be sufficient to get an inequality. Observe that the approximation we have obtained is indeed a lower bound for 𝑏 , and therefore 2 −(𝑎−log(𝑑)) ≥ 2 −𝑏 , as it corresponds to bounding the probability of some of the components being greater than 𝐵 by the addition of the probabilities for each of them, computing Í𝑑 𝑖=12−𝑎=2−(𝑎−log2(𝑑)) ≥2−𝑏. We can also obtain this bound profiting from the fact that the statistical distance satisfies the triangular inequality. We could then build a chain of inequalities using consecutive distributions that start from 𝐷𝑑 𝜎 and end up with 𝐷𝑑 𝜎,𝐵 by truncating each time the tails from one dimension. Δ(𝐷𝑑 𝜎, 𝐷𝑑 𝜎,𝐵) ≤ 𝑑Δ(𝐷𝜎, 𝐷𝜎,𝐵) ≤ 𝑑 2 −𝑎= 2 −(𝑎−log(𝑑)) . Proposition 1.60 (Multidimensional Gaussian tails). If Pr𝑒←𝐷𝜎|𝑒|>𝐵≤2−𝑎then Δ(𝐷𝑑 𝜎, 𝐷𝑑 𝜎,𝐵) ≤ 2−(𝑎−log(𝑑)).
70 1.4. Probability Preliminaries Observation 1.61. We have already proved this proposition from a probabilistic point of view and applying properties of the statistical distance, but it is worth mentioning that this result is equivalent to Bernoulli’s inequality (we will later introduce it in Proposition 4.10). We finally reproduce here the influential lemma from Lyubashevsky’s [77]. Lemma 1.62 (Lemma 4.4 from [77]). For any 𝑘>0we have that Pr |𝑧|>𝑘𝜎𝑧←r𝐷𝜎≤2exp(−𝑘2/2). Auxiliary Functions To simplify coming proofs we make use of the recent propositions to define several auxiliary functions practical for defining parameters and checking security properties. We think this is a useful summary. In each of these propositions the relevant points are the direction of the inequalities and whether the results that we obtain are the smaller or the larger for which we can ensure the considered property. Proposition 1.63 (boundedPr).The function boundedPr, defined as follows, outputs the greater 𝑎 for which we can guarantee that the probability of a sample from 𝐷𝜎 not belonging to [−𝐵, 𝐵]is lower or equal than 2−𝑎. boundedPr(𝜎, 𝐵)≔max 0,𝐵2 2𝜎2log(𝑒)−1. Proof. Directly comes from Lemma 1.62 (Lemma 4.4 in [77]). □ Proposition 1.64 (vecBoundedPrFromBoundedPr).The function vecBoundedPrFrom- BoundedPr, defined as follows, outputs the greater 𝑏 for which we can ensure that the sub-infinity norm of a vector of dimension 𝑑 not being bounded by a certain bound has a probability smaller or equal to 2 −𝑏 if a single sample has a probability smaller or equal to 2 −𝑎 of not being within that bound. vecBoundedPrFromBoundedPr(𝑎, 𝑑)≔max 𝑎−log(𝑑),0. Proof. Direct, iteratively applying the triangular inequality to bound the statistical distance (using Proposition 1.60), as we have discussed before. We have only been able to obtain inequalities, so the actual probability would be smaller, but this is what we can guarantee. □ Proposition 1.65 (vecBoundedPrToBoundedPr).The function vecBoundedPrToBoundedPr, defined as follows, outputs the smaller 𝑎 for which we can ensure that all independently sampled elements of a vector of dimension 𝑑 satisfy some condition except with probability
Chapter 1. Introduction 71 smaller or equal than 2 −𝑏 if a single sample satisfies it except with probability smaller or equal than 2−𝑎. vecBoundedPrToBoundedPr(𝑏, 𝑑)≔𝑏+log(𝑑). Proof. Can be deduced too from Proposition 1.60. □ Proposition 1.66 (sigmaFromB).The function sigmaFromB outputs the greater parameter 𝜎 for which we can ensure that a sample from 𝐷𝜎 only surpasses the bound 𝐵 with a probability smaller or equal than 2−𝑎. sigmaFromB(𝑎, 𝐵)≔𝐵slog(𝑒) 2(𝑎+1). Proof. Can be deduced from Lemma 1.62 (Lemma 4.4 in [77]) again. □ Observation 1.67. With these auxiliary functions we have been considering a symmetric scenario discussing whether samples belong or not to the interval [−𝐵, 𝐵] . However, to ensure the small elements can be characterized solely from the length of its bit decomposition we require the interval to be [−2𝜅,2𝜅)for some 𝜅∈Z≥0. For that reason we just use 𝐵= 2 𝜅− 1, as [− 2 𝜅+ 1 , 2 𝜅− 1 ] ⊂ [− 2 𝜅, 2 𝜅) . This means the bounds that we use are not the tightest ones we could obtain, but the tests we have conducted with real instantiations of the schemes that are going to be presented in the following chapters show no perceptible difference on the final parameters from using this much more simple symmetrical inequalities. 1.5 Contributions The first contribution, presented in Chapter 2, is a complete analysis of the necessary and sufficient conditions that we need to be able to efficiently multiply polynomials in the particular quotient rings of interest for lattice-based cryptography, i.e. 𝑅𝑞= Z𝑞[𝑥]/⟨𝑥𝑛+1⟩ with 𝑞 an odd prime number and 𝑛 a power of two. Fast Fourier multiplication is a well-known technique for efficient multiplication of polynomials, but cannot always be used. The Fast Fourier Transform (FFT) approach can be generalized to more general situations, withthe so-calledpartialFFTmultiplicationalgorithm, and weparticularly study when partial FFT can be applied to general rings 𝑅𝑚=Z[𝑥]/⟨𝑥𝑛−𝑎⟩with 𝑚 and 𝑎 arbitrary positive integers. This techniques are extensively used in lattice-based cryptographic implementations, but many of the conditions are vaguely defined in the literature, or the algorithm is described only as a set of rules for a particular case without any further explanation, so we believe a rigorous theoretical analysis as the
72 1.5. Contributions one presented in Chapter 2 would be of interest for the lattice-based cryptographic community. The results presented in this chapter are under review for publication at the time of deposit of this dissertation, and a preprint version is available at [88]. The main contribution of this dissertation is split between Chapters 3 and 4. We present new and more efficient Stern-based ZKPoKs, and apply them defining a new lattice-based commitment scheme providing protocols to prove knowledge of valid openings of given commitments and to prove that the openings of three commitments satisfy linear or multiplicative relations. The commitment scheme and the interactive proofs are presented in Chapter 3, proving that the commitment and the proofs are secure provided a set of conditions is satisfied. A previous version of the commitment and the interactive proofs were presented at the 17th IMA International Conference on Cryptography and Coding, celebrated in Oxford in 2019 [87]. Finally, in Chapter 4 we see how to transform the interactive proof into NIZKPoKs via the Fiat-Shamir transform, and study its security. We implement both the commitment and the NIZKPoKs, describe how to obtain optimal sets of secure parameters and benchmark the performance of the prototype implementation. The implementation has been a joint work with Sergi Rovira, and the details about it, together with the NIZKPoKs and the security analysis of the instantiations are also currently under review for publication. A preprint version is available at [89].
Chapter 2 Partial FFT Multiplication One of the main advantages of lattice-based cryptography is that, computationally speaking, every computation is fairly simple (perhaps excluding Gaussian sampling). Regular lattices only require linear operations as matrix-vector products, with polynomially large elements, and ideal-lattices only add polynomial products, allowing even more efficient implementations. This makes some lattice constructions good candidates for lightweight cryptography, designed to be executed in resourceconstrained hardware, for example with Internet of Things devices [71]. For this reason, having efficient multiplication algorithms for the quotient ring of polynomials Z𝑚[𝑥]/⟨𝑥𝑛−𝑎⟩ , with 𝑛 a power of 2and 𝑚 a non necessarily prime integer, is of great importance. The most efficient algorithm known involves the FFT when 𝑚 is a prime (and then usually denoted as 𝑞 ) and 𝑎 is − 1, such that 𝑥𝑛+ 1fully splits in linear factors modulo 𝑞 . Through this chapter we systematize the existing knowledge and meticulously study the necessary and/or sufficient conditions required for the applicability of these multiplication algorithms. This work allows us to unify the different approaches to the problem of efficiently computing the product of two polynomials in these quotient rings and formally generalize existing algorithms to partially splitting rings where 𝑥𝑛+ 1does not fully split in linear factors. 2.1 Introduction Constructing efficient multiplication algorithms for polynomials with coefficients in a ring 𝑅 , through this chapter we denote by 𝑅 the arbitrary ring of the coefficients (and not the ring of polynomials itself), has been an extensive research area. Given two polynomials 𝑔(𝑥), ℎ(𝑥) ∈ 𝑅[𝑥] of degree bounded by 𝑛 , 𝑔(𝑥)=Í𝑛−1 𝑖=0𝑔𝑖𝑥𝑖 and ℎ(𝑥)=Í𝑛−1 𝑖=0ℎ𝑖𝑥𝑖 , computing its product in a naïve way (known as the schoolbook 73
74 2.1. Introduction multiplication algorithm), (𝑔·ℎ)(𝑥)= 𝑛−1 Õ 𝑖=0 𝑛−1 Õ 𝑗=0𝑔𝑖·ℎ𝑗𝑥𝑖+𝑗, requires a quadratic number, 𝑛2, of multiplications of elements from the ring 𝑅. 𝑥6𝑥5𝑥4𝑔3𝑥3+𝑔2𝑥2+𝑔1𝑥+𝑔0 𝑥6𝑥5𝑥4×ℎ3𝑥3+ℎ2𝑥2+ℎ1𝑥+ℎ0 𝑥6𝑥5𝑥4𝑔3·ℎ0𝑥3+𝑔2·ℎ0𝑥2+𝑔1·ℎ0𝑥+𝑔0·ℎ0 𝑥6𝑥5𝑔3·ℎ1𝑥4+𝑔2·ℎ1𝑥3+𝑔1·ℎ1𝑥2+𝑔0·ℎ1𝑥 𝑥6𝑔3·ℎ2𝑥5+𝑔2·ℎ2𝑥4+𝑔1·ℎ2𝑥3+𝑔0·ℎ2𝑥2𝑥 𝑔3·ℎ3𝑥6+𝑔2·ℎ3𝑥5+𝑔1·ℎ3𝑥4+𝑔0·ℎ3𝑥3𝑥2𝑥 Í i+j=6 𝑔𝑖ℎ𝑗𝑥6+Í i+j=5 𝑔𝑖ℎ𝑗𝑥5+Í i+j=4 𝑔𝑖ℎ𝑗𝑥4+Í i+j=3 𝑔𝑖ℎ𝑗𝑥3+Í i+j=2 𝑔𝑖ℎ𝑗𝑥2+Í i+j=1 𝑔𝑖ℎ𝑗𝑥+𝑔0ℎ0 If we now want to work in a ring 𝑅[𝑥]/⟨𝑓(𝑥)⟩ the schoolbook multiplication algorithm would perform the same amount of operations taking into account that at the end we might perform a reduction. For the particular cases 𝑓(𝑥)=𝑥𝑛± 1it is clear that the algorithm performs the same number of operations, as we just need to multiply by ∓ 1all 𝑖 th coefficients from 𝑛to 2𝑛−2and add them to their corresponding 𝑖−𝑛column. The goal of this chapter is to formalize and unify some concepts used to build more efficient multiplication algorithms focusing on the ring 𝑅[𝑥]=Z𝑚[𝑥] and then on its quotient Z𝑚[𝑥]/⟨𝑥𝑛+1⟩ , with 𝑛 a power of 2and 𝑚 non necessarily prime (although sometimes we would also consider 𝑥𝑛−1or in general 𝑥𝑛−𝑎). We choose to study optimizations for this particular ring as it is widely used by cryptographic constructions that base their security on ideal lattices [ 83 ], that can be identified with ideals in Z𝑚[𝑥]/⟨𝑥𝑛+1⟩ (as we have seen in Section 1.3, restricting ourselves to the particular case of a prime modulus, but lattice problems can also be defined with non-prime modulus). Most of the literature usually deals with this matter by providing a set of recipes that can be applied for some specific particular rings (considering whether 𝑚 is prime or not or how does 𝑥𝑛−𝑎 split modulo 𝑚 ), without specifying if the imposed conditions in these recipes are necessary or only sufficient. This lack of detail might make more difficult the applicability of such recipes. Through this chapter we instead analyze what are the fundamental properties that allow us to obtain a
Chapter 2. Partial FFT Multiplication 75 computational speedup from a comprehensive and mathematical point of view, so that the reader can apprehend these techniques and distinguish intrinsic properties from superfluous conventions. Therefore, the analysis presented in this chapter will help the reader to avoid confusions when using multiplication algorithms for polynomials in quotient rings as Z𝑚[𝑥]/⟨𝑥𝑛+1⟩. Many of the ideas developed in this chapter are folklore when working on other rings such as C[𝑥] or Z𝑞[𝑥] with 𝑞 a prime satisfying certain conditions, but an exhaustive analysis might be very helpful to analyze when these ideas can be, completely or partially, generalized to our ring of interest and why the required conditions for the underlying ring are indeed necessary or just sufficient. 2.1.1 Polynomial Multiplication Related Work Karatsuba Multiplication Algorithm The first subquadratic multiplication algorithm was designed by Karatsuba in [ 67 ], with a cost of O𝑛log3 derived from a clever divide and conquer strategy. We include it here as our approach uses Karatsuba’s algorithm as a subroutine. Let 𝑔(𝑥) and ℎ(𝑥) be two polynomials of degree strictly smaller than 𝑛 (a power of two). We can split these polynomials into upper and lower degree polynomials as 𝑔(𝑥)=𝑔𝑈(𝑥)𝑥𝑛/2+𝑔𝐿(𝑥) and ℎ(𝑥)=ℎ𝑈(𝑥)𝑥𝑛/2+ℎ𝐿(𝑥) where 𝑔𝐿, 𝑔𝑈, ℎ𝐿, ℎ𝑈 have all degree smaller than 𝑛/2. A naïve computation would be 𝑔(𝑥)· ℎ(𝑥)=(𝑔𝑈(𝑥)𝑥𝑛/2+𝑔𝐿(𝑥))(ℎ𝑈(𝑥)𝑥𝑛/2+ℎ𝐿(𝑥)) =(𝑔𝑈(𝑥)· ℎ𝑈(𝑥))𝑥𝑛 +(𝑔𝑈(𝑥)· ℎ𝐿(𝑥)+ 𝑔𝐿(𝑥)· ℎ𝑈(𝑥))𝑥𝑛/2 +𝑔𝐿(𝑥)· ℎ𝐿(𝑥). Thatwaywedividethefullmultiplicationintofourmultiplicationsofpolynomials of size 𝑛/ 2. One can see however that this does not improve the efficiency of the computation. Let 𝑇(𝑛) be the number of operations required for computing the product using this method. The recurrence obtained, 𝑇(𝑛)= 4 𝑇(𝑛/ 2 ) + O𝑛 , implies (via the Master Theorem for divide-and-conquer recurrences [ 20 ]) that 𝑇(𝑛)=O𝑛2. Karatsuba’s gifted idea was to notice that the crossed terms can be obtained from the other terms and a single multiplication of 𝑛/ 2-polynomials. That is, we can write
76 2.1. Introduction the term (𝑔𝑈(𝑥)· ℎ𝐿(𝑥)+ 𝑔𝐿(𝑥)· ℎ𝑈(𝑥))as (𝑔𝐿(𝑥)+ 𝑔𝑈(𝑥))(ℎ𝐿(𝑥)+ ℎ𝑈(𝑥))−(𝑔𝑈(𝑥)· ℎ𝑈(𝑥))−(𝑔𝐿(𝑥)· ℎ𝐿(𝑥)). Notice how the recurrence now computes only 3products of half size and a linear amount of operations ( 𝑇(𝑛)= 3 𝑇(𝑛/ 2 )+O𝑛 ), providing the desired sublinear running time of 𝑇(𝑛)=O𝑛log3 (solving again the recurrence with the Master Theorem for divide-and-conquer recurrences [20]). Algorithm 2.1 Karatsuba Input: Two polynomials 𝑔(𝑥)and ℎ(𝑥)of degree bounded by 𝑛 Output: Product of 𝑔(𝑥)· ℎ(𝑥) 1: if n=1then return 𝑔·ℎ Split 𝑔(𝑥)and ℎ(𝑥)into 𝑔𝐿(𝑥), 𝑔𝑈(𝑥), ℎ𝐿(𝑥), ℎ𝑈(𝑥). 2: 𝑎(𝑥)≔Karatsuba(𝑔𝑈(𝑥), ℎ𝑈(𝑥)) 3: 𝑏(𝑥)≔Karatsuba(𝑔𝐿(𝑥), ℎ𝐿(𝑥)) 4: 𝑐(𝑥)≔Karatsuba(𝑔𝐿(𝑥)+ 𝑔𝑈(𝑥), ℎ𝐿(𝑥)+ ℎ𝑈(𝑥)) 5: return 𝑎(𝑥)𝑥𝑛+(𝑐(𝑥)−𝑎(𝑥)−𝑏(𝑥))𝑥𝑛/2+𝑏(𝑥) Karatsuba Multiplication Algorithm mod 𝑓(𝑥) However, notice this is not the most natural way of writing this recursion when working modulo 𝑥𝑛± 1as all recursive calls work the same way but the last one, where a reduction has to be performed. Alternatively we can split 𝑔(𝑥)=𝑔1(𝑥2)𝑥+𝑔0(𝑥2) , with 𝑔0 containing the even coefficients and 𝑔1 containing the odd ones. This allows us to think of 𝑔(𝑥) ∈ 𝑅[𝑥] of degree smaller than 𝑛 as 𝑔(𝑥, 𝑦)=𝑔0(𝑦) + 𝑔1(𝑦)𝑥∈𝑅[𝑥, 𝑦] of 𝑥 -degree 1and 𝑦 -degree smaller than 𝑛/ 2. It is called Dual Karatsuba and the idea remains the same: 𝑔(𝑥)· ℎ(𝑥)=(𝑔1(𝑥2)𝑥+𝑔0(𝑥2))(ℎ1(𝑥2)𝑥+ℎ0(𝑥2)) =𝑔1(𝑥2)· ℎ1(𝑥2)𝑥2 +𝑔1(𝑥2)· ℎ0(𝑥2)+ 𝑔0(𝑥2)· ℎ1(𝑥2)𝑥 +𝑔0(𝑥2)· ℎ0(𝑥2) And analogously as we did before we can write the second term with only one additional multiplication. 𝑔1(𝑥2)· ℎ0(𝑥2)+ 𝑔0(𝑥2)· ℎ1(𝑥2)is 𝑔1(𝑥2)+ 𝑔0(𝑥2)·ℎ1(𝑥2)+ ℎ0(𝑥2)−𝑔1(𝑥2)· ℎ1(𝑥2)− 𝑔0(𝑥2)· ℎ0(𝑥2).
Chapter 2. Partial FFT Multiplication 77 Now the reduction modulo 𝑥𝑛± 1works at each level of the recursive algorithm, as b𝑔(𝑦) · bℎ(𝑦) (mod 𝑦𝑛/2± 1 ) is equivalent to b𝑔(𝑥2) · bℎ(𝑥2) (mod 𝑥𝑛± 1 ) once we change variables again. We obtain no computational advantage, but it allows us to understand it from a different perspective. Algorithm 2.2 Karatsuba (mod 𝑥𝑛±1) Input: Two polynomials 𝑔(𝑥)and ℎ(𝑥)of degree bounded by 𝑛 Output: Product of 𝑔(𝑥)· ℎ(𝑥) 1: if n=1then return 𝑔·ℎ Split 𝑔(𝑥)and ℎ(𝑥)into 𝑔0(𝑥), 𝑔1(𝑥), ℎ0(𝑥), ℎ1(𝑥). 2: 𝑎(𝑦)≔Karatsuba(𝑔1(𝑦), ℎ1(𝑦)) 3: 𝑏(𝑦)≔Karatsuba(𝑔0(𝑦), ℎ0(𝑦)) 4: 𝑐(𝑦)≔Karatsuba(𝑔0(𝑦)+ 𝑔1(𝑦), ℎ0(𝑦)+ ℎ1(𝑦)) 5: return 𝑎(𝑥2)𝑥2+(𝑐(𝑥2)−𝑎(𝑥2)−𝑏(𝑥2))𝑥+𝑏(𝑥2) (mod 𝑥𝑛±1) Notice 𝑔0(𝑦) + 𝑔1(𝑦) ≡ 𝑔(𝑥, 𝑦)mod 𝑥− 1and 𝑔0(𝑦) ≡ 𝑔(𝑥, 𝑦)mod 𝑥 . These ideas are considered in [ 22 ] in order to see all these tools as part of the same framework. Faster Multiplication Algorithms Even faster algorithms can be obtained from more clever recurrences. For example mapping the polynomials into a different domain in a recursive way where they can be efficiently multiplied in linear time. If the recursion works computing two transforms of half the size, 𝑇(𝑛)= 2 𝑇(𝑛/ 2 )+O𝑛 , then the final computational complexity is O𝑛log 𝑛. Through this work we are going to focus and systematically explore the multiplication algorithms derived from the FFT paradigm, that is going to be extensively described in the following sections. This approach is usually referred as Number Theoretic Transformation (NTT) when working with finite fields. The main idea of the FFT recurrence is attributed to Gauss and was fully developed by Cooley and Tukey in its seminal work [ 42 ], considering the ring of complex numbers. Many variants have been developed since then, generalizing [ 42 ] to non-power of two bounded degree polynomials or providing additional tricks and interpretations fromwhich we benefit, suchas [ 53 ]. Anextensive andmagnificentlywell documented survey can be found in [22]. Most of the work has focused on the particular case of multiplications in
84 2.3. Efficient Transforms 2.3.2 Efficient Evaluation of 𝑇−1 In order to obtain an efficient multiplication algorithm we need not only an efficient transform algorithm but also an efficient anti-transform algorithm. Notice beforehand that, the same way we saw in Remark 2.4 that Condition 3 is preserved when squaring the evaluation points we should check if the same holds with Condition 1. To do so we first require the following Lemma 2.6. Lemma 2.6. Let 𝛼0, . . . , 𝛼𝑛−1be a twofold set of 𝑛th roots of 𝑎with invertible differences. Then 𝛼𝚤=−𝛼𝑖. Proof. Since the set satisfies Condition 3 we know 𝛼𝑖2=𝛼𝚤2. That is 0=𝛼𝑖2−𝛼𝚤2=(𝛼𝑖−𝛼𝚤)(𝛼𝑖+𝛼𝚤). Using that the elements have invertible differences we obtain 𝛼𝑖+𝛼𝚤=0.□ Proposition 2.7 (Squares of a set satisfying Conditions 1 to 3 also satisfy Conditions 1 to 3).Let 𝛼0, . . . , 𝛼𝑛−1be a twofold set of 𝑛th roots of 𝑎with invertible differences. Then the set 𝛼02, . . . , 𝛼𝑛/2−12 is a twofold set of 𝑛/2 th roots of 𝑎 with invertible differences. Proof. From the definition of a twofold set it directly follows that the set of squares 𝛼02, . . . , 𝛼𝑛/2−12is a twofold set of 𝑛/2th roots of 𝑎. We only need to check if the differences among the squares are still invertible. 𝛼𝑖2−𝛼𝑗2=(𝛼𝑖−𝛼𝑗)(𝛼𝑖+𝛼𝑗)=(𝛼𝑖−𝛼𝑗)(𝛼𝑖−𝛼𝚥). Using Lemma 2.6 we have seen the differences among the squares are products of differences among original elements, invertible by hypothesis, implying the squares also satisfy the conditions. □ After these preliminaries one can define the anti-transform from a constructive point of view by reversing the transform algorithm or explicitating the inverse of the transform matrix. However, to get a deeper insight we are going to describe it using the language of Lagrange interpolation. Given an indexed set of points {𝛼𝑖}𝑛−1 𝑖=0 with invertible differences and the evaluations of a polynomial in such points {𝑔(𝛼𝑖)}𝑛−1 𝑖=0 we can recover the original polynomial 𝑔(𝑥)using Lagrange polynomials 𝑙{𝛼𝑗}𝑛−1 𝑗=0 𝑖(𝑥)as 𝑔(𝑥)= 𝑛−1 Õ 𝑖=0 𝑔(𝛼𝑖)𝑙{𝛼𝑗}𝑛−1 𝑗=0 𝑖(𝑥), 𝑙{𝛼𝑗}𝑛−1 𝑗=0 𝑖(𝑥)= 𝑛−1 Ö 𝑗=0 𝑗≠𝑖 𝑥−𝛼𝑗 𝛼𝑖−𝛼𝑗 .
Chapter 2. Partial FFT Multiplication 85 Notice the Lagrange polynomials are well-defined because we ensure the evaluation points have invertible differences. The key point is to observe that, due to the particular requirements of our set of evaluation points, that is Conditions 1 to 3, our Lagrange polynomials factorize in a special way. Using Lemma 2.6 we can see how the Lagrange polynomial splits. 𝑙{𝛼𝑗}𝑛−1 𝑗=0 𝑖(𝑥)= 𝑛−1 Ö 𝑗=0 𝑗≠𝑖 𝑥−𝛼𝑗 𝛼𝑖−𝛼𝑗 =𝑥−𝛼𝚤 𝛼𝑖−𝛼𝚤 𝑛/2−1 Ö 𝑗=0 𝑗.𝑖 (mod 𝑛/2) 𝑥−𝛼𝑗 𝛼𝑖−𝛼𝑗𝑥−𝛼𝚥 𝛼𝑖−𝛼𝚥 =𝑥−𝛼𝚤 𝛼𝑖−𝛼𝚤 𝑛/2−1 Ö 𝑗=0 𝑗.𝑖 (mod 𝑛/2) 𝑥2−𝛼𝑗2 𝛼𝑖2−𝛼𝑗2 =𝑙{𝛼𝑖,𝛼𝚤} 𝑖(𝑥)𝑙{𝛼𝑗2}𝑛/2−1 𝑗=0 𝑖rem 𝑛/2(𝑥2). It is crucial to note that with a twofold set 𝑙{𝛼𝑗2}𝑛/2−1 𝑗=0 𝚤rem 𝑛/2(𝑥)=𝑙{𝛼𝑗2}𝑛/2−1 𝑗=0 𝑖rem 𝑛/2(𝑥). Then we can write 𝑔(𝑥)= 𝑛−1 Õ 𝑖=0 𝑔(𝛼𝑖)𝑙{𝛼𝑗}𝑛−1 𝑗=0 𝑖(𝑥) = 𝑛−1 Õ 𝑖=0 𝑔(𝛼𝑖)𝑙{𝛼𝑖,𝛼𝚤} 𝑖(𝑥)𝑙{𝛼𝑗2}𝑛/2−1 𝑗=0 𝑖rem 𝑛/2(𝑥) = 𝑛/2−1 Õ 𝑖=0𝑔(𝛼𝑖)𝑙{𝛼𝑖,𝛼𝚤} 𝑖(𝑥)+ 𝑔(𝛼𝚤)𝑙{𝛼𝑖,𝛼𝚤} 𝚤(𝑥)𝑙{𝛼𝑗2}𝑛/2−1 𝑗=0 𝑖(𝑥2). Once we have this decomposition the advantage of this language is that it allows us to interpret it. We were considering 𝑔(𝑥) as 𝑔0(𝑥2)+𝑥𝑔1(𝑥2) . Polynomials 𝑙{𝛼𝑗2}𝑛/2−1 𝑗=0 𝑖(𝑥) wouldhelpusinterpolate 𝑔0(𝑥) and 𝑔1(𝑥) ifwehadtheir images {𝑔0(𝛼𝑖2)} and {𝑔1(𝛼𝑖2)}. However, the images we have are {𝑔(𝛼𝑖)} . But then 𝑙{𝛼𝑖,𝛼𝚤} 𝑖(𝑥) and 𝑙{𝛼𝑖,𝛼𝚤} 𝚤(𝑥) are precisely the polynomials that interpolate 𝑔0(𝛼𝑖2)+𝑥𝑔1(𝛼𝑖2) (a polynomial of degree 1that has the desired evaluations as coefficients) from 𝑔(𝛼𝑖)and 𝑔(𝛼𝚤).
86 2.3. Efficient Transforms As we are going to use it later lets explicitate 𝑔(𝛼𝑖)𝑙{𝛼𝑖,𝛼𝚤} 𝑖(𝑥)+ 𝑔(𝛼𝚤)𝑙{𝛼𝑖,𝛼𝚤} 𝚤(𝑥)=𝛼𝑖𝑔(𝛼𝑖)+ 𝑔(𝛼𝚤) 𝛼𝑖−𝛼𝚤+𝑥𝑔(𝛼𝑖)− 𝑔(𝛼𝚤) 𝛼𝑖−𝛼𝚤. This can be used to build an efficient interpolation algorithm. From the 𝑛 evaluations of a polynomial 𝑔 of degree bounded by 𝑛 at points {𝛼𝑖}𝑛−1 𝑖=0 we can recover the evaluations of polynomials 𝑔0 and 𝑔1 at points {𝛼𝑖2}𝑛/2−1 𝑖=0 (this is done with interpolations of polynomials of degree bounded by 2, so each requires a constant time, and we need a total of O𝑛operations). Then we use them to interpolate 𝑔0 and 𝑔1 , each of them polynomials of degree bounded by 𝑛/2 defined in 𝑅[𝑥]/𝑥𝑛/2−𝑎 . That is 𝑇(𝑛)= 2 𝑇(𝑛/ 2 )+O𝑛 , and we end up again achieving 𝑇(𝑛)=O𝑛log 𝑛. Algorithm 2.4 IFFT Input: A vector of evaluations 𝒚 of size 𝑛 and a twofold set 𝛼0, . . . , 𝛼𝑛−1 of 𝑛 th roots of 𝑎with invertible differences Output: Coefficients of a polynomial 𝑔(𝑥)interpolating 𝒚at 𝛼0, . . . , 𝛼𝑛−1 1: if n=1then return 𝑦 2: for 𝑖∈0, . . . , 𝑛/2−1do 3: 𝒚0[𝑖]≔𝛼𝑖𝒚[𝑖]+𝒚[𝑖+𝑛/2] 𝛼𝑖−𝛼𝑖+𝑛/2 4: 𝒚1[𝑖]≔𝒚[𝑖]−𝒚[𝑖+𝑛/2] 𝛼𝑖−𝛼𝑖+𝑛/2 5: end for 6: 𝑔0(𝑥)≔IFFT(𝒚0,𝛼02, . . . , 𝛼𝑛/2−12) 7: 𝑔1(𝑥)≔IFFT(𝒚1,𝛼02, . . . , 𝛼𝑛/2−12) 8: return 𝑔0(𝑥2)+𝑥𝑔1(𝑥2) 2.3.3 Efficient Multiplication Algorithm in 𝑅[𝑥]/⟨𝑥𝑛−𝑎⟩ Combining both Algorithms 2.3 and 2.4 we describe in Algorithm 2.5 an efficient multiplication algorithm in 𝑅[𝑥]/⟨𝑥𝑛−𝑎⟩. Thereby our work is to study the existence of sets of evaluation points satisfying Conditions 1 to 3 and how to find them in our desired 𝑅.
Chapter 2. Partial FFT Multiplication 87 Algorithm 2.5 Efficient FFT Multiplication Input: Two polynomials 𝑔(𝑥),ℎ(𝑥)of degree bounded by 𝑛 Auxiliary: A twofold set 𝛼0, . . . , 𝛼𝑛−1 of 𝑛 th roots of 𝑎 with invertible differences Output: The product (𝑔·ℎ)(𝑥)of 𝑔(𝑥)and ℎ(𝑥)in 𝑅[𝑥]/⟨𝑥𝑛−𝑎⟩ 1: 𝒈≔FFT(𝑔(𝑥),𝛼0, . . . , 𝛼𝑛−1) 2: 𝒉≔FFT(ℎ(𝑥),𝛼0, . . . , 𝛼𝑛−1) 3: 𝒇≔𝒈⊙𝒉 4: 𝑓(𝑥)≔IFFT(𝒇,𝛼0, . . . , 𝛼𝑛−1) 5: return 𝑓(𝑥) 2.4 Characterization of suitable sets of evaluation points in the ring Z𝑚[𝑥]/⟨𝑥𝑛−𝑎⟩ In this section we focus on Z𝑚 and study the relations among the given conditions to see that these are precisely the required notions and provide necessary and sufficient conditions for the existence of proper evaluation sets. We can start certifying that Conditions 1 to 3 are indeed independent in general. Proposition 2.8 (Condition 3 does not imply Condition 1 in Z𝑚 if 𝑚 is not a power of a prime).Let 𝛼0, . . . , 𝛼𝑛−1 be a twofold set of 𝑛 th roots of 𝑎 in Z𝑚 , where 𝑚 is not a power of a prime. There is a twofold set of 𝑛th roots of 𝑎in Z𝑚without invertible differences. Proof. Decomposing 𝑚=𝑝𝑞 with 𝑝 and 𝑞 coprime proper factors we can always construct another twofold set defining 𝛼′ 𝑖≡𝛼𝑖(mod 𝑝) but 𝛼′ 𝑖≡𝛼0(mod 𝑞) . It would be a twofold set, but none of their differences would be invertible. □ When the modulus is a power of a prime 𝑝𝑒 invertibility comes from being different modulo 𝑝 , which is not implied in general by being different modulo 𝑝𝑒 . We have first to further characterize 𝑛 th roots in Z𝑝𝑒 , when 𝑝 is prime, to address this particular case. Theorem 2.9 (Hensel’s lemma as in Theorem 2.23 from [ 93 ]).Suppose that 𝑓(𝑥) is a polynomial with integral coefficients. If 𝑓(𝑥0) ≡ 0 (mod 𝑝𝑒) and 𝑓′(𝑥0). 0 (mod 𝑝) , then there is a unique 𝑡(mod 𝑝)such that 𝑓(𝑥0+𝑡𝑝𝑒) ≡ 0(mod 𝑝𝑒+1). In our case we are particularly interested in 𝑓(𝑥)=𝑥𝑛−𝑎 , with 𝑛 a power of 2, so 𝑓′(𝑥)=𝑛𝑥𝑛−1 . Since our solutions are 𝑛 th roots of 𝑎 (when considered modulo 𝑝𝑒and therefore also modulo 𝑝)𝑛𝑥0𝑛−1.0(mod 𝑝)as long as 𝑝≠2and 𝑎≠0. Corollary 2.10. There is a one to one correspondence of 𝑛 th roots in Z𝑝𝑒 and in Z𝑝 , where 𝑝 is an odd prime.
88 2.4. Characterization of Suitable Sets of Evaluation Points Proof. On the one hand we can see each root in Z𝑝𝑒as a root in Z𝑝by applying rem 𝑝. On the other hand one just needs to apply Theorem 2.9 iteratively 𝑒− 1times from Z𝑝to Z𝑝𝑒.□ In particular this directly implies the order of 𝑛 th roots of 1, as elements of the group, is preserved, given that powers of a root are uniquely lifted to powers of the lifted root. Remark 2.11.We omit here the case 𝑝= 2as in the following sections we are going to see that other conditions forbid this particular case. Proposition 2.12 (Condition 2 implies Condition 1 in Z𝑚 if 𝑚 is a power of an odd prime).Let 𝑚=𝑝𝑒 , with 𝑝 an odd prime, and let 𝛼0, . . . , 𝛼𝑛−1 be 𝑛 different 𝑛 th roots of 𝑎 in Z𝑝𝑒. Then 𝛼𝑖−𝛼𝑗is invertible in Z𝑝𝑒for all 𝑖≠𝑗. Proof. Every 𝛼𝑖 is a root of 𝑓(𝑥)=𝑥𝑛−𝑎 when considered modulo 𝑝 . By the previous corollary we have 𝛼𝑖.𝛼𝑗(mod 𝑝𝑒) implies 𝛼𝑖.𝛼𝑗(mod 𝑝) . Therefore, gcd(𝛼𝑖−𝛼𝑗, 𝑝)=1, as we wanted. □ Proposition 2.13 (Condition 3 implies Condition 1 in Z𝑚 if 𝑚 is a power of an odd prime).Let 𝑚=𝑝𝑒 , with 𝑝 an odd prime, and let 𝛼0, . . . , 𝛼𝑛−1 be a twofold set of 𝑛 th roots of 𝑎in Z𝑝𝑒. Then 𝛼𝑖−𝛼𝑗is invertible in Z𝑝𝑒for all 𝑖≠𝑗. Proof. Condition 3 implies Condition 2 and Condition 2 implies Condition 1. □ Working with an arbitrary modulus 𝑚 , that has 𝑚=𝑝1𝑒1𝑝2𝑒2. . . 𝑝𝑘𝑒𝑘 as its prime decomposition, we can completely determine any 𝑑∈Z𝑚 , via the Chinese Remainder Theorem (CRT), from 𝑑(𝑖)such that 𝑑(1)≡𝑑(mod 𝑝1𝑒1), 𝑑(2)≡𝑑(mod 𝑝2𝑒2), . . . 𝑑(𝑘)≡𝑑(mod 𝑝𝑘𝑒𝑘). Using this representation we can prove the following theorem. Theorem 2.14 (Conditions 1 and 2 hold if and only if Condition 2 holds modulo every 𝑝𝑗𝑒𝑗 ).Let 𝛼0, . . . , 𝛼𝑛−1∈Z𝑚 be a set of different 𝑛 th roots of 𝑎∈Z𝑚 , and let 𝑚=𝑝1𝑒1𝑝2𝑒2. . . 𝑝𝑘𝑒𝑘be the prime decomposition of an odd module 𝑚. The differences among these elements are invertible modulo 𝑚 if and only if all the elements are still different when considered modulo any of the 𝑝𝑗𝑒𝑗.
Chapter 2. Partial FFT Multiplication 89 Proof. Follows the same ideas as the previous propositions, since an element is invertible if and only if it is invertible modulo all the coprime factors of a factorization of its modulus, we have seen (Corollary 2.10) that such roots are different modulo 𝑝𝑗𝑒𝑗 if and only if they are different modulo 𝑝𝑗 , and therefore have invertible differences. □ The same way we can see how other implications are not true in general either. Proposition 2.15 (Conditions 1 and 2 do not imply Condition 3 in Z𝑚 if 𝑚 is not a power of a prime).Not every 𝑛 -set of 𝑛 th roots of 𝑎∈Z𝑚 with invertible differences is a twofold set of 𝑛th roots. It is not the case in general, not even for roots of unity. Proof. Consider the set { 12 , 14 , 18 , 21 } ⊂ Z65 , of 4th roots of unity, and let us also compute its squares. 124≡1(mod 65),122≡14 (mod 65), 144≡1(mod 65),142≡1(mod 65), 184≡1(mod 65),182≡64 (mod 65), 214≡1(mod 65),212≡51 (mod 65). Even if all of them are indeed 4th roots of unity, and the set of their differences { 2 , 3 , 4 , 6 , 7 , 9 } only contains invertible elements modulo 65, we have seen it is not a twofold set because all the squares are different modulo 65.□ Observe that the evaluation points from the example are indeed, after some reorderings, a twofold set of 𝑛 th roots of unity in Z5 and in Z13 , but the reorderings are different. 122≡182(mod 5),122≡142(mod 13), 142≡212(mod 5),182≡212(mod 13). Once again the proposition does hold if we work modulo a power of an odd prime. To prove it we require a couple of lemmas that show the important role of roots of unity and allow us to focus on them, with the goal of better understanding these orderings. Lemma 2.16 (Conditions 1 and 2 imply the evaluation points are invertible).Let 𝛼0, . . . , 𝛼𝑛−1 be different 𝑛 th roots of 𝑎 in Z𝑚 such that 𝛼𝑖−𝛼𝑗 is invertible in Z𝑚 for all 𝑖≠𝑗. Then 𝛼𝑖is invertible in Z𝑚for all 𝑖. Proof. Choose two indices 𝑖 and 𝑗 and let 𝑑 be a square-free common divisor of 𝛼𝑖 and 𝑚 . Since 𝛼𝑖𝑛≡𝑎(mod 𝑚) and 𝛼𝑗𝑛≡𝑎(mod 𝑚) we have that 𝑚|𝛼𝑖𝑛−𝛼𝑗𝑛 , implying
90 2.4. Characterization of Suitable Sets of Evaluation Points that 𝑑|𝛼𝑗 (here we have to use that 𝑑 is square free). We would finally get 𝑑|𝛼𝑖−𝛼𝑗 , but we know gcd(𝛼𝑖−𝛼𝑗, 𝑚)= 1and therefore 𝑑= 1, proving gcd(𝛼𝑖, 𝑚)= 1for all 𝑖.□ Remark 2.17.If roots of 𝑎 are invertible it directly follows that 𝑎 itself has to be invertible. We will impose it when required, since this argument implies it is a necessary condition for the existence of the inverse transform 𝑇−1. Lemma 2.18 (Roots of 𝑎 and roots of 1).Let 𝑎∈Z𝑚 . The following two statements are equivalent: (i) The set 𝛼0, . . . , 𝛼𝑛−1∈Z𝑚satisfies Conditions 1 and 2. (ii) The set 𝛼0, . . . , 𝛼𝑛−1∈Z𝑚 can be constructed from an invertible 𝑛 th root of 𝑎 , let us denote it 𝛼 , and 𝑛 different 𝑛 th roots of unity 𝜔0, . . . , 𝜔𝑛−1 with invertible differences in Z𝑚such that 𝛼𝑖=𝛼𝜔𝑖. Proof. Let us prove both implications: •(i) =⇒(ii) Let 𝛼0, . . . , 𝛼𝑛−1be the roots satisfying the conditions. We can define 𝛼≔𝛼0 (invertible by Lemma 2.16) and 𝜔𝑖≔𝛼𝑖·𝛼0−1 . We can check 𝜔𝑖are roots of unity, and their differences are invertible (𝜔𝑖−𝜔𝑗)−1=𝛼𝑖 𝛼0−𝛼𝑗 𝛼0−1 =𝛼0·(𝛼𝑖−𝛼𝑗)−1. •(ii) =⇒(i) Let 𝛼,𝜔0, . . . , 𝜔𝑛−1be a set of roots satisfying the conditions. Define now 𝛼𝑖≔𝛼·𝜔𝑖 . Again, by construction, all 𝛼𝑖 are 𝑛 th roots of 𝑎 and their differences are invertible since (𝛼𝑖−𝛼𝑗)−1=(𝛼·𝜔𝑖−𝛼·𝜔𝑗)−1=𝛼−1(𝜔𝑖−𝜔𝑗)−1. □ This motivates the definition of a sufficient condition that, as we are going to see, will be necessary when 𝑚is a power of an odd prime. Definition 2.19 ( (𝛼,𝜔) -set).Let 𝛼 be any 𝑛 th root of an invertible 𝑎∈𝑅 and 𝜔 an 𝑛 th root of unity in 𝑅 of order 𝑛 whose powers have invertible differences. Then the set defined as 𝛼𝑖=𝛼𝜔𝑖is said to be an (𝛼,𝜔)-set.
Chapter 2. Partial FFT Multiplication 91 Condition 4 ( (𝛼,𝜔) -set).We say a set of evaluation points satisfies Condition 4 if (after some reordering) it is an (𝛼,𝜔)-set for some 𝛼,𝜔∈𝑅. Remark 2.20.Let 𝑚=𝑝1𝑒1𝑝2𝑒2. . . 𝑝𝑘𝑒𝑘 be the prime decomposition of the module 𝑚 . An 𝑛 th root of unity 𝜔∈Z𝑚 can be determined from 𝜔(𝑖)≡𝜔(mod 𝑝𝑒𝑖 𝑖) and the order of 𝜔 is just the least common multiple of the orders of 𝜔(𝑖) in Z𝑝𝑒𝑖 𝑖 . Since we choose 𝑛 to be a power of 2and all the orders of each 𝜔(𝑖) divide 𝑛 the least common multiple is just going to be the maximum of the orders. Then, for 𝜔 to be an 𝑛 th root of unity of order 𝑛 it is only necessary that one of these 𝜔(𝑗) has order 𝑛 . However, as we also need to impose invertibility of the differences of its powers then every 𝜔(𝑖)has to have order 𝑛in Z𝑝𝑒𝑖 𝑖. Proposition 2.21 (Condition 4 implies Conditions 1 to 3).An (𝛼,𝜔) -set in Z𝑚 is a twofold set of 𝑛th roots of 𝑎with invertible differences. Proof. Let 𝛼𝑖≔𝛼𝜔𝑖and let 𝑚=𝑝1𝑒1𝑝2𝑒2. . . 𝑝𝑘𝑒𝑘be the prime decomposition of 𝑚. We can start checking Condition 1. From the proof of Lemma 2.18 we know an (𝛼,𝜔) -set of 𝑛 th roots satisfies Condition 1 if 𝛼 is invertible and 𝜔𝑖−𝜔𝑗 are invertible too. Since 𝑎 is invertible in Z𝑚 then 𝛼 as an 𝑛 th root of 𝑎 has to be invertible too. Otherwise, if 𝛼≡ 0 (mod 𝑝𝑗) for some 𝑗 then 𝑎≡ 0 (mod 𝑝𝑗) for the same 𝑗 and it would not be invertible either, contradicting the statement. The second condition is ensured from the definition. Therefore, every difference is invertible modulo 𝑚. Condition 2 follows from the construction of an (𝛼,𝜔)-set. Finally, for Condition 3, let 𝑖≡𝑗(mod 2 log(𝑛)−𝑘) and, without loss of generality, assume 𝑖≥𝑗 and therefore 𝑖=𝑗+𝑐· 2 log(𝑛)−𝑘 for some non-negative integer 𝑐 . Then 𝛼2𝑘 𝑖=(𝛼0𝜔𝑖)2𝑘 =𝛼2𝑘 0𝜔(𝑗+𝑐·2log(𝑛)−𝑘)·2𝑘=𝛼2𝑘 0𝜔𝑗·2𝑘+𝑐·𝑛=(𝛼0𝜔𝑗)2𝑘 =𝛼2𝑘 𝑗. □ This condition is quite convenient, for example it allows us to explicitly describe the transform from its Vandermonde matrix, as we mentioned before, in a compact way given that (𝑉)𝑖 𝑗 =(𝛼𝜔𝑖)𝑗 and (𝑉−1)𝑖 𝑗 =1/𝑛(𝛼−1𝜔−𝑗)𝑖 . Notice that the inverse matrix looks like 1/𝑛 times the transpose of the evaluation matrix of an (𝛼−1,𝜔−1) -set. If we were working in Z𝑚[𝑥]/⟨𝑥𝑛−1⟩ with 𝛼= 1, the transpose would be irrelevant as the matrix would be symmetric and the same efficient recursive evaluation techniques from the direct transform would work directly for its inverse.
92 2.4. Characterization of Suitable Sets of Evaluation Points However, even if Condition 4 implies Conditions 1 to 3, the converse is not true in general, as we are going to see. Besides that, we can see it holds for some particular cases, when 𝑚is a power of a prime. Proposition 2.22 (Conditions 1 and 2 do imply Condition 4 in Z𝑚 if 𝑚 is a power of an odd prime).Let 𝛼0, . . . , 𝛼𝑛−1 be a set of 𝑛 th roots of 𝑎 with invertible differences in Z𝑝𝑒 , with 𝑝an odd prime. This is (except reordering) an (𝛼,𝜔)-set of 𝑛th roots of 𝑎in Z𝑝𝑒. Proof. From Lemma 2.18 we deduce the existence of an invertible 𝛼 and 𝜔0, . . . , 𝜔𝑛−1 with invertible differences such that 𝛼𝑖=𝛼·𝜔𝑖. Given that Z𝑝 is a field its multiplicative group is a cyclic group of order 𝑝− 1. Then the set of 𝑛 th roots of unity in Z𝑝 is also a group, and as a subgroup of a cyclic group it is also cyclic. It is also known that 𝑥𝑛− 1has at most 𝑛 solutions modulo 𝑝 (Theorem 2.6 from [ 93 ]), therefore the 𝑛 roots 𝜔𝑖rem 𝑝 (all different since 𝛼𝜔𝑖rem 𝑝 are lifted to different points in Z𝑝𝑒 ) form the whole cyclic group of roots of unity and in consequence are generated by one of them. As there is a one to one correspondence among 𝑛 th roots in Z𝑝 and in Z𝑝𝑒 the original 𝜔𝑖∈Z𝑝𝑒 are generated too by one 𝜔 of order 𝑛 . That is, there exists a permutation 𝜋such that 𝜔𝜋(𝑖)=𝜔𝑖. After this reordering defined by 𝜋 the set 𝛼𝜋(0),𝛼𝜋(1), . . . , 𝛼𝜋(𝑛−1) is an (𝛼,𝜔) -set. □ Proposition 2.23 (Conditions 1 and 2 do imply Condition 3 in Z𝑚 if 𝑚 is a power of an odd prime).Let 𝛼0, . . . , 𝛼𝑛−1 be a set of 𝑛 th roots of 𝑎 with invertible differences in Z𝑝𝑒 , with 𝑝an odd prime. This is (except reordering) a twofold-set of 𝑛th roots of 𝑎in Z𝑝𝑒. Proof. Direct as we know by Proposition 2.22 that Conditions 1 and 2 imply Condition 4 in Z𝑚 if 𝑚 is a power of an odd prime and Condition 4 always implies Condition 3, as seen in Proposition 2.21. □ This new condition seems the right choice, and the FFT is usually introduced from constructions equivalent to this definition, but we should study first if restricting to this particular family of sets of evaluation points reduces the options for computing an FFT multiplication when 𝑚is not a power of an odd prime. Once again Conditions 1 and 2 being true modulo every 𝑝𝑗𝑒𝑗 should imply that Condition 4 holds modulo every 𝑝𝑗𝑒𝑗, but the permutations might be different. There are cases where these permutations allow Condition 3 to be true while Condition 4 is not. Theorem 2.24 (Conditions 1 to 3 do not imply Condition 4 in general, but imply the existence of a set satisfying Condition 4).Let 𝛼0, . . . , 𝛼𝑛−1 be a twofold set of 𝑛 th roots
Chapter 2. Partial FFT Multiplication 93 of 𝑎 with invertible differences in Z𝑚 , where 𝑚 is odd and not a power of a prime and 𝑛 is a power of two greater than 2 2 . Then 𝑎 has an inverse in Z𝑚 , there is both a twofold set 𝛼′ 0, . . . , 𝛼′ 𝑛−1 of 𝑛 th roots of 𝑎 in Z𝑚 with invertible differences not satisfying Condition 4 and a set 𝛼′′ 𝑖=𝛼𝜔𝑖 where 𝛼 is an 𝑛 th root of 𝑎 and 𝜔 is a root of unity of order 𝑛 with all its powers having invertible differences, that is, an (𝛼,𝜔)-set. Proof. Following Lemma 2.16 we get 𝑎is invertible. Let 𝑚=𝑝1𝑒1𝑝2𝑒2. . . 𝑝𝑘𝑒𝑘be the prime decomposition of 𝑚. There is a unique (except reordering) twofold set of 𝑛 th roots of 𝑎 with invertible differences in Z𝑝𝑗𝑒𝑗 . This is the case since the values of each of the roots of 𝑎 modulo 𝑝𝑗𝑒𝑗 are completely determined, being the unique elements lifted to Z𝑝𝑗𝑒𝑗 from the unique 𝑛 roots of 𝑎 in Z𝑝𝑗 . By Proposition 2.22 it satisfies Condition 4. The only thing we could choose is the respective order they have. This order is irrelevant in Z𝑝𝑗𝑒𝑗 but becomes important when considering Z𝑚 as once we fix an order modulo 𝑝1𝑒1 the different respective orders for the remaining 𝑝𝑗𝑒𝑗would produce different elements in Z𝑚. From the twofold set definition we got a tree structure in Figure 2.1 and a specific notation for the points (a bit decomposition of the index). The twofold structure is only preserved by the tree structure, so the only possible reorderings are those that come from swapping the left and right children of a node. That is, choosing 𝑏𝑖−1. . . 𝑏0 (an internal node), and mapping 𝛼𝑏log(𝑛)−1...𝑏𝑖+1𝑏𝑖𝑏𝑖−1...𝑏0 to 𝛼𝑏log(𝑛)−1...𝑏𝑖+1𝑏𝑖𝑏𝑖−1...𝑏0 , for all 𝑏log(𝑛)−1, . . . , 𝑏𝑖+1, still preserves this structure. For example, choosing nodes 𝛼1 and 𝛼10 we obtain a different ordering like in Figure 2.2. Figure 2.2 Twofold set of 8th roots swapping left and right descendants of 𝛼1 and 𝛼10 𝑎 𝛼0 𝛼00 𝛼000 𝛼100 𝛼10 𝛼110 𝛼010 𝛼1 𝛼11 𝛼011 𝛼111 𝛼01 𝛼001 𝛼101 This means that, given a twofold set of 𝑛 th roots, there are exactly 2 𝑛−1 possible reorderings (since the tree has exactly 𝑛− 1inner nodes, and we can swap or not
100 2.5. FFT Generalizations This implies that, under the necessary conditions for an FFT multiplication algorithm, 𝑥𝑛+ 1fully splits in linear factors when considered modulo 𝑚 . However, sometimes this is not the case, and we are enforced to use modulus that specifically require 𝑥𝑛+1to split in a smaller number of factors. That is the case of some cryptographic constructions that use Theorem 2.32 from [ 86 ] (or similar versions) to guarantee the invertibility of particular subsets of elements in Z𝑚[𝑥]/⟨𝑥𝑛+1⟩ , as it is going to happen with the commitment scheme that we are going to propose in the following chapter. The condition 𝑝𝑖≡ 2 𝑑+ 1 (mod 4 𝑑) implies that there are 𝑑 th roots of − 1in Z𝑚 , but no 2𝑑th roots of −1. Therefore, if 𝑑<𝑛no suitable evaluation points exist. However, having only 𝑑 th roots of − 1does not prevent us from finding a reasonably efficient multiplication algorithm. We cannot complete the recursion strategy, but we can still partially use it. To do so we just need to apply a technique called 𝑛/𝑑 -degree striding (as described in [ 22 ]), mapping our polynomials to a more convenient ring, defining an auxiliary new variable 𝑦=𝑥𝑛/𝑑 . We can always consider 𝑅[𝑥]/⟨𝑥𝑛+1⟩ as a subring of 𝑅[𝑥, 𝑦]/𝑥𝑛/𝑑−𝑦, 𝑥𝑛+1 , and observe we can also describe this second ring as 𝑅[𝑥][𝑦]/𝑥𝑛/𝑑−𝑦, 𝑦𝑑+1. With this simple change of variables we can now represent our original polynomial as a polynomial in 𝑦 with 𝑦 -degree bounded by 𝑑 that has as coefficients polynomials in 𝑅[𝑥] of 𝑥 -degree bounded by 𝑛/𝑑 . As a polynomial in 𝑦 it satisfies all required conditions as we are only considering modulus 𝑦𝑑+ 1and the new ring 𝑅′=𝑅[𝑥] does contain 𝑑 evaluation points 𝛼0, . . . , 𝛼𝑑−1 satisfying Conditions 1 to 3. With these 𝑑 th roots of − 1we can efficiently use 𝑔(𝑥, 𝑦) and ℎ(𝑥, 𝑦) to compute evaluations {𝑔(𝑥, 𝛼𝑖)} and {ℎ(𝑥, 𝛼𝑖)} , do a pointwise product in 𝑅[𝑥] (using an auxiliary multiplicationalgorithm, such as(Dual)Karatsuba)and invert the transform to recover the product (𝑔·ℎ)(𝑥, 𝑦) that directly gives us the desired solution substituting again 𝑦with 𝑥𝑛/𝑑. Observe that, the same way we have to choose an 𝛼 that is a 𝑑 th root of − 1to make the evaluation compatible with the quotient 𝑦𝑑+1 the other quotient 𝑥𝑛/𝑑−𝑦 implies that when computing the evaluation of the variable 𝑦 at 𝛼 we obtain as a result a polynomial in 𝑅[𝑥]/𝑥𝑛/𝑑−𝛼 , which is then only defined modulo 𝑥𝑛/𝑑−𝛼 . This is an artifact of the technique due to the additional variable introduced that has no impact in the final result, but helps us keep these 𝑥 -polynomials bounded when computing their products. The running time for both the transform and the anti-transform is now O𝑛log 𝑑 , added to the 𝑑 products of polynomials of degree 𝑛/𝑑 that require O(𝑛/𝑑)log3 operations each, for a total of O𝑛log 𝑑+𝑑(𝑛/𝑑)log3.
Chapter 2. Partial FFT Multiplication 101 From an abstract point of view, we could directly apply Algorithm 2.5, as it was described for a general ring 𝑅 , and therefore we could use it just taking into account to which ring each element belongs. However, for the sake of readability, we explicitate this generalization in Algorithm 2.8. Algorithm 2.8 Generalized Efficient FFT Multiplication Input: Two polynomials 𝑔(𝑥),ℎ(𝑥)of degree bounded by 𝑛 Auxiliary: A twofold set 𝛼0, . . . , 𝛼𝑑−1 of 𝑑 th roots of − 1with invertible differences Output: The product (𝑔·ℎ)(𝑥)of 𝑔(𝑥)and ℎ(𝑥)in Z𝑚[𝑥]/⟨𝑥𝑛+1⟩ 1: b𝑔(𝑦)≔𝑔(𝑥)rem 𝑥𝑛/𝑑−𝑦⊲polynomial in (Z𝑚[𝑥])[𝑦] 2: bℎ(𝑦)≔ℎ(𝑥)rem 𝑥𝑛/𝑑−𝑦⊲polynomial in (Z𝑚[𝑥])[𝑦] 3: 𝒈≔FFT(b𝑔(𝑦),𝛼0, . . . , 𝛼𝑑−1)⊲vector of polynomials in Z𝑚[𝑥] 4: 𝒉≔FFT(bℎ(𝑦),𝛼0, . . . , 𝛼𝑑−1)⊲vector of polynomials in Z𝑚[𝑥] Define 𝒇a vector of polynomials in Z𝑚[𝑥]of size 𝑑. 5: for 𝑖∈0, . . . , 𝑑 −1do 6: 𝒇[𝑖]≔Karatsuba(𝒈[𝑖],𝒉[𝑖]) rem 𝑥𝑛/𝑑−𝛼𝑖 7: end for 8: b𝑓(𝑦)≔IFFT(𝒇,𝛼0, . . . , 𝛼𝑑−1) 9: 𝑓(𝑥)≔b𝑓(𝑦)rem 𝑦−𝑥𝑛/𝑑 10: return 𝑓(𝑥) 2.5.1 Fast Chinese Remaindering As we mentioned in the introduction, this particular issue of partially splitting rings, where we cannot directly apply the original full FFT to the initial polynomials, has been studied in [ 86 ] for rings with prime modulus from a different point of view, considering FFT-like algorithms for efficiently applying the CRT [85, 121]. Recall the evaluation 𝑔(𝛼) of any polynomial in 𝛼 is equivalent to computing its remainder after dividing by 𝑥−𝛼 (this is known as the Polynomial Remainder Theorem). The main idea of these CRT approaches is to consider evaluations at 𝛼𝑖 as representatives for 𝑔(𝑥) (mod 𝑥−𝛼𝑖) , sufficient for determining 𝑔(𝑥) via the CRT since 𝑥𝑛+ 1 ≡Î𝑛−1 𝑗=0𝑥−𝛼𝑗(mod 𝑚) (as we know from Theorems 2.32 and 2.33). The same kind of recursions apply, given that both 𝑔(𝑥)rem 𝑥−𝛼𝑖 and 𝑔(𝑥)rem 𝑥−𝛼𝚤 can be computed from 𝑔(𝑥) (mod 𝑥2−𝛼𝑖2) (in an equivalent manner to what we saw in Section 2.3). We can see the vector whose components are these evaluations as the CRT representation of the polynomial. Pointwise multiplication of these vectors of evaluations for two polynomials 𝑔(𝑥) and ℎ(𝑥) is just a multiplication in the CRT
102 2.5. FFT Generalizations domain, and the interpolation consists of recovering the polynomial coefficients from the CRT representations. It is essentially a different interpretation of the same idea. It allows the same analysis as the CRT representation over a set of factors can be computed even if 𝑥𝑛−𝑎does not fully split. The important point is that this argument works even if 𝑑≠𝑛 , and we could use it to represent any polynomial with 𝑑 remainders (rem 𝑥𝑛/𝑑−𝛼𝑖) , compute the pointwise products among polynomials of degree bounded by 𝑛/𝑑 and then recover back the product polynomial modulo 𝑥𝑛−𝑎. Given a twofold set 𝛼0, . . . , 𝛼𝑑−1 of 𝑑 th roots of − 1with invertible differences, what we do in Algorithm 2.8 is precisely computing the reminders (rem 𝑥𝑛/𝑑−𝛼𝑖) that determine the original polynomials via the CRT. However, we believe ourpreviouspresentation isstillmoredirect andinformative, since the generalization to a not necessarily prime modulus in a partially splitting ring, not explored in [ 86 ], came completely for free, while the interpretation using the CRT requires a much more technically involved analysis when the ring is not a Principal Ideal Domain, or not even a Unique Factorization Domain. In order to verify the hypothesis of the theorem one should check whether some ideals are comaximal to be able to ensure that every mapping is indeed an isomorphism. Theorem 2.34 (CRT for Z𝑚[𝑥]/⟨𝑥𝑛−𝑎⟩ ).Let 𝑥𝑛−𝑎=Î𝑑−1 𝑖=0(𝑥𝑛/𝑑−𝛼𝑖) where {𝛼𝑖}𝑖 are a twofold set of 𝑑th roots of 𝑎with differences invertible in Z𝑚, then Z𝑚[𝑥]/⟨𝑥𝑛−𝑎⟩Z𝑚[𝑥]/D𝑥𝑛/𝑑−𝛼0E×···×Z𝑚[𝑥]/D𝑥𝑛/𝑑−𝛼𝑑−1E. Proof. For convenience, we are going to label the 𝑑 roots as 𝛼𝑏log(𝑑)−1...𝑏0 as we did in Figure 2.1. From an argument analogous to Theorem 2.33 we know that we can write 𝑥𝑛/2𝑘−𝛼𝑏𝑘−1...𝑏0=(𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0)(𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0). We have to prove that Z𝑚[𝑥].D𝑥𝑛/2𝑘−𝛼𝑏𝑘−1...𝑏0Eis isomorphic to Z𝑚[𝑥].D𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0E×Z𝑚[𝑥].D𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0E. We can define a map from Z𝑚[𝑥]to Z𝑚[𝑥].D𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0E×Z𝑚[𝑥].D𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0E by computing rem, and the kernel would be D𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0EÙD𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0E.
Chapter 2. Partial FFT Multiplication 103 That is, the map is also well-defined from Z𝑚[𝑥].D𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0EÙD𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0E. So far this discussion has been completely general. However, for these particular polynomials we have D𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0E+D𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0EZ𝑚[𝑥]. This is the case since (𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0)−(𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0)=𝛼1𝑏𝑘−1...𝑏0−𝛼0𝑏𝑘−1...𝑏0, which is invertible in Z𝑚(as every difference of roots is invertible), implying 1∈D𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0E+D𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0E. We can explicitly write this saying there are two polynomials 𝑔(𝑥) and ℎ(𝑥) such that (𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0)𝑔(𝑥)+(𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0)ℎ(𝑥)=1. On the one hand this implies that the map is surjective. From the previous identity we know any pair of polynomials (𝑎(𝑥), 𝑏(𝑥)) has a preimage 𝑏(𝑥)𝑔(𝑥)(𝑥𝑛/2𝑘+1− 𝛼0𝑏𝑘−1...𝑏0)+ 𝑎(𝑥)ℎ(𝑥)(𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0). On the other hand this implies D𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0EÙD𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0E=D𝑥𝑛/2𝑘−𝛼𝑏𝑘−1...𝑏0E. The right-hand side is directly a subset of the left-hand side. To see the other inclusion we can check that for any 𝑎(𝑥) ∈ D𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0EÙD𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0E, that is, there are polynomials 𝑏(𝑥)and 𝑐(𝑥)such that 𝑎(𝑥)=𝑏(𝑥)(𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0)=𝑐(𝑥)(𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0),
104 2.5. FFT Generalizations it is also true that 𝑎(𝑥)=𝑎(𝑥)·1 =𝑎(𝑥)(𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0)𝑔(𝑥)+ 𝑎(𝑥)(𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0)ℎ(𝑥) =𝑐(𝑥)(𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0)(𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0)𝑔(𝑥) +𝑏(𝑥)(𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0)(𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0)ℎ(𝑥) =(𝑐(𝑥)𝑔(𝑥)+𝑏(𝑥)ℎ(𝑥))(𝑥𝑛/2𝑘−𝛼𝑏𝑘−1...𝑏0), and therefore 𝑎(𝑥) ∈ D𝑥𝑛/2𝑘−𝛼𝑏𝑘−1...𝑏0E. Summing up, the desired mapping is an isomorphism. The main issue here is that the CRT is usually defined for principal ideal domains or at least unique factorization domains. If it is not the case, such as with our construction, we have to specifically check these additional properties, such as D𝑥𝑛/2𝑘+1−𝛼0𝑏𝑘−1...𝑏0Eand D𝑥𝑛/2𝑘+1−𝛼1𝑏𝑘−1...𝑏0Ebeing comaximal. □ We then have a polynomial 𝑔(𝑥) ∈ Z𝑚[𝑥]/⟨𝑥𝑛−𝑎⟩ and a twofold set of 𝑑 th roots of 𝑎with invertible differences {𝛼𝑏log(𝑑)−1𝑏log(𝑑)−2...𝑏0}. Our goal is to efficiently compute all 𝑔𝑏log(𝑑)−1...𝑏0(𝑥)=𝑔(𝑥) (rem 𝑥𝑛/𝑑−𝛼𝑏log(𝑑)−1...𝑏0) . To do so we start computing 𝑔0(𝑥)=𝑔(𝑥) (rem 𝑥𝑛/2−𝛼0) and 𝑔1(𝑥)=𝑔(𝑥) (rem 𝑥𝑛/2−𝛼1). Then we notice 𝑔0𝑏0(𝑥)=𝑔(𝑥) (rem 𝑥𝑛/4−𝛼0𝑏0)=𝑔𝑏0(𝑥) (rem 𝑥𝑛/4−𝛼0𝑏0) and 𝑔1𝑏0(𝑥)=𝑔(𝑥) (rem 𝑥𝑛/4−𝛼1𝑏0)=𝑔𝑏0(𝑥) (rem 𝑥𝑛/4−𝛼1𝑏0). In general, we can recursively compute 𝑔𝑏𝑖𝑏𝑖−1...𝑏0(𝑥)=𝑔(𝑥) (rem 𝑥𝑛/2𝑖+1− 𝛼𝑏𝑖𝑏𝑖−1...𝑏0)=𝑔𝑏𝑖−1...𝑏0(𝑥) (rem 𝑥𝑛/2𝑖+1−𝛼𝑏𝑖𝑏𝑖−1...𝑏0) . Therefore, at the 𝑖 th level, computing each remainder takes O𝑛/2𝑖 operations and has to be done O2𝑖 times, for a total cost of O𝑛. Observe computing 𝑔𝑏𝑖−1...𝑏0(𝑥) (rem 𝑥𝑛/2𝑖+1−𝛼0𝑏𝑖−1...𝑏0) is done taking the lower coefficients of 𝑔𝑏𝑖−1...𝑏0(𝑥)and adding the higher coefficients multiplied by 𝛼0𝑏𝑖−1...𝑏0. The same way, since 𝛼1𝑏𝑖−1...𝑏0=−𝛼0𝑏𝑖−1...𝑏0 we have that 𝑔𝑏𝑖−1...𝑏0(𝑥) (rem 𝑥𝑛/2𝑖+1− 𝛼1𝑏𝑖−1...𝑏0) is computed taking the lower coefficients of 𝑔𝑏𝑖−1...𝑏0(𝑥) and subtracting the higher coefficients multiplied by 𝛼0𝑏𝑖−1...𝑏0. Notice the multiplications are the same (and could be reused), and the only difference is that we add or subtract depending on the case. The number of levels is log(𝑑) , and we end up with O𝑛log(𝑑) operations to compute the CRT representation of 𝑔(𝑥) taking modulus over the 𝑑 different polynomials of degree 𝑛/𝑑.
Chapter 2. Partial FFT Multiplication 105 Algorithm 2.9 FFT (CRT) Input: A polynomial 𝑔(𝑥) of degree bounded by 𝑛 and a twofold set 𝛼0, . . . , 𝛼𝑑−1 of 𝑑th roots of 𝑎with invertible differences Output: Remainders of 𝑔(𝑥)when divided by 𝑥𝑛/𝑑−𝛼0, . . . , 𝑥𝑛/𝑑−𝛼𝑑−1 1: if 𝑟=1then return 𝑔 2: {𝑔𝑏log(𝑑)−2...𝑏0}≔FFT(𝑔, 𝛼02, . . . , 𝛼𝑑/2−12) 3: for 𝑏log(𝑑)−2. . . 𝑏0∈ {0,1}log(𝑑)−1do Split 𝑔𝑏log(𝑑)−2...𝑏0into 𝑔𝐿 𝑏log(𝑑)−2...𝑏0and 𝑔𝐻 𝑏log(𝑑)−2...𝑏0 4: 𝑔0𝑏log(𝑑)−2...𝑏0≔𝑔𝐿 𝑏log(𝑑)−2...𝑏0+𝑔𝐻 𝑏log(𝑑)−2...𝑏0·𝛼0𝑏log(𝑑)−2...𝑏0 5: 𝑔1𝑏log(𝑑)−2...𝑏0≔𝑔𝐿 𝑏log(𝑑)−2...𝑏0−𝑔𝐻 𝑏log(𝑑)−2...𝑏0·𝛼0𝑏log(𝑑)−2...𝑏0 6: end for 7: return {𝑔𝑏log(𝑑)−1𝑏log(𝑑)−2...𝑏0} At this point we could use Karatsuba’s algorithm to multiply them, that is, a cost of O𝑑(𝑛/𝑑)log(3). Then we have to invert these operations. To do so we could follow the same ideas inverting the operations at each level. In order to recover the lower part of 𝑔𝑏𝑖−1...𝑏0(𝑥) we add 𝑔0𝑏𝑖−1...𝑏0(𝑥)+𝑔1𝑏𝑖−1...𝑏0(𝑥) and divide by two (that is, multiply each coefficient by 2 −1 ). To recover the upper part we now subtract them computing 𝑔0𝑏𝑖−1...𝑏0(𝑥)− 𝑔1𝑏𝑖−1...𝑏0(𝑥) and multiply each coefficient by 2 −1(𝛼0𝑏𝑖−1...𝑏0)−1 . The cost of these operations is again O𝑛log(𝑑). As we have to divide by 2at each level one could just skip this step and divide by 𝑑at the end. Algorithm 2.10 IFFT (CRT) Input: A CRT representation 𝑔0. . . 𝑔𝑑−1 of a polynomial 𝑔(𝑥) of degree bounded by 𝑛, and a twofold set 𝛼0, . . . , 𝛼𝑑−1of 𝑑th roots of 𝑎with invertible differences Output: The polynomial 𝑔(𝑥) 1: if 𝑑=2then return 2−1(𝑔0+𝑔1)+𝑥𝑛/2(𝑔0+𝑔1)· 𝛼0−1 2: for 𝑏log(𝑑)−2. . . 𝑏0∈ {0,1}log(𝑑)−1do 3: 𝑔𝑏log(𝑑)−2...𝑏0≔2−1(𝑔0𝑏log(𝑑)−2...𝑏0+𝑔1𝑏log(𝑑)−2...𝑏0)+ 𝑥𝑛/𝑑2−1(𝑔0𝑏log(𝑑)−2...𝑏0−𝑔1𝑏log(𝑑)−2...𝑏0)·𝛼0𝑏log(𝑑)−2...𝑏0−1 4: end for 5: return IFFT({𝑔𝑏log(𝑑)−2...𝑏0},𝛼02, . . . , 𝛼𝑑/2−12) This alternative interpretation has then same properties and can also be used to
106 2.6. Conclusions design the same efficient multiplication algorithms. We reiterate here that we believe the previous presentation was more insightful, provided that some conditions, as the requirement for 𝑚to be odd, only appear as artifacts of the CRT construction. 2.6 Conclusions The main result can be summarized in the following way, in order to design an efficient multiplication algorithm in Z𝑚[𝑥]/⟨𝑥𝑛−𝑎⟩ via an FFT, the necessary and sufficient condition is to have a set of 𝑛 different 𝑛 th roots of 𝑎 (Condition 2, so that multiplication is compatible with congruence classes) with invertible differences (Condition 1, so that the inverse transform is defined) such that its recursive squares are equal two by two (Condition 3, so that the computation can be efficiently done recursively). This characterization is similar but not equivalent to the usual characterization with roots of unity (Condition 4), which is sufficient but not necessary. Despite that, we have proven in Theorem 2.24 that restricting to sets satisfying Condition 4 does not decrease the applicability of these efficient multiplication algorithms as the defined (𝛼,𝜔) -sets exist if and only if the necessary and sufficient sets satisfying Conditions 1 to 3 exist. As intermediate result we have also proven that these properties are indeed independent in the general case, and we do believe that this analysis might help to clarify whether some considerations and conditions usually stated in the folklore are fundamental considerations about the algebraic structure or just conventions for a particular instantiation on a particular setting (as it is the case with roots of unity). This framework is also a general introduction to FFT multiplication from a rigorous mathematical point of view while still keeping it readable for an audience not familiarized with more advanced algebraic considerations. For example our analysis directly generalizes, as we have seen in Section 2.5, to a ring where 𝑥𝑛−𝑎 does not fully split and Z𝑚 is not a field, while alternative interpretations are much more delicate to work with.
Chapter 3 Commitment scheme and companion ZKPoKs This chapter and the following constitute the core contribution of this dissertation. Now that we have motivated the need of new post-quantum cryptographic primitives, explained the power of ZKPoKs and carefully analyzed the properties of the quotient rings of polynomials that allow efficient operations, we already have all the tools to develop improved ZKPoKs for lattice constructions. Rather than presenting a bare proof of knowledge of the secret that characterizes a RLWE distribution we define a lattice-based commitment scheme and design interactive proofs of knowledge for several statements, including linear and multiplicative relations among committed elements. This work is going to be continued in the next chapter with the implementation of non-interactive versions of these proofs. 3.1 Introduction The goal of this chapter is to design new ways of proving linear and multiplicative relations between elements hidden in lattice-based structures, without revealing any additional information about the elements themselves. This kind of proofs play an important role in many applications, from authentication protocols to electronic voting, and can be used as building blocks for more complex cryptographic primitives. We choose to apply these new techniques to a commitment scheme and the relations between committed elements because the simple structure of the scheme allows us to explain what are the advantages and disadvantages of our methods and at the same time we provide a very flexible primitive with actual utility to solve a great variety of problems. In fact, the general strategy of proving statements about committed elements in zero-knowledge, called commit-and-prove, is an active 107
108 3.1. Introduction research field on its own, and we further increase its lattice-based branch. We focus on improving the applications of the seminal code-based Stern protocol [ 116 , 117 ] (mentioned in Section 1.3.8) to the lattice setting. It provides the most efficient ZKPoK for code-based cryptography [ 114 ], but we use its ideas to deal with the lattice-based RLWE problem as underlying hardness assumption. We increase the efficiency of existing proofs and show how to obtain exact ZKPoKs convincing a verifier that the prover knows a valid opening for a commitment. Then we use this opening proof as the foundation for the relation proofs, showing that committed messages satisfy linear or multiplicative relations. 3.1.1 Lattice-Based Zero-Knowledge Proofs Related Work In this chapter we specially benefit from the adaptation of Stern’s protocol to lattices from Ling et al. [ 76 ], the modification of Cayrel et al. [ 38 ] for reducing the soundness error increasing the number of rounds and the proposals of Jain et al. [ 64 ] and Xie et al. [124] for proving linear and multiplicative relations, that we further improve. It is also important to mention the contribution of Benhamouda et al. [ 19 ], who generalized the commitment idea of [ 124 ] without using Stern’s approach. We still use Stern-based techniques for the proofs but borrow the notation and structure from [ 19 ], as it is the more natural adaptation of [ 64 ] to the lattice scenario. They instead use Fiat-Shamir with aborts (the alternative technique we have also briefly discussed in Section 1.3.8). This decision implies relaxing the definition of commitment for their construction, because they are forced to admit as valid a set of openings larger than the set of openings an honest prover could get when committing to an element (the prover obtain an opening satisfying a relation ℜ but is only able to prove a milder relation ℜ′ ). In particular, even if the prover samples the noise terms from a bounded error distribution with bound 𝐵 the verifier is only convinced of the fact that it is bounded by a significantly larger 𝐵′≫𝐵. This has an impact on the restrictions the parameters have to satisfy. On the one hand, we have already seen in Section 1.3 the importance of the fact that the noise terms are small, which is extensively used in security proofs of lattice-based cryptography (in our case and in [ 19 ] it is used to prove that the commitment is binding). On the other hand, the error parameter has to be sufficiently large so that the underlying RLWE problem is hard enough. If from the same noise distribution bounded by 𝐵 we are only able to prove knowledge of an error term bounded by 𝐵′≫𝐵 then we might be forced to use this less tight bound to prove the remaining properties, obtaining worse results due to that gap. On the contrary, our proposal increases the literature of exact zero-knowledge proofs, providing ZKPoKs of committed elements without any soundness slack. This allows us to tightly choose
Chapter 3. Commitment scheme and companion ZKPoKs 109 all parameters as we do not have to take into account any error growth. This trade-off between efficiency and the soundness gap is a constant in the related literature. Bootle et al. [ 28 ] presented some succinct zero-knowledge arguments with an extreme soundness slack. In this case, a prover knowing a certain bound on the error term can only convince a verifier that they are able to extract an error which is exponentially larger. Nevertheless, several improvements have been made on rejection sampling techniques for proving relations among committed elements. First, Baum et al. [ 17 ] greatlyimprovedtheefficiencyofthisapproachusingtheMLWEproblemashardness assumption and changing the structure of the commitment, so the minimum size of the proofs is greatly reduced, though the binding property is ensured only computationally instead of statistically. While [ 17 ] already had an efficient proof for linear relations, the recent work of Attema et al. [ 14 ] provides new proofs for multiplicative relations for this commitment scheme. It has also been modified to provide even more efficient opening proofs in [119]. Some proposals as [ 29 ] or [ 51 ] try to circumvent the issues that arise from the relaxed definition of the commitment verifying additional conditions to obtain exact lattice-based proofs. A very prolific research path is the use of a relaxed commitment scheme with companion rejection sampling ZKPoKs as a subroutine of a more complex protocol that then obtains efficient exact proofs. As relaxed commitment scheme these applications use [ 17 ] (with small modifications). That is the case of [ 126 , 50 , 82 , 80 ]. Exact lattice-based ZKPoKs are therefore an active field of research. On the other hand, Stern-based techniques have been applied to prove knowledge of several relations (including multiplications) when committing (using lattices) to exponentially large integers using a polynomially large modulus 𝑞 , as it was done by Libert et al. in [ 74 ], and to prove matrix-vector relations [ 75 ] again by Libert et al. The first has been outperformed by Kuchta et al. in [ 70 ] and also in [ 81 ] by Lyubashevsky et al., using the rejection sampling scenario. A general technique useful to reduce the soundness error of Stern-based protocols was presented in [ 24 ], greatly reducing the proof sizes at the expense of significantly increasing the computational cost. 3.1.2 Our Contribution The main contribution of this chapter is an improvement over the first two Sternbased ZKPoKs for linear and multiplicative relations from [ 64 , 124 ]. Our ideas on proving multiplicative relations can be easily adapted to any scenario where messages are encoded as RLWE samples. Regarding the commitment itself we follow the notation from the proposal of
116 3.2. Stern-Based Schemes of [ 68 ]). This approach is used by Aguilar-Melchor et al. in [ 2 ], Cayrel et al. in [ 37 , 34 ], Bettaieb and Schrek in [23] and Branco and Mateus in [31]. Even more exotic signature schemes have been built using Stern-based protocols, as the undeniable signature scheme by Aguilar-Melchor et al. in [ 1 ], the blind signature [ 25 ] by Blazy et al., the group signature [ 6 ] by Alamélou et al. or the designated verifier signature [61] by Hongbin and Yan. We end this section revisiting with more detail the commitment schemes with Stern-based ZKPoKs for linear and multiplicative relations among committed elements. The first proposal in this direction was [64], due to Jain et al. The authors of [ 64 ] built a commitment scheme from the Learning Parity with Noise (LPN) problem. This problem states that given 𝑨∈F𝑘×𝑙 2 a binary matrix, it is hard to distinguish 𝑨𝒙 ⊕𝒆 from 𝒖 , where 𝒙∈F𝑙 2 and 𝒖∈F𝑘 2 are uniformly random binary vectors and 𝒆∈F𝑘 2 is a low-weight binary vector. It can be seen as a binary version of the decisional LWE problem. In this paper they use a version where the error distribution only outputs fixed weight errors, and call it xLPN. Security is preserved as LPN can be reduced to xLPN. Then, the commitment to a message 𝒎∈F𝑛 2 is 𝑨(𝒓||𝒎)⊕ 𝒆 , where 𝒓∈F𝑙−𝑛 2 is a random binary vector and 𝒆∈F𝑘 2 is again a random low-weight error. The most relevant feature of this commitment scheme is that it allows the committer to prove that they know a valid opening of a commitment, or that the hidden messages of different commitments satisfy any bitwise relation. To do this kind of proofs they present a dual version of the Stern protocol from [ 116 ], this time with the proper masking elements to achieve the zero-knowledge property that was not obtained in the dual version of [120]. Linear relations are proven by running in parallel three executions of the knowledge of opening protocol modifying the elements masking the messages so that they also satisfy the same linear relation. This simple strategy is going to be used too by [124, 19, 17] and us. In order to prove any bitwise relation, 𝒎3=𝒎1◦𝒎2 , they first extend the messages to a size four times larger. For each index 𝑗 in messages 𝒎1 and 𝒎2 we have a pair of bits (𝒎1[𝑗],𝒎2[𝑗]) . They append at the end three additional pairs flipping the first, the second or both bits 𝒎1[𝑗],𝒎2[𝑗] , 𝒎1[𝑗],𝒎2[𝑗] , 𝒎1[𝑗],𝒎2[𝑗] . We call e𝒎1,e𝒎2 to this extended versions and define e𝒎3=e𝒎1◦e𝒎2 . Notice that since each possible pair of bits appears the same amount of times once we permute these messages the result does not reveal anything about the original ones. Following the same strategy as the original Stern protocol some answers reveal the permutation but keep the messages masked, while some others prove 𝜋(e𝒎3)=𝜋(e𝒎1)◦𝜋(e𝒎2) , and only a combination of all the three answers gives us soundness.
Chapter 3. Commitment scheme and companion ZKPoKs 117 Notice the strategy is always the same, we expand the secrets so that we are able to completely randomize them in different ways (permuting or adding masking elements) that still preserve some properties, allowing us to remove one of the randomization elements to reveal that one property holds while the other kind of randomization hides everything else. The previous scheme only allowed commitments to binary messages, but its ideas were soon adapted to the lattice setting by Xie et al. in [ 124 ]. This article transforms the commitment scheme of [ 64 ] into a lattice proposal using a dual version of the techniques from [76] (presenting new ideas since it is not a trivial translation). Observe the RLWE problem is the right choice for this kind of constructions, even if the proofs are slightly more cumbersome, as it admits any message 𝑚∈𝑅𝑞 as a secret, treating the small error 𝑒←r𝜒 separately. This is not the case with the ISIS problem, where the only secret is restricted to have small norm, preventing us from computing arbitrary operations with the messages preserving this condition. The most difficult part is proving multiplicative relations. Authors first present a simple inefficient version directly following the ideas of [ 64 ]. In order to be able to randomize the secrets they extend them with a 𝑞2 overhead so that each pair (𝑎, 𝑏) ∈ Z𝑞×Z𝑞appears the same number of times. They can reduce the overhead to 4first decomposing the secrets in binary and then using the same idea as before. However, this requires repeating the proof log(𝑞)2 times, as we have decomposed each message in log(𝑞) binary messages, and we have to multiply them. The binary decomposition is never disclosed, because only a commitment to each binary message has to be published, so a linear relation has to be used to show that these commitments to binary vectors are indeed commitments to a binary decomposition of the original committed message. Binding property is obtained as two valid openings would imply the existence of a lattice vector shorter than the shortest lattice vector. Notice here that a binary decomposition was feasible when we were talking about the error term since it is bounded and needs only a small overhead. A binary decomposition for products of unbounded polynomials requires this log(𝑞)2 overhead. Our greatest contribution is going to be a newly designed proof that allows us to avoid such overhead. This prolific area has recently been mostly replaced by Fiat-Shamir with aborts proposals, but we however think that it is still interesting to see how far can we optimize the original Stern’s idea. In order to make faithful comparisons it is also important to be committed to strict formal proofs of security that can be quantitatively used to securely instantiate the lattice-based schemes belonging to this family, so that the current performance of this alternative can be properly evaluated.
118 3.3. Lattice-Based Commitment Scheme 3.3 Lattice-Based Commitment Scheme Now we can define our proposal for a lattice-based commitment scheme. Any message 𝑚∈𝑅𝑞 can be encoded as the coordinates of a point in an ideal lattice defined by 𝒂∈𝑅𝑘 𝑞 . To hide this lattice point 𝒂𝑚∈ ℒ(𝒂) we add a RLWE sample from another lattice 𝒃𝑟+𝒆 , where 𝒃∈𝑅𝑘 𝑞 defines this other lattice ℒ(𝒃) , the randomness 𝑟←r𝑅𝑞 is chosen uniformly at random and the error term 𝒆←r𝜒𝑘 is chosen from the appropriate bounded discrete Gaussian distribution. This structure 𝒂𝑚+𝒃𝑟+𝒆 is used by Benhamouda et al. in [ 19 ], and it is very similar to the one proposed by Xie et al. in [ 124 ]. We however define a different set of conditions designed to guarantee security and be able to latter design the companion ZKPoKs of valid openings, linear and multiplicative relations. The degree of the polynomial 𝑛= 2 𝜅 is a power of two, usually choosing 𝜅= 9or 𝜅= 10. The modulus 𝑞 is a prime number such that 𝑞≡ 2 𝑑+ 1 mod 4 𝑑 for another power of two 𝑑 smaller than 𝑛 (so that we can apply the efficient multiplication algorithm discussed in Chapter 2). Integer 𝑘 would be the multiplicative overhead (the length of 𝒂 as a vector of polynomials). And finally, as error distribution 𝜒 we would use a bounded discrete Gaussian distribution 𝐷𝜎,𝐵 of parameter 𝜎 and bound yet another power of two 𝐵 . That is, the probability of each coefficient would be proportional to that of a Gaussian distribution of standard deviation 𝜎 conditioned to be in [−𝐵, 𝐵), as defined in Section 1.3.1. Recall we abuse notation and just write ∥𝒆∥∞≤𝐵. Remember a commitment scheme is defined by a tuple of three algorithms Gen, Com and Ver, as defined in Definition 1.6. While the commitment algorithm Com we present in this chapter is formally the same as the one that was introduced in [ 19 ] the verification Ver algorithm is much simpler and satisfies the standard definitions, as our proofs of openings and relations do not require any relaxation (the set of valid openings is exactly the set of openings obtained following the commitment algorithm, which was not the case in [ 19 ]). Even if the commitment key (𝒂,𝒃) ←r(𝑅𝑘 𝑞)2 is equivalent and follows again a uniform distribution in (𝑅𝑘 𝑞)2 the public parameters pp ≔(𝑛, 𝑞, 𝑑, 𝑘, 𝜎, 𝐵) are defined in a different manner and have to satisfy less strict properties, so the key generation algorithm Gen is also different. For that reason the following proposal shares structure with [ 19 ], but is a different construction as a commitment scheme. 3.3.1 The Commitment Scheme The following is a secure lattice-based commitment scheme under the assumption that the decisional-RLWE is hard if the parameters are properly chosen. We define it
Chapter 3. Commitment scheme and companion ZKPoKs 119 here and prove its security in Section 3.3.2. • Gen: the generator algorithm takes a security parameter 1 𝜆 and outputs public parameters pp ≔(𝑛, 𝑞, 𝑑, 𝑘, 𝜎, 𝐵) , a public key pk ≔(𝒂,𝒃) ∈ (𝑅𝑘 𝑞)2 , where 𝑅𝑞=Z𝑞[𝑥]/⟨𝑥𝑛+1⟩and the noise distribution 𝜒is defined as 𝐷𝑛 𝜎,𝐵. (pk ≔(𝒂,𝒃);pp ≔(𝑛, 𝑞, 𝑑, 𝑘, 𝜎, 𝐵))←rGen 1𝜆 • Com: the commitment algorithm takes as input public parameters pp ≔ (𝑛, 𝑞, 𝑑, 𝑘, 𝜎, 𝐵) , a message 𝑚∈𝑅𝑞 and a public key pk ≔(𝒂,𝒃)∈(𝑅𝑘 𝑞)2 , and produces a commitment 𝒄≔𝒂𝑚+𝒃𝑟+𝒆 and an opening 𝑜≔(𝑟, 𝒆) , where 𝑟←r𝑅𝑞and 𝒆←r𝜒𝑘. (𝒄≔𝒂𝑚+𝒃𝑟+𝒆, 𝑜 ≔(𝑟, 𝒆))←rCom (𝑚;pk ≔(𝒂,𝒃),pp) • Ver: the verification algorithm takes as input public parameters pp ≔(𝑛, 𝑞, 𝑑, 𝑘, 𝜎, 𝐵) , a commitment 𝒄∈𝑅𝑘 𝑞 , a message 𝑚∈𝑅𝑞 , an opening 𝑜≔(𝑟, 𝒆) with 𝑟∈𝑅𝑞 and 𝒆∈𝑅𝑘 𝑞 , and a public key pk ≔(𝒂,𝒃) ∈ (𝑅𝑘 𝑞)2 , and accepts if 𝒄? =𝒂𝑚+𝒃𝑟+𝒆and ∥𝒆∥∞ ? ≤𝐵, or rejects otherwise. Ver :(𝒄, 𝑚, 𝑜;pk,pp)→accept,reject 3.3.2 Security Proofs of the Commitment Scheme Now we can see what conditions are sufficient for the commitment we have just described in Section 3.3.1 to be secure. Proposition 3.1 (Security of the commitment scheme).Provided that Gen outputs public parameters pp ≔(𝑛, 𝑞, 𝑑, 𝑘, 𝜎, 𝐵) satisfying the following conditions the previously defined commitment scheme is secure, i.e., satisfies the standard notions of correctness, binding, and hiding. •𝑞≡2𝑑+1(mod 4𝑑),(3.1) •𝑘≥𝜆+2𝑛log(𝑞) 𝑛(log(𝑞)/𝑑−log(4𝐵−1)),(3.2) •𝑑<log(𝑞) log(4𝐵−1),(3.3) •bitsec(RLWE𝑛 𝑞 𝑘 𝐷𝑛 𝜎) ≥ 𝜆,(3.4) •(𝐵−1)2 2𝜎2log(𝑒)−log(𝑛·𝑘) ≥ 𝜆+1.(3.5)
120 3.3. Lattice-Based Commitment Scheme Proof. We can check that all standard properties are verified, the commitment has correctness, it is perfectly binding except with negligible probability in the generation of the public key, and it is computationally hiding under the assumption that the decisional-RLWE is a hard problem. •Correctness: if everybody is honest the verifier accepts the opening. It immediately follows by the definitions of Com and Ver. The structure validated by the verifier (a lattice point with the message as coordinates 𝒂𝑚 plus a RLWE sample 𝒃𝑟+𝒆 ) is exactly the same used to build the commitment in the first place, and the additional condition on the norm of the noise term 𝒆 is ensured by the fact that we are already using as error distribution a truncated discrete Gaussian so that this condition is always satisfied. Notice that, as we are going to see when discussing the hiding property, the 𝜎 parameter is going to be chosen so that the probability of the tails from 𝐷𝑛 𝜎 is negligible in the security parameter 𝜆 , so one could alternatively use nontruncated discrete Gaussians at the expense of having correctness except with negligible probability. We prefer to define the scheme with perfect correctness and deal with the bounded tails when studying the hiding property because it makes the analysis slightly simpler. •Binding: a commitment can only be correctly opened to one message. We can guarantee it similarly than [ 19 ], using a counting argument to ensure that no two valid openings exist for a single commitment except with a very small probability in the sampling of the commitment key. Provided that our commitment definition does not need any kind of relaxation we are able to provide a simpler proof with tighter bounds. The argument is also generalized to the fact that 𝑥𝑛+ 1could factorize into 𝑑 irreducible polynomials, for 𝑑 any power of two smaller or equal than 𝑛 , instead of only considering the case 𝑑= 2. We also directly bound the undesired probability by a specific 2 −𝜆 , rather than proving that it is asymptotically negligible in 𝑛 , which helps the subsequent work of finding suitable parameters for a particular target security level. The binding property proof of [ 19 ] relies on the algebraic structure of 𝑅𝑞= Z𝑞[𝑥]/⟨𝑥𝑛+1⟩ . This structure heavily depends on the modulus 𝑞 , as it has an impact on the factorization of 𝑥𝑛+ 1, which is irreducible over the integers but splits into two irreducible polynomials of degree 𝑛/2 when 𝑞≡ 3 (mod 8 ) [ 115 ]. However, as we want to take advantage of the efficient multiplication algorithm described in Chapter 2 we have to use a different condition on the modulus.
Chapter 3. Commitment scheme and companion ZKPoKs 121 We have seen that 𝑞≡2𝑑+1(mod 4𝑑)(eq. (3.1)) implies via Theorem 2.32 that 𝑥𝑛+ 1splits into 𝑑 polynomials Î𝑑−1 𝑗=0𝑥𝑛/𝑑−𝛼𝑗 where each 𝑥𝑛/𝑑−𝛼𝑗is irreducible modulo 𝑞. We can similarly use this alternative attribute to prove the binding property for our construction. Furthermore, we want to prove that, with overwhelming probability over the choice of 𝒂,𝒃∈𝑅𝑘 𝑞, we have that accept ←Ver (𝒄, 𝑚′, 𝑜′;pk,pp) accept ←Ver (𝒄, 𝑚′′, 𝑜′′;pk,pp))=⇒𝑚′=𝑚′′. Two accepted openings to the same commitment would be 𝒄=𝒂𝑚′+𝒃𝑟′+𝒆′, 𝒄=𝒂𝑚′′ +𝒃𝑟′′ +𝒆′′. We have that 𝒂(𝑚′−𝑚′′)+𝒃(𝑟′−𝑟′′)+(𝒆′−𝒆′′)= 0, and we can rename the differences and write 𝒂𝑚+𝒃𝑟+𝒆 , where 𝑚≠ 0if 𝑚′≠𝑚′′ and the elements from 𝒆 belong to the interval [− 2 𝐵+ 1 , 2 𝐵− 1 ] if ∥𝒆′∥∞,∥𝒆′′∥∞≤𝐵 . However, we are going to see that, with overwhelming probability over the choice of 𝒂 and 𝒃 , and provided that 𝑞≡ 2 𝑑+ 1 (mod 4 𝑑) , 𝑑 is small enough and 𝑘 is large enough, there are no 𝑚, 𝑟 ∈𝑅𝑞 and 𝒆∈𝑅𝑘 𝑞 such that 𝒂𝑚+𝒃𝑟+𝒆= 0holds, 𝒆 is small and 𝑚≠0. For fixed 𝑚 , 𝑟 and 𝒆 we count the proportion of pairs (𝒂,𝒃) for which the equality holds. Then, in order to estimate the overall probability of choosing a pair (𝒂,𝒃) such that there exists a solution, we use a union bound adding up all previous probabilities for any possible triplet (𝑚, 𝑟, 𝒆) . We finally see that it is negligible if parameters are carefully selected. As we said, if we consider fixed 𝑚 , 𝑟 and 𝒆 , for each 𝒃 we have 𝒂𝑚=−𝒃𝑟−𝒆 . In each of the 𝑘 components 𝑎𝑖𝑚=−𝑏𝑖𝑟−𝑒𝑖 . 𝑞≡ 2 𝑑+ 1 (mod 4 𝑑) implies that 𝑥𝑛+ 1splits into 𝑑 irreducible polynomials 𝑝1(𝑥), 𝑝2(𝑥), . . . , 𝑝𝑑(𝑥) of degree 𝑛/𝑑 . We know that 𝑚. 0 mod 𝑥𝑛+ 1, therefore, 𝑚. 0 mod 𝑝𝑗(𝑥) for some 𝑗∈ {1, . . . , 𝑑}. For this case we know that choosing different 𝑎𝑖 we have that 𝑎𝑖𝑚 takes at least 𝑞𝑛/𝑑 different values (mod 𝑝𝑗(𝑥)) . There are 𝑞𝑛/𝑑 equivalence classes (mod 𝑝𝑗(𝑥)) and only one of them is −𝑏𝑖𝑟−𝑒𝑖(mod 𝑝𝑗(𝑥)) , therefore at most
122 3.3. Lattice-Based Commitment Scheme 1/𝑞𝑛/𝑑 of the possible 𝑎𝑖 hold the equation. As this is independently true for each 𝑖 , we have that the probability of (𝒂,𝒃) to fit the equation for these particular 𝑚,𝑟and 𝒆is at most 1/𝑞𝑛𝑘/𝑑. If we want to consider the possibility that there exists a solution, we can bound the total probability with a union bound. There are less than 𝑞𝑛 possible 𝑚 , 𝑞𝑛 possible 𝑟 and (4𝐵−1)𝑛𝑘 possible 𝒆 . Therefore, if (𝒂,𝒃) ←r(𝑅𝑘 𝑞)2 and we want to impose that the commitment is binding except with a probability smaller than 2−𝜆we have Pr (𝒂,𝒃)∃𝑚, 𝑟, 𝒆 𝒂𝑚+𝒃𝑟+𝒆=0 𝒆∈ [−2𝐵+1,2𝐵−1]𝑘 𝑚≠0≤𝑞2𝑛(4𝐵−1)𝑛𝑘 𝑞𝑛𝑘/𝑑≤2−𝜆. Taking logarithms, the condition that has to be satisfied is 𝑛(2log(𝑞)+ 𝑘(log(4𝐵−1)−log(𝑞)/𝑑)) ≤ −𝜆. If we ensure (log(4𝐵−1)−log(𝑞)/𝑑)is negative then we only need to choose 𝑘≥𝜆+2𝑛log(𝑞) 𝑛(log(𝑞)/𝑑−log(4𝐵−1)).(eq. (3.2)) Notice here the first condition just imposes the maximum value of 𝑑 we can still use, preserving the binding property, 𝑑<log(𝑞) log(4𝐵−1).(eq. (3.3)) There is an important trade-off in the result of Theorem 2.32, the more factors the faster the multiplication of ring elements can be implemented (the optimum is achieved when 𝑥𝑛+ 1splits into linear factors, and we can apply FFT multiplication), but achieving the binding property becomes harder. Considering that, we might end up with a larger commitment size or, if 𝑑 is too large, we might end up not being able to find a secure set of parameters at all. The smaller the error bound 𝐵 gets the more options we have for this trade-off. As larger bounds also increase the size of the proof, our goal would be to find the smaller bound 𝐵that still ensures the hiding property. • Hiding: a well constructed commitment 𝒄 does not leak any relevant information about the message 𝑚.
Chapter 3. Commitment scheme and companion ZKPoKs 123 It is computationally hiding as 𝒃𝑟+𝒆 are 𝑘 RLWE samples, indistinguishable from independent uniformly random polynomials under the decisional RLWE𝑛 𝑞 𝑘 𝐷𝑛 𝜎𝐵 assumption. Any adversary able to break the hiding property would then also be able to solve the RLWE𝑛 𝑞 𝑘 𝐷𝑛 𝜎𝐵 problem (as seen in Proposition 1.49). Notice that we choose parameters so that the probability that 𝒆←r𝐷𝑛𝑘 𝜎 has ∥𝒆∥∞>𝐵 is negligible and then original and conditioned probability distributions are statistically indistinguishable. First of all we have to check that the underlying computational problem is hard enough. We denote by bitsec(RLWE𝑛 𝑞 𝑘 𝜒) the number of security bits, i.e. 2 bitsec(RLWE𝑛 𝑞 𝑘 𝜒) would be a lower bound on the number of operations required to solve the problem. One can then study the asymptotic behavior, as we know the currently most efficient algorithms for the usual instantiations of the RLWE problem are still exponential, and just ensure that 𝑞 and 𝜒 are chosen so that the usual reductions can be applied to get bitsec(RLWE𝑛 𝑞 𝑘 𝜒) ∈ Ω(𝜆). For practical purposes the asymptotics are not enough because we do care about the constant factors that might determine if the scheme can or cannot be broken in practice. For that reason we directly estimate bitsec using Albrecht et al. Lattice Estimator*[8]. Let us take a moment to discuss how the noise terms are treated. On the one hand, regarding the hiding property, we are concerned with the indistinguishability of RLWE samples from uniform polynomials and, as we have seen in Section 1.3.7, we mainly have reductions from the decisional-RLWE problem to presumably hard lattice problems when the noise distribution 𝜒 is a Gaussian, and discrete Gaussians are the most well-studied noise distributions. On the other hand, regarding both correctness and binding, we can see that is not enough. The verification algorithm usually boils down to check that the commitment was correctly computed using the revealed randomness 𝑟 and 𝒆 . We then found two issues that arise from the noisy nature of the lattice problems. Acorrectly computed commitment would imply that the error term was sampled from 𝜒𝑘 , but any vector of polynomials 𝒗∈𝑅𝑘 𝑞 could be, even if with a very small probability, a sample from 𝜒𝑘 . Nevertheless, the fact that 𝒆 was small played an essential role when we proved that the equation 𝒄=𝒂𝑚+𝒃𝑟+𝒆 had a unique solution for 𝑚 , implying the binding property (without this restriction finding multiple openings would be trivial just isolating 𝒆 ). The only possibility we have to check it was correctly computed is to verify some condition on 𝒆 that is fulfilled with overwhelming probability when 𝒆 does *Commit f9f4b3c69d5be6df2c16243e8b1faa80703f020c from github.com/malb/lattice-estimator
124 3.3. Lattice-Based Commitment Scheme come from a discrete Gaussian and, at the same time, ensures a unique solution exists so that the binding property holds. This checkable property is just a bound on the infinity norm ∥𝒆∥∞≤𝐵, as we have seen. What we have left is to ensure that the decisional-RLWE problem remains hard even if we use a slightly different noise distribution because we condition the infinity norms to be bounded by 𝐵 . As we have seen in Proposition 1.53 indistinguishability is almost preserved if we substitute one distribution, just increasing the bound on the advantage by the SD. We have also seen in Proposition 1.55 that the SD when we condition to an event is the probability of that event not happening, and how to bound probabilities and distances between truncated or not multivariate discrete Gaussians in Propositions 1.63 and 1.64. We can particularize the definition of the advantage of an adversary against the hiding property, the ability they would have distinguishing two commitments to two different messages chosen by themself. More formally Adv hid (𝒜) = Pr 𝑏𝒜=𝑏 ((𝒂,𝒃);pp ≔(𝑛, 𝑞, 𝑑, 𝑘, 𝜎, 𝐵)) ←rGen(1𝜆) (𝑚0, 𝑚1,aux) ←r𝒜1((𝒂,𝒃),pp,1𝜆), 𝑏←r{0,1}, 𝑟←r𝑅𝑞,𝒆←r𝐷𝑛𝑘 𝜎,𝐵 𝒄=𝒂𝑚𝑏+𝒃𝑟+𝒆 𝑏𝒜←r𝒜2(𝒄,(𝒂,𝒃),pp,aux,1𝜆) −1/2 and we can apply Corollary 1.57 to relate it to the probability of the truncated Gaussian tails and the RLWE problem with a standard non-truncated discrete Gaussian distribution ≤Pr ∥𝒆∥∞>𝐵𝒆←r𝐷𝑛𝑘 𝜎 + Pr 𝑏𝒜=𝑏 ((𝒂,𝒃);pp ≔(𝑛, 𝑞, 𝑑, 𝑘, 𝜎, 𝐵)) ←rGen(1𝜆) (𝑚0, 𝑚1,aux) ←r𝒜1((𝒂,𝒃),pp,1𝜆), 𝑏←r{0,1}, 𝑟←r𝑅𝑞,𝒆←r𝐷𝑛𝑘 𝜎 𝒄=𝒂𝑚𝑏+𝒃𝑟+𝒆 𝑏𝒜←r𝒜2(𝒄,(𝒂,𝒃),pp,aux,1𝜆) −1/2
Chapter 3. Commitment scheme and companion ZKPoKs 125 which we know by Proposition 1.49 that is equivalent to the advantage of a similarly powerful (performs the same plus a constant number of operations) adversary ℬagainst the decisional RLWE𝑛 𝑞 𝑘 𝐷𝑛 𝜎problem ≤Pr ∥𝒆∥∞>𝐵𝒆←r𝐷𝑛𝑘 𝜎+max ℬn𝐴𝑑𝑣RLWE𝑛 𝑞 𝑘 𝐷𝑛 𝜎(ℬ)o. Observe we cannot apply here the usual strategy of bounding each of the two terms by some 𝜖/2 so that the total advantage is bounded by 𝜖 , because we cannot really be such precise for the second term. The assumption is computational, we can either prove only asymptotic claims (the advantage 𝐴𝑑𝑣RLWE𝑛 𝑞 𝑘 𝐷𝑛 𝜎 for polynomial adversaries is negligible in 𝜆 for sufficiently large parameters, but the actual constants depend on the polynomial that bounds the running time of the adversary) or make it so solving it with overwhelming probability takes 2 𝜆 operations and expect that there is no strange trade-off between computations and success probability, and therefore any algorithm with a running time significantly lower than 2 𝜆 would only achieve a sufficiently small success probability. The first part is simpler, as it is inherently a probability condition, and can be directly addressed to ensure it is below a certain threshold 2 −𝜆 . This approach is not entirely satisfactory, but it is the best we can do to mix computational assumptions with statistical statements. We follow the second procedure ensuring maxℬn𝐴𝑑𝑣RLWE𝑛 𝑞 𝑘 𝐷𝑛 𝜎(ℬ)o is insignificant by imposing bitsec(RLWE𝑛 𝑞 𝑘 𝐷𝑛 𝜎) ≥ 𝜆,(eq. (3.4)) and using the auxiliary functions that were discussed in Section 1.4.4 to find sufficient conditions for bounding the tail probability Pr h∥𝒆∥∞≤𝐵𝒆←r𝐷𝑛𝑘 𝜎i≥1−2−𝜆.(eq. (3.5’)) We explicitly defined vecBoundedPrFromBoundedPr in Proposition 1.64 so that if we find 𝑎such that Pr 𝑒∉[−𝐵, 𝐵)𝑒←r𝐷𝜎≤2−𝑎then −log Pr h∥𝒆∥∞>𝐵𝒆←r𝐷𝑛𝑘 𝜎i≥vecBoundedPrFromBoundedPr (𝑎, 𝑛𝑘), therefore it would be sufficient to ensure that vecBoundedPrFromBoundedPr (𝑎, 𝑛 ·𝑘)≥𝜆.
132 3.4. Interactive Zero-Knowledge Proofs of Knowledge Completeness If 𝒫 knows a valid witness and both the prover and the verifier correctly follow the protocol then the verifier always accepts at the end, as all relations hold by construction. The commitment verifications come from the correctness of the auxiliary commitment scheme and the fact that the 𝒈𝑗 were correctly computed using the previously committed 𝒇𝒋 and 𝒆′ 𝑗 (the fact that this 𝒈𝑗 have been sent before the second challenge is received implies that the same elements have to be used to prove all properties). The vector 𝒛 does belong to ℒ(𝒂) as it is equal to 𝒂(𝜇+𝛼𝑚) if the prover has followed the protocol (this is only possible because 𝒆 is small and therefore 𝜙(Í𝑗 2 𝑗𝒆′ 𝑗)−𝑩=𝒆 and cancels out the error terms). Finally, 𝒆′ 𝑗∈𝔅𝑛𝑘 if the original 𝒆 had all its coefficients in [−𝐵, 𝐵)and the 𝒆′ 𝑗have been computed using expand. Unlike Fiat-Shamir with aborts ZKPoKs here we have standard completeness as an honest prover will always succeed responding and there is no abort probability. Soundness Observe with each of the challenges 𝑏= 1or 𝑏= 0we check statements related to the conditions (a) and (b’). If a (possibly malicious) prover 𝒫∗ is able to provide accepted answers to 𝛿 rounds of interaction with an honest verifier 𝒱 with probability ((𝑞+1)/2𝑞)𝛿+𝜖 , were 𝜖 is non-negligible, then they are able to efficiently extract a witness with probability proportional to 𝜖. Recall the definition of soundness for an interactive protocol between a prover and a verifier 𝒫,𝒱 given in Definition 1.8. We want that for any 𝑥∉ ℜ the success probability of any malicious prover 𝒫∗should be small as Pr h𝒫∗,𝒱(𝑥)=accepti≤𝜖(𝑥). That is the goal of our proofs, as we want to convince the verifier of the validity of the statements, but we can also ensure that we could extract a witness using the knowledge-soundness Definition 1.10, that can be seen to imply soundness. In many occasions, soundness is then proved via showing Knowledge-Soundness because the proof satisfies yet another property, called special soundness, from which we need the multiple-moves version. Definition 3.2 ( (𝑘1, . . . , 𝑘𝜇) -Special Soundness as in [ 10 ]).A ( 2 𝜇+ 1 ) -move public-coin protocol is (𝑘1, . . . , 𝑘𝜇) -special sound if there is an efficient algorithm that on input
Chapter 3. Commitment scheme and companion ZKPoKs 133 Î𝜇 𝑗=1𝑘𝑗accepting transcripts n(𝑥, 𝑎, {𝑐𝑖1,...,𝑖𝑗}𝜇 𝑗=1,{𝑏𝑖1,...,𝑖𝑗}𝜇 𝑗=1)o𝑖𝑗∈{1,...,𝑘𝑗} ∀𝑗∈{1,...,𝜇}, such that 𝑐𝑖1,...,𝑖𝑗−1,𝑖𝑗≠𝑐𝑖1,...,𝑖𝑗−1,𝑖′ 𝑗 when 𝑖𝑗≠𝑖′ 𝑗 , outputs a witness 𝑤 such that (𝑥, 𝑤) ∈ ℜ . Observe this definition is a fine-graded generalization of the usual 𝑘 -special soundness for 3-move protocols where one just needs 𝑘 transcripts (𝑎, 𝑐𝑗, 𝑏𝑗) with 𝑐𝑗≠𝑐𝑗′ . Nevertheless, when working with multiple-move protocols asking just for a number of transcripts does not fully capture the structure of the proof, as the possibilities branch out with each different challenge and the tree structure of the relevant conversations plays a relevant role if one wants to obtain tight proofs (see Figure 1 of [11] for a nice visualization of the tree structure). Our proposal has been designed so that a single iteration of our opening protocol is ( 2 , 2 ) -special sound, as we just need four transcripts with 𝛼 and 𝛼′ as the first challenge and both 𝑏=0and 𝑏=1as the second for each of them. Proposition 3.3 ( ( 2 , 2 ) -Special Soundness of the Opening Protocol 3.1).The opening protocol described in Protocol 3.1 satisfies the definition of (2,2)-Special Soundness. Proof. If we can find commitments 𝑐1 , 𝑐2 , two 𝛼,𝛼′ and 𝒈𝑗,𝒈′ 𝑗 that induce accepted answers for both 𝑏=0and 𝑏=1then we can extract a valid witness. Define Δ𝛼=𝛼−𝛼′≠ 0. On the one hand, the binding property of 𝑐1 , 𝑐2 ensures that openings to e 𝜋𝑗 , e𝒚 and e𝒆′ 𝑗 are fixed (for the sake of simplifying the proof let us assume here that the auxiliary commitment is perfectly binding, what happens otherwise is going to be later discussed). 𝒛=e𝒚+𝛼(𝒄+𝑩)−𝒃e𝑠−𝜙(Í𝑗2𝑗e 𝜋−1 𝑗(𝒈𝑗)) 𝒛′=e𝒚+𝛼′(𝒄+𝑩)−𝒃e𝑠′−𝜙(Í𝑗2𝑗e 𝜋−1 𝑗(𝒈′ 𝑗)) Δ𝛼𝒄=(𝒛−𝒛′)+𝒃(e𝑠−e𝑠′)+𝜙(Í𝑗2𝑗e 𝜋−1 𝑗(𝒈𝑗−𝒈′ 𝑗))−Δ𝛼𝑩 𝒄= Δ−1 𝛼(𝒛−𝒛′)+𝒃(Δ−1 𝛼(e𝑠−e𝑠′))+𝜙(Í𝑗2𝑗e 𝜋−1 𝑗(Δ−1 𝛼(𝒈𝑗−𝒈′ 𝑗)))−𝑩 On the other hand, the claimed commitment to 𝜋𝑗(𝒇𝑗) is now opened to both 𝒈𝑗−𝛼e𝒆′ 𝑗 and 𝒈′ 𝑗−𝛼′e𝒆′ 𝑗 , so the binding property of the auxiliary commitment scheme now ensures an equality. 𝒈𝑗−𝛼e𝒆′ 𝑗=𝒈′ 𝑗−𝛼′e𝒆′ 𝑗 e𝒆′ 𝑗= Δ−1 𝛼(𝒈𝑗−𝒈′ 𝑗) So we can substitute it in the previous expression. 𝒄= Δ−1 𝛼(𝒛−𝒛′)+𝒃(Δ−1 𝛼(e𝑠−e𝑠′))+𝜙(Í𝑗2𝑗e 𝜋−1 𝑗(e𝒆′ 𝑗))−𝑩
134 3.4. Interactive Zero-Knowledge Proofs of Knowledge We know Δ−1 𝛼(𝒛−𝒛′) ∈ ℒ(𝒂) because 𝒛,𝒛′∈ ℒ(𝒂) , but it is still left to detail how to check if a point 𝒛 belongs to ℒ(𝒂) , the ideal lattice defined by 𝒂 , and how to recover its coordinates (the polynomial 𝑡∈𝑅𝑞 such that the vector of polynomials is 𝒂𝑡 ). In order to efficiently do so, we use one property of the commitment key that has not been mentioned yet, but that can be deduced from the binding property of the commitment scheme. Lemma 3.4. If (𝒂,𝒃) ∈ 𝑅𝑘 𝑞×𝑅𝑘 𝑞 defines a commitment key for a perfectly binding commitment scheme in a ring 𝑅𝑞=Z𝑞[𝑥]/⟨𝑥𝑛+1⟩ such that 𝑥𝑛+ 1splits in 𝑑 irreducible 𝑝𝑗(𝑥) modulo 𝑞 for 𝑗∈ { 1 , . . . , 𝑑} , then there exist 𝑑 indexes 𝑖𝑗 such that the component 𝑎𝑖𝑗∈𝑅𝑞is invertible modulo 𝑝𝑗(𝑥). Proof. This can be directly proved by contradiction. Assume it is not the case and for some 𝑗∈ {1, . . . , 𝑑}we have that 𝑎𝑖≡0modulo 𝑝𝑗(𝑥)for all 𝑖∈ {1, . . . , 𝑘}. Then we can define 𝑚0 such that 𝑚0≡ 0 mod 𝑝𝑗′(𝑥) for all 𝑗′≠𝑗 and 𝑚0≡ 1 mod 𝑝𝑗(𝑥) . By construction 𝑚0≠ 0but 𝒂𝑚0= 0and, therefore, we could open any commitment to any message 𝑚 to a different message 𝑚+𝑚0 , breaking the binding property of the commitment scheme. □ We explicitly check this condition (and abort if it is not satisfied) in the key generation protocol, but it will hold except with negligible probability if the used set of parameters is secure. We also output the specific indexes 𝑖𝑗 and the inverses 𝑎𝑖𝑗−1 mod 𝑝𝑗 as auxiliary parameters during the key generation protocol (even if omitted during the text, it is implicit that participants receiving the public key (𝒂,𝒃) also get these auxiliary elements precomputed). With that property in mind now we can see that, provided a vector of polynomials 𝒛∈𝑅𝑘 𝑞 ifthere existsapolynomial 𝑡 suchthat 𝒛=𝒂·𝑡 this 𝑡 shouldverifythat 𝑧𝑖𝑗≡𝑎𝑖𝑗𝑡 mod 𝑝𝑗(𝑥), and we could completely determine it from 𝑡≡𝑎𝑖𝑗−1𝑧𝑖𝑗mod 𝑝𝑗(𝑥). Since we have already restricted the possible candidates for 𝑡 to one single polynomial, we would just need to check that for every 𝑖∈ { 1 , . . . , 𝑘} and every 𝑗∈ { 1 , . . . , 𝑑} it holds that 𝑧𝑖≡𝑎𝑖𝑎𝑖𝑗−1𝑧𝑖𝑗mod 𝑝𝑗(𝑥) . Using again the invertibility of the 𝑎𝑖𝑗 , to verify 𝒛? ∈ ℒ(𝒂) it is sufficient to just check 𝑎𝑖𝑗𝑧𝑖 ? ≡𝑎𝑖𝑧𝑖𝑗mod 𝑝𝑗(𝑥) , without ever explicitly computing the 𝑡. Only the extractor needs to use these auxiliary public parameters to compute the involved 𝑡and 𝑡′from 𝒛and 𝒛′. Then it could finally write 𝒄=𝒂Δ−1 𝛼(𝑡−𝑡′)+𝒃(Δ−1 𝛼(e𝑠−e𝑠′))+𝜙(Í𝑗2𝑗e 𝜋−1 𝑗(e𝒆′ 𝑗))−𝑩. As these elements come from accepted answers we know that e𝒆′ 𝑗∈𝔅𝑛𝑘 ⊂ { 0 , 1 }2𝑛𝑘 and therefore 𝜙(Í𝑗2𝑗e 𝜋−1 𝑗(e𝒆′ 𝑗))−𝑩has norm smaller than 𝐵.
Chapter 3. Commitment scheme and companion ZKPoKs 135 Then (Δ−1 𝛼(e𝑡−e𝑡′),Δ−1 𝛼(e𝑠−e𝑠′),𝜙(Í𝑗2𝑗e 𝜋−1 𝑗(e𝒆′ 𝑗))−𝑩)is a valid opening. □ Observe the definition is only rigorously satisfied if the auxiliary commitment is perfectly binding, as we have explicitly used that two openings to the same commitment must be equal. Nevertheless, it is still possible to take advantage of the property if we instead use a computationally binding commitment. In that case, if we have used rewindable access to a prover 𝒫∗ to obtain the 4accepting conversations with the requested structure with a non-negligible probability, the commitment openings would still be unique with overwhelming probability, and we could still use the previous strategy to extract a valid witness. Recall the definition does not ask the extractor success probability to be exactly the difference between the success probability of 𝒫∗ and 𝜅 , as we are satisfied with it being decreased only in a polynomial amount (and a computationally binding commitment would only decrease it negligibly). We have mentioned the possibility of using rewindable access to a prover to get the accepting conversations, but to see how ( 2 , 2 ) -Special Soundness implies Knowledge-Soundness it remains to specify how to efficiently obtain such tree of conversations. A general tight efficient extractor was first defined in [ 10 ] and [ 11 ] proves (Theorem 3 in their paper) that a (𝑘1, . . . , 𝑘𝜇) -special sound protocol is knowledge sound with knowledge error 𝜅=1− 𝜇 Ö 𝑗=1𝒞𝑗−𝑘𝑗+1 𝒞𝑗.(3.7) That means a single repetition of the opening interactive protocol would be knowledge sound with knowledge error 𝜅=1−𝑞−2+1 𝑞·2−2+1 2=1−𝑞−1 2𝑞=𝑞+1 2𝑞. Itcorresponds totheprobabilityof correctlyguessingatleastoneofthechallenges, which is a usual property of this kind of protocols. Of course such bound on the cheating probability is unreasonable for any meaningful practical case. The general strategy is to repeat the same protocol 𝛿 independent times, significantly reducing the bound on the cheating probability to something as low as we are comfortable with. It is however significantly more involved to extract the useful accepting conversations from 𝛿 parallel repetitions of a (𝑘1, . . . , 𝑘𝜇) -special sound protocol (we specifically need to avoid exploring the whole possible execution tree as the complexity would then increase exponentially in the number of repetitions).
136 3.4. Interactive Zero-Knowledge Proofs of Knowledge Fortunately, the really novel contribution of [ 11 ] (presented in their Theorem 4) is that the parallel repetition of a (𝑘1, . . . , 𝑘𝜇) -special sound protocol 𝛿 times is knowledge sound with knowledge error 𝜅𝛿 (when the 𝛿 parallel repetitions effectively reduce the knowledge error from 𝜅 to 𝜅𝛿 they call it a strong parallel repetition result). Moreover, the extractor would only require a number of rewinds proportional to Î𝜇 𝑖=1𝑘𝑖(proportional to 4in the opening protocol). It is interesting to just mention how [ 11 ] achieves its results. Their main contribution is a novel extractor for a 𝑘 -special sound Σ -protocol (that is, with just three moves), that can then be naturally generalized to multi-round protocols, parallel repetitions, or both at the same time. This new extractor can be analyzed using a more fine-graded measure of the quality of the prover than just its expected success probability, given by the minimum expected probability of the prover when some challenges have been removed from the challenge set. This new definition comes naturally from the fact that, to be able to extract a witness from a 𝑘 -special sound protocol, we might try to sequentially obtain different accepting conversations with challenges different from the ones for which we have already obtained a valid conversation, therefore we are only interested in the success probability when the prover is challenged with a new challenge (removing the previous challenges from the challenge set), captured by this new notion. It allows them to easily define the extractor in a recursive way, aborting if the first attempt fails and recursively extracting (𝑘− 1 ) accepting conversations excluding the previous challenge for which we already have a valid conversation. Their approach then fails and aborts in the first step with probability 1 −𝜖 , and only continues with probability 𝜖 (the success probability of the prover). This allows the extractor to have O1/𝜖 attempts to obtain the next (𝑘− 1 ) accepting conversations while keeping the expected running time constant (it is proportional to 1/𝜖 with probability 𝜖 or constant otherwise). With that strategy, the success probability is proportional to 𝜖−𝜅 , as required by the standard definition, while keeping constant the expected number of prover rewinds. Furthermore, they also provide clever bounds for the success probability of the extractor applied to the parallel repetitions. Instead of ensuring that we can use one of the repetitions to extract a witness and focusing on it, or trying every 𝑖∈ { 1 , . . . , 𝛿} but bounding its probability with the probability of a single 𝑖 , they show the probability of being successful on at least one of the repetitions. This allows them to obtain an efficient extractor while obtaining a strong parallel repetition result, effectively reducing a knowledge-soundness error 𝜅to 𝜅𝛿. Using it we are able to ensure that the opening protocol satisfies Knowledge- Soundness and therefore soundness as introduced in Definitions 1.8 and 1.10.
Chapter 3. Commitment scheme and companion ZKPoKs 137 Zero-Knowledge In order to prove the protocol satisfies the honest verifier zero-knowledge property we are going to show the existence of a simulator 𝒮 that, given a pair of challenges (𝛼, 𝑏) , outputs a conversation following the same distribution as the ones one would obtain from honest provers and verifiers. This ensures that only the fact that the protocol was followed in order convinced the verifier that the prover knows the witness (as seen in the soundness property), but the conversation itself does not reveal any additional information about the secret because someone can indeed produce similar (computationally indistinguishable) transcripts using the simulator without any knowledge of the secret. We introduce here notation b𝑎 to refer to the simulated element that plays the role of some element 𝑎 so that we can then use both notations to prove that distributions involving b𝑎are identically distributed to those involving the honestly computed 𝑎. Case 𝑏=0.b𝑡,b𝑠←r𝑅𝑞,b𝒈𝑗←rZ2𝑛𝑘 𝑞,b 𝜋𝑗←r𝔖2𝑛𝑘 𝑐1←raCom({b 𝜋𝑗}𝑗,𝒂b𝑡+𝒃b𝑠+𝜙(Í𝑗2𝑗b 𝜋−1 𝑗(b𝒈𝑗))−𝛼(𝒄+𝑩)) 𝒮reveals {b𝒈𝑗}𝑗,{e 𝜋𝑗=b 𝜋𝑗}𝑗,e𝒚=𝒂b𝑡+𝒃b𝑠+𝜙(Í𝑗2𝑗b 𝜋−1 𝑗(b𝒈𝑗))−𝛼𝒄,e𝑠=b𝑠. Indistinguishable from a real conversation with the same 𝜋𝑗=b 𝜋𝑗 and where 𝜇=b𝑡−𝛼𝑚,𝜌=b𝑠−𝛼𝑟and 𝒇𝑗=b 𝜋−1 𝑗(b𝒈𝑗)−𝛼𝒆′ 𝑗. 𝒈𝑗=𝜋𝑗(𝒇𝑗+𝛼𝒆′ 𝑗) =𝜋𝑗(b 𝜋−1 𝑗(b𝒈𝑗))+𝜋𝑗(𝛼𝒆′ 𝑗−𝛼𝒆′ 𝑗) =b𝒈𝑗 𝒂𝜇+𝒃𝜌+𝜙(Í𝑗2𝑗𝒇𝑗)=𝒂(b𝑡−𝛼𝑚)+𝒃(b𝑠−𝛼𝑟)+𝜙(Í𝑗2𝑗(b 𝜋−1 𝑗(b𝒈𝑗)−𝛼𝒆′ 𝑗)) =𝒂b𝑡+𝒃b𝑠+𝜙(Í𝑗2𝑗b 𝜋−1 𝑗(b𝒈𝑗))−𝛼(𝒂𝑚+𝒃𝑟+𝜙(Í𝑗2𝑗𝒆′ 𝑗)) =𝒂b𝑡+𝒃b𝑠+𝜙(Í𝑗2𝑗b 𝜋−1 𝑗(b𝒈𝑗))−𝛼(𝒄+𝑩) Case 𝑏=1. b𝒆′ 𝑗←r𝔅𝑛𝑘 ,b𝒇𝑗←rZ2𝑛𝑘 𝑞,b 𝜋𝑗←r𝔖2𝑛𝑘 𝑐2←raCom({b 𝜋𝑗(b𝒇𝑗)}𝑗,{b 𝜋𝑗(b𝒆′ 𝑗)}𝑗) b𝒈𝑗=b 𝜋𝑗(b𝒇𝑗+𝛼b𝒆′ 𝑗)
138 3.4. Interactive Zero-Knowledge Proofs of Knowledge 𝒮 reveals {b𝒈𝑗}𝑗 , {e𝒆′ 𝑗=b 𝜋𝑗(b𝒆′ 𝑗)}𝑗 . Equivalent to an honest conversation were 𝜋𝑗 is such that 𝜋𝑗(𝒆′ 𝑗)=b 𝜋𝑗(b𝒆′ 𝑗)and 𝒇𝑗=𝜋−1 𝑗(b 𝜋𝑗(b𝒇𝑗)). 𝒈𝑗=𝜋𝑗(𝒇𝑗+𝛼𝒆′ 𝑗) =𝜋𝑗(𝜋−1 𝑗(b 𝜋𝑗(b𝒇𝑗)))+𝛼b 𝜋𝑗(b𝒆′ 𝑗) =b 𝜋𝑗(b𝒇𝑗+𝛼b𝒆′ 𝑗) =b𝒈𝑗 Notice that in both cases simulated conversations follow the same distribution as honest conversations. All omitted commitments can be computed as commitments to 0, which makes them indistinguishable from honestly computed commitments by the hiding property of the auxiliary commitment scheme. The elements 𝜋𝑗,𝜇,𝜌,𝒇𝑗 or just 𝜋𝑗,𝒇𝑗 in the first or the second case would follow precisely a uniform distribution as they would do in a real conversation (the permutation of uniformly random elements or the addition to uniformly random elements follows a uniform distribution and the fact that 𝜋𝑗(𝒆′ 𝑗) has to be b 𝜋𝑗(b𝒆′ 𝑗) is no restriction because b 𝜋𝑗 and b𝒆′ 𝑗 are uniformly distributed again). 3.4.2 Knowledge of a Linear Relation The feasibility of proving that different committed elements are related is the most important feature of the presented commitment scheme, as then it can be used as building block for more complex cryptographic applications. The linear structure of the commitment scheme aides the design of a linear relation proof. Given a secure public key 𝒂,𝒃∈𝑅𝑘 𝑞 and valid commitments 𝒄1,𝒄2,𝒄3∈𝑅𝑘 𝑞 with their respective openings to three messages 𝑚1, 𝑚2, 𝑚3∈𝑅𝑞 such that 𝑚3=𝜆1𝑚1+𝜆2𝑚2 for known 𝜆1,𝜆2∈𝑅𝑞 , the prover would like to convince the verifier of the fact that they not only know such valid openings but that the committed values 𝑚𝑖indeed satisfy the linear relation. From now on, in this subsection and the next, index 𝑖 will belong to { 1 , 2 , 3 } . The goal of the prover would then be to prove knowledge of 𝑚1, 𝑚2, 𝑚3∈𝑅𝑞 , 𝑟1, 𝑟2, 𝑟3∈𝑅𝑞 and 𝒆1,𝒆2,𝒆3∈𝑅𝑘 𝑞 so that 𝒄𝑖=𝒂𝑚𝑖+𝒃𝑟𝑖+𝒆𝑖 , ensuring that the error terms have coefficients with norm bounded by 𝐵 and that the committed values satisfy the linear relation with coefficients 𝜆1and 𝜆2. The main strategy consists on repeating three times in parallel the ZKPoK of a valid opening, for each of the three commitments. Then, an additional verification is added to check the linear relation. The shortness of the error terms is not compatible with linear transformations, so
Chapter 3. Commitment scheme and companion ZKPoKs 139 it has to be proven independently decomposing again {𝒆′ 𝑖𝑗}𝑗←expand(𝒆𝑖)so that 𝒄𝑖=𝒂𝑚𝑖+𝒃𝑟𝑖+𝜙(Í𝑗2𝑗𝒆′ 𝑖𝑗)−𝑩. To demonstrate that the committed messages satisfy the linear relation we just have to choose the message masking elements holding the same linear relation. 𝜇3 is computed as 𝜆1𝜇1+𝜆2𝜇2 , and in case 𝑏= 0the verifier just needs to check whether 𝒛3=𝜆1𝒛1+𝜆2𝒛2 . Provided 𝒛𝑖=𝒂(𝜇𝑖+𝛼𝑚𝑖) and the challenge 𝛼 has been chosen by the verifier when the 𝜇𝑖 already form part of one of the auxiliary commitments we are going to be able to deduce that this implies the linear relation holds for the committed messages. The full interaction between an honest prover 𝒫 and a verifier 𝒱 is completely specified in Protocol 3.2. Completeness Completeness comes from the completeness property of the opening protocol, as most of the computations are completely equivalent. The only new verification we should review is the linearity verification 𝒛3? =𝜆1𝒛1+𝜆2𝒛2. From the completeness analysis of the opening protocol we already know that if the prover washonest 𝒛𝑖=𝒂(𝜇𝑖+𝛼𝑚𝑖) . Ifthe statementis true then 𝑚3=𝜆1𝑚1+𝜆2𝑚2 , and if the prover has followed the protocol then 𝜇3=𝜆1𝜇1+𝜆2𝜇2 . Combining both we get that the verification should pass, and the linear protocol is also complete. Soundness If a (possibly malicious) prover 𝒫∗ is able to provide accepted answers to 𝛿 rounds of interaction with an honest verifier 𝒱 with probability ((𝑞+1)/2𝑞)𝛿+𝜖 , where 𝜖 is non-negligible, then they are able to efficiently extract a witness. We can extend the ( 2 , 2 ) -special soundness from the opening protocol to the linear proof. Applying the same arguments from four valid conversations with challenges 𝛼≠𝛼′ and 𝑏= 0and 𝑏= 1for both cases we could obtain three valid openings (Δ−1 𝛼(e𝑡𝑖−e𝑡′ 𝑖),Δ−1 𝛼(e𝑠𝑖−e𝑠′ 𝑖),𝜙(Í𝑗2𝑗e 𝜋−1 𝑖𝑗 (e𝒆′ 𝑖𝑗))−𝑩)𝑖.
140 3.4. Interactive Zero-Knowledge Proofs of Knowledge ZKP h𝑚𝑖, 𝑟𝑖,𝒆𝑖𝒄𝑖=𝒂𝑚𝑖+𝒃𝑟𝑖+𝒆𝑖,∥𝒆𝑖∥∞≤𝐵, 𝑚3=𝜆1𝑚1+𝜆2𝑚2i(3.8) Protocol 3.2 Knowledge of a Linear Relation 𝒫((𝒂,𝒃),{𝒄𝑖}𝑖,(𝜆1,𝜆2);{𝑚𝑖, 𝑟𝑖,𝒆𝑖}𝑖)𝒱((𝒂,𝒃),{𝒄𝑖}𝑖,(𝜆1,𝜆2)) 1: for 𝑖∈1,2,3do 2: {𝒆′ 𝑖𝑗 }𝑗←expand(𝒆′ 𝑖) 3: 𝜋𝑖0, . . . , 𝜋𝑖log(𝐵)←r𝔖2𝑛𝑘 4: 𝒇𝑖0, . . . , 𝒇𝑖log(𝐵)←rZ2𝑛𝑘 𝑞 5: 𝜇1,𝜇2,𝜌1,𝜌2,𝜌3←r𝑅𝑞 6: 𝜇3≔𝜆1𝜇1+𝜆2𝜇2 7: (𝑐1, 𝑜1) ←raCom{𝜋𝑖𝑗 }𝑖,𝑗 ,{𝒂𝜇𝑖+𝒃𝜌𝑖+𝜙(Í𝑗2𝑗𝒇𝑖𝑗)}𝑖 8: (𝑐2, 𝑜2) ←raCom{𝜋𝑖𝑗(𝒇𝑖𝑗)}𝑖,𝑗 ,{𝜋𝑖𝑗(𝒆′ 𝑖𝑗)}𝑖,𝑗𝑐1,𝑐2 −−−−−−−−−−−→ 9: 𝛼←rZ𝑞 𝛼 ←−−−−−−−−−−− 10: for 𝑖∈1,2,3do 11: for 𝑗∈0, . . . , log(𝐵)do 12: 𝒈𝑖𝑗 ≔𝜋𝑖𝑗(𝒇𝑖𝑗 +𝛼𝒆′ 𝑖𝑗){𝒈𝑖𝑗 }𝑖,𝑗 −−−−−−−−−−−→ 13: 𝑏←r{0,1} 𝑏 ←−−−−−−−−−−− 14: if 𝑏=0then 15: for 𝑖∈1,2,3do 16: e𝒚𝑖≔𝒂𝜇𝑖+𝒃𝜌𝑖+𝜙(Í𝑗2𝑗𝒇𝑖𝑗) 17: e𝑠𝑖≔𝜌𝑖+𝛼𝑟𝑖 18: for 𝑗∈0, . . . , log(𝐵)do 19: e 𝜋𝑖𝑗 ≔𝜋𝑖𝑗 20: e𝑜≔𝑜1 21: ans ≔({e 𝜋𝑖𝑗 }𝑖,𝑗 ,{e𝒚𝑖}𝑖,{e𝑠𝑖}𝑖,e𝑜) 22: if 𝑏=1then 23: for 𝑖∈1,2,3do 24: for 𝑗∈0, . . . , log(𝐵)do 25: e𝒆′ 𝑖𝑗 ≔𝜋𝑖𝑗(𝒆′ 𝑖𝑗) 26: e𝑜≔𝑜2 27: ans ≔({e𝒆′ 𝑖𝑗 }𝑖,𝑗 ,e𝑜)ans −−−−−−−−−−−→ 28: if 𝑏=0then 29: ? aVer𝑐1,({e 𝜋𝑖𝑗 }𝑖,𝑗 ,{e𝒚𝑖}𝑖),e𝑜 30: for 𝑖∈1,2,3do 31: 𝒛𝑖≔e𝒚𝑖+𝛼(𝒄𝑖+𝑩)−𝒃e𝑠𝑖−𝜙(Í𝑗2𝑗e 𝜋−1 𝑖𝑗 (𝒈𝑖𝑗)) ? ∈ ℒ(𝒂) 32: 𝒛3? =𝜆1𝒛1+𝜆2𝒛2 33: if 𝑏=1then 34: ? aVer𝑐2,({𝒈𝑖𝑗 −𝛼e𝒆′ 𝑖𝑗 }𝑖,𝑗 ,{e𝒆′ 𝑖𝑗 }𝑖,𝑗),e𝑜 35: for 𝑖∈1,2,3do 36: for 𝑗∈0, . . . , log(𝐵)do 37: e𝒆′ 𝑖𝑗 ? ∈𝔅𝑛𝑘
Chapter 3. Commitment scheme and companion ZKPoKs 141 We have to be aware that in general linearity of some lattice points 𝒛𝑖∈ ℒ(𝒂) does not always imply that the same relation holds for some coordinates of these points 𝑡𝑖 such that 𝒛𝑖=𝒂𝑡𝑖 . That is the case because 𝑅𝑞 is not an integral domain. Nevertheless, this property holds whenever 𝒂 is part of the public key of a binding commitment. We can prove it using a similar argument than the one we saw before with Lemma 3.4. Proposition 3.5 (Linearity of lattice points implies linearity of its coordinates if the commitment is binding).If (𝒂,𝒃) ∈ 𝑅𝑘 𝑞×𝑅𝑘 𝑞 defines a commitment key for a perfectly binding commitment scheme in a ring 𝑅𝑞=Z𝑞[𝑥]/⟨𝑥𝑛+1⟩ then 𝒛3=𝜆1𝒛1+𝜆2𝒛2 for 𝒛𝑖=𝒂𝑡𝑖∈𝑅𝑘 𝑞implies 𝑡3=𝜆1𝑡1+𝜆2𝑡2∈𝑅𝑞. Proof. Assume by contradiction the statement is false and 𝒛3=𝜆1𝒛1+𝜆2𝒛2 but 𝑡3≠𝜆1𝑡1+𝜆2𝑡2. Then we could define 𝑚0=𝑡3−𝜆1𝑡1−𝜆2𝑡2 . By assumption, we know 𝑚0≠ 0, but 𝒂𝑚0=𝒂𝑡3−𝜆1𝒂𝑡1−𝜆2𝒂𝑡2=𝒛3−𝜆1𝒛1−𝜆2𝒛2=0. This implies we could open any commitment to a message 𝑚∈𝑅𝑞 to a different value 𝑚+𝑚0 , contradicting the perfectly binding property of the commitment scheme. Our first assumption could not be correct, and the statement is therefore true. □ From the linear relation that the verifier would check if 𝑏= 0involving the 𝒛𝑖 or the 𝒛′ 𝑖 we can therefore obtain that e𝑡3=𝜆1e𝑡1+𝜆2e𝑡2 and similarly that e𝑡′ 3=𝜆1e𝑡′ 1+𝜆2e𝑡′ 2 . As a result, we have that the required linear relation holds Δ−1 𝛼(e𝑡3−e𝑡′ 3)=𝜆1Δ−1 𝛼(e𝑡1−e𝑡′ 1)+𝜆2Δ−1 𝛼(e𝑡2−e𝑡′ 2). That means a single repetition of the linear interactive protocol would be knowledge sound with knowledge error 𝜅=(𝑞+1)/2𝑞 . We could again repeat it 𝛿 times to reduce this knowledge error to 𝜅𝛿. Zero-Knowledge The same simulator for Protocol 3.1 works repeated 3times in parallel, with the only exception that in case 𝑏= 0we randomly choose b𝑡1,b𝑡2←r𝑅𝑞 but b𝑡3 would be computed asb𝑡3=𝜆1b𝑡1+𝜆2b𝑡2. This would be indistinguishable from a real conversation where 𝜇𝑖=b𝑡𝑖+𝛼𝑚𝑖 and this last condition ensures that 𝜇3 would be 𝜆1𝜇1+𝜆2𝜇2 as it would have been in a real conversation between an honest prover and a verifier.