Difference between revisions of "Efficient FHE from (Standard) LWE"

From certFHE Community KB
Jump to navigation Jump to search
 
(5 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
introduced a fully homomorphic encryption scheme which is based only on the [https://en.wikipedia.org/wiki/Learning_with_errors LWE] assumption. The authors show that the security of the scheme can be reduced to the worst-case hardness of [https://en.wikipedia.org/wiki/Lattice_problem short vector problem] on arbitrary latices.
 
introduced a fully homomorphic encryption scheme which is based only on the [https://en.wikipedia.org/wiki/Learning_with_errors LWE] assumption. The authors show that the security of the scheme can be reduced to the worst-case hardness of [https://en.wikipedia.org/wiki/Lattice_problem short vector problem] on arbitrary latices.
  
They start by introducing a somewhat homomorphic encryption scheme SH, which is then transformed into a bootstrappable scheme BTS. In doing so, the authors deviate from previously known techniques of “squashing” the decryption algorithm of SH that has been used by Dijk, Gentry, Halevi and Vaikuntanathan in [[FHE over the integers]] and instead introduce a new “dimension-modulus reduction” technique, which shortens the ciphertexts and simplifies the decryption circuit of SH. This is all achieved without introducing additional assumptions, such as the hardness of the sparse subset-sum problem.
+
They start by introducing a somewhat homomorphic encryption scheme SH, which is then transformed into a bootstrappable scheme BTS. In doing so, the authors deviate from previously known techniques of “squashing” the decryption algorithm of SH that has been used by Dijk, Gentry, Halevi and Vaikuntanathan in [[FHE over the Integers]] and instead introduce a new “dimension-modulus reduction” technique, which shortens the ciphertexts and simplifies the decryption circuit of SH. This is all achieved without introducing additional assumptions, such as the hardness of the [https://eprint.iacr.org/2011/567.pdf sparse subset-sum problem].
  
 
This scheme has particularly short ciphertexts and for this reasons the authors managed to use it for constructing an efficient single-server private information retrieval (PIR) protocol.
 
This scheme has particularly short ciphertexts and for this reasons the authors managed to use it for constructing an efficient single-server private information retrieval (PIR) protocol.
Line 75: Line 75:
 
By computing <math> w_{mult} - \langle v_{mult}, s_{l+1} \rangle </math> one will see that indeed this will be equal to the plaintext output <math> \mu \mu' </math> plus some noise term that depends on the input ciphertexts <math>c, c' </math> and also on the evaluation key <math> \Psi</math>.
 
By computing <math> w_{mult} - \langle v_{mult}, s_{l+1} \rangle </math> one will see that indeed this will be equal to the plaintext output <math> \mu \mu' </math> plus some noise term that depends on the input ciphertexts <math>c, c' </math> and also on the evaluation key <math> \Psi</math>.
  
TODO: Talk about the advantage of using this re-liniarization, maybe in a separate section.
+
The advantages of using this re-liniarisation technique for multiplications are detailed in Section 1.1 of [https://eprint.iacr.org/2011/344.pdf [1]].
  
 
<b> Decryption </b>: In this scheme, we only want to decrypt ciphertexts of the form <math>c = ((v,w),L) </math>, which are the ones that are <math>SH.Eval(\dots)</math> outputs. The algorithm <math>SH.Dec_{s_L}(c)</math> computes and <b> outputs </b>:
 
<b> Decryption </b>: In this scheme, we only want to decrypt ciphertexts of the form <math>c = ((v,w),L) </math>, which are the ones that are <math>SH.Eval(\dots)</math> outputs. The algorithm <math>SH.Dec_{s_L}(c)</math> computes and <b> outputs </b>:
Line 85: Line 85:
 
Although the scheme <math> SH </math> presented in the previous section is not bootstrappable, the authors introduce a new "dimension-modulus reduction" technique which allows them to transform <math> SH </math> into a scheme which has much shorter ciphertexts and lower decryption complexity.  
 
Although the scheme <math> SH </math> presented in the previous section is not bootstrappable, the authors introduce a new "dimension-modulus reduction" technique which allows them to transform <math> SH </math> into a scheme which has much shorter ciphertexts and lower decryption complexity.  
  
The new scheme inherits the parameters <math> (n,m,q, \chi, L) </math> from <math> SH </math> and has additional parameters <math> (k,p, \hat{\chi}) </math>, which we will refer to as the small parameters.
+
The new scheme inherits the parameters <math> (n,m,q, \chi, L) </math> from <math> SH </math> and has additional parameters <math> (k,p, \hat{\chi}) </math>, to which the authors refer as "small parameters".
  
 
The parameters <math>n,q \in \mathbb N </math> are the "long" dimension and the "long" modulus. while <math>k,p </math> are the "short" dimension and modulus, respectively. <math>\chi, \hat{\chi} </math> are the long and short noise distributions taken over <math>\mathbb Z_{q} </math> and <math> \mathbb Z_p </math>. The parameter <math> m</math> is used just for key generation and the parameter <math>L </math> is an upper bound on the multiplicative depth of the evaluated function.
 
The parameters <math>n,q \in \mathbb N </math> are the "long" dimension and the "long" modulus. while <math>k,p </math> are the "short" dimension and modulus, respectively. <math>\chi, \hat{\chi} </math> are the long and short noise distributions taken over <math>\mathbb Z_{q} </math> and <math> \mathbb Z_p </math>. The parameter <math> m</math> is used just for key generation and the parameter <math>L </math> is an upper bound on the multiplicative depth of the evaluated function.
  
Let us call this new scheme <math>BTS </math>.
+
For details concerning this new scheme <math>\mathrm{BTS}</math> as well as the proof that this is boostrappable, hence can (at least in theory) evaluate any circuit, we refer to the article listed below.
  
In the paper there is a discussion of the optimal parameter values. We choose not to include that here, but instead we consider the following easy to understand values as an example.
+
== References ==
 
 
The security parameter of <math>BTS </math> is <math> \lambda </math>. We can take <math> n= \lambda^4</math>, <math> q \approx 2^{\sqrt{n}}</math>, <math> L=1/3 \log{n} = 4/3 \log k</math>, <math> p =(n^2 \log q) \cdot poly(k) = poly(k) </math> and <math> m= O(n \log q) </math>. The distributions <math> \chi </math> and <math>\hat{\chi} </math> can be considered <math>n </math> and <math>k </math>-bounded, respectively. That is, samples from that distributions are bounded above by <math>n </math> and <math>k</math> with large probability.
 
 
 
TODO: Keygen, Encrypt, HomEval, Decrypt.
 
 
 
== Bootstrapping BTS into a Fully Homomorphic encryption scheme ==
 
 
 
'''Efficiency of the Scheme'''
 

Latest revision as of 13:15, 4 January 2021

As anounced in the title, Brakerski and Vaikuntanathan [1] introduced a fully homomorphic encryption scheme which is based only on the LWE assumption. The authors show that the security of the scheme can be reduced to the worst-case hardness of short vector problem on arbitrary latices.

They start by introducing a somewhat homomorphic encryption scheme SH, which is then transformed into a bootstrappable scheme BTS. In doing so, the authors deviate from previously known techniques of “squashing” the decryption algorithm of SH that has been used by Dijk, Gentry, Halevi and Vaikuntanathan in FHE over the Integers and instead introduce a new “dimension-modulus reduction” technique, which shortens the ciphertexts and simplifies the decryption circuit of SH. This is all achieved without introducing additional assumptions, such as the hardness of the sparse subset-sum problem.

This scheme has particularly short ciphertexts and for this reasons the authors managed to use it for constructing an efficient single-server private information retrieval (PIR) protocol.

A Somewhat Homomorphic encryption Scheme SH

Let us start by presenting a somewhat homomorphic encryption scheme. Denote by the security parameter. The scheme is parameterized by a dimension , a positive integer , an odd modulus (which does not have to be prime) and a noise distribution over . An additional parameter of the scheme is an upper bound on the maximal multiplicative depth that the scheme can homomorphically evaluate.

We are not going to elaborate on the appropriate choice of the size for the parameters, but we invite the curious reader to look at the paper. However, for brevity, we mention that the dimension is polynomial in the security parameter , is a polynomial in , the modulus is an odd number is sub-exponential in , i.e. is a positive constant which is strictly smaller than . The noise distribution produces small samples, of magnitude at most in . The depth bound is approximately of the size .

SH.Keygen: sample vectors uniformly from and compute, for all , and , the value

where and are chosen uniformly at from and from the distribution , respectively.

Let be the set of all these values. Notice that these seem like encryptions of (mod ), except these “ciphertexts” can’t be decrypted since the underlying message is not a single bit value.

The key generation might seem rather strange now, but publishing these “encryptions” of the quadratic terms in the secret keys is very important and we will explain this when we describe homomorphic multiplication.

The key-generation algorithm proceeds to choose a uniformly random matrix from and an -dimensional vector from the distribution . Set .

The algorithm outputs the secret key , the evaluation key and the public key .

Encryption(): We recall that the public key is . To encrypt a message , we sample a random vector and set:

and .

The output ciphertext contains the pair , together with a "level tag" which is used during homomorphic evaluation and indicates the multiplicative depth of the ciphertexts. Fresh ciphertexts, i.e. ciphertexts that are obtained straight from the encryption of messages and that did not suffer any homomorphic evaluation, will have this tag level zero. The encryption algorithm outputs .

Homomorphic evaluation: We now present the algorithm , where . We require that is represented by a binary arithmetic circuit with '' gates of arbitrary fan-in and '' gates with fan-in equal to . Furthermore, it is required that every circuit is layered, namely that it is composed of layers containing having either all '' gates or all '' gates. Every binary circuit can be represented in this way. It is also required that the multiplicative depth of the circuit is exactly .

The algorithm homomorphically evaluates the circuit gate by gate. We present how to perform homomorphic addition for arbitrarily many ciphertexts and homomorphic multiplication for two ciphertexts. Combining the two, any circuit can be evaluated.

Homomorphic evaluation will generate ciphertexts of the form , where the tag indicates the multiplicative level at which the ciphertext has been generated. Here the fact that is layered plays an important role, as it makes sure that all inputs to a gate have the same tag. Throughout the evaluation, it is important that the output of each gate evaluation is such that

,

where is the output of the gate in plaintext, i.e. the correct output, and is a noise term that depends on the ciphertexts that went into the gate. We always have due to the bound on the multiplicative depth and the output of the homomorphic evaluation of the entire circuit must have .

Addition gates: Let , where be ciphertexts. The homomorphic evaluation of their sum is performed by outputting

One can see that

Here is the plaintext corresponding to , so the homomorphic evaluation outputs a ciphertexts that corresponds to the sum of the inputs with a noise term that is equal to the sum of the noises of 's.

Multiplication of two ciphertexts . Let be two ciphertexts of level . The output of the multiplication will be a ciphertext of the form , since the level of multiplication is increased by .

Let us first consider the -variable symbolic polynomial in the vector :

.

Notice that when evaluated at the secret key vector , the above expression should give the plaintext (underlying message of the product of the ciphertexts) plus some additional noise term.

If we symbolically open the parenthesis of the (quadratic in ) polynomial above, we get something of the form

,

where are known coefficients. For managing the growth of the noise term, it is essential to express as a polynomial with small coefficients. This can be achieved by considering the binary representations , where .

Then we have , where the sum is over and .

Now recall that the evaluation key produced by contains elements of the form such that . The homomorphic multiplication algorithm will thus set

and and the final output will be .

By computing one will see that indeed this will be equal to the plaintext output plus some noise term that depends on the input ciphertexts and also on the evaluation key .

The advantages of using this re-liniarisation technique for multiplications are detailed in Section 1.1 of [1].

Decryption : In this scheme, we only want to decrypt ciphertexts of the form , which are the ones that are outputs. The algorithm computes and outputs :

( mod ) mod 2.

The Bootstrappable Scheme BTS

Although the scheme presented in the previous section is not bootstrappable, the authors introduce a new "dimension-modulus reduction" technique which allows them to transform into a scheme which has much shorter ciphertexts and lower decryption complexity.

The new scheme inherits the parameters from and has additional parameters , to which the authors refer as "small parameters".

The parameters are the "long" dimension and the "long" modulus. while are the "short" dimension and modulus, respectively. are the long and short noise distributions taken over and . The parameter is used just for key generation and the parameter is an upper bound on the multiplicative depth of the evaluated function.

For details concerning this new scheme as well as the proof that this is boostrappable, hence can (at least in theory) evaluate any circuit, we refer to the article listed below.

References

  1. Z. Brakerski, F. Vaikuntanathan, Efficient Fully Homomorphic Encryption from (Standard) LWE, SIAM J. Comput., 43(2), 831–871.