Next Article in Journal
Tracing CVE Vulnerability Information to CAPEC Attack Patterns Using Natural Language Processing Techniques
Next Article in Special Issue
Data Security Protocol with Blind Factor in Cloud Environment
Previous Article in Journal
A Hybrid Knowledge-Based Recommender for Product-Service Systems Mass Customization
Previous Article in Special Issue
Formalizing the Blockchain-Based BlockVoke Protocol for Fast Certificate Revocation Using Colored Petri Nets
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Integer-Wise Functional Bootstrapping on TFHE: Applications in Secure Integer Arithmetics †

1
KDDI Research, Inc., Saitama 356-8502, Japan
2
Royal Holloway, University of London, London WC1E 7HU, UK
3
Simula UiB, Thormøhlens Gate 53D, 5006 Bergen, Norway
*
Author to whom correspondence should be addressed.
This paper is an extended version of our presentation in the 23rd Information Security Conference (ISC 2020), Online, 16–20 December 2020.
Information 2021, 12(8), 297; https://doi.org/10.3390/info12080297
Submission received: 5 July 2021 / Revised: 21 July 2021 / Accepted: 22 July 2021 / Published: 26 July 2021
(This article belongs to the Special Issue Secure Protocols for Future Technologies)

Abstract

:
TFHE is a fast fully homomorphic encryption scheme proposed by Chillotti et al. in Asiacrypt’ 2018. Integer-wise TFHE is a generalized version of TFHE that can encrypt the plaintext of an integer that was implicitly presented by Chillotti et al., and Bourse et al. presented the actual form of the scheme in CRYPTO’ 2018. However, Bourse et al.’s scheme provides only homomorphic integer additions and homomorphic evaluations of a sign function. In this paper, we construct a technique for operating any 1-variable function in only one bootstrapping of the integer-wise TFHE. For applications of the scheme, we also construct a useful homomorphic evaluation of several integer arithmetics: division, equality test, and multiplication between integer and binary numbers. Our implementation results show that our homomorphic division is approximately 3.4 times faster than any existing work and that its run time is less than 1 second for 4-bit integer inputs.

1. Introduction

Gentry first proposed a fully homomorphic encryption (FHE) construction in 2009 [1,2], and a variety of new features and hardness assumptions for FHE schemes [3,4,5,6,7,8,9,10,11,12,13] have been considered. The FHE performs computations on encrypted data without decryption of the data.
One notable application is secure computation in order to protect the secrecy of data against computation servers. An example of secure computation services is privacy-preserving machine learning as a service (MLaaS) [14,15]. In such a service, users want to hide sensitive data (e.g., genomic, anamnesis data, etc.) from the server and the server does not want to provide its cognitive models to users. FHE should be a fundamental component of secure multi-party computation (MPC). However, most applications are constructed without FHE operations because the MPC may require FHE operations many times and the run time of the operations would be substantial due to the inefficiency of FHE schemes.
Most FHE schemes consist of bit-wise or integer-wise encryption operations; the plaintext space is Z 2 in bit-wise encryption, and the plaintext space is Z p for some p > 2 in integer-wise encryption [16,17,18]. Some schemes have been executed via integer arithmetics, but bit-wise integer addition and multiplication are not practical even though the bit-wise integer comparison algorithm is efficient [19]. In particular, the full adder algorithm has to execute homomorphic multiplication l times for an l-bit length integer. Thus, homomorphic integer multiplication based on the full adder must execute approximately l 2 [18] operations.
On the other hand, integer-wise FHE schemes can efficiently perform addition and multiplication because the construction of those calculations in a homomorphic manner is merely integer addition and multiplication. Recent studies [14,15,20,21] on secure MLaaS used integer-wise homomorphic encryption. Secure integer-wise comparison [22] and integer-wise division [23] have recently been proposed; however, arithmetic operations such as division are remain impractical. The design of efficient algorithms for basic arithmetic operations is an open issue required to reduce computational costs of the operations.
HElib [24], HEAAN [25], PALISADE [26], SEAL [27], and TFHE [6,7,8] are open-source implementations of homomorphic encryption. TFHE is a variant of the FHEW scheme [28] in which the bootstrapping procedure can be performed in less than 0.1 seconds, which is a major bottleneck of FHE. TFHE successfully improved the overall performance of arithmetic operations, although TFHE does not explicitly provide integer-wise arithmetics. Moreover, the number of bootstrapping operations required is equal to the number of bits. Bourse et al. [14] modified TFHE to enable integer-wise encryption, which only supports homomorphic integer addition and homomorphic evaluation of the sign function.

Contribution

In this paper, we present an approach where an arbitrary function is executed during a bootstrap procedure in the integer-wise TFHE scheme with a generalization of the constant variable “test vector” in the bootstrapping. Our bootstrapping procedure is applicable to homomorphic operations of fundamental arithmetics, where specific settings of the value of test vector are given: We propose the homomorphic equality test (Eq, Algorithm 6) and its variant, which test the equality between a ciphertext and a plaintext (ConstEq, Algorithm 7); the homomorphic multiplication between an integer and a binary number (MultbyBin, Algorithm 8); and homomorphic division, where the dividend is a ciphertext and the divisor is a constant plaintext (DivbyConst, Algorithm 9). Based on these building blocks, we propose a homomorphic algorithm for integer division (Div, Algorithm 10). Our implementation of Divruns approximately 3.4 times faster than the fastest existing work. We also generalize the Divalgorithm to a homomorphic evaluation of an any 2-variable function.

2. Preliminaries

2.1. Notation

We write the security parameter as λ . We denote by T the torus of real numbers modulo 1, R / Z . For any ring R , polynomials of the variable X with coefficients in R are denoted by R [ X ] . We define R N [ X ] : = R [ X ] / ( X N + 1 ) , Z N [ X ] : = Z [ X ] / ( X N + 1 ) , and their quotient T N [ X ] : = R N [ X ] / Z N [ X ] , which are the ring of polynomials of variable X with quotient X N + 1 and real coefficients modulo 1. Let B : = { 0 , 1 } be a set, and we write vectors in bold. We write s $ S when s is uniformly random sampled from S . We denote by U ( S ) the uniform distribution over the set S , and we denote by e χ the process of sampling e according to the distribution χ .

2.2. Background of TFHE

2.2.1. Learning with Errors

The learning with errors (LWE) problem is a computational problem introduced by Regev [29]. We use the torus variant of LWE, as in [6,30]. Let n N , and let χ be a statistical distribution on R . The torus LWE distribution for a fixed uniformly random secret vector s $ B n is defined as follows:
LWE n , s , χ : = { ( a , b ) | a $ T n , e χ , b = a · s + e T } .
The search-LWE problem is to find the secret vector s from LWE samples { ( a i , a i · s + e i ) } i = 1 m sampled from LWE n , s , χ . The decision-LWE problem is to distinguish whether samples { ( a i , s · a i + e i ) } i = 1 m are drawn from LWE n , s , χ or U ( T n + 1 ) .
TFHE uses a sub-Gaussian distribution for the error distribution. A distribution χ σ over R such that t R , E ( e t X ) e σ 2 t 2 / 2 is called σ -sub-Gaussian. Let Y and Z be independent random variables that are σ - and σ -sub-Gaussian, respectively. Then, for all k, l R , k · Y + l · Z is k 2 σ 2 + l 2 σ 2 -sub-Gaussian.

2.2.2. Bit-Wise LWEEncryption

We briefly explain bit-wise Regev’s encryption [29], which is a building block of the (bit-wise) TFHE. Let m B be a plaintext. The encryption scheme works as follows:
  • Setup ( λ ) : Let the security parameter be λ . Select and fix public parameters n = n ( λ ) , σ = σ ( λ ) ; then, Setup ( λ ) samples a secret key s $ B n and outputs it.
  • Enc ( s , m ) : a uniformly random vector a $ T n and a noise e D T N [ X ] , σ are sampled, where D T N [ X ] , σ is the Gaussian distribution over T N [ X ] with a standard deviation σ . Then, the algorithm outputs a ciphertext ( a , b ) , where
    b = a · s + e + m / 2 .
  • Dec ( s , ( a , b ) ) : The decryption algorithm returns 2 ( b a · s ) . It outputs plaintext correctly if the size of noise e is bounded as
    | e | < 1 / 4 ,
    Since 2 ( b a · s ) = 2 e + m , | 2 e | < 1 2 , thus 2 ( b a · s ) = m .
