GSW - Bootstrapping

From certFHE Community KB
Jump to navigation Jump to search

Gentry's bootstrapping theorem [1] allows for converting a “somewhat homomorphic” encryption scheme (which supports only a bounded number of homomorphic operations) into a fully homomorphic encryption one (which has no such bound). The bounded nature of all known somewhat homomorphic schemes cannot be avoided due to “error” terms in their ciphertexts, which are necessary for security. The error grows as a result of performing homomorphic operations, and if it grows too large, the ciphertext will no longer decrypt correctly.

Bootstrapping the error of a ciphertext so that it can support more homomorphic operations, by homomorphically evaluating the decryption function on the ciphertext. The result is a ciphertext that still encrypts the original encrypted message. If the error coming from the homomorphic evaluation is smaller than the error in the original ciphertext, we say that the ciphertext is “refreshed”. To date, bootstrapping is the only known way of obtaining an unbounded FHE scheme, i.e., one that can homomorphically evaluate any efficient function using keys and ciphertexts of a fixed size.

Here we present an efficient bootstrapping method for a variant of the GSW scheme, as presented in the paper of Alperin-Sheriff and Peikert [2].

Recall that in GSW, a ciphertext is a square binary matrix , a secret key is a "structured" mod vector , and is an "approximate mod eigenvector" of , in the sense that , where is the message.

In this new variant, a ciphertext is a rectangular mod matrix , a secret key is some (unstructured, short) integer vector and (mod ), i.e. amd are corresponding left- and right- "approximate singular vectors" of .

A "simpler" variant of the GSW cryptosystem

The authors present a variant of the GSW scheme which permits a tighter analysis of its error growth under homomorphic operations.

Given a modulus , let us denote by and define the "gadget" (we will think of it as column) vector

Remark that , according to our choice of .

A randomized decomposition function. There is a randomized, efficiently computable function such that is "subgaussian" with parameter , and always satisfies . [3]

In particular is randomized and has low entries with very large probability.

For vectors and matrices over , define the randomized function by applying independently to each entry. Notice that for any , if , then has small entries (is "subgaussian") and

, where

is the block matrix with copies of as diagonal blocks, and zeros elsewhere.

This version of the GSW scheme has as parameters a dimension , a modulus and , as defined above. For bootstrapping, we only work with ciphertexts encrypting messages in . The ciphertext space is . For simplicity, we present just a symmetric-key scheme, which can be converted to a public key setting, similar to the one described in GSW.

A substantial difference between the original GSW scheme and this variant is the following: the homomorphic multiplication procedure in the current variant uses the randomized operation presented above. This gives important advantages, such as very simple error analysis (using the subgaussianity property) and the ability to completely re-randomize the error in a ciphertext.

The algorithms of the scheme are as follows

  • GSW.Gen(): choose and output the secret key .
  • GSW.Enc(): choose uniformly and , let mod , and output the ciphertext

where .

  • GSW.Dec(): let be the penultimate column of . Output , where indicates whether its argument is closer modulo to or to , the penultimate entry of .
  • GSW.Add(): Output .
  • GSW.Multiply( ): Output . This operation is a ramdomized one, as is randomized. The multiplication is also right-associative.

The authors remark that a fresh ciphertext is just plus a matrix which contains independent LWE samples under the secret which are pseudorandom if one assumes the hardness of .

Correctness and homomorphic operations

A ciphertext is said to be designed to encrypt a message (under a secret key ) if it is a fresh encryption of , or if is the sum (or the product) of two ciphertexts that are designed to encrypt and .

The error vector of a ciphertext designed to encrypt a message under the key is (mod ).

Notice that the matrix is designed to encrypt and has error .

Claim. If is designed to encrypt some and has error vector whose penultimate coordinate has magnitude less than , then GSW.Dec() correctly outputs .

This follows from the fact that and the penultimate column of is , where mod .

Let be ciphertexts designed to encrypt and have error vectors . Then, their homomorphic sum has error vector . Moreover, if is the homomorphic product of these ciphertexts, then for (subgaussian), we have the following


which as is further equal to

It is important to remember that the error upon multiplication is quasi-additive and asymmetric with respect to the errors . The first error is multiplied by a subgaussian matrix , the second error vector is only multiplied by the message , which the authors make sure they always keep in .

