The invention relates generally to inversion operations on homomorphically encrypted data, in particular division.
Homomorphic encryption (HE) can allow many computations to be performed securely over encrypted data, without decrypting and/or exposing the underlying data. However, computations performed over HE data can be significantly more complex and time-consuming than, for example, their plaintext counterparts. In particular many HE schemes fail to support certain operations (e.g., inversion operations such as division).
In some existing HE schemes a numerator and denominator are determined, the numerator and denominator are decrypted, and the division is performed on the unencrypted data between the plaintext numerator and the plaintext denominator. Decryption of the numerator and denominator can reveal sensitive information, such as person information, presenting a security issue. Accordingly, it can be desired to perform operations such as division on HE data which can allow for performing the operation while the data is encrypted.
Embodiments of the invention provide a technique to accelerate processor execution of computations over homomorphically encrypted data. Further, embodiments of the invention may improve the accuracy of numerical approximations for those computations. Embodiments of the invention may have the additional advantage of increased data security because the data used by embodiments of the invention does not need to be decrypted in order to perform the computation.
According to one or more embodiments, there is provided a method for performing an operation on at least one homomorphically encrypted ciphertext, the method including: determining, by a computing device, a value that is an initial approximation of a result of the operation on the at least one homomorphically encrypted ciphertext; and iteratively improving, by the computing device, the value using a recurrence relation wherein a number of iterations is determined based on a predetermined accuracy to minimize an approximation error.
According to some embodiments, the predetermined accuracy is based on a word length of the computing device.
According to some embodiments, the approximation error is a uniform relative error.
According to some embodiments, the operation is division.
According to some embodiments, the recurrence relation is a modified Newton iteration recurrence relation.
According to some embodiments, the modified Newton iteration recurrence relation is given by the formula: yl+1=yl+γl−yl(σl−x·yl) wherein γl is a predefined natural number and σl is a predefined number greater than zero.
According to some embodiments, γl<<1 and σl<<1.
According to some embodiments, a sequence (γ1, σ1), (γ2, σ2), . . . , is obtained by training using at least one of: random testing; and selection based on a fitness function.
According to one or more embodiments, there is provided a method for calculating a polynomial approximation of 1/x for a homomorphically encrypted ciphertext x, the method including: receiving a first value, l, corresponding to a degree of the polynomial approximation to be calculated; receiving a second value, α, and a third value, β, wherein the second value and the third value define a range over which the polynomial approximation is to be calculated; and calculating the polynomial approximation using the expression:
wherein ak(l)=2ξak+1(l)+ak+2(l) for k=2l−3, 2l−4, . . . , 1, 0, wherein
and wherein Tk(x) is a Chebyshev polynomial of the first kind of degree k.
According to some embodiments, 0 is included in the range defined by the second value and the third value.
According to one or more embodiments, there is provided a system for performing an operation on at least one homomorphically encrypted ciphertext, the system comprising at least one processor and a memory containing instructions which, when executed by the at least one processor, cause the at least one processor to: determine a value that is an initial approximation of a result of the operation on the at least one homomorphically encrypted ciphertext; and iteratively improve the value using a recurrence relation wherein a number of iterations is determined based on a predetermined accuracy to minimize an approximation error.
According to some embodiments, the predetermined accuracy is based on a word length of the at least one processor.
According to some embodiments, the approximation error is a uniform relative error.
According to some embodiments, the operation is division.
According to some embodiments, the recurrence relation is a modified Newton iteration recurrence relation.
According to some embodiments, the modified Newton iteration recurrence relation is given by the formula: yl+1=yl+γl·yl(σl−x·yl) wherein γl is a predefined natural number and a1 is a predefined number greater than zero.
According to some embodiments γl>>1 and σl<<1.
According to some embodiments, a sequence (γ1, σ1), (γ2, σ2), . . . , is obtained by training using at least one of: random testing; and selection based on a fitness function.
According to one or more embodiments, there is provided a system for calculating a polynomial approximation of 1/x for a homomorphically encrypted ciphertext x, the system comprising at least one processor and a memory containing instructions which, when executed by the at least one processor, cause the at least one processor to: receive a first value, l, corresponding to a degree of the polynomial approximation to be calculated; receive a second value, α, and a third value, β, wherein the second value and the third value define a range over which the polynomial approximation is to be calculated; and calculate the polynomial approximation using the expression:
wherein ak(l)=2ξ0ak+1(l)+ak+2(l) for k=2l−3, 2l−4, . . . , 1, 0, wherein
and wherein Tk(x) is a Chebyshev polynomial of the first kind of degree k.
According to some embodiments, 0 is included in the range defined by the second value and the third value.
Non-limiting examples of embodiments of the disclosure are described below with reference to figures attached hereto. Dimensions of features shown in the figures are chosen for convenience and clarity of presentation and are not necessarily shown to scale. The subject matter regarded as the invention is particularly pointed out and distinctly claimed in the concluding portion of the specification. The invention, however, both as to organization and method of operation, together with objects, features, and advantages thereof, may be understood by reference to the following detailed description when read with the accompanied drawings. Embodiments are illustrated without limitation in the figures, in which like reference numerals indicate corresponding, analogous, or similar elements, and in which:
It will be appreciated that for simplicity and clarity of illustration, elements shown in the figures have not necessarily been drawn to scale. For example, the dimensions of some of the elements may be exaggerated relative to other elements for clarity. Further, where considered appropriate, reference numerals may be repeated among the figures to indicate corresponding or analogous elements.
In general, the invention can provide efficient and/or secure systems for performing computations in a homomorphically encrypted environment implementing accelerated algorithms for division for HE schemes. It will be understood that the methods and systems presented herein may be used for other mathematical operations/functions similar to division, e.g., matrix inversion.
In general, the invention can provide two methods for approximating the function ƒ(x)=1/x. The first method can relate to accelerated Newton iterations, and the second method can relate to minimax polynomial approximation. Both methods can produce a polynomial approximation minimizing the uniform relative error, as shown below in EQN. 1:
where n[x] denotes a set of polynomials with real coefficients whose degree is less than or equal to n. This criterion can be of relevance to HE computations due to, for example, the magnitude of the approximated function being, in general, unavailable for HE evaluated functions. In some embodiments relating to the minimax polynomial approximation method, the minimax polynomial approximation method of the invention can differ from standard minimax approximation techniques typically used in the prior art, which typically aim to minimize the uniform absolute error. The minimax polynomial approximation method of the invention can aim to minimize the uniform relative error. Minimizing the uniform relative error may allow greater choice of parameter selection.
According to some embodiments, method 200 includes determining (e.g., via computing device 100A as shown below in
The value may be input by a user and/or determined automatically by the computing device. A value that is an initial approximation of a result of the operation may be a naïve guess of the result of the operation. For example, an initial approximation of the result of the division 5/2 may be 4, because 4 is less than 5.
According to some embodiments, method 200 includes iteratively improving (e.g., via the computing device 100A as shown above in
The predetermined accuracy can be based on a word length of the computing device. For example, the predetermined accuracy may be based on the 64 bit word length of current computer processors. In general the predetermined accuracy can be based on the needs of the application.
According to some embodiments, the recurrence relation corresponds to simulated annealing. According to some embodiments, the recurrence relation is a modified Newton iteration recurrence relation.
Typically, Newton iterations for the division problem can be defined by the relation as shown below in EQN. 2:
where the initial approximation y0(x)≈1/x can be predetermined according to the interval of values [a, b]. Typically, y0(x) is set to as a low-order minimax polynomial approximation. For the case 0<a<b, setting a constant initial guess y0(x)=c0∈ where
b·c
0∈(1−∈,1+∈),∈∈[0,1) EQN. 3
can ensure convergence and produce a polynomial of degree 2l at iteration l∈.
The acceleration of Newton iterations away from zero can be achieved by modifying the Newton iteration recurrence relation in a manner that can accelerate a departure from zero, according to some embodiments of the invention. The modified Newton iteration recurrence relation may be referred to as an accelerated Newton iteration recurrence relation. According to some embodiments, the Newton iteration recurrence relation is modified as shown below in EQN. 4:
y
l+1
=y
l+γl·yl(σl−x·yl),γl∈,σl>0 EQN. 4
Note that for γl=σl=1 the accelerated Newton iteration recurrence relation reduces to the Newton iteration recurrence relation shown in EQN. 2. As shown in EQN. 4, setting large values (e.g., >>1) for the gamma and small values (e.g., <<1) for the sigma at the initial iterations can effectively accelerate the slow departure from zero. A total number of required iterations can be reduced compared to, for example, the conventional approach of EQN. 2. Imposing γl ∈ can reduce a required number of homomorphic multiplications required at each iteration to one to, for example, reduce a computational complexity of the execution of the operation. Setting excessively large values for γl (e.g. anything where γl ∈ does not hold) can lead to instability (e.g. a failure to converge to a single value), and should therefore be avoided.
In some embodiments, for any given range of values [a, b], an acceleration sequence (γ1, σ1), (γ2, α2), . . . , can be obtained by training (e.g. random testing and selection based on a fitness function). Typically, γl ∈{1, 2, . . . , 8} where for sufficiently large l, γl ∈{1}, in other words γl=1 ∀l≥l0. Thus, for any given sequence {σl} the training for {γl} may be implemented using a simple search over all options.
Table 1 shows pseudocode for the accelerated Newton iteration method, according to embodiments of the invention.
An initial approximation, e.g. the value that is an initial approximation of the result of the operation, may be set as y0=1/b. According to some embodiments, the value that is an initial approximation is generated using pseudocode as shown in Table 2 below.
Method 300 may include receiving a first value, l, corresponding to a degree of the polynomial approximation to be calculated (Step 302). The first value l can be low (e.g., less than 10), corresponding to a low degree polynomial because, for example, low degree polynomials have less computational complexity and/or accumulated encryption noise. According to some embodiments, polynomials of degree 7 are used.
Method 300 may include receiving a second value, α, and a third value, β, wherein the second value and the third value define a range over which the polynomial approximation is to be calculated (Step 304). For example the polynomial approximation may be calculated over one of the ranges (α,β),(α,β], [α,β), or [α,β].
Method 300 may include calculating the polynomial approximation using the expression as shown below in EQN. 5:
wherein ak(l)=2ξ0ak+1(l)+ak+2(l) for k=2l−3, 2l−4, . . . , 1, 0, wherein
and wherein Tk(x) is a Chebyshev polynomial of the first kind of degree k (Step 306).
Assuming |x|≥1 the optimal polynomial approximation whose degree is less than or equal to some predetermined n∈ with respect to the relative error satisfies the following minimax problem as shown below in EQN. 6:
The solution to the minimax problem for the case 0 ∉[a, b] can be available from a result in approximation theory. For example, let [a, b] be a non-empty interval in R and let τ∉[a, b], then the minimum, as shown in EQN. 7:
can be attained by the polynomial, as shown in EQN. 8:
where Tn(x) denotes a Chebyshev polynomial of the first kind of degree n.
Since the polynomial ϕ(x)=1−x·pn(x) can satisfies ϕ(0)=1, setting τ=0 can imply that the optimal solution to the minimax problem given in EQN. 6 can be given by EQN 9:
Denoting:
where
using the identity as shown in EQN. 11:
C
l+1(x)=T2
EQN 12 can follow:
Thus,
which, except for the restriction γl∈, can agree with the accelerated Newton iterations formula in EQN. 6. As l increases, Cl(0) eventually increases exponentially. For sufficiently large l the recurrence relation can effectively coincide with the Newton iterations recurrence relation of EQN. 2.
Denoting:
then the formula for the Chebyshev polynomials approximation can be as shown in EQN. 15 below:
and can satisfy EQN 16 as shown below:
Employing EQN 17 as shown below:
2Tj(ξ)·Tk(ξ)=Tj+k(ξ)+T|j−k|(ξ) EQN. 17
then
where ak=0 for all k∈{0, 1, . . . , 2l-1}. Thus, the recurrence relation for the coefficients is obtained as shown below in EQN. 18:
a
k
(l)=2ξ0ak+1(l)+ak+2(l),k=2l−3,2l−4, . . . ,1,0 EQN. 19
which can satisfy initial conditions as shown below in EQN. 20 and EQN. 21:
as well as the consistency condition as shown in EQN. 22 below:
Table 2 shows an algorithmic implementation (e.g., pseudocode) of a recursive formula for generating the polynomial approximation {circumflex over (p)}n(x) according to embodiments of the invention.
2L slots
The returned outcome “a” may be an array (e.g., ordered list) containing the coefficients for the polynomial approximation. Following a convention in computing of counting starting with 0, the first value in the array (position 0) may be the coefficient for the 0th power of x in the polynomial, e.g., x0=1 in other words a constant, the second value in the array (position 1) may be the coefficient for the first power of x, e.g. x1=x, the third value in the array may be the coefficient for the second power of x, e.g. x2, and so on.
If |T2
Embodiments of the invention can attain a significant reduction of total number of homomorphic multiplications compared to current state of the art techniques. For n=2l embodiments of the invention relating to accelerated Newton iterations can achieve a multiplicative depth l=log2(n) or l+1, and a total number of homomorphic operations l or l+1. Embodiments of the invention relating to minimax polynomial approximation can achieve a multiplicative depth l=log2(n), and/or a total number of homomorphic operations C(n0)=l−l0. The term n0=2l
Embodiments of the invention can be applicable to any range of values [a, b], including range of values containing zero. Let x∈[a, b]†{0}, and let d∈ denote a predetermined bound for the multiplicative depth. The goal of division algorithms according to embodiments of the invention is to obtain a low complexity polynomial approximation, pn(x)≈1/x, minimizing the error in some appropriate norm given a predetermined multiplicative depth bound, d.
In some embodiments, either 0∈(a, b) or one of the interval bounds (a or b) can be arbitrarily close to 0. In these embodiments, infx∈(a,b)|x|<<1 and the division by x is numerically unstable and can produce an unreliable result. Assuming a scaling factor δ>1 such that:
The last point can be importance for computations. In the general case, the aim can be to minimize either the absolute error or the relative error based on the estimated magnitude of the approximated function. Such an estimate of the magnitude may not available for a evaluated function.
One concern for division by polynomial approximations can be the sensitivity to numerical underflow/overflow, e.g. what happens in contrast to assumptions |x|<1 (underflow) or |x|>max{|a|, |b|} (overflow). Typically, when |x|>max{|a|, |b|} the approximation error can become very large (e.g. sufficiently large to prevent correct decryption) even when the deviation is small. High sensitivity to numerical overflow can be avoided by taking a larger interval for evaluating the approximation. However, this comes at the expense of accuracy: expanding the interval [a, b] requires larger multiplicative depth to achieve the same accuracy as the original interval. In other words, there can be a trade-off between the accuracy of the approximation within the interval [a, b] and the stability of the method with respect to numerical underflow/overflow.
For the case 0 ∈[a, b], denote c=max{|a|, |b|} and consider an odd approximation, pn(x)=−pn(−x)≈1/x, x∈[−c, c. Thus, for another polynomial approximation whose domain of application is contained in the set of positive of positive real numbers, {circumflex over (q)}m(x)≈1/x, x∈(∈2, c2), ∈∈(0, c), deg({circumflex over (q)}m(x))=m∈, there exists the approximation as shown below in EQN. 24:
{circumflex over (q)}
2m+1(x)=x·{circumflex over (q)}m(x2)≈1/x,x∈[−c,−∈]∩[c,∈] EQN. 24
Effectively, the problem can reduce to the approximation of ƒ(x)=1/x for the case 0∈[a, b] with c=b>a=∈>0.
Operating system 115A may be or may include code to perform tasks involving coordination, scheduling, arbitration, or managing operation of computing device 100A, for example, scheduling execution of programs. Memory 120A may be or may include, for example, a Random Access Memory (RAM), a read only memory (ROM), a Flash memory, a volatile or non-volatile memory, or other suitable memory units or storage units. At least a portion of Memory 120A may include data storage housed online on the cloud. Memory 120A may be or may include a plurality of different memory units. Memory 120A may store for example, instructions (e.g. code 125A) to carry out a method as disclosed herein. Memory 120A may use a datastore, such as a database.
Executable code 125A may be any application, program, process, task, or script. Executable code 125A may be executed by controller 105A possibly under control of operating system 115A. For example, executable code 125A may be, or may execute, one or more applications performing methods as disclosed herein, such as a machine learning model, or a process providing input to a machine learning model. In some embodiments, more than one computing device 100A or components of device 100A may be used. One or more processor(s) 105A may be configured to carry out embodiments of the present invention by for example executing software or code.
Storage 130A may be or may include, for example, a hard disk drive, a floppy disk drive, a compact disk (CD) drive, a universal serial bus (USB) device or other suitable removable and/or fixed storage unit. Data described herein may be stored in a storage 130A and may be loaded from storage 130A into a memory 120A where it may be processed by controller 105A. Storage 130A may include cloud storage. Storage 130A may include storing data in a database.
Input devices 135A may be or may include a mouse, a keyboard, a touch screen or pad or any suitable input device or combination of devices. Output devices 140A may include one or more displays, speakers and/or any other suitable output devices or combination of output devices. Any applicable input/output (I/O) devices may be connected to computing device 100A, for example, a wired or wireless network interface card (NIC), a modem, printer, a universal serial bus (USB) device or external hard drive may be included in input devices 135A and/or output devices 140A.
Embodiments of the invention may include one or more article(s) (e.g. memory 120A or storage 130A) such as a computer or processor non-transitory readable medium, or a computer or processor non-transitory storage medium, such as for example a memory, a disk drive, or a USB flash memory encoding, including, or storing instructions, e.g., computer-executable instructions, which, when executed by a processor or controller, carry out methods disclosed herein.
Server(s) 110 and computers 140 and 150, may include one or more controller(s) or processor(s) 116, 146, and 156, respectively, for executing operations according to embodiments of the invention and one or more memory unit(s) 118, 148, and 158, respectively, for storing data (e.g., encryption and/or decryption keys, and encrypted and/or decrypted data) and/or instructions (e.g., software for applying computations or calculations, keys to encrypt or decrypt data according to embodiments of the invention) executable by the processor(s). Processor(s) 116, 146, and/or 156 may include, for example, a central processing unit (CPU), a digital signal processor (DSP), a microprocessor, a controller, a chip, a microchip, an integrated circuit (IC), or any other suitable multi-purpose or specific processor or controller. Memory unit(s) 118, 148, and/or 158 may include, for example, a random access memory (RAM), a dynamic RAM (DRAM), a flash memory, a volatile memory, a non-volatile memory, a cache memory, a buffer, a short term memory unit, a long term memory unit, or other suitable memory units or storage units.
Computers 140 and 150 may be servers, personal computers, desktop computers, mobile computers, laptop computers, and notebook computers or any other suitable device such as a cellular telephone, personal digital assistant (PDA), video game console, etc., and may include wired or wireless connections or modems. Computers 140 and 150 may include one or more input devices 142 and 152, respectively, for receiving input from a user (e.g., via a pointing device, click-wheel or mouse, keys, touch screen, recorder/microphone, other input components). Computers 140 and 150 may include one or more output devices 144 and 154 (e.g., a monitor or screen) for displaying data to a user provided by or for server(s) 110.
Database 115 may include software processes or applications for storing and retrieving data 117 such as large-word data structures and large-work CKKS computations, and/or encryption and/or decryption keys. Data 117 may also include code (e.g., software code) or logic, e.g., to enable the application of large-work CKKS algorithms according to embodiments of the invention. Database 115 may be internal or external to one or more of server(s) 110 and/or computer(s) 140 and/or 150 (not shown) and may be connected thereto by a local or remote and a wired or wireless connection. In some embodiments, data 117 is stored in an alternate location separate from database 115, e.g., memory unit(s) 118, 148, and/or 158.
Any of system 100 devices may operate as a secure or insecure party. Secure parties may each securely store unencrypted (or encrypted) data and private keys associated with each dataset, party, etc. Insecure parties may not access the unencrypted data or private keys.
Unless specifically stated otherwise, as apparent from the foregoing discussion, it is appreciated that throughout the specification discussions utilizing terms such as “processing,” “computing,” “calculating,” “determining,” or the like, refer to the action and/or processes of a computer or computing system, or similar electronic computing device, that manipulates and/or transforms data represented as physical, such as electronic, quantities within the computing system's registers and/or memories into other data similarly represented as physical quantities within the computing system's memories, registers or other such information storage, transmission or display devices.
Embodiments of the invention may include an article such as a computer or processor readable non-transitory storage medium, such as for example a memory, a disk drive, or a USB flash memory encoding, including, or storing instructions, e.g., computer-executable instructions, which when executed by a processor or controller, cause the processor or controller to carry out methods disclosed herein.
It should be recognized that embodiments of the invention may solve one or more of the objectives and/or challenges described in the background, and that embodiments of the invention need not meet every one of the above objectives and/or challenges to come within the scope of the present invention. While certain features of the invention have been particularly illustrated and described herein, many modifications, substitutions, changes, and equivalents may occur to those of ordinary skill in the art. It is, therefore, to be understood that the appended claims are intended to cover all such modifications and changes in form and details as fall within the true spirit of the invention.
In the above description, an embodiment is an example or implementation of the inventions. The various appearances of “one embodiment,” “an embodiment” or “some embodiments” do not necessarily all refer to the same embodiments.
Although various features of the invention may be described in the context of a single embodiment, the features may also be provided separately or in any suitable combination. Conversely, although the invention may be described herein in the context of separate embodiments for clarity, the invention may also be implemented in a single embodiment.
Reference in the specification to “some embodiments”, “an embodiment”, “one embodiment” or “other embodiments” means that a particular feature, structure, or characteristic described in connection with the embodiments is included in at least some embodiments, but not necessarily all embodiments, of the inventions.
It is to be understood that the phraseology and terminology employed herein is not to be construed as limiting and are for descriptive purpose only.
The principles and uses of the teachings of the present invention may be better understood with reference to the accompanying description, figures, and examples.
It is to be understood that the details set forth herein do not construe a limitation to an application of the invention.
Furthermore, it is to be understood that the invention may be carried out or practiced in various ways and that the invention may be implemented in embodiments other than the ones outlined in the description above.
It is to be understood that the terms “including”, “comprising”, “consisting” and grammatical variants thereof do not preclude the addition of one or more components, features, steps, or integers or groups thereof and that the terms are to be construed as specifying components, features, steps, or integers.
If the specification or claims refer to “an additional” element, that does not preclude there being more than one of the additional elements.
It is to be understood that where the claims or specification refer to “a” or “an” element, such reference is not to be construed that there is only one of that element.
It is to be understood that where the specification states that a component, feature, structure, or characteristic “may”, “might”, “may” or “could” be included, that a particular component, feature, structure, or characteristic is not required to be included.
Where applicable, although state diagrams, flow diagrams or both may be used to describe embodiments, the invention is not limited to those diagrams or to the corresponding descriptions. For example, flow need not move through each illustrated box or state, or in exactly the same order as illustrated and described.
Methods of the present invention may be implemented by performing or completing manually, automatically, or a combination thereof, selected steps or tasks.
The descriptions, examples, methods and materials presented in the claims and the specification are not to be construed as limiting but rather as illustrative only.
Meanings of technical and scientific terms used herein are to be commonly understood as by one of ordinary skill in the art to which the invention belongs, unless otherwise defined. The present invention may be implemented in the testing or practice with methods and materials equivalent or similar to those described herein.
While the invention has been described with respect to a limited number of embodiments, these should not be construed as limitations on the scope of the invention, but rather as exemplifications of some of the preferred embodiments. Other possible variations, modifications, and applications are also within the scope of the invention. Accordingly, the scope of the invention should not be limited by what has thus far been described, but by the appended claims and their legal equivalents.
This application claims the benefit of and priority to U.S. Provisional Patent Application No. 63/215,865 filed Jun. 28, 2021, which is owned by the assignee of the instant application and incorporated herein by reference in its entirety.
Number | Date | Country | |
---|---|---|---|
63215865 | Jun 2021 | US |