We explain later in Section 2.4 that this scheme can be extended to integer-wise encryptions.

2.2.3. Torus LWE(TLWE)

The General-LWEproblem (GLWE) proposed by Brakerski, Gentry, and Vaikuntanathan [31] is a general problem that includes the LWE problem, and the Ring-LWE problem proposed by Lyubashevsky, Peikert, and Regev in [32]. TLWE is a torus analogue of the GLWE problem. Let k be a positive integer, N be a power of 2, and χ be a probability distribution over R N [ X ] . A TLWE secret key s ¯ is a vector of k polynomials over Z N [ X ] with binary coefficients, denoted as s ¯ B N [ X ] k . Given a polynomial message μ T N [ X ] , a “fresh” TLWE ciphertext of μ under the key s ¯ is a TLWE sample ( a ¯ , b ¯ ) T N [ X ] k × T N [ X ] , where a ¯ T N [ X ] k and b ¯ = s ¯ · a ¯ + μ + e , where e χ .
Let ( a ¯ , b ¯ ) be a TLWE ciphertext of a polynomial message μ T N [ X ] under a TLWE key s ¯ B N [ X ] k . Notice that the coefficients of the TLWE sample is an LWE ciphertext of the constant term of the polynomial message μ . We define the function SampleExtract that simply extracts the coefficients vector of the TLWE sample, and we denote the vector of coefficients of a polynomial a T N ( X ) by coefs ( a ( X ) ) . Then, we can obtain the extracted LWE ciphertext as ( a , b ) : = SampleExtract ( ( a ¯ , b ¯ ) ) , where a = ( coefs ( a ¯ 1 ( 1 / X ) ) , …, coefs ( a ¯ k ( 1 / X ) ) ) and b is the constant term of the polynomial b ¯ . This is the ciphertext encrypted with an extracted key s : = KeyExtract ( s ¯ )   : = ( coefs ( s ¯ 1 ( X ) ) , , coefs ( s ¯ k ( X ) ) ) Z k N .
As mentioned before, TLWE includes the LWE problem and the Ring-LWE problem. When N > 1 is large and k = 1 , TLWE is the (binary-secret) Ring-LWE. Conversely, when N = 1 and k is large, TLWE is the (binary-secret) LWE. Note that, in the TFHE library [33], N = 1024 and k = 1 by default; thus, TLWE is simply a Ring-LWE in the library, i.e., we can simple consider the TLWE samples as Ring-LWE samples ( a , b ) T N [ X ] × T N [ X ] in this paper.

2.2.4. TGSW

TGSW is a generalized variant of the GSW FHE scheme proposed by Gentry, Sahai, and Waters [10]. TGSW can be regarded as the matrix extension of TLWEbecause GSW is the matrix extension of LWE. Each row of a TGSW sample is a TLWE sample. As with TFHE [6], an external product ⊡ that maps : TGSW × TLWE TLWE can be defined. The product of the TGSW ciphertext of a polynomial message μ TGSW T N [ X ] and the TLWE ciphertext of a polynomial message μ TLWE T N [ X ] becomes a TLWE ciphertext of a polynomial message ( μ TGSW · μ TLWE ) T N [ X ] . We refer the readers to [6] for more details.

2.3. Overview of TFHE Bootstrapping

We refer to the bootstrapping procedure of the TFHE in [6]. We present the bootstrapping algorithm in Algorithm  1. As we mentioned before, in the default settings of the TFHE library [33], the dimension of the TLWE sample is set as k = 1 . This means that the TLWE sample is simply the Ring-LWEsample ( a ¯ , b ¯ ) T N [ X ] × T N [ X ] . In the rest of this paper, we set k = 1 : we also consider the TLWE sample to be the Ring-LWEsample ( a , b ) T N [ X ] × T N [ X ] .
Algorithm 1: TFHE bootstrapping [6] for binary arithmetics.
Input: An LWE sample ( a , b ) LWE s ( m in ) whose plaintext m in { 0 , 1 } , a constant m set { 0 , 1 } , a
   bootstrapping key BK s s , α , and a keyswitching key KS s s , γ , where s = KeyExtract ( s ) .