Homomorphic product of multiple ciphertexts. Suppose that are designed to encrypt and have error vectors . Then for any fixed values of these variables, the matrix

has an error vector whose entries are mutually independent and subgaussian with parameter , where is the concatenation of the individual error vectors.

Homomorphic encryption for Symmetric Groups

We describe HEPerm a homomorphic encryption scheme for symmetric groups. Let be the ciphertext space for the GSW scheme. The main procedures of HEPerm are as follows:

  • HEPerm.Enc(): let be the permutation matrix associated with . Output the following ciphertext space
, where

This is an entry-wise encryption of . Decryption is obvious. A ciphertext is said to be "designed" to encrypt a permutation , if its -entries are designed to encrypt the corresponding entries of .

will denote the encryption of the identity permutation, where each entry is encrypted with zero noise.

  • Homomorphic composition: will be computed in the obvious way. Namely, the entries of the output where

Like the multiplication for ciphertexts in the GSW, the composition is right associative.

  • Homomorphic equality test Eq?(): Given a ciphertext encrypting some permutation and a permutation (in the clear), output a ciphertext encrypting if and otherwise, i.e. output

where is the fixed zero-error encryption of .

Remark the for the two operations above, the GSW ciphertext(s) that appear in the output are always designed to encrypt messages.

To analyse the noise resulting in these operations, let is recall that the GSW scheme is parameterized by . Denote the space of error vectors by , where . The Euclidean norm on is defined in the ovious way. In the following analysis, we will often consider vectors and matrices over , i.e. in which the entries are vectors from .

Claim. (Lemma 4.1 in the first reference) The error matrix in is , where is the matrix encoding (in the clear), is the error of and the -entries of the matrix are mutually independent, and those in its -th row are subgaussian with parameter , where is the -th row of .

Similarly to a multiplication chain of GSW ciphertexts, one can perform a (right-associative) chain of compositions while incurring only small error growth. For conveniece of analysis, we always include the fixed zero-error ciphertext as the rightmost ciphertext in the chain.

Claim. (Corollary 4.2 in the first reference) Suppose that are designed to encrypt permutation matrices and have error matrices . Then for any fixed values of these variables,

has an error matrix whose -entries are mutually independent, and those in its -th row are subgaussian with parameter , where is the -th row of the concatenated matrices .


We have to instantiate the GSW and HEPerm with parameters . Importantly, the ciphertext modulus is not the modulus of the scheme to be bootstrapped, but rather some modulus . Let be the ciphertext of the GSW scheme.

Let be of the form , where are small powers of distinct primes. One can choose to be large enough by letting it be the product of all maximal prime-powers that are bounded by , of which there are . Let be the group embedding of into , and let denote the -th component of this embedding, i.e. the one from into .

  • BootGen(): Given secret key for the scheme GSW and a secret key for HEPerm, embed each coordinate of as and encrypt the components under HEPerm. That is, generate and output the bootstrapping key

Recalling that we are working with embeddings of , each can be represented as a tuple of GSW ciphertexts encrypting an indicator vector. Since and , the bootstrapping key has ciphertexts.

  • Bootstrap(): given a binary ciphertext , do the following:

First, homomorphically compute an encryption of using the encryptions of the as embedded into the permutation group . Additions above are replaced using a chain of compositions.

Then, one has to round. Homomorphically map to , in the following way. For each such that , homomorphically tests whether by evaluating the homomorphic product of the resulting ciphertexts from all the equality tests mod . Then homomorphically sum the results of all the tests.

Bootstrapping performs homomorphic multiplications and additions on GSW ciphertexts.

We refer to the paper of Alperin-Sheriff and Peikert [2] for a detailed analysis of the security and correctness.


  1. C. Gentry. Computing arbitrary functions of encrypted data. In "Communications of the ACM", 2010.
  2. J. Alperin-Sheriff and C. Peikert. Faster Bootstrapping with Polynomial Error. In CRYPTO 2014 (Springer).
  3. D. Micciancio and C. Peikert. Trapdoors for lattices: Simpler, tighter, faster, smaller. In EUROCRYPT, pages 700–718. 2012