Output: An LWE sample LWE s ( m out ) , where m out = m in · m set .
1  μ : = m set 2 T , μ = μ 2 T
2  b ¯ : = 2 N b , a i ¯ : = 2 N a i for each i [ 1 , n ]
3 testv : = ( 1 + X + + X N 1 ) · X N 2 · μ T N [ X ]
4  ACC X b ¯ · ( 0 , testv ) T N [ X ] × T N [ X ]
5 for i = 1 to n do  ACC [ h + ( X a ¯ i 1 ) · BK i ] ACC   (
                           // ( ACC = TLWE ( X ( b ¯ a ¯ s ) · t e s t v ) = TLWE ( X ( m in N + e ) · t e s t v ) (
6  u : = ( 0 , μ ) + SampleExtract ( ACC )        //  ( msg ( SampleExtract ( ACC ) ) = μ ( m in = 1 ) , μ ( m in = 0 ) (
7  return  KeySwitch KS ( u )

2.3.1. Input

The input for the bootstrapping is an LWE ciphertext of message binary message m in B , ( a , b ) T n × T , where b = a · s + e + m in 2 . The noise e is sampled according to the distribution such that | e | < 1 4 to satisfy the condition for correct decryption of the LWE encryption.

2.3.2. Rounding

After the rounding operation in line 2, we obtain an rounded LWE ciphertext ( a ¯ , b ¯ ) Z 2 N n × Z 2 N , where
b ¯ a ¯ · s = 2 N b i = 1 n 2 N a i s i = 2 N b + ξ 0 i = 1 n ( 2 N a i + ξ i ) s i = 2 N e + m in / 2 + e ACC ,
and e ACC : = ξ 0 i = 1 n ξ i s i and ξ 0 , ξ n are rounding errors that are uniformly distributed over ( 1 2 , 1 2 ) . Note that e ACC = 0 when the coefficients ( a , b ) are in 1 2 N Z / Z ; thus, we can ignore e ACC when we use the default parameter setting in the TFHE library of N = 1024 .

2.3.3. BlindRotate

At the line 4, ACC is a trivial TLWE ciphertext ( 0 , X b ¯ · testv ) T N [ X ] × T N [ X ] ; thus, Error ( ACC 1 ) = 0 . After the loop in line 5, from [6] (Theorem 4.6), we have
Error ( ACC n ) 2 n ( k + 1 ) l N β α BK + n ( 1 + k N ) ϵ ,
where β = B g / 2 and ϵ = 1 / 2 B g l are the precision parameters of the gadget decomposition, l N , B g N , and α BK is a error size ratio of the bootstrapping key BK. After the loop in line 5, the message of ACC becomes a polynomial X b ¯ a ¯ s · testv . From (3) and e ACC = 0 , we have ψ ( ( a ¯ , b ¯ ) ) : = b ¯ a ¯ · s = 2 N e + m in / 2 . Notice that
X b ¯ a ¯ · s · testv = X b ¯ a ¯ · s + N 2 · ( 1 + X 1 + + X ( N 1 ) ) · μ ,
where b ¯ a ¯ · s + N 2 = 2 N e + N 2 + N m in , and from (2), we obtain 0 < 2 N e + N 2 < N . Therefore, we have the following facts:
b ¯ a ¯ · s + N 2 [ 0 , N ) ( m in = 0 ) , [ N , 2 N ) ( m in = 1 ) , the constant term of X b ¯ a ¯ · s · testv = μ ( m in = 0 ) , μ ( m in = 1 ) .
Note that, here, we used the fact that X i X N + i , which follows the definition X N + 1 0 .

2.3.4. Extract

The output of SampleExtract in line 6 is simply the coefficients vector of the TLWE sample over the torus ( a , b ) : = ( coefs ( a ( X ) ) , b 0 ) T N × T , where coefs ( a ( X ) ) is a coefficient vector of a T N ( X ) and b 0 T is a constant term of the polynomial b T N ( X ) . The message of the extracted sample msg ( ( a , b ) ) is the constant term of the polynomial ( X b ¯ a ¯ · s · testv ) . The message is μ if m in = 0 and μ if m in = 1 . Therefore,
msg ( u ) = μ + msg ( SampleExtract ( ACC ) = 2 μ ( = μ ) ( m in = 0 ) , 0 ( m in = 1 ) ;
i.e., msg ( u ) = μ · ( 1 m in ) . The size of the error of ( a , b ) remains Error ( ACC ) since SampleExtract adds no extra noise.

2.3.5. KeySwitch

The output of KeySwitchin line 7 is a TLWE sample ( a , b ) T n × T of a message m out 2 T , with the secret key s . We write this TLWE ciphertext as LWE s ( m out ) for simplicity of the notation. The KeySwitchprocedure is the same as that in [6]. We refer to KeySwitch in Algorithm 2 for completeness of this paper. The keyswitching key is defined as KS s s , γ , t , where KS i , j LWE s , γ ( s i · 2 j ) for i [ 1 , N ] and j [ 1 , t ] . Here, γ R is a parameter that decides the size of the noise of the key switching key, which satisfies Error ( KS i , j ) γ , and t N is a parameter that decides the precision. From [6] (Lemma 4.3), we obtain
ψ s ( a , b ) = ψ s ( 0 , b ) i = 1 N j = 1 t a i , j φ s ( KS i , j ) , = ψ s ( a , b ) i = 1 N j = 1 t a i , j Error ( KS i , j ) + i = 1 N ( a i a ¯ i ) s i .
Therefore, we have the bound on the size of the noise as follows:
Error ( a , b ) Error ( ACC ) + N t γ + N 2 ( t + 1 ) , 2 n ( k + 1 ) l N β α BK + n ( 1 + k N ) ϵ + N t γ + N 2 ( t + 1 ) ,
where the second inequality follows from (4). The bootstrapping outputs a “fresh” LWE ciphertext when the parameters satisfy the following:
2 n ( k + 1 ) l N β α BK + n ( 1 + k N ) ϵ + N t γ + N 2 ( t + 1 ) < 1 / 4 .
Algorithm 2: KeySwitch.
Information 12 00297 i001
This upper bound follows from (2).

2.4. Integer-Wise LWE Encryption

We use a integer-extended variant of Regev’s encryption following the scheme proposed by Bourse et al. in [14]. Let τ N , the message m { τ , , τ 1 } . The integer-wise LWE encryption works as follows:
  • Setup ( λ ) : On a input security parameter λ , n = n ( λ ) and σ = σ ( λ ) are fixed; a secret key s $ B n is output.
  • Enc ( s , m ) : A uniformly random vector a $ T n and a noise e D T N [ X ] , σ are sampled, where D T N [ X ] , σ is a Gaussian distribution over T N [ X ] with a standard deviation σ . A ciphertext ( a , b ) is output, where
    b = a · s + e + m 2 τ .
  • Dec ( s , ( a , b ) ) : The decryption algorithm returns ( b a · s ) · 2 τ . The decryption works correctly if the size noise | e | is small enough, i.e.,
    | e | < 1 / 4 τ ,
    Since b a · s · 2 τ = e + m 2 τ · 2 τ = m + 2 τ e and | 2 τ e | < 1 2 holds from (7).

3. Integer-Wise General Functional Bootstrapping

We modify TFHE to a variant that can encrypt the plaintext of an integer and perform any 1-variable function in only one bootstrapping. We highlight this section as follows:
  • We present our general bootstrapping in Algorithm 3 of Section 3.1, which is built upon the integer-wise LWE encryption Section 2.4.
  • Our key technique to construct the general bootstrapping is generalizing the setting of the coefficients of the test vector, which is used in the BlindRotate part of the bootstrapping procedure, in Algorithm 4.
  • We also discuss the possible security issue that arose after our modification in Section 3.2.

3.1. General Functional Bootstrapping

We present our bootstrapping scheme in Algorithm 3. Our bootstrapping is different from that of Chillotti et al.’s Algorithm 1 in the setting of the test vector used in the BlindRotatepart. Our bootstrapping procedure is constructed over the integer-wise LWE encryption described in Section 2.4, where homomorphic evaluation is performed in an integer-wise manner. We summarize in Table 1 how the input ciphertext is converted line by line for clarity.
Algorithm 3: General functional bootstrapping.
Input: A ciphertext C m in : = An LWE sample ( a , b ) LWE s ( m in ) , such that its plaintext m in { τ , , τ 1 } , a
   bootstrapping key BK s s , α , a keyswitching key KS s s , γ , where s = KeyExtract ( s ) , a constant function
    f : { 0 , , τ 1 } { τ , , τ 1 } , and a set of coefficients { μ 0 , , μ N 1 } of the test vector that.
    corresponds to the function f
Output: An LWE sample LWE s ( m out ) : = Bootstrap ( C m in , f ) , where
m out = f ( m in ) : = { f ( m in ) ( m in { 0 , , τ 1 } ) , f ( τ + m in ) ( m in { τ , , 1 } ) .

1  b ¯ : = 2 N b , a i ¯ : = 2 N a i for each i [ 1 , n ]
2  Set the test vector as
testv : = μ 0 + μ 1 X 1 + + μ N 1 X ( N 1 ) T N [ X ] .

3  ACC X b ¯ · ( 0 , testv ) T N [ X ] × T N [ X ]
4 for i = 1 to n do  ACC [ h + ( X a ¯ i 1 ) · BK i ] ACC
  (
5  u : = SampleExtract ( ACC )
6 return  KeySwitch KS ( u )

3.1.1. Input

The input for our bootstrapping scheme is an LWE ciphertext ( a , b ) T n × T of an integer message m in { τ , , τ 1 } , where b = a · s + e + m in / 2 τ . The noise e is sampled according to the distribution such that (7) holds to satisfy the condition for correct decryption of the LWE encryption.

3.1.2. Rounding (Line 1)

The output of the rounding is an rounded LWE ciphertext ( a ¯ , b ¯ ) Z 2 N n × Z 2 N . Similar to (3), we have
b ¯ a ¯ s = 2 N e + m in / 2 τ + e ACC .
Concretely, we obtain e ACC = 0 when N = 1024 , as we mentioned in Section 2.3.

3.1.3. BlindRotate (Line 3 to Line 4)

At line 3, the ACC is a trivial (noiseless) TLWE sample ( 0 , X b ¯ · testv ) T N [ X ] × T N [ X ] . After the iteration in line 4, the message of ACC becomes a polynomial X b ¯ a ¯ s · testv . Since e ACC = 0 and from (10), we have ψ ( ( a ¯ , b ¯ ) ) : = b ¯ a ¯ s = 2 N e + m in 2 τ . Thus, we obtain from (7) that
N 2 τ < 2 N e < N 2 τ .
Note that we define the test vector in general form testv : = μ 0 + μ 1 X 1 + + μ N 1 X ( N 1 ) T N [ X ] , which is the core modification of our scheme. In the following, we explain how to set the value of the testv coefficients for a homomorphic evaluation of the arbitrary input function f in one bootstrapping. We summarize the setting in Algorithm 4 and show its illustration in Figure 1.
  • When m in = 0 , we have ψ ( ( a ¯ , b ¯ ) ) = 2 N e and ( a ¯ , b ¯ ) { N 2 τ , , N 2 τ } . Thus, the constant term of the polynomial
    X ψ ( ( a ¯ , b ¯ ) ) · testv = X ψ ( ( a ¯ , b ¯ ) ) · ( μ 0 + μ 1 X 1 + + μ N 1 X ( N 1 ) ) = X ψ ( ( a ¯ , b ¯ ) ) · ( μ N 1 X 1 + μ 0 + μ 1 X 1 )
    is in
    M 0 : = { μ N N 2 τ , , μ N 1 , μ 0 , μ 1 , , μ N 2 τ } .
    We define the value of all elements μ M 0 as μ : = f ( 0 ) 2 τ T . Note that, since X N + 1 0 , we now have X i X N i or, equivalently, X i X ( N i ) . Similar to this case, when m in = τ , the constant term of the polynomial X ψ ( ( a ¯ , b ¯ ) ) · testv is in { μ N N 2 τ , …, μ N 1 , μ 0 , μ 1 , …, μ N 2 τ } : = M τ . The elements of this set are the sign inversions of the elements of the set M 0 . Therefore, μ M τ are already defined as μ : = f ( 0 ) 2 τ T .
  • When m in { 1 , , τ 1 } , we have ψ ( ( a ¯ , b ¯ ) ) = 2 N e + m in 2 τ . From (11), we have N 2 τ < m in 1 2 N τ < ψ ( ( a ¯ , b ¯ ) ) < m in + 1 2 N τ < N. Thus, we obtain ψ ( ( a ¯ , b ¯ ) ) m in 1 2 N τ , , m in + 1 2 N τ , and the constant term of the polynomial X ψ ( ( a ¯ , b ¯ ) ) · testv is in
    M m in : = { μ m in 1 2 N τ , , μ m in + 1 2 N τ } .
    We define the value of all μ M m in as μ : = f ( m in ) 2 τ T . Similarly, when m in { ( τ 1 ) , , 1 } , we have N < m in 1 2 N τ < ψ ( ( a ¯ , b ¯ ) ) < m in + 1 2 N τ < N 2 τ . Thus, ψ ( ( a ¯ , b ¯ ) ) m in 1 2 N τ ,…, m in + 1 2 N τ , and the constant term of the polynomial X ψ ( ( a ¯ , b ¯ ) ) · testv is in { μ N + m in 1 2 N τ , …, μ N + m in + 1 2 N τ } . These values are the sign inversions of the previously defined μ M m in for m in { 1 , , τ 1 } .
Algorithm 4: Our setting of the test vector coefficients defined in (9).
Information 12 00297 i002

3.1.4. Extract (Line 5)

The message of the output u : = SampleExtract ( ACC ) in line 5, denoted as msg ( ( a , b ) ) , is the constant term of ( X b ¯ a ¯ s · testv ). By our construction of BlindRotate, it is the coefficient μ = m out 2 τ = f ( m in ) 2 τ T , where f is defined in (8).

3.1.5. KeySwitch (Line 7)

Our scheme uses the same KeySwitchprocedure as the original TFHE, which is mentioned in Section 2.3.5. The output KeySwitch KS ( u ) of line 6 is a TLWE sample denoted as ( a , b ) T n × T . The sample is the encryption of the message m out 2 τ T with the secret key s . We denote this TLWE ciphertext as LWE s ( m out ) for simplicity of the notation. Only the difference from the original bit-wise TFHE is the upper bound of (5): From (7), we need to choose the parameters that satisfy the upper bound
2 n ( k + 1 ) l N β α BK + n ( 1 + k N ) ϵ + N t γ + N 2 ( t + 1 ) < 1 / 4 τ ,
so that we can obtain a “fresh” LWE sample after the bootstrapping with overwhelming probability.

3.2. Security

The security of our scheme largely relies on the original TFHE scheme because we only modify the test vector, and it changes only the bound of the size of noise given in (12). Although the noise bound of TFHE is fixed to 1 / 4 , as in (5), that of our scheme is 1 / 4 τ . Therefore, when we use the larger plaintext space, the bound becomes lower. This means that we need to use the TLWE sample with smaller noise if the bound (12) does not hold. Conversely, we select the security parameters and τ that satisfy (12); then, the security of our scheme relies solely on the original TFHE scheme. We use the same security parameters and noise as those in the original TFHE scheme and choose a value of τ that satisfies (12) in our experiments in Section 5. Notably, the bound in (12) is independent of the input function f; therefore, our scheme can run arbitrary functions with the same parameters and running time.

4. Applications

We present several basic applications of our integer-wise general TFHE bootstrapping procedure (Algorithm 3):
  • C sign ( a ) = Sign ( C a ) : Homomorphic evaluation of the sign function over a ciphertext (Algorithm 5)
  • C ( a = b ) = Eq ( C a , C b ) : Homomorphic evaluation of the equality test (Algorithm 6)
  • C ( a = b ) = ConstEq ( C a , b ) : Homomorphic evaluation of the equality test with a plaintext (Algorithm 7)
  • C a · b = MultbyBin ( C a , C b ) : Homomorphic evaluation of multiplication by a binary number (Algorithm 8)
  • C a / d = DivbyConst ( C a , d ) : Homomorphic evaluation of division by a plaintext (Algorithm 9)
  • C a / d = Div ( C a , C d ) : Homomorphic evaluation of division (Algorithm 10)
The function Sign ( ) , which is the homomorphic algorithm of sign, was already presented by Bourse et al. in [14]. For clarity, we describe Sign ( ) performed in our scheme to show that our general Bootstrapping schemes includes the sign function. Additionally, the integer-wise TFHE proposed by Bourse et al. [14] can evaluate only Sign ( ) bootstrapping; it does not support the homomorphic multiplication of integer ciphertexts.
We show Eqand ConstEqin Section 4.2, MultbyBinin Section 4.3, and DivbyConstin Section 4.4. We propose Divin Section 4.5 using DivbyConst, ConstEq, and MultbyBinas building blocks. We also generalize the Divfunction to the homomorphic algorithm that evaluates any 2-variable function in Section 4.5.
Algorithm 5: Sign ( C m in ) : Homomorphic sign evaluation in our bootstrapping scheme.
Input: A ciphertext C m in , where m in { τ , , τ 1 } .
Output: C m out : = Sign ( C m in ) , where m out = { 1 ( m in { τ + 1 , , 1 } ) , 0 ( m in { τ , 0 } ) , 1 ( m in { 1 , , τ 1 } ) .
  1 return  Bootstrap ( C m in , f sign ) , where f sign ( x ) : = 1 if x { 1 , , τ 1 } , 0 if x = 0 .
Algorithm 6: Eq ( C m 1 , C m 2 ) : Equality test.
Input: Two ciphertexts C m 1 and C m 2 , where m 1 , m 2 { 0 , , τ 1 } .
Output: C m out : = Eq ( C m 1 , C m 2 ) , where m out = { τ ( true ) if m 1 = m 2 , 0   ( false ) otherwise .
  1 return  Bootstrap ( C m 1 C m 2 , f ztest ) , where f ztest ( x ) : = τ if x = 0 , f ztest ( x ) : = 0
otherwise.
Algorithm 7: ConstEq ( C m 1 , m 2 ) : Equality test with a constant
Input: A ciphertext C m 1 and plaintext m 2 , where m 1 , m 2 { 0 , , τ 1 } .
Output: C m out : = ConstEq ( C m 1 , m 2 ) , where m out = { τ ( true ) if m 1 = m 2 , 0   ( false ) otherwise .
1    Encode m 2 { 0 , , τ 1 } to ν m 2 : = m 2 2 τ T .
  2 return  Bootstrap ( C m 1 ( 0 , ν m 2 ) , f ztest ) , where f ztest ( x ) : = τ if x = 0 ,
f ztest ( x ) : = 0 otherwise.

4.1. Homomorphic Evaluation of the Sign Function: Sign ( )

Algorithm 5 shows that our algorithms homomorphically evaluate the sign function. This algorithm is constructed using Bootstrap with an input function f sign . Specifically, we “express” f sign by defining the coefficients μ 0 , , μ N 1 T of test vector using Algorithm 4, as follows:
μ 0 , , μ N 2 τ : = 0 , μ N 2 τ + 1 , , μ N N 2 τ 1 : = 1 2 τ , μ N N 2 τ , , μ N 1 : = 0 .
We illustrate the setting of the test vector coefficients in Figure 2. We can confirm from (8) that m out = f ( m in ) = f sign ( m in ) = 1 for m in { 1 , , τ 1 } , m out = f ( m in ) = f sign ( B + m in ) = 1 for m in { τ + 1 , , 1 } , m out = f ( m in ) = 0 for m in = 0 , and m out = f ( m in ) = f sign ( B + m in ) = 0 for m in = τ . Note that the plaintext of the output with m in = τ is the same as that with m in = 0 .
Algorithm 8: MultbyBin ( C m int , C m bin ) : Homomorphic multiplication by binary number
Input: Ciphertexts C m int , C m bin , where m int { 0 , , τ 1 } , m bin { τ ( true ) , 0 ( false ) } .
Output: C m out : = MultbyBin ( C m int , C m bin ) = { C m int ( m bin = τ ( true ) ) , C 0 ( m bin = 0 ( false ) ) .
1  C tmp = Bootstrap ( C m int + C m bin + ( 0 , τ 2 τ ) , f id )    // ( C tmp = { C m int ( m bin = τ ( true ) ) , C m int ( m bin = 0 ( false ) ) . (
2 return  Bootstrap ( C m int + C tmp , f half )    // ( C m int + C tmp = { 2 · C m int ( m bin = τ ( true ) ) , C 0 ( m bin = 0 ( false ) ) . (
Algorithm 9: DivbyConst ( C m in , m d ) : Homomorphic division by a constant
Input: A ciphertext C m in , where m in { 0 , , τ 1 } , and a constant plaintext
m d { 1 , , τ 1 } .
Output: C m out : = DivbyConst ( C m in , m d ) : = C m in / m d
  1 return  Bootstrap ( C m in , f div , m d )
Algorithm 10: Div ( C m in , C m d ) : Homomorphic division.
Information 12 00297 i003

4.2. Homomorphic Equality Test: Eq ( ) and ConstEq ( )

For clarity, we present that our bootstrapping scheme includes the homomorphic equality test. This concept is similar to the homomorphic comparison on TFHE proposed by Bourse et al. in [34]. Note that we require the input plaintext space to be in { 0 , , τ 1 } (or in { τ , , 1 } ), for our equality tests Algorithms 6 and 7. This restriction is required since, if we allowed m 1 and m 2 to be in { τ , , τ 1 } , we would have m 2 m 1 = τ and would obtain the trueoutput when m 2 = τ + m 1 , although m 1 m 2 .
Some previous integer-wise homomorphic equality tests were performed based on Fermat’s little theorem [35] in other FHE schemes, such as HElib. For example, in HElib (i.e., in the BGV FHE scheme [31]), the plaintext space was Z p for some prime number modulus p, and the equality test was constructed using the fact
( x y ) p 1 1 mod p ( x y ¬ 0 ) 0 mod p ( x y 0 ) .
However, this approach is not efficient because it calls for homomorphic multiplication many ( log ( p ) ) times, and thus, some additional bootstrapping are required in order to reduce the increase in noise caused by the homomorphic multiplication. Our homomorphic equality test is efficient because it calls only one bootstrapping procedure.
Algorithm 6 shows Eq ( · , · ) , the equality test between two ciphertexts. The algorithm is based on the integer-wise “zero test” bootstrapping with the function f ztest , where f ztest ( x ) : = τ if x = 0 , 0 otherwise. Concretely, we define the test vector coefficients μ 0 , , μ N 1 T that correspond to f ztest , based on Algorithm 4, as follows:
μ 0 , , μ N 2 τ : = τ 2 τ = 1 2 , μ N 2 τ + 1 , , μ N N 2 τ 1 : = 0 , μ N N 2 τ , , μ N 1 : = τ 2 τ = 1 2 .
We show the illustration of the setting of the coefficients of the test vector in Figure 3.
Algorithm 7 shows the variant that is performed between a ciphertext and a plaintext. Notice that the second argument of the algorithm is a plaintext m 1 , which is then encoded as a trivial ( 0 , ν m 1 ) LWE ciphertext in line 1.

4.3. Homomorphic Multiplication by a Binary Number: MultbyBin ( )

Algorithm 8 shows the algorithm used to homomorphically evaluate the multiplication by a binary number (MultbyBin). As mentioned before, integer-wise TFHE cannot perform homomorphic multiplication between integer ciphertexts. MultbyBinhomomorphically multiplies an integer ciphertext by a ciphertext of a binary message. MultbyBinis called as a module in the homomorphic division Div, which we describe later in Algorithm 10. Figure 4 illustrates how the MultbyBinworks. Note that we need restrictions for MultbyBin: (1) τ to be an odd number and (2) m in { 0 , , τ 1 } . We explained these restrictions later in this subsection.
We define two functions f id and f half to be used as inputs of Bootstrapto construct MultbyBin. The function f id : { 0 , , τ 1 } { 0 , , τ 1 } is an identity function defined as f id ( x ) : = x . Based on Algorithm 4, we define the test vector coefficients μ 0 , , μ N 1 T for f id as follows:
μ 0 , , μ N 2 τ : = f id ( 0 ) 2 τ = 0 , μ ( 2 i 1 ) N 2 τ + 1 , , μ ( 2 i + 1 ) N 2 τ : = f id ( i ) 2 τ = i 2 τ , f o r   i = 1 , , τ 1 , μ N N 2 τ , , μ N 1 : = f id ( 0 ) 2 τ = 0 .
The function f half is defined as
f half ( x ) : = x 2 ( x is even ) , x + 1 2 τ 1 2 ( x is odd ) .
For f half , we define the test vector coefficients μ 0 , , μ N 1 T based on Algorithm 4, as follows:
μ 0 , , μ N 2 τ : = f half ( 0 ) 2 τ = 0 , μ ( 2 i 1 ) N 2 τ + 1 , , μ ( 2 i + 1 ) N 2 τ : = f half ( i ) 2 τ , f o r i = 1 , , τ 1 , μ N N 2 τ , , μ N 1 : = f half ( 0 ) 2 τ = 0 .
We now explain Algorithm 8. First, in line 1, we homomorphically multiply a ciphertext of a binary message in { τ , 0 } , C m bin and a constant ( 0 , τ 2 τ ) to C m int . The output of the bootstrapping of the sum with f id is stored as C tmp .
  • If C m bin is a ciphertext of 0 (which means false ), then C m bin + ( 0 , τ 2 τ ) is C τ (ciphertext of the constant τ ). Thus, the phase of C m int is rotated to a position symmetrical about the origin, as illustrated in Figure 4 by the dashed arrow in the left image. Then, the phase of the ciphertext is rotated to a position symmetrical about the x-axis. After bootstrapping with f id , C tmp becomes a ciphertext of m int .
  • If C m bin is a ciphertext of τ (which means true ), then C m bin + ( 0 , τ 2 τ ) is C 0 (ciphertext of 0). Thus, C tmp remains a ciphertext of m int .
Therefore, in line 2, C m int + C tmp = C m int + C m int when m bin = τ , and C m int + C tmp = C 0 when m bin = 0 . After bootstrapping with f half , C m int + C m int is converted to C m int , and C 0 remains C 0 , as illustrated in Figure 4. Finally, we obtain C m out = C m int when m bin = τ and C 0 when m bin = 0 .
As noted before, we need to restrict τ to odd values. If τ is even, when m int = τ 2 and m bin = τ , the ciphertext in line 2  C m int + C tmp = C m int + C m int is converted to C 0 , but we require it to remain as C τ 2 . Therefore, τ needs to be an odd number to homomorphically evaluate the division by 2 with the function Bootstrap ( · , f half ) . Additionally, we require the input m int to be in { 0 , , τ 1 } because we cannot perform multiplication with binary values on negative plaintext m int { τ + 1 , , 1 } with MultbyBin. (Although we can perform binary multiplication on m int = τ or τ , which is equivalent to m int = 0 , we omit τ from the input plaintext space, for simplicity.) For m int { τ + 1 , , 1 } ,
  • if m bin = τ (which means true ), the message of C tmp in line 1 is ( τ + m int ) , and the output becomes m out = 0 because C tmp + C m bin = C τ for all m int { B + 1 , , 1 } while m bin = τ ( true ) .
  • If m bin = 0 (which means false ), in line 1, the message of C tmp is τ m int and the output is m out = τ + m int .
Therefore, for negative inputs m int { τ + 1 , , 1 } , MultbyBin does not work as multiplication with binary values; thus, we need the restriction.

4.4. Homomorphic Division by a Constant: DivbyConst

Algorithm 9 shows that DivbyConsthomomorphically evaluates “division by a constant”. DivbyConsttakes a ciphertext C m in and a plaintext m d as inputs, and it outputs a ciphertext of C m in / m d . Note that we need to restrict m in { 0 , , τ 1 } and m d { 1 , , τ 1 } .
Bit-wise integer division by 2 on TFHE was proposed in [7]. The algorithm was constructed based on a right shift over the bits; therefore, it only supports a power of two dividend. Homomorphic division by a (not only 2) constant was proposed in [23] based on HElib. This algorithm uses polynomial interpolation, which needs to homomorphically calculate all powers of the ciphertexts { C a , C a 2 , C a 3 , , C a p 1 } , where p is the modulus of the plaintext space Z p . Thus, it is not efficient since many ( p 1 ) homomorphic multiplications are needed for a homomorphic polynomial interpolation. Contrary to that, our homomorphic division by a constant on the integer-wise TFHE is efficient because it needs only one bootstrapping.
The function f div , d : { 0 , , τ 1 } { 0 , , τ 1 } is defined as f div , d ( x ) : = x / d for a constant d { 1 , , τ 1 } . We define the test vector coefficients for f div , d based on Algorithm 4, as follows:
μ 0 , , μ N 2 τ : = f div , d ( 0 ) 2 τ = 0 , μ ( 2 i 1 ) N 2 τ + 1 , , μ ( 2 i + 1 ) N 2 τ : = f div , d ( i ) 2 τ = i / d 2 τ , for   i = 1 , , τ 1 , μ N N 2 τ , , μ N 1 : = f div , d ( 0 ) 2 τ = 0 .
Note that we need to have a set of { μ 0 , , μ N 1 } for all d { 0 , , τ 1 } : we need to store N B values in T before starting the algorithm. Additionally, we need the restriction m in { 0 , , τ 1 } since we cannot perform divisions for m in { τ , , 1 } , as the output m out becomes ( τ m in ) / m d .

4.5. Homomorphic Division: Div ( )

As a final application, we construct a homomorphic division Divin Algorithm 10. It calls DivbyConst, ConstEq, and MultbyBinas subalgorithms. As these subalgorithms need the restriction m in { 0 , , τ 1 } , Divalso follows this restriction.
We now explain Div. First, in line 1, we set a C SUM = C 0 = ( 0 , 0 ) as a trivial TLWE ciphertext of a message 0. In the iteration on line 2 and 6, we obtain a ciphertext of a / i , denoted as C a / i with DivbyConst, and then, we test if i = d with ConstEq, where d is the plaintext of the input C d . The output is the ciphertext of the Boolean value of the test result C ( d = i ) . Second, in line 5, we have
MultbyBin ( C a / i , C ( i = d ) ) = C a / d ( i = d ) , C 0 ( otherwise ) .
Therefore, after this loop, we have C SUM = C 0 + + C a / d + + C 0 = C a / d .

Generalization to a Two-Variable Function: Func ( )

We now generalize Divto any two-variable function Func ( C m 1 , C m 2 ) , in Algorithm 11. The algorithm takes the following inputs: two ciphertexts C m 1 and C m 2 ; a two-variable function f ( x , y ) ; and sets of test vector coefficients { μ 0 , y , , μ N 1 , y } , which corresponds to a one-variable function f y ( x ) : = f ( x , y ) for all fixed y { 0 , , τ 1 } . The output of the algorithm is a ciphertext C f ( m 1 , m 2 ) . This algorithm generalizes Divby generalizing the DivbyConstto Bootstrap ( C m in , f y ) , which is the homomorphic evaluation of a general one-variable function f y ( x ) : = f ( x , y ) over a ciphertext C x .

5. Results of Homomorphic Division

In this section, we present the implementation results of Div. We implemented our bootstrapping procedure and Divby modifying the TFHE library [33]. The parameter values are the same as the defaults of the TFHE library:
  • The degree of the polynomials in the ring: N = 1024 .
  • The dimensions of the LWE and TLWE: n = 500 and k = 1 .
  • Decomposition basis and length of TGSWciphertexts: B g = 2 10 and l = 2 .
  • Decomposition basis and length of KeySwitch: 2 l and t = 8 .
  • Standard deviation of the noise of the key-switching keys KS: σ KS = 2.44 · 10 5 .
  • Standard deviation of the noise of the bootstrapping keys BK: σ BK = 7.18 · 10 9 .
These choices of parameters achieve at least 128-bit security [6]. A single bootstrapping procedure takes approximately 10 msec on our PC with a 3.4 -GHz Intel Core i5 CPU. We implemented Divfor a 4-bit integer, which is the same target as that of existing work on homomorphic division algorithms [16,17,18,23]. Thus, we set B = 17 to encrypt 4-bit integers.
Table 2 shows our results, including the values taken from the existing works on homomorphic division. We ran Div (Algorithm 10) 1000 times and took the average. Our method is approximately 3.4 times faster than the fastest method ([23]) shown in the table while achieving a higher level of security ( λ > 128 ) than that of existing methods. For a fair comparison, we also implemented the “non-restorative division algorithm” on the original (bit-wise) TFHE library with the same parameters. The non-restorative division algorithm is a classic bit-wise algorithm for integer division that is used in previous works [16,17,18]. We can confirm from Table 2 that our method is approximately 2.2 times faster than non-restorative division. In the asymptotic analysis, as shown in the “Complexity” column of the table, our division algorithm and that of [23] take exponential time. Thus, our algorithm and that of [23] are asymptotically slower than other works based on the bit-wise non-restorative division algorithm. The main bottle necks of our algorithm and that in [23] are the exhaustive loop of line 2–6 in Algorithm 10, similar to the part in [23]. However, while the method of [23] needs an O ( 2 2 l ) calculation, our algorithm is quadratically faster: it takes a smaller O ( 2 l ) calculation. This is due to that our bootstrapping being able to evaluate any one-variable function without extra computational costs over the original TFHE, and in contrast, the bootstrapping in [23] needs an O ( 2 l ) calculation for homomorphic evaluation of the general one-variable function.
Algorithm 11: Func ( C m 1 , C m 2 , f ( · , · ) ) : Homomorphic evaluation of a 2-variable function f ( x , y )
Information 12 00297 i004
We show in Table 3 the breakdown of the run time of our Div, which was completed in 930 msec in total. The run time for each of MultbyBin, ConstEq, DivbyConst, and Bootstrap ( · , f id ) in line 5 of Algorithm 10 are shown in the table. The run times of these subalgorithms account for almost the entire run time. As the single bootstrapping takes approximately 10 msec on our PC, the cost of these functions is dominated by the run time of bootstrapping, i.e., our functions entail minimal additional costs.

Limitations of Correctness

In the parameter setting of this section, the final standard deviation of the noise after bootstrapping is σ = 0.00961 , as in [6]. The probability of decryption failure, i.e., the probability of the standard deviation of noise after bootstrapping is larger than 1 / 16 and is bounded by erf ( 1 / 16 2 σ ) < 2 32 . The condition suffices for the bit-wise TFHE scheme. However, for our scheme, decryption fails if the size of the noise after bootstrapping is larger than 1 / 4 τ , as shown in (12). The probability of decryption error is bounded by erf ( 1 / 4 τ 2 σ ) < 2 4.06 for our scheme. This upper bound appears large, but we empirically observed in our experiment that the decryption error rate is approximately 0.08 % (4 decryption errors in 5000 bootstrappings). In other words, there is a trade-off between the size of the plaintext space τ and the decryption error rate. For 5-bit integers, i.e., when B = 33 , the upper bound of the decryption failure probability rapidly increases to approximately 30 % . Thus, for the parameter setting in this section, our scheme is practical only for 4 -bit integer input. Notably, although the decryption failure rate of our scheme increases as τ increases, the security of the scheme is not affected because τ is independent of the standard deviation σ of the noise [14].

6. Conclusions

We proposed a technique for performing arbitrary 1-variable functions with only one bootstrapping procedure using the integer-wise variant of TFHE. The core modification is to generalize the test vector used in the bootstrapping and the concrete setting of the values of the test vector coefficients. Based on this general functional bootstrapping procedure, we extended the functionality of the integer-wise TFHE scheme to construct several basic applications, such as homomorphic equality testing, multiplication by a binary number, and a division algorithm. We implemented our homomorphic division algorithm and showed that it can be performed in less than 1 second, which is approximately 3.4 times faster than the fastest division algorithm. However, as a limitation, our scheme is practical only for ≤4-bit integer inputs, when we use the default parameters of TFHE library. In order to use our scheme for larger integer inputs, we need to use a smaller error rate.
Efficient algorithms for basic arithmetic operations are needed to increase the options for optimizing high-level secure computation applications. We believe our bootstrapping scheme can be used to develop a wide variety of homomorphic calculation algorithms.

Author Contributions

Conceptualization, H.O.; methodology, H.O.; software, H.O.; validation, H.O.; formal analysis, H.O.; writing—original draft preparation, H.O.; writing—review and editing, H.O. and S.K.; visualization, H.O.; supervision, S.K. and C.C.; All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Acknowledgments

We thank Benjamin Curtis and Rachel Player for their comments on the preliminary version of this paper [36].

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Gentry, C. A Fully Homomorphic Encryption Scheme. Ph.D. Thesis, Stanford University, Stanford, CA, USA, 2009. [Google Scholar]
  2. Gentry, C. Fully Homomorphic Encryption Using Ideal Lattices. In STOC 2009; ACM: New York, NY, USA, 2009; pp. 169–178. [Google Scholar] [CrossRef] [Green Version]
  3. Brakerski, Z.; Vaikuntanathan, V. Efficient Fully Homomorphic Encryption from (Standard) LWE. In FOCS 2011; IEEE: Piscataway, NJ, USA, 2011; pp. 97–106. [Google Scholar] [CrossRef] [Green Version]
  4. Brakerski, Z.; Vaikuntanathan, V. Fully Homomorphic Encryption from Ring-LWE and Security for Key Dependent Messages. In CRYPTO 2011; Rogaway, P., Ed.; Springer: Berlin/Heidelberg, Germany, 2011; pp. 505–524. [Google Scholar] [CrossRef] [Green Version]
  5. Brakerski, Z.; Vaikuntanathan, V. Lattice-based FHE As Secure As PKE. In ITCS 2014; ACM: New York, NY, USA, 2014; pp. 1–12. [Google Scholar] [CrossRef] [Green Version]
  6. Chillotti, I.; Gama, N.; Georgieva, M.; Izabachène, M. Faster Fully Homomorphic Encryption: Bootstrapping in Less Than 0.1 Seconds. In ASIACRYPT 2016; Cheon, J.H., Takagi, T., Eds.; Springer: Berlin/Heidelberg, Germany, 2016; pp. 3–33. [Google Scholar] [CrossRef]
  7. Chillotti, I.; Gama, N.; Georgieva, M.; Izabachène, M. Faster Packed Homomorphic Operations and Efficient Circuit Bootstrapping for TFHE. In ASIACRYPT 2017; Takagi, T., Peyrin, T., Eds.; Springer International Publishing: Cham, Switzerland, 2017; pp. 377–408. [Google Scholar] [CrossRef]
  8. Chillotti, I.; Gama, N.; Georgieva, M.; Izabachène, M. TFHE: Fast Fully Homomorphic Encryption Over the Torus. J. Cryptol. 2020, 33, 34–91. [Google Scholar] [CrossRef]
  9. Gentry, C.; Halevi, S.; Smart, N.P. Homomorphic Evaluation of the AES Circuit. In CRYPTO 2012; Safavi-Naini, R., Canetti, R., Eds.; Springer: Berlin/Heidelberg, Germany, 2012; pp. 850–867. [Google Scholar] [CrossRef] [Green Version]
  10. Gentry, C.; Sahai, A.; Waters, B. Homomorphic Encryption from Learning with Errors: Conceptually-Simpler, Asymptotically-Faster, Attribute-Based. In CRYPTO 2013; Canetti, R., Garay, J.A., Eds.; Springer: Berlin/Heidelberg, Germany, 2013; pp. 75–92. [Google Scholar] [CrossRef] [Green Version]
  11. Smart, N.P.; Vercauteren, F. Fully Homomorphic Encryption with Relatively Small Key and Ciphertext Sizes. In PKC 2010; Nguyen, P.Q., Pointcheval, D., Eds.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 420–443. [Google Scholar] [CrossRef] [Green Version]
  12. Stehlé, D.; Steinfeld, R. Faster Fully Homomorphic Encryption. In ASIACRYPT 2010; Abe, M., Ed.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 377–394. [Google Scholar] [CrossRef] [Green Version]
  13. van Dijk, M.; Gentry, C.; Halevi, S.; Vaikuntanathan, V. Fully Homomorphic Encryption over the Integers. In EUROCRYPT 2010; Gilbert, H., Ed.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 24–43. [Google Scholar] [CrossRef] [Green Version]
  14. Bourse, F.; Minelli, M.; Minihold, M.; Paillier, P. Fast Homomorphic Evaluation of Deep Discretized Neural Networks. In CRYPTO 2018; Shacham, H., Boldyreva, A., Eds.; Springer International Publishing: Cham, Switzerland, 2018; pp. 483–512. [Google Scholar] [CrossRef] [Green Version]
  15. Gilad-Bachrach, R.; Dowlin, N.; Laine, K.; Lauter, K.; Naehrig, M.; Wernsing, J. CryptoNets: Applying Neural Networks to Encrypted Data with High Throughput and Accuracy. In Proceedings of the 33rd International Conference on Machine Learning, New York, NY, USA, 19–24 June 2016; Volume 48, pp. 201–210. [Google Scholar] [CrossRef]
  16. Chen, J.; Feng, Y.; Liu, Y.; Wu, W. Faster Binary Arithmetic Operations on Encrypted Integers. In WCSE 2017; SCIEI: Hong Kong, China, 2017; pp. 956–960. [Google Scholar] [CrossRef]
  17. Chen, Y.; Gong, G. Integer arithmetic over ciphertext and homomorphic data aggregation. In Proceedings of the IEEE Conference on Communications and Network Security (CNS), Florence, Italy, 28–30 September 2015; pp. 628–632. [Google Scholar] [CrossRef]
  18. Xu, C.; Chen, J.; Wu, W.; Feng, Y. Homomorphically Encrypted Arithmetic Operations Over the Integer Ring. In ISPEC 2016; Bao, F., Chen, L., Deng, R.H., Wang, G., Eds.; Springer: Berlin/Heidelberg, Germany, 2016; pp. 167–181. [Google Scholar] [CrossRef]
  19. Çetin, G.S.; Doröz, Y.; Sunar, B.; Savaş, E. Depth Optimized Efficient Homomorphic Sorting. In LATINCRYPT 2015; Lauter, K., Rodríguez-Henríquez, F., Eds.; Springer: Berlin/Heidelberg, Germany, 2015; pp. 61–80. [Google Scholar] [CrossRef] [Green Version]
  20. Bost, R.; Popa, R.A.; Tu, S.; Goldwasser, S. Machine Learning Classification over Encrypted Data. In Proceedings of the Network and Distributed System Security (NDSS) Symposium, San Diego, CA, USA, 8–11 February 2015. [Google Scholar] [CrossRef] [Green Version]
  21. Juvekar, C.; Vaikuntanathan, V.; Chandrakasan, A. GAZELLE: A Low Latency Framework for Secure Neural Network Inference. In USENIX Security 2018; USENIX Association: Baltimore, MD, USA, 2018; pp. 1651–1669. [Google Scholar]
  22. Narumanchi, H.; Goyal, D.; Emmadi, N.; Gauravaram, P. Performance Analysis of Sorting of FHE Data: Integer-Wise Comparison. In AINA 2017; IEEE: Piscataway, NJ, USA, 2017; pp. 902–908. [Google Scholar] [CrossRef]
  23. Okada, H.; Cid, C.; Hidano, S.; Kiyomoto, S. Linear Depth Integer-Wise Homomorphic Division. In WISTP 2018; Blazy, O., Yeun, C.Y., Eds.; Springer International Publishing: Cham, Switzerland, 2019; pp. 91–106. [Google Scholar] [CrossRef]
  24. Halevi, S.; Shoup, V. HElib—An Implementation of Homomorphic Encryption. 2019. Available online: https://github.com/shaih/HElib/ (accessed on 26 July 2020).
  25. Cheon, J.H.; Han, K.; Kim, A.; Kim, M.; Song, Y. Bootstrapping for Approximate Homomorphic Encryption. In EUROCRYPT 2018; Nielsen, J.B., Rijmen, V., Eds.; Springer International Publishing: Cham, Switzerland, 2018; pp. 360–384. [Google Scholar] [CrossRef]
  26. New Jersey Institute of Technology. PALISADE. 2019. Available online: https://git.njit.edu/palisade/PALISADE (accessed on 26 July 2020).
  27. Chen, H.; Dai, W.; Kannepalli, S.; Khanpour, H.; Laine, K.; Lauter, K.; Singh, T.; Song, Y.; Tieman, J. Microsoft SEAL: Fast and Easy-to-Use Homomorphic Encryption Library. 2019. Available online: https://www.microsoft.com/en-us/research/project/microsoftseal/ (accessed on 26 July 2020).
  28. Ducas, L.; Micciancio, D. FHEW: Bootstrapping Homomorphic Encryption in Less Than a Second. In EUROCRYPT 2015; Oswald, E., Fischlin, M., Eds.; Springer: Berlin/Heidelberg, Germany, 2015; pp. 617–640. [Google Scholar] [CrossRef] [Green Version]
  29. Regev, O. On Lattices, Learning with Errors, Random Linear Codes, and Cryptography. In STOC ’05; ACM: New York, NY, USA, 2005; pp. 84–93. [Google Scholar] [CrossRef]
  30. Cheon, J.H.; Stehlé, D. Fully Homomophic Encryption over the Integers Revisited. In EUROCRYPT 2015; Oswald, E., Fischlin, M., Eds.; Springer: Berlin/Heidelberg, Germany, 2015; pp. 513–536. [Google Scholar] [CrossRef] [Green Version]
  31. Brakerski, Z.; Gentry, C.; Vaikuntanathan, V. (Leveled) Fully Homomorphic EncryptionWithout Bootstrapping. In ITCS 2012; ACM: New York, NY, USA, 2012; pp. 309–325. [Google Scholar] [CrossRef] [Green Version]
  32. Lyubashevsky, V.; Peikert, C.; Regev, O. On Ideal Lattices and Learning with Errors over Rings. In EUROCRYPT 2010; Gilbert, H., Ed.; Springer: Berlin/Heidelberg, Germany, 2010; pp. 1–23. [Google Scholar] [CrossRef]
  33. Carpov, S.; Chillotti, I.; Gama, N.; Georgieva, M.; Izabachene, M. TFHE: Fast Fully Homomorphic Encryption over the Torus. 2019. Available online: https://tfhe.github.io/tfhe/ (accessed on 26 July 2020).
  34. Bourse, F.; Sanders, O.; Traoré, J. Improved Secure Integer Comparison via Homomorphic Encryption. In EUROCRYPT 2020; Jarecki, S., Ed.; Springer International Publishing: Cham, Switzerland, 2020; pp. 391–416. [Google Scholar] [CrossRef]
  35. Çetin, G.S.; Doröz, Y.; Sunar, B.; Martin, W.J.; Arithmetic Using Word-wise Homomorphic Encryption. Cryptology ePrint Archive, Report 2015/1195. 2015. Available online: https://eprint.iacr.org/2015/1195 (accessed on 26 July 2020).
  36. Okada, H.; Kiyomoto, S.; Cid, C. Integerwise Functional Bootstrapping on TFHE. In Information Security; Susilo, W., Deng, R.H., Guo, F., Li, Y., Intan, R., Eds.; Springer International Publishing: Cham, Switzerland, 2020; pp. 107–125. [Google Scholar] [CrossRef]
Figure 1. Illustration of the “slices” for the integer-wise LWEencryption and bootstrapping procedure when τ = 5 .
Figure 1. Illustration of the “slices” for the integer-wise LWEencryption and bootstrapping procedure when τ = 5 .
Information 12 00297 g001
Figure 2. Illustration of the slices for the test vector coefficients of sign bootstrapping (when τ = 5 ).
Figure 2. Illustration of the slices for the test vector coefficients of sign bootstrapping (when τ = 5 ).
Information 12 00297 g002
Figure 3. Illustration of the slices for the test vector coefficients of equality test bootstrapping (when τ = 5 ).
Figure 3. Illustration of the slices for the test vector coefficients of equality test bootstrapping (when τ = 5 ).
Information 12 00297 g003
Figure 4. Illustration of MultbyBinwhen ( m int , m bin ) = ( 1 , 0 ) . The left figure illustrates the procedure in line 1, and the right figure illustrates the procedure in line 2.
Figure 4. Illustration of MultbyBinwhen ( m int , m bin ) = ( 1 , 0 ) . The left figure illustrates the procedure in line 1, and the right figure illustrates the procedure in line 2.
Information 12 00297 g004

Table 1. Overview of the bootstrapping scheme.
Table 1. Overview of the bootstrapping scheme.
CtxtPtxtNoise (or Its Bound)
( a , b ) T n × T m in 2 τ e T
Round ( a ¯ , b ¯ ) Z 2 N n × Z 2 N 2 N ( m in 2 τ ) 2 N e
BlindRotate ( a , b ) T N [ X ] × T N [ X ] X b ¯ a ¯ s · testv Error ( ACC )
SampleExtract ( a , b ) T N × T m out 2 τ Error ( ACC )
KeySwitch ( a , b ) T n × T m out 2 τ Error ( ACC ) b r e a k + N ( t γ + 2 ( t + 1 ) )
Table 2. Results: comparison with existing homomorphic division implementations. We abbreviate the non-restoring division method as NRD. The “Complexity” column shows the asymptotic complexity for a one-bit-length integer input.
Table 2. Results: comparison with existing homomorphic division implementations. We abbreviate the non-restoring division method as NRD. The “Complexity” column shows the asymptotic complexity for a one-bit-length integer input.
MethodFHE lib.TypeBits (l)Time [sec]ComplexitySecurity λ
[17]HElibBit-wise467.94 O ( l 2 ) >128
[18]HElibBit-wise414.63 O ( l 2 ) >128
[16]HElibBit-wise47.74 O ( l 2 ) >80
[23]HElibInteger-wise43.15 O ( 2 2 l ) >80
Ours (Div)TFHEInteger-wise40.93 O ( 2 l ) >128
NRDTFHEBit-wise42.05 O ( l 2 ) >128
Table 3. A breakdown of the run time of our Div  (Algorithm 10).
Table 3. A breakdown of the run time of our Div  (Algorithm 10).
Functions# of BootstrapTime [msec]# of CallsMean [msec]
MultbyBin (line 5)2346.0 (37.2%) τ 1 = 16 21.6
ConstEq (line 4)1174.8 (18.8%) τ 1 = 16 10.9
DivbyConst (line 3)1175.8 (18.9%) τ 1 = 16 11.0
Bootstrap ( · , f id ) (line 5)1173.9 (18.7%) τ 1 = 16 10.9
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Okada, H.; Kiyomoto, S.; Cid, C. Integer-Wise Functional Bootstrapping on TFHE: Applications in Secure Integer Arithmetics. Information 2021, 12, 297. https://doi.org/10.3390/info12080297

AMA Style

Okada H, Kiyomoto S, Cid C. Integer-Wise Functional Bootstrapping on TFHE: Applications in Secure Integer Arithmetics. Information. 2021; 12(8):297. https://doi.org/10.3390/info12080297

Chicago/Turabian Style

Okada, Hiroki, Shinsaku Kiyomoto, and Carlos Cid. 2021. "Integer-Wise Functional Bootstrapping on TFHE: Applications in Secure Integer Arithmetics" Information 12, no. 8: 297. https://doi.org/10.3390/info12080297

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop