WO2023074133A1 - 暗号処理装置、暗号処理方法、及び暗号処理プログラム - Google Patents

暗号処理装置、暗号処理方法、及び暗号処理プログラム Download PDF

Info

Publication number
WO2023074133A1
WO2023074133A1 PCT/JP2022/033600 JP2022033600W WO2023074133A1 WO 2023074133 A1 WO2023074133 A1 WO 2023074133A1 JP 2022033600 W JP2022033600 W JP 2022033600W WO 2023074133 A1 WO2023074133 A1 WO 2023074133A1
Authority
WO
WIPO (PCT)
Prior art keywords
ciphertext
cryptographic processing
processing device
plaintext
integer
Prior art date
Application number
PCT/JP2022/033600
Other languages
English (en)
French (fr)
Inventor
優佑 星月
航太郎 松岡
Original Assignee
株式会社アクセル
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社アクセル filed Critical 株式会社アクセル
Publication of WO2023074133A1 publication Critical patent/WO2023074133A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F7/00Methods or arrangements for processing data by operating upon the order or content of the data handled
    • G06F7/38Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation
    • G06F7/48Methods or arrangements for performing computations using exclusively denominational number representation, e.g. using binary, ternary, decimal representation using non-contact-making devices, e.g. tube, solid state device; using unspecified devices
    • G06F7/52Multiplying; Dividing
    • G06F7/535Dividing only
    • GPHYSICS
    • G09EDUCATION; CRYPTOGRAPHY; DISPLAY; ADVERTISING; SEALS
    • G09CCIPHERING OR DECIPHERING APPARATUS FOR CRYPTOGRAPHIC OR OTHER PURPOSES INVOLVING THE NEED FOR SECRECY
    • G09C1/00Apparatus or methods whereby a given sequence of signs, e.g. an intelligible text, is transformed into an unintelligible sequence of signs by transposing the signs or groups of signs or by replacing them by others according to a predetermined system
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L9/00Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols
    • H04L9/30Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy

Definitions

  • the present invention relates to a cryptographic processing device, a cryptographic processing method, and a cryptographic processing program for processing ciphertext.
  • Homomorphic encryption is an encryption method that can process encrypted data without decrypting it.
  • Additive homomorphic encryption is a cipher in which operations between ciphertexts correspond to additions between plaintexts
  • multiplicative homomorphic encryption is ciphers in which operations between ciphertexts corresponding to multiplication between plaintexts exist.
  • Additive homomorphic cryptography that performs only additive operations (addition and subtraction) and multiplicative homomorphic cryptography that performs only multiplicative operations (multiplication) have been known for some time. In a finite cyclic group, repeated addition can be used to multiply a plaintext by an integer.
  • FHE Fully Homomorphic Encryption
  • Fully homomorphic encryption based on the LWE (Learning with Errors) problem is known as one of the fully homomorphic encryption methods. .
  • Non-Patent Document 1 bit-wise homomorphic encryption with two values as plaintext and based on logical operation
  • integer-wise homomorphic encryption with whole integer as plaintext as one ciphertext TFHE shown in Non-Patent Document 1 is a Bit-wise type.
  • the TFHE plaintext is a real number between 0 and 1 associated with the circle group. Therefore, it can be applied as an integer-wise type homomorphic encryption with integers as plaintext by sequentially associating the intervals dividing the value range 0 to 1 of the circle group with integers (see Non-Patent Document 2).
  • TFHE Fast Fully Homomorphic Encryption over the Torus. Journal of Cryptology, 33:34-91, 2020, I. Chillotti, N. Gama, M. Georgieva, and M. Izabachene Integerwise Functional Bootstrapping on TFHE, 2020, Hiroki Okada, Shinsaku Kiyomoto, and Carlos Cid
  • TFHE can be used as a homomorphic encryption that can perform four arithmetic operations not in bit-wise but in integer-wise, it will be possible to perform processing more efficiently than calculating bit by bit.
  • Integer-wise TFHE it was necessary to increase the number of divisions of the circle group and represent large numbers with a single ciphertext. Increasing the number of divisions of the circle group reduces the margin of error added to the plaintext, sacrificing the security of the ciphertext.
  • an object of the present invention is to realize operations of multiple precision integers in order to handle large numbers in Integer-wise type TFHE without compromising the security of ciphertexts.
  • the present invention is a cryptographic processing device for processing a ciphertext, wherein the ciphertext has a value obtained by adding an error having a predetermined variance to a predetermined value as a plaintext associated with an integer, and is decrypted.
  • the cryptographic processing device is characterized by comprising a calculation unit that calculates a corresponding new ciphertext.
  • FIG. 3 is a diagram explaining in detail a calculation process based on the functional configuration of FIG. 2;
  • FIG. 3 is an image diagram explaining a circle group that a TLWE cipher has as a plaintext;
  • FIG. 10 is an operation image diagram of binary Gate Bootstrapping;
  • FIG. 4 is a diagram explaining TFHE applied to an Integer-wise type;
  • FIG. 10 is a diagram illustrating a mechanism for realizing multiple precision multiplication by subtraction; 4 is a flow chart showing the flow of scalar division processing executed by the cryptographic processing device; 4 is a flow chart showing the flow of scalar remainder calculation processing executed by the cryptographic processing device; 4 is a flow chart showing the flow of multiple length arithmetic processing executed by the cryptographic processing device; FIG. 4 is a diagram showing ciphertexts input and output to Gate Bootstrapping of the present embodiment; 1 is a block diagram illustrating one embodiment of a computing device; FIG.
  • FIG. 1 is a diagram for explaining the functional configuration of the cryptographic processing apparatus of this embodiment.
  • the cryptographic processing device 1 includes a control unit 10 , a storage unit 20 , a communication unit 25 and an input unit 26 .
  • the control unit 10 includes a reception unit 11, a first calculation unit 12, a second calculation unit 13, a first bootstrapping unit (first calculation unit) 15, a second bootstrapping unit (second calculation unit) 16, and an output unit. 18 and .
  • the accepting unit 11 accepts an input of a ciphertext to be operated through the communication unit 25 and the input unit 26 . Alternatively, the receiving unit 11 receives input of ciphertext from another process executed by the cryptographic processing device 1 .
  • the first computation unit 12 performs a first homomorphic computation on an input cipher.
  • the second computation unit 13 performs a second homomorphic computation on the input cipher.
  • the first bootstrapping unit 15 performs gate bootstrapping processing described below on the calculation result of the first calculation unit 12 or the calculation result of the second calculation unit 12, and outputs a new ciphertext.
  • the second bootstrapping unit 16 performs gate bootstrapping processing described below on the calculation result of the first calculation unit 12 or the calculation result of the second calculation unit 12, and outputs a new ciphertext.
  • the first calculation unit 12 and the second calculation unit 13 are calculation processing units that implement the homomorphic calculation described below by software. At least one of the first calculation unit 12, the second calculation unit 13, the first bootstrapping unit 15, and the second bootstrapping unit 16 may be realized by hardware.
  • the output unit 18 outputs the final calculation result to the outside of the cryptographic processing device 1 or to another processing process executed by the cryptographic processing device 1 .
  • the storage unit 20 can store input ciphertexts, temporary files and temporary data used in calculations on ciphertexts, and output ciphertexts.
  • the encrypted database 60 can be stored in the storage unit 20 .
  • the communication unit 25 connects the cryptographic processing device 1 to a network and enables communication with external devices. By storing the encrypted database 60 in the storage unit 20 and providing the communication unit 25, the cryptographic processing apparatus 1 can function as a database server. In this case, the cryptographic processing device 1 receives an encrypted query from a terminal device as an external device, searches the encrypted encrypted database 60, and responds with the encrypted search result to the terminal device. can do
  • the input unit 26 inputs a ciphertext to be processed and a query to the encrypted database 60 to the cryptographic processing device 1 .
  • FIG. 2 is a diagram explaining in detail the calculation process based on the functional configuration of FIG.
  • the configuration shown in FIG. 2 uses Gate Bootstrapping presented in the above paper.
  • the TFHE Gate Bootstrapping presented in the above paper is detailed below.
  • FIG. 2(a) shows the functional configuration for performing scalar operations (scalar division, scalar remainder calculation), and
  • FIG. It shows the functional configuration for performing In FIG. 2A, the first arithmetic unit 12 and the first bootstrapping unit 15 constitute the scalar division unit in FIG.
  • the first calculator 12 when a ciphertext cx having an integer x as a plaintext is input, the first calculator 12 performs a first homomorphic operation to multiply the ciphertext cx by 2n to obtain a new ciphertext cx′. 2n times the ciphertext cx is the integer multiple of the ciphertext, and as explained above, the integer multiple of the ciphertext is defined on the circle group.
  • the ciphertext cx' is obtained from methods known in the art.
  • the first bootstrapping unit 15, which receives the ciphertext cx', performs gate bootstrapping described below, and at the same time, performs scalar division to divide the ciphertext cx' by a predetermined plaintext.
  • the second bootstrapping unit 16 which receives the ciphertext cx', performs gate bootstrapping described below, and at the same time, performs scalar remainder calculation to find the remainder when the ciphertext cx' is divided by a predetermined plaintext.
  • FIG. 2A the first arithmetic unit 12 and the second bootstrapping unit 15 constitute the scalar division unit in FIG.
  • the first arithmetic unit 12 and the second bootstrapping unit 16 constitute the scalar remainder calculation unit in FIG. .
  • FIG. 2(b) shows a configuration for performing multiple length arithmetic (addition) between ciphertexts using the scalar division section and scalar remainder calculation section of FIG. 2(a).
  • the second calculation unit 13 divides the input ciphertexts ca and cb to be calculated, respectively, into the i-th part and the i-1-th quotient ciphertext cd output from the scalar division unit.
  • a second homomorphic operation (ca i +cb i +cd i ⁇ 1 ) is performed on i ⁇ 1 (carrying described in detail later).
  • the ciphertext cc which is the output of the second homomorphic operation, is input to the scalar division unit and the scalar remainder calculation unit, and the quotient cd, which is the division result when the ciphertext cc is divided by the plaintext, and the remainder calculation result A remainder ciphertext cm i is output.
  • the quotient ciphertext cd is returned to the second operation unit 13, and the second operation unit 13 performs a second homomorphic operation on the i+1-th portion of the input ciphertexts ca and cb and the quotient ciphertext cd.
  • the following scalar division and scalar remainder calculations are performed.
  • the second homomorphic operation, the scalar division, and the scalar remainder calculation are repeatedly performed, and the sequence of the ciphertext cm, which is the result of the scalar remainder calculation when the second homomorphic operation, the scalar division, and the scalar remainder calculation are repeated a predetermined number of times, becomes the operation result of the multiple length operation (addition). .
  • Gate Bootstrapping is a technique to make fully homomorphic encryption practical, which was not practical due to the enormous amount of data and the computation time.
  • TFHE in the above paper uses a cipher called a TLWE cipher, which is an LWE (Learning with Errors) cipher configured on a circle group. It implements isomorphic logical operations (and any other operations such as addition and multiplication).
  • TLWE ciphertext encrypted with a private key.
  • TFHE implements fully homomorphic encryption (FHE) based on TLWE ciphertext.
  • FHE fully homomorphic encryption
  • the TLWE cipher is a special case of the LWE cipher, which is a kind of lattice cipher (the LWE cipher defined on the circle group).
  • TLWE encryption is an additive homomorphism, and it is known that additive operations between TLWE-encrypted plaintexts can be performed without decrypting the ciphertexts.
  • FIG. 3 is an image diagram for explaining the circle group that the TLWE cipher has as plaintext.
  • any point in the circle group ⁇ T ⁇ shown in FIG. Use as plaintext.
  • a point on the circle group ⁇ T ⁇ is also referred to herein as an "element”.
  • a cryptographic processing unit that handles TFHE performs general homomorphic operations such as addition operations as operations between TLWE ciphertexts, and gate bootstrapping is used to keep the error of the operation results within an appropriate range. Realize fully homomorphic encryption (FHE) that allows logical operations (at a later stage).
  • FHE fully homomorphic encryption
  • [TLWE encryption] Explain the TLWE cipher.
  • a vector [a] of N uniformly distributed random numbers is prepared as an element on the circle group ⁇ T ⁇ .
  • a private key [s] which is a collection of N binary values of 0 and 1, is prepared.
  • a set of ([a], [s] ⁇ [a] + e), where e is a random number of Gaussian distribution (normal distribution) whose mean value is plaintext ⁇ and whose variance is ⁇ predetermined is an example of a TLWE ciphertext.
  • the plaintext ⁇ is the average value of e when an infinite number of TLWE ciphertexts are generated for the same plaintext ⁇ , where ⁇ is plaintext without error and e is plaintext with error.
  • This TLWE cipher is an additive homomorphism, and an additive operation between plaintexts of TLWE ciphertexts can be performed without decrypting the ciphertexts.
  • This shows that the TLWE ciphertext is "additive homomorphic encryption".
  • various operations are realized by repeatedly performing addition operations on TLWE ciphertext with error added to plaintext and reducing the error by Gate Bootstrapping.
  • Gate Bootstrapping uses the residue ring of polynomial rings as a finite cyclic group.
  • residue ring of polynomial rings is a finite cyclic group.
  • a polynomial of degree n is generally represented as a n x n +a n ⁇ 1 x n ⁇ 1 + . . . +a 0 . All these sets form a commutative group with respect to the sum f(x)+g(x) of polynomials.
  • the product f(x)g(x) of polynomials has the same properties as the commutative group, except that the inverse does not always exist.
  • TFHE uses a polynomial ring whose coefficients are the circle group ⁇ T ⁇ , and such a polynomial ring is denoted by T[X]. If the polynomial ring T(X), which is a polynomial ring, is decomposed into the form of T[X](X n +1)+T[X], and only the residual parts are taken out and collected, this is also a "ring", so the polynomial ring A remainder ring is obtained. In TFHE, the remainder ring of the polynomial ring is represented as T[X]/(X n +1).
  • Polynomial F(X) ⁇ X n-1 + ⁇ X n-2 + ⁇ + ⁇ X+ ⁇ take out. Multiplying the element F(X) of the residue ring of the polynomial ring by X gives ⁇ X n ⁇ 1 + ⁇ X n ⁇ 2 + . appears as a constant term. Further multiplication by X does the same thing again: ⁇ X n-1 + ⁇ X n-2 + . . . + ⁇ X 2 - ⁇ X- ⁇ term). Repeating this for a total of n times, we get - ⁇ X n-1 - ⁇ X n-2 .
  • a cryptographic processing device implements fully homomorphic encryption by utilizing properties of polynomial F(X) based on such a residue ring of polynomial rings.
  • TRLWE cipher Gate Bootstrapping uses a cipher called TRLWE cipher in addition to TLWE cipher.
  • the TRLWE cipher will be explained.
  • the R in the TRLWE cipher represents a ring
  • the TRLWE cipher is an LWE cipher composed of rings.
  • TRLWE is also an additive homomorphic cipher.
  • the ring in the TRLWE cipher is the residue ring T[X]/(X n +1) of the polynomial ring described above. To obtain the TRLWE cipher, the elements of the remainder ring T[X]/(X n +1) of the polynomial ring are randomly selected.
  • n coefficients of the n ⁇ 1 degree polynomial are selected from the circle group ⁇ T ⁇ by uniformly distributed random numbers. If the degree of the polynomial is n ⁇ 1, it will not be divided by X n +1 and there is no need to consider the remainder.
  • n random numbers e i be random numbers of Gaussian distribution (normal distribution) with an average value of plain text ⁇ i and a variance of ⁇ , and construct the following polynomial e(X) from these.
  • TRLWE ciphertext (a(X), b(X)) is obtained as TRLWE ciphertext.
  • the TRLWE cipher uses random numbers to perform encryption, so an infinite number of ciphertexts can correspond to the same secret key and plaintext.
  • Gadget Decomposition Gadget Decomposition is explained.
  • the coefficients of the polynomial used in the TRLWE ciphertext are real numbers greater than or equal to 0 and less than 1, which are elements of the circle group ⁇ T ⁇ in FIG. 5, and have only fractional parts.
  • Gadget Decomposition is an operation for obtaining [v] that minimizes
  • is the norm (length) of the vector.
  • Generate 2l ciphertexts Zi (a(X), b(X)) made up of polynomials in which all the coefficients of e(X) have an average value of 0 and the variance is ⁇ .
  • the plaintext ⁇ is encrypted as follows to obtain the following ciphertext k.
  • This ciphertext k is defined as TRGSW ciphertext BK.
  • the TRGSW ciphertext BK constitutes the Bootstrapping Key used below.
  • Bootstrapping Key is used to encrypt the private key for Gate Bootstrapping. Separate from the private key [s] (Nth order) used for TLWE ciphertext, each element of the private key [s'] for encrypting the private key [s] is set to 0 or 1 in order to be used for Gate Bootstrapping. Select with two values. The degree of the secret key [s'] must match the degree n of the polynomial used in the TRLWE cipher. Create a TRGSW ciphertext BK for each element of the private key [s].
  • the CMux function outputs the ciphertext of plaintext ⁇ 0 without decryption, and when s i is 1, outputs the ciphertext of plaintext ⁇ 1 without decryption.
  • the CMux function can compute the ciphertext of plaintext ⁇ 0 or plaintext ⁇ 1 , but it does not know which one was chosen.
  • Binary Gate Bootstrapping of TFHE is performed using various information described above.
  • Binary Gate Bootstrapping consists of the following three steps: (1) BlindRotate, (2) SampleExtract, and (3) Key switching.
  • FIG. 4 is an operation image diagram of binary gate bootstrapping.
  • Binary Gate Bootstrapping reduces the errors in the plaintext of the results of homomorphic operations between TLWE ciphertexts through the following three steps.
  • plaintext means the result of computation between plaintexts resulting from computation between TLWE ciphertexts. Convert the plaintext in the interval from 0 to 0.25 (1/4) and 0.75 (3/4) to 1 in the circle group ⁇ T ⁇ in FIG. /4) to 0.75 (3/4) is converted into ciphertext of 0.25 (1/4). During this conversion, the error added to the plaintext is anywhere in the range of ⁇ 1/16.
  • Blind Rotate BlindRotate is done as the first step in Gate Bootstrapping.
  • BlindRotate is the process of creating the TRLWE ciphertext.
  • T(X) trivial TRLWE ciphertext
  • T(X) polynomial T(X)
  • the TRLWE ciphertext multiplied by X ⁇ s(c′) is obtained without decryption.
  • 0 indicates a 0th order polynomial 0.
  • ⁇ s(c') is a plaintext obtained by multiplying the following LWE ciphertext c' by a decryption function.
  • ⁇ s' (A n ) is polynomial ciphertext obtained by multiplying polynomial T(X) by X ⁇ 1 ⁇ 1′ times.
  • the TLWE ciphertext cs obtained by SampleExtract in (2) is encrypted not with the secret key [s] but with the secret key [s']. Therefore, decrypt the TLWE ciphertext cs. Instead, it is necessary to replace the key of the TLWE ciphertext cs with the private key [s] to restore the encrypted state with the private key [s]. Therefore, the method of key switching will be explained.
  • the secret key [s] of the TLWE ciphertext used in TFHE was an N-order vector. This is used to encrypt the secret key [s'] of the n-th order vector when the Bootstrapping Key was created. i.e.
  • the elements of the circle group ⁇ T ⁇ the real numbers from 0 to 1, are encoded as values shifted to each digit when expressed in binary.
  • the private key is [s].
  • “Number of digits” t is a system parameter. Decrypting with the private key [s] yields becomes. This is the "key switching key”.
  • the number of elements of [a] is n, like the secret key [s']. Converting these one by one to t-bit fixed decimal numbers, can be written in the form The error is increased at this stage, but a system parameter can constrain the maximum absolute value.
  • TLWE ciphertext cx is calculated as the main processing of the key switching. Since the term ([0], b) is a trivial ciphertext, the decrypted result is b, and the result of decrypting the TLWE ciphertext cx is calculated as follows: is. Since s' i is a constant with respect to j, , and substitute the expression when decomposing into fixed decimals in the above. resulting in, This means that the key switching has been successful.
  • the TLWE ciphertext cx obtained here is encrypted with the same secret key [s] as the TLWE ciphertext c used as input for Gate Bootstrapping. By performing the key switching process, it returns to the TLWE ciphertext encrypted with the secret key [ s ]. If ⁇ s (c) is in the range of 1/2 ⁇ 1/4, the plaintext ⁇ s (cx) is 1/4. As a result of the above processing, a TLWE ciphertext having either binary value of 0 or 1/4 and an error within ⁇ 1/16 is obtained as a result of Gate Bootstrapping. The maximum value of the error does not depend on the input TLWE ciphertext c and is a value fixed by system parameters. Therefore, the system parameters are set so that the maximum error value is within ⁇ 1/16 of the input TLWE ciphertext. As a result, NAND operation can be performed any number of times, and all operations such as addition and multiplication are possible.
  • Errors in the "plaintext" of the TLWE ciphertext output from Gate Bootstrapping include the error added by converting the TLWE ciphertext into an integer, the error added by CMux, and the error when converting to a fixed decimal number by key switching. All of these errors can be constrained by system parameters, and the system parameters can be adjusted so that the overall error is ⁇ 1/16.
  • the above is the process of Gate Bootstrapping of TFHE.
  • TFHE is a bit-wise homomorphic encryption that has 0 or non-zero as plaintext and performs logical operations.
  • the plaintext is a real number of 0 to 1 associated with the circle group ⁇ T ⁇ . Therefore, by sequentially associating the intervals obtained by dividing the circle group ⁇ T ⁇ with integers, it can be applied as an integer-wise type homomorphic encryption having integers as plaintext.
  • the above paper shows that the TLWE ciphertext used in TFHE is additively homomorphic to the plaintext of the circle group, and it is obvious that addition (subtraction) operations can be performed. Scalar division or scalar remainder calculations are possible in the manner described below.
  • Scalar division and scalar remainder calculation are operations for obtaining the quotient and remainder when an integer-wise type ciphertext is divided by a real number that is not a ciphertext.
  • TFHE can be used as a homomorphic encryption capable of four arithmetic operations in Integer-wise type.
  • Bit-wise type TFHE can perform processing more efficiently than calculating bit by bit.
  • the result of scalar division or scalar remainder calculation can be used to implement multiple precision operations in homomorphic encryption.
  • FIG. 5 is a diagram explaining TFHE applied to the Integer-wise type.
  • the value range of 0 to 1 associated with the circle group ⁇ T ⁇ is divided into t pieces.
  • the possible values of plaintext are t values obtained by dividing the value range 0 to 1 -(t/2) to (t/2)-1, where (t/2)-1 is one
  • these integer values are -4/t, -3/t, -2/t, -1/t, - It is assigned to intervals of 0/t, 4/t, 3/t, 2/t, 1/t and 0/t. If the circle group ⁇ T ⁇ is finely divided by increasing the value of t, the integer value that can be recorded in the TLWE ciphertext can be increased. There is a problem that the strength is lowered. This point will be explained later.
  • scalar division/modulus calculation for homomorphic encryption is realized, and furthermore, multiple length arithmetic for homomorphic encryption is realized using the results of scalar division/scalar remainder calculation.
  • Multiple precision arithmetic divides a number into one or more arithmetic units to perform calculations. Multiple precision arithmetic allows large numbers to be handled without compromising cryptographic strength.
  • the cryptographic processing device 1 improves Gate Bootstrapping presented in the above paper.
  • the cryptographic processing device 1 sets the TRLWE ciphertext (polynomial F(X) as a test vector) input to BlindRotate to a polynomial whose coefficients are the result of a step function and a sawtooth wave function, respectively.
  • the cryptographic processing device 1 calculates such a TRLWE ciphertext from a divisor and performs BlindRotate using such a TRLWE ciphertext, thereby realizing scalar division and scalar remainder calculation.
  • the contents of the multiple precision arithmetic and the processing such as encryption performed using it can be used as they are.
  • the cryptographic processing device 1 sets the number t for dividing the value range 0 to 1 of the circle group ⁇ T ⁇ . (t/2)-1 is the maximum integer value that can be recorded in one TLWE ciphertext.
  • the cryptographic processing device 1 sets system parameters for TFHE cryptography.
  • the degree n of the polynomial of the TRLWE cipher (the polynomial F(X) as the test vector) is preferably a multiple of t. Also, system parameters are set so that the range of error added to the plaintext in the ciphertext obtained after Gate Bootstrapping is less than ⁇ 1/(2t).
  • the TLWE ciphertext cx is the real number corresponding to the integer x (dividend) that cannot be known without the private key.
  • plaintext 1/(2t) is an offset for positioning the plaintext at the center of the slice obtained by dividing the circle group ⁇ T ⁇ in FIG.
  • the TLWE ciphertext cx is divided or remaindered by the real number y.
  • Non-Patent Document 1 a technique that extends Gate Bootstrapping in the above paper. This technique is described in the paper "Bootstrapping in FHEW-like Cryptosystems, Daniele Micciacio and Yuriy Polyakov Duality Technologies February 23, 2020".
  • This technique is described in the paper "Bootstrapping in FHEW-like Cryptosystems, Daniele Micciacio and Yuriy Polyakov Duality Technologies February 23, 2020".
  • the disclosed method by setting the result of the function instead of setting the coefficient of the test vector to a constant ⁇ , different results are obtained depending on the value of the TLWE ciphertext.
  • a test vector polynomial proposes to use
  • the cryptographic processing device 1 uses the following test vector polynomials T1(X) and T2(X).
  • a test vector polynomial T1 is a test vector polynomial for division.
  • a test vector polynomial T2 is a test vector polynomial for remainder calculation. common to the two test vector polynomials corresponds to one interval obtained by dividing the circle group by t.
  • the test vector polynomial T1(X) is a function (t/y ) is set as the coefficient.
  • the cryptographic processing device 1 uses the TLWE ciphertext cx and the plaintext y as inputs for Gate Bootstrapping, performs BlindRotate using the test vector polynomial T1, and further performs SampleExtract and key switching to handle the division result (quotient).
  • a TLWE ciphertext with x/y as plaintext can be obtained.
  • the test vector polynomial T2(X) is a function ( t mod y) is set as a coefficient.
  • the cryptographic processing device 1 uses the TLWE ciphertext cx and plaintext y as inputs for Gate Bootstrapping, performs BlindRotate using the test vector polynomial T2, and further performs SampleExtract and key switching to obtain the result of remainder calculation (remainder) as A TLWE ciphertext with the corresponding t mod y plaintext can be obtained.
  • the cryptographic processing device 1 creates trivial ciphertexts (0, T1(X)) and (0, T2(X)) having the test vector polynomials T1(X) and T2(X) as plaintexts, respectively. .
  • the cryptographic processing device 1 (first arithmetic unit 12) multiplies each coefficient of the TLWE ciphertext cx by 2n and rounds off to obtain a TLWE ciphertext cx′.
  • the TLWE ciphertext cx' is, as a plaintext, have
  • the cryptographic processing device 1 (first gate bootstrapping unit 15) receives the TLWE ciphertext cx′ as an input and performs BlindRotate using the test vector polynomial T1(X).
  • the coefficients of the constant term of the plaintext polynomial resulting from BlindRotate are is. ⁇ is the error introduced by BlindRotate.
  • the cryptographic processing device 1 receives the TLWE ciphertext cx′ as an input and performs BlindRotate using the test vector polynomial T2(X).
  • the constant coefficients of the plaintext polynomial resulting from BlindRotate are is. where ⁇ is the error caused by BlindRotate.
  • the cryptographic processing device 1 performs SampleExtract and key switching on TRLWE ciphertexts obtained as a result of each BlindRotate in the same manner as normal Gate Bootstrapping. As a result, the cryptographic processing device 1 obtains a TLWE ciphertext cq corresponding to the calculation result (quotient) of the division and a TLWE ciphertext cr corresponding to the calculation result (remainder) of the remainder calculation.
  • the TLWE ciphertext cq corresponds, as plaintext, to the coefficients of the constant term of the plaintext polynomial resulting from BlindRotate using the test vector polynomial T1(X) have
  • the TLWE ciphertext cr corresponds, as plaintext, to the coefficients of the constant term of the plaintext polynomial resulting from BlindRotate using the test vector polynomial T2(X) have
  • the processing described above is the processing of scalar division and scalar remainder calculation that can be performed by the cryptographic processing device 1 .
  • the cryptographic processing device 1 uses the scalar division and scalar remainder calculation described above to perform multiple precision arithmetic on a large number of plaintexts (BIG INTEGER). A multiple precision operation performed by the cryptographic processing device 1 will be described with reference to FIG. 2(b).
  • the cryptographic processing device 1 uses an appropriate natural number t' to set t (division number of the circle group described with reference to FIG. 5) to be small enough to maintain the strength of the encryption, so that t ⁇ t'2 .
  • t' is a power of 2
  • the cryptographic processing device 1 determines an appropriate natural number u as the number of fields of the multiple length integer (the bit unit or interval for dividing the multiple length integer).
  • u is the number of TLWE ciphertexts into which one plaintext (multiprecision integer) is divided. Divide the multiple precision integer by u fields or fields t′ 0 , t′ 1 , t′ 2 , . . . t′ u ⁇ 1 .
  • the cryptographic processing device converts the plaintext X into It divides into u X i in the form of .
  • the cryptographic processing device 1 encrypts each X i to create u TLWE ciphertexts ca i (0 ⁇ i ⁇ u ⁇ 1).
  • the ciphertext ca 0 is the ciphertext of the field t′ 0 obtained by dividing the multiple precision integer
  • the ciphertext ca 1 is the ciphertext of the field t′ 1 obtained by dividing the multiple precision integer
  • the ciphertext ca 2 is the ciphertext of the field t′ 1 obtained by dividing the multiple precision integer.
  • the ciphertext of the field t'2 obtained by dividing the double-precision integer is the ciphertext of the field t'u-1
  • the ciphertext ca u-1 is the ciphertext of the field t'u-1 obtained by dividing the multiple-precision integer.
  • the original plaintext X can be obtained by calculating X i obtained by decoding ca i using the above equation.
  • the cryptographic processing device 1 converts another plaintext Y, like the plaintext X, It divides into u Y i in the form of .
  • the cryptographic processing device 1 encrypts each Y i and creates u TLWE ciphertexts cb i (0 ⁇ i ⁇ u ⁇ 1).
  • the ciphertext cb 0 is the ciphertext of the field t′ 0 obtained by dividing the multiple precision integer
  • the ciphertext cb 1 is the ciphertext of the field t′ 1 obtained by dividing the multiple precision integer
  • the ciphertext The text cb2 is the ciphertext of the field t'2 obtained by dividing the multiple precision integer
  • the ciphertext cb u-1 is the ciphertext of the field t'u -1 obtained by dividing the multiple precision integer.
  • the cryptographic processing device 1 can perform the four arithmetic operations of multiple length while maintaining the security of the ciphertext.
  • the cryptographic processing device 1 executes the multiple length operation between the ciphertexts corresponding to the plaintext X+plaintext Y in the following procedure.
  • i 0.
  • the ciphertext cc i corresponds to the ciphertext cx.
  • the ciphertext cd i of the quotient obtained by dividing cc i by t′ by scalar division and scalar remainder calculation and the ciphertext cm i of the remainder are obtained (scalar division section, scalar remainder calculation section).
  • the ciphertext cd i corresponds to the ciphertext cq
  • the ciphertext cmi corresponds to the ciphertext cr.
  • the ciphertext cd i of the quotient obtained by the scalar division for the homomorphic addition at t'i is the carry to t'i +1 by the operation of t'i .
  • the ciphertext cd i is also added in the homomorphic operation of ca i+1 and cb i+1 for t′ i+1.
  • the cryptographic processing device 1 increments i by 1 and repeats the processes (1) to (3) u times.
  • the string of cm i after repeating u times becomes the multiple length ciphertext cm corresponding to the plaintext X+plaintext Y.
  • the cryptographic processing device 1 performs the operation b+d between the ciphertexts of field t'0 of plaintext X and plaintext Y.
  • FIG. The cryptographic processing device 1 first performs scalar division by the scalar division unit and scalar remainder calculation by the scalar remainder calculation unit on the operation result of b+d.
  • the remainder obtained as a result of the scalar remainder calculation is the value of the interval (or digit) t'0 of the ciphertext which is the addition result.
  • the quotient resulting from the scalar division is carried up to t'1 .
  • the cryptographic processing device 1 performs scalar division and scalar remainder calculation on the operation result of a+c+carry.
  • the remainder obtained as a result of the scalar remainder calculation is the value of the interval (or digit) t'1 of the ciphertext that is the addition result.
  • the quotient resulting from the scalar division is carried up to t'2 .
  • the scalar division and scalar remainder calculations are repeatedly performed on the result of adding rounding to the sum of the ciphertexts of field t'2 .
  • a multiple precision operation between ciphertexts corresponding to plaintext XY can also be calculated by performing homomorphic subtraction (ca i ⁇ cb i ⁇ cd i ⁇ 1 ) instead of homomorphic addition in (2).
  • the ciphertext cd i of the quotient obtained by scalar division with respect to the homomorphic subtraction at t'i is carried down from t'i +1 by the operation of t'i.
  • the ciphertext cd i is also subtracted in the homomorphic operation of ca i+1 and cb i+1 for t′ i+1.
  • a multiple precision operation between ciphertexts corresponding to plaintext X ⁇ plaintext Y can also be calculated by subtraction, the Karatsuba method, a method using FFT, or the like, like general multiple precision multiplication.
  • a well-known algorithm can also be used for the multiple precision operation between ciphertexts corresponding to plaintext X ⁇ plaintext Y.
  • the greatest common divisor GCD(X, Y) of plaintext X+plaintext Y can also use a known algorithm such as Euclid's algorithm.
  • the inverse of a with respect to a suitable prime number p can also be calculated by known algorithms such as extended Euclidean division and Fermat's little theorem.
  • FIG. 6 is a diagram illustrating a mechanism for realizing multiprecision multiplication between ciphertexts by subtraction.
  • the ciphertext of field t'0 obtained by dividing plaintext X is a
  • the ciphertext of field t'1 is b
  • the ciphertext of field t'0 obtained by dividing plaintext Y is c
  • field t'1 will be described as d.
  • the cryptographic processing device 1 performs a d ⁇ b operation on the ciphertexts of field t′0 of plaintext X and plaintext Y.
  • the cryptographic processing apparatus 1 first performs scalar division by the scalar division unit and scalar remainder calculation by the scalar remainder calculation unit on the result of the d ⁇ b operation.
  • the remainder resulting from the scalar remainder calculation is the value of field t'0 of the ciphertext resulting from the multiplication.
  • the quotient resulting from the scalar division is carried up to t'1 .
  • the cryptographic processing device 1 performs scalar division and scalar remainder calculation on the d ⁇ a operation result.
  • the remainder resulting from the scalar remainder calculation is the value of field t'1 of the ciphertext resulting from the multiplication.
  • the quotient resulting from the scalar division is carried up to t'2 .
  • the cryptographic processing device 1 performs scalar division and scalar remainder calculation on the result of c ⁇ b operation.
  • the remainder resulting from the scalar remainder calculation is the value of field t'1 of the ciphertext resulting from the multiplication.
  • the quotient resulting from the scalar division is carried up to t'2 .
  • the cryptographic processing device 1 performs scalar division and scalar remainder calculation on the result of c ⁇ a.
  • the remainder resulting from the scalar remainder calculation is the value of field t'2 of the ciphertext resulting from the multiplication.
  • the quotient resulting from the scalar division is carried up to t'3 .
  • Non-Patent Document 2 which discloses an Integer-wise type TFHE, describes a test vector similar to the test vector for performing scalar division used in this embodiment.
  • the method disclosed in Non-Patent Document 2 is used to perform multiple precision arithmetic using the above-described scalar remainder calculation. I can't do it.
  • experiments are conducted with 4-bit integers, but in order to operate large numbers (such as 128 bits) using the configuration disclosed in non-patent document 2 without using scalar remainder calculation, There is no choice but to increase the number of divisions of the circle group.
  • Non-Patent Document 2 the number of divisions of the circle group is increased to represent it with one ciphertext, and calculation is performed between these ciphertexts.
  • the permissible error to be added to the plaintext becomes smaller and the security of the ciphertext is sacrificed. This is because the security of the LWE cipher including the TLWE ciphertext used in TFHE is ensured by the error added to the plaintext.
  • the cryptographic processing device 1 converts addition (addition and subtraction) and multiprecision operations of multiplication into digit-by-digit addition and subtraction and digit-by-digit multiplication using remainder operations, respectively.
  • the cryptographic processing apparatus 1 of the present embodiment performs multiple precision arithmetic using modulo arithmetic on encrypted text obtained by dividing a multiple precision integer. Therefore, the cryptographic processing device 1 can perform a large number of operations with TFHE while maintaining the security strength of the ciphertext without increasing the number of divisions of the circle group.
  • Non-Patent Document 2 does not describe the use of remainder operations to configure multiple precision operations that maintain security strength without increasing the number of divisions of the circle group as in the present embodiment.
  • FIG. 7 is a flowchart showing the flow of scalar division processing executed by the cryptographic processing device.
  • the cryptographic processing device 1 (first arithmetic unit 12) multiplies each coefficient of the ciphertext cx of the divisible number x by 2n to obtain the ciphertext cx'.
  • the cryptographic processing device 1 (first bootstrapping unit 15) performs division by performing gate bootstrapping with the ciphertext cx′ as an input.
  • step S102 the cryptographic processing device 1 performs BlindRotate using the ciphertext cx' and the test vector polynomial T1(X).
  • the cryptographic processing device 1 performs SampleExtract in step S103.
  • the cryptographic processing device 1 performs key switching and outputs the obtained ciphertext as the division result.
  • FIG. 8 is a flowchart showing the flow of scalar remainder calculation processing executed by the cryptographic processing device.
  • the cryptographic processing device 1 first arithmetic unit 12 multiplies each coefficient of the ciphertext cx of the divisible number x by 2n to obtain the ciphertext cx'.
  • the cryptographic processing device 1 (second bootstrapping unit 16) performs remainder calculation by performing gate bootstrapping with the ciphertext cx′ as an input.
  • step S112 the cryptographic processing device 1 performs BlindRotate using the ciphertext cx' and the test vector polynomial T(X).
  • the cryptographic processing device 1 performs SampleExtract in step S113.
  • the cryptographic processing device 1 performs key switching and outputs the obtained ciphertext as the result of remainder calculation.
  • FIG. 9 is a flowchart showing the flow of multiple precision arithmetic processing executed by the cryptographic processing device.
  • the cryptographic processing device 1 (second arithmetic unit 13) substitutes 0 for the variable i as initialization in step S201.
  • the cryptographic processing device 1 (second arithmetic unit 13) performs homomorphic addition of ca i , cb i, and cd i ⁇ 1 to obtain cc i .
  • step S203 the cryptographic processing device 1 (the first arithmetic unit 12 and the first bootstrapping unit 15) performs scalar division with cc i as an input using the method described in FIG. 7 to obtain the ciphertext cd i .
  • step S204 the cryptographic processing device 1 (the first arithmetic unit 12 and the second bootstrapping unit 16) performs scalar remainder calculation with cc i as an input using the method described in FIG. 8 to obtain the ciphertext cm i .
  • the cryptographic processing apparatus 1 determines whether or not i has reached u in step S205. If it is determined that i has not reached u (No in step S205), the cryptographic processing apparatus 1 increases the value of i by 1 in step S206, and repeats the processing of steps S202 to S204. If it is determined that i has reached u (Yes in step S205), the cryptographic processing device 1 outputs the string of cm obtained up to this point as the multiple precision operation result.
  • multiple precision arithmetic (addition) between Integer-wise type TLWE ciphertexts could be executed.
  • the cryptographic processing device 1 uses (1) homomorphic multiplication of integers and binary ciphertexts, and (2) homomorphic matching test between ciphertexts and constants to compare integer ciphertexts. Perform homomorphic multiplication.
  • (1) Homomorphic multiplication of integers and binary ciphertexts, and (2) Homomorphic matching tests of ciphertexts and constants will be explained.
  • (1) The multiplication of the integer ciphertext cy and the binary ciphertext cz by the binary multiplier can be performed, for example, as follows. As shown in FIG.
  • the value range of 0 to 1 associated with the circle group ⁇ T ⁇ is divided into t pieces, and the ciphertext cy is 0 to (t/2)-1. is a ciphertext.
  • the ciphertext cz has the binary symbol 1 when the plaintext is 0, and the binary symbol 0 when the plaintext is 1/2.
  • the ciphertext cz is associated with the ciphertext having the integer 0 or the integer t/2 as the plaintext.
  • t is an even number.
  • the plaintext 0 of the ciphertext cz is associated with the integer 0, and the plaintext 1/2 of the ciphertext cz is associated with the following integer t/2.
  • the ciphertext cz will be described as a ciphertext cz that has a symbol 1 when the plaintext is an integer 0 and a symbol 0 when the plaintext is an integer t/2.
  • F id univariate functions
  • F half elements of Gate Bootstrapping.
  • a technique that extends Gate Bootstrapping in the above paper can be used. This technique is described in the paper "Bootstrapping in FHEW-like Cryptosystems, Daniele Micziancio and Yuriy Polyakov Duality Technologies February 23, 2020".
  • the univariate function F id outputs ciphertexts of the same integers 0 to (t/2)-1 for input of ciphertexts cy of integers 0 to (t/2)-1.
  • the test vector T id (X) for executing the univariate function f id at the same time as BlindRotate is the coefficient of each degree from 0 to n ⁇ 1, as follows: set.
  • the univariate function f half calculates cy/2 for the input of the ciphertext cy of integers 0 to (t/2)-1 if the value of the plaintext integer is an even number, otherwise -(cy+1 )/2-((t/2)-1)/2.
  • the test vector T half (X) for executing the univariate function f half at the same time as BlindRotate is given by set.
  • the cryptographic processing device 1 performs a homomorphic operation on the TLWE ciphertext cz, which is a binary ciphertext, and the TLWE ciphertext cy, which is an integer ciphertext.
  • the cryptographic processing device 1 receives the result of the homomorphic operation as an input, performs Gate Bootstrapping using the test vector polynomial T id (X), and obtains a temporary ciphertext c tmp . If TLWE ciphertext cz is the ciphertext of t/2 (corresponding to plaintext 0 of ciphertext cz, symbol 0) then the result of cz + cy is the ciphertext of y/t + 1/2 and the plaintext of TLWE ciphertext cy is , rotates to a symmetrical position with respect to the origin.
  • the plaintext of the ciphertext c tmp after Gate Bootstrapping using the test vector polynomial T id (X) moves to a symmetrical position.
  • the ciphertext c tmp is a ciphertext obtained by inverting the sign of the ciphertext cy. If the TLWE ciphertext cz is the ciphertext of 0 (corresponding to the plaintext 1/t of the ciphertext cz, symbol 1), then the result of cz+cy is the ciphertext of y/t, and the ciphertext c tmp after Bootstrapping is It remains the same plaintext as the plaintext of the ciphertext cy.
  • the cryptographic processing device 1 performs a homomorphic operation on the ciphertext cy+the ciphertext c_tmp .
  • the homomorphic operation result of ciphertext cy+ciphertext ctmp is ciphertext cy+ciphertext cy.
  • the homomorphic operation result of the ciphertext cy+ciphertext c tmp is the ciphertext c0 whose plaintext is 0 .
  • the cryptographic processing device 1 receives the result of the homomorphic addition as an input and performs gate bootstrapping using the test vector polynomial T half (X). As a result of Gate Bootstrapping, ciphertext cy+ciphertext cy is converted to ciphertext cy, and ciphertext c0 remains ciphertext c0 .
  • the TLWE ciphertext cz to be multiplied by the integer ciphertext cy is ciphertext of 0
  • the ciphertext cy is obtained by Gate Bootstrapping
  • the TLWE ciphertext cz is the ciphertext of t/2
  • the ciphertext c 0 is obtained.
  • the cryptographic processing device 1 can perform multiplication of the integer ciphertext cy and the binary ciphertext cz. As described above, since the values on the circle group used in the ciphertext cz are different, it is necessary to adjust by multiplying the value obtained by Gate Bootstrapping by 2t. Since 2t is an integer here, multiplication is defined on the circle group.
  • the cryptographic processing device 1 encrypts the plaintext m2 to obtain v m2 .
  • the cryptographic processing device 1 performs a homomorphic operation on the ciphertext c m1 -(0, v m2 ), and receives the operation result as an input, Perform Gate Bootstrapping using a test vector polynomial with (0, v m2 ) is a trivial ciphertext with v m2 as plaintext.
  • the new ciphertext cf obtained as a result of Gate Bootstrapping is a binary (binary) ciphertext that indicates the match/mismatch between the ciphertext and the constant . /2 and has 0 as plaintext if c m1 ⁇ (0, v m2 ).
  • the cryptographic processing device 1 substitutes 0 for the ciphertext c sum as an initial value, and 0 as an initial value for the variable i indicating the number of repetitions.
  • the cryptographic processing device 1 receives the multiplicand as an input, performs Gate Bootstrapping using the polynomial F(X) of the above paper as a test vector, and obtains the ciphertext ce.
  • the cryptographic processing device 1 tests whether the multiplier and the value of the variable i match by using the homomorphic matching test method between the ciphertext and the constant. According to the above, a ciphertext cf having t/2 as plaintext when the multiplier and the variable i match and having 0 as the plaintext when the multiplier and the variable i do not match is obtained.
  • the cryptographic processing device 1 multiplies the integer ciphertext ce (corresponding to cy) by the binary ciphertext cf (corresponding to cz) using the method of homomorphic multiplication of integer and binary ciphertext. do.
  • the multiplicand is multiplied by t/2, and when the multiplier and the variable i do not match, the multiplicand is multiplied by 0.
  • the cryptographic processing device 1 inputs the result of adding this operation result to the ciphertext csum of the multiplication result, and performs Gate Bootstrapping using a test vector polynomial for executing the above-mentioned one-variable function Fid .
  • FIG. 10 is a diagram showing ciphertexts input and output to Gate Bootstrapping of this embodiment.
  • gate bootstrapping is performed in the order of BlindRotate, SampleExtract, and key switching.
  • key switching can be performed first in Gate Bootstrapping, and then BlindRotate and SampleExtract can be performed.
  • TLWE ciphertext has a level concept according to security strength.
  • the TLWE ciphertext used as input/output is LEVEL0.
  • BlindRotate is performed on the TLWE ciphertext of LEVEL0, and the TLWE ciphertext obtained by SampleExtracting the output TRLWE ciphertext is LEVEL1, but as a result of key switching, TLWE ciphertext of LEVEL0 is output.
  • the TLWE ciphertext that is the input and output of Gate Bootstrapping is set to LEVEL1
  • BlindRotate is performed in the state where key switching is performed first to lower it to LEVEL0, and the output TRLWE ciphertext is LEVEL1 TLWE ciphertext is output when SampleExtract is performed for .
  • the ciphertext of LEVEL0 consists of the N-order vector [a] of the elements on the circle group ⁇ T ⁇ encrypted with the N-order secret key [s].
  • the ciphertext of LEVEL1 obtained as a result of SampleExtract consists of the nth order vector [a'] of the elements on the circle group ⁇ T ⁇ encrypted with the nth order secret key [s']. Since the ciphertext of LEVEL0 has a smaller number of coefficients (degree of vector), which is the degree of difficulty of the LWE problem, than the ciphertext of LEVEL1, the amount of homomorphic addition calculation is smaller than that of LEVEL1.
  • LEVEL0 ciphertext has the problem that the security strength tends to decrease when the margin of error added to the plaintext is reduced. This is because the security of the LWE-based cipher is guaranteed by the error added to the plaintext.
  • TLWE ciphers are more difficult to calculate (decrypt) as the error added to the plaintext increases and as the number of coefficients (order of the vector) increases. In other words, the smaller the error added to the plaintext and the smaller the number of coefficients (order of the vector), the easier the calculation (decryption) of the TLWE cipher becomes.
  • the time required for BlindRotate is proportional to the number of coefficients (order of vector) of the input TLWE ciphertext, since the number of times of CMux is the same as the order. Therefore, when the ciphertext of LEVEL1 is input, the time required for BlindRotate becomes longer in proportion to the number of coefficients (degree of vector) than when the ciphertext of LEVEL0 is input. Even if LEVEL1 ciphertext is used as input for Gate Bootstrapping to ensure ciphertext security, an increase in required time can be avoided by performing BlindRotate using LEVEL0 TLWE ciphertext converted by key switching as input.
  • the error added to the plaintext is distributed according to a normal distribution, and it is not possible to set a strict "error range". Although it is still concentrated around 0, in principle, it is only possible to concentrate more of the error in the specified range. If the error exceeds the set range, the plaintext is interpreted as a different plaintext, which may lead to unexpected calculation results. It doesn't make the calculation itself impossible, it just gives different results. The acceptable probability of obtaining different computational results depends on the application to which the homomorphic encryption is applied.
  • the overlap of the error ranges is kept within a certain value. It is necessary to set system parameters.
  • the error may be set so as to satisfy particularly important conditions according to the system or device to which this embodiment is applied.
  • the processing performed by the cryptographic processing device 1 can be applied as follows. For example, consider a case where you want to aggregate a specific field within a certain range from a database whose fields and records are encrypted with TLWE encryption (for example, when you want to find the average annual income of 30 to 39 years old). At this time, the cryptographic processing device 1 is a database server that manages an encrypted database. It is returned to the terminal device in an encrypted state. Encrypted databases cannot be indexed, so comparisons and aggregations must be performed on the entire database.
  • the cryptographic processing device 1 uses the functions of the first arithmetic unit 12, the second arithmetic unit 13, the first bootstrapping unit 14, and the first bootstrapping unit 15 to perform a comparison operation for comparing all the records of the encrypted database with the query.
  • the comparison operation is subtraction between the ciphertexts of the record and the query, and the positive or negative result of the subtraction is equivalent to the comparison operation.
  • the cryptographic processing device 1 can further perform an aggregation operation on records that match the query in the comparison operation. In the aggregation operation, the cryptographic processing apparatus 1 calculates the sum by adding records that match the query in the comparison operation, and obtains the average value using division.
  • the processing of queries to encrypted databases includes four arithmetic operations such as addition, subtraction, multiplication, and division of integers that make up the ciphertext, and comparisons (comparisons are equivalent to positive or negative results of subtraction). need to do
  • bit-wise ciphertext it is conceivable that full adder operations are frequently used in processing.
  • the four arithmetic operations are homomorphic four arithmetic operations on encrypted numerical values regarded as ciphertext of each bit when the permutation using the input ciphertext is expressed in binary numbers.
  • the cryptographic processing apparatus 1 of the present embodiment does not perform four arithmetic operations on bit-wise ciphertexts using a full adder, but uses integer-wise ciphertexts having integers as plaintexts. By performing four arithmetic operations and comparisons in , it is possible to significantly reduce query execution time.
  • Fuzzy authentication is, for example, biometric authentication using biometric data, and the absolute condition is to encrypt and conceal the biometric data that remains unchanged throughout life. Fuzzy authentication performs authentication based on the correspondence between the biometric authentication data presented as an authentication request and the biometric authentication data registered in the database. determine whether or not Fuzzy search is an ambiguous search method that presents data close to the query from the database as search results even if the query and records do not completely match.
  • fuzzy authentication and fuzzy search similar to the comparison operation/aggregation operation in the encrypted database described above, the encrypted database and the query are compared. You need to perform comparison operations on the data.
  • Euclidean distance is often used for comparison in fuzzy authentication and fuzzy search.
  • a squaring operation is required when calculating the Euclidean distance. Therefore, in bit-wise homomorphic encryption, O(N 2 ) full adders must be operated for the bit length of data when performing multiplication. Also, even a simple subtraction-based comparison operation requires an O(N) full adder.
  • the cryptographic processing apparatus 1 of the present embodiment does not perform four arithmetic operations on bit-wise ciphertexts using a full adder, but uses integer-wise ciphertexts having integers as plaintexts. The processing time required for fuzzy authentication and fuzzy search can be greatly reduced by performing four arithmetic operations and comparisons in .
  • attribute-based encryption can be implemented for data encrypted with TFHE.
  • Attribute-based cryptography has advanced added value such as access control for users and groups to which they belong to encrypted data.
  • many high-performance cryptosystems require a relatively large amount of computation, such as elliptic curves and pairing maps, and are difficult to adopt in low-power environments such as microcomputers.
  • the above-described multiple-precision arithmetic enables TFHE to handle large values without degrading the encryption strength, so secret keys for high-performance cryptography can be encrypted with TFHE.
  • processing of high-performance cryptography can be delegated to a more sophisticated and high-performance external server or cloud service, so high-performance cryptography can be made more practical.
  • the inside of the double encryption can be processed.
  • FIG. 11 is a block diagram showing one embodiment of a computer device.
  • the configuration of the computer device 100 will be described with reference to FIG.
  • the computer device 100 is, for example, a cryptographic processing device that processes various types of information.
  • Computer device 100 includes control circuit 101 , storage device 102 , reading device 103 , recording medium 104 , communication interface 105 , input/output interface 106 , input device 107 and display device 108 .
  • Communication interface 105 is also connected to network 200 .
  • Each component is connected by a bus 110 .
  • the cryptographic processing device 1 can be configured by appropriately selecting some or all of the components described in the computer device 100 .
  • the control circuit 101 controls the computer device 100 as a whole.
  • the control circuit 101 is, for example, a processor such as Central Processing Unit (CPU), Field Programmable Gate Array (FPGA), Application Specific Integrated Circuit (ASIC) and Programmable Logic Device (PLD).
  • CPU Central Processing Unit
  • FPGA Field Programmable Gate Array
  • ASIC Application Specific Integrated Circuit
  • PLD Programmable Logic Device
  • the control circuit 101 functions, for example, as the control section 10 in FIG.
  • the storage device 102 stores various data.
  • the storage device 102 is, for example, memory such as Read Only Memory (ROM) and Random Access Memory (RAM), Hard Disk (HD), Solid State Drive (SSD), and the like.
  • the storage device 102 may store an information processing program that causes the control circuit 101 to function as the control unit 10 in FIG.
  • the storage device 102 functions, for example, as the storage unit 20 in FIG.
  • the cryptographic processing device 1 When the cryptographic processing device 1 performs information processing, the program stored in the storage device 102 is read into the RAM.
  • the cryptographic processing device 1 executes any one of reception processing, first arithmetic processing, second arithmetic processing, first bootstrapping processing, second bootstrapping processing, and output processing by executing the program read into the RAM by the control circuit 101. Execute the processing including the above.
  • the program may be stored in a storage device of a server on network 200 as long as control circuit 101 can access it via communication interface 105 .
  • the reader/writer 103 is controlled by the control circuit 101 to read/write data from/to the removable recording medium 104 .
  • a recording medium 104 stores various data.
  • the recording medium 104 stores, for example, an information processing program.
  • the recording medium 104 is, for example, a Secure Digital (SD) memory card, a Floppy Disk (FD), a Compact Disc (CD), a Digital Versatile Disk (DVD), a Blu-ray (registered trademark) Disk (BD), a flash memory, or the like. is a non-volatile memory (non-temporary recording medium).
  • the communication interface 105 communicably connects the computer device 100 and other devices via the network 200 .
  • the communication interface 105 functions as the communication unit 25 in FIG. 1, for example.
  • the input/output interface 106 is, for example, an interface detachably connected to various input devices.
  • the input device 107 connected to the input/output interface 106 includes, for example, a keyboard and a mouse.
  • the input/output interface 106 communicably connects various input devices and the computer device 100 .
  • the input/output interface 106 outputs signals input from various connected input devices to the control circuit 101 via the bus 110 .
  • Input/output interface 106 also outputs a signal output from control circuit 101 to an input/output device via bus 110 .
  • the input/output interface 106 functions as the input unit 26 in FIG. 1, for example.
  • the display device 108 displays various information.
  • the display device 108 is, for example, a CRT (Cathode Ray Tube), an LCD (Liquid Crystal Display), a PDP (Plasma Display Panel), an OELD (Organic Electroluminescence Display), or the like.
  • the network 200 is, for example, a LAN, wireless communication, P2P network, or the Internet, and connects the computer device 100 and other devices for communication. It should be noted that the present embodiment is not limited to the embodiments described above, and various configurations or embodiments can be adopted without departing from the gist of the present embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Pure & Applied Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Mathematical Optimization (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Software Systems (AREA)
  • Complex Calculations (AREA)

Abstract

暗号文のセキュリティを損なうことなく、Integer-wise型TFHEで多倍長整数の演算を実現する。暗号文を処理する暗号処理装置であって、ce暗号文は、所定の値に所定の分散を持つ誤差を与えた値を、整数に対応付けた平文として有し、復号することなく整数同士の所定の演算が可能な完全準同型暗号文であり、割られる数の暗号文に対して、割る数の平文を含む第1の多項式に基づいてスカラ剰余算を行い、剰余に対応する新たな暗号文を算出する算出部を備える。

Description

暗号処理装置、暗号処理方法、及び暗号処理プログラム
 本発明は、暗号文を処理する暗号処理装置、暗号処理方法、及び暗号処理プログラムに関する。
 準同型暗号(Homomorphic Encryption)は、暗号化したデータを復号せず、暗号化したままデータ処理を行うことが出来る暗号方式である。
 平文同士での加算に対応する暗号文同士の演算が存在する暗号が加法準同型暗号であり、平文同士での乗算に対応する暗号文同士の演算が存在する暗号が乗法準同型暗号である。
 有限巡回群を整数に見立てて、加法演算(加算、減算)のみを行う加法準同型暗号と、乗法演算(乗算)のみを行う乗法準同型暗号とが以前から知られていた。
 有限巡回群は、加算を繰り返せば整数倍が出来るので、平文の整数倍ができ、乗算を繰り返せば平文のべき乗計算をすることも出来る。
 また、加法演算と乗法演算の両方を暗号化したまま処理する完全準同型暗号(Fully Homomorphic Encryption,FHE)がある。
 完全準同型暗号の一つとして、暗号化時に復号には問題のない程度の小さな誤差を平文に加えることで構成される、LWE(Learning with Errors)問題に基づく完全準同型暗号が知られている。
 LWE問題に基づく完全準同型暗号では、演算を行うとともに誤差が蓄積していくので、誤差が大きくなりすぎて復号ができなくなる前に、暗号化したまま誤差成分を縮小するbootstrappingが実行される。
 bootstrappingの計算時間は、完全準同型暗号に含まれる計算時間の大部分を占める。また、bootstrappingでは膨大なデータを扱うため、その計算量は膨大である。したがって、完全準同型暗号の演算においては、実用的な時間内で演算結果を得ることができないことがある。
 この問題を劇的に改善した手法が、非特許文献1(以下の説明において、上記論文として参照される)に示されるTFHE(Fast Fully Homomorphic Encryption over the Torus)である。
 準同型暗号には、平文として二値を有し論理演算をベースとするBit-wise型の準同型暗号と、平文として整数を丸ごと1暗号文とするInteger-wise型の準同型暗号と、があり、非特許文献1に示されるTFHEはBit-wise型である。
 なおTFHEの平文は円周群に対応づけられた0~1の実数である。よって、円周群の値域0~1を区切った区間を順番に整数と対応付けることにより、整数を平文として有するInteger-wise型の準同型暗号として応用することが出来る(非特許文献2参照)。
TFHE:Fast Fully Homomorphic Encryption over the Torus. Journal of Cryptology, 33:34-91, 2020, I.Chillotti, N.Gama, M.Georgieva, and M.Izabachene Integerwise Functional Bootstrapping on TFHE, 2020, Hiroki Okada, Shinsaku Kiyomoto, and Carlos Cid
 TFHEをBit-wiseではなくInteger-wiseでの四則演算が可能な準同型暗号として利用することができれば、1ビットずつ計算するよりも効率的に処理を行うことができる。
 しかしながら、従来はInteger-wise型のTFHEで大きな数の演算を行うには、円周群の分割数を大きくして一つの暗号文で大きな数を表現する必要があった。円周群の分割数を増やすと平文に付加する許容誤差が小さくなり、暗号文のセキュリティが犠牲になる。
 本発明は、一側面として暗号文のセキュリティを損なうことなく、Integer-wise型TFHEで大きな数を扱うために、多倍長整数の演算を実現することを目的とする。
 本発明は、暗号文を処理する暗号処理装置であって、前記暗号文は、所定の値に所定の分散を持つ誤差を与えた値を、整数に対応付けた平文として有し、復号することなく整数同士の所定の演算が可能な完全準同型暗号文であり、割られる数の暗号文に対して、割る数の平文から得られる第1の多項式に基づいてスカラ剰余算を行い、剰余に対応する新たな暗号文を算出する算出部を備える、暗号処理装置を特徴とする。
 本発明によれば、一側面として、暗号文のセキュリティを損なうことなく、Integer-wise型TFHEで多倍長整数の演算を実現することが出来る。
本実施形態の暗号処理装置の機能構成を説明する図である。 図2の機能構成に基づく演算プロセスを詳しく説明する図である TLWE暗号が平文として有する円周群を説明するイメージ図である。 2値Gate Bootstrappingの動作イメージ図である。 Integer-wise型に適用したTFHEを説明する図である。 多倍長乗算をひっ算で実現する仕組みを説明する図である。 暗号処理装置が実行するスカラ除算処理の流れを示すフローチャートである。 暗号処理装置が実行するスカラ剰余算処理の流れを示すフローチャートである。 暗号処理装置が実行する多倍長演算処理の流れを示すフローチャートである。 本実施形態のGate Bootstrappingに入出力される暗号文を示す図である。 コンピュータ装置の一実施例を示すブロック図である。
 以下に、図面を参照して本発明の実施の形態を詳細に説明する。
 なお、以下の説明において、[]で囲まれた英数字はそれがベクトルであることを示す。{}で囲まれた英数字はそれが集合であることを示す。
 また、本明細書において、「論理演算」と記す場合は2値もしくは多値の論理演算のことを指すものとする。
 図1は、本実施形態の暗号処理装置の機能構成を説明する図である。
 暗号処理装置1は、制御部10と、記憶部20と、通信部25と、入力部26と、を備える。
 制御部10は、受付部11と、第1演算部12と、第2演算部13と、第1Bootstrapping部(第1算出部)15と、第2Bootstrapping部(第2算出部)16と、出力部18と、を備えている。
 受付部11は、通信部25や入力部26を介した、演算の対象となる暗号文の入力を受け付ける。あるいは、受付部11は、暗号処理装置1が実行する他のプロセスから暗号文の入力を受け付ける。
 第1演算部12は、入力暗号に対して第1準同型演算を行う。
 第2演算部13は、入力暗号に対して第2準同型演算を行う。
 第1Bootstrapping部15は、第1演算部12の演算結果、又は第2演算部12の演算結果に対して下記に説明するGate Bootstrapping処理を行って、新たな暗号文を出力する。
 第2Bootstrapping部16は、第1演算部12の演算結果、又は第2演算部12の演算結果に対して下記に説明するGate Bootstrapping処理を行って、新たな暗号文を出力する。
 第1演算部12、第2演算部13は、下記に説明する準同型演算をソフトウェアで実現する演算処理部である。第1演算部12、第2演算部13、第1Bootstrapping部15、第2Bootstrapping部16の少なくとも一つはハードウェアで実現されてもよい。
 出力部18は、最終的な演算結果を暗号処理装置1の外部、あるいは、暗号処理装置1で実行される別の処理プロセスに対して出力する。
 記憶部20は、入力暗号文や、暗号文に対する演算で用いられる一時ファイルや一時データ、出力暗号文を格納することが出来る。
 また、記憶部20には、暗号化された暗号化データベース60を格納することが出来る。
 通信部25は、暗号処理装置1をネットワークに接続し、外部装置との通信を可能にする。
 記憶部20に暗号化された暗号化データベース60を格納し、通信部25を備えることにより、暗号処理装置1は、データベースサーバとして機能することが出来る。
 この場合、暗号処理装置1は、外部装置としての端末装置から、暗号化されたクエリを受け付け、暗号化された暗号化データベース60に対する検索を行い、暗号化された検索結果を端末装置に応答することが出来る。
 入力部26は、暗号処理装置1に対して、演算処理対象の暗号文や、暗号化データベース60に対するクエリを入力する。
 図2は、図1の機能構成に基づく演算プロセスを詳しく説明する図である。図2に示す構成では、上記論文で提示されたGate Bootstrappingを使用する。上記論文で提示されているTFHEのGate Bootstrappingについては下記に詳述する。
 図2(a)は、スカラ演算(スカラ除算、スカラ剰余算)を行うための機能構成、図2(b)は、スカラ演算(スカラ除算、スカラ剰余算)を含み多倍長演算(加算)を行うための機能構成を示している。
 図2(a)において、第1演算部12、第1Bootstrapping部15は図2(b)のスカラ除算部を構成し、第2準同型演算の演算結果に対してスカラ除算を実行する。例えば、整数xを平文として有する暗号文cxが入力されると、第1演算部12は暗号文cxの2n倍する第1準同型演算を行い、新たな暗号文cx’を得る。
 暗号文cxの2n倍は暗号文の整数倍であり、上記に説明したように暗号文の整数倍は円周群上に定義されている。従って、暗号文cx’は従来知られる方法から得られる。
 暗号文cx’を入力された第1Bootstrapping部15は下記に説明するGate Bootstrappingを行うと同時に、暗号文cx’を所定の平文で割るスカラ除算を行う。
 また暗号文cx’を入力された第2Bootstrapping部16は下記に説明するGate Bootstrappingを行うと同時に、暗号文cx’を所定の平文で割った余りを求めるスカラ剰余算を行う。
 図2(a)において、第1演算部12、第2Bootstrapping部15は図2(b)のスカラ除算部を構成し、第2準同型演算の演算結果に対してスカラ除算を実行する。
 また図2(a)において、第1演算部12、第2Bootstrapping部16は図2(b)のスカラ剰余算部を構成し、第2準同型演算の演算結果に対してスカラ剰余算を実行する。
 図2(b)は、図2(a)のスカラ除算部、スカラ剰余算部を用いて暗号文同士の多倍長演算(加算)を行う場合の構成を示している。
 図2(b)において、第2演算部13は、演算対象の入力暗号文ca、cbを夫々分割したi番目の部分と、i-1番目にスカラ除算部から出力された商の暗号文cdi-1(後に詳述する繰り上がり)とに対して第2準同型演算(ca+cb+cdi-1)を行う。ただし初回(i=1)の第2準同型演算を行う場合は、下記に説明するようにcdi-1は0を平文とする暗号文であり、単にca+cb(i=1)を行うのみである。
 第2準同型演算の出力である暗号文ccは、スカラ除算部、スカラ剰余算部に入力されて、暗号文ccを平文で割ったときの除算結果である商の暗号文cd、剰余算結果である剰余の暗号文cmが出力される。
 商の暗号文cdは第2演算部13に戻され、第2演算部13は、入力暗号文ca、cbのi+1番目の部分と商の暗号文cdの第2準同型演算を行う。次のスカラ除算、スカラ剰余算を行われる。
 第2準同型演算、スカラ除算、スカラ剰余算を繰り返し行い、全体で所定回数繰り返したときのスカラ剰余算の結果である暗号文cmの列が、多倍長演算(加算)の演算結果となる。
 TFHEで説明されるGate Bootstrappingについて詳述する。
 Gate Bootstrappingは、膨大なデータ量や演算時間のために実用的とは言えなかった完全準同型暗号を実用的にするための手法である。
 上記論文のTFHEでは、LWE(Learning with Errors)暗号を円周群上で構成したTLWE暗号と呼ばれる暗号を用い、演算時の誤差を小さくしながら高速かつ小さなデータサイズでTLWE暗号文同士の各種準同型論理演算(ひいては加算・乗算などの任意の演算)を実現する。
 TFHEにおけるGate Bootstrappingの入力は、秘密鍵で暗号化されたTLWE暗号文である。
 TFHEでは、TLWE暗号文を基本として完全準同型暗号(FHE)を実現する。
 TLWE暗号は、格子暗号の一種であるLWE暗号の特殊な場合(LWE暗号を円周群上で定義したもの)である。
 TLWE暗号は加法準同型であり、TLWE暗号化された平文同士の加法演算を、暗号文を復号することなく行うことができることが知られている。
 図3は、TLWE暗号が平文として有する円周群を説明するイメージ図である。
 TLWE暗号は、0から実数の精度で進み1になると0に戻る、図5に示す円周群{T}の任意の点を平文とし、0近辺(誤差含む)とμ近辺(誤差含む)を平文として使用する。
 円周群{T}上の点は、本明細書において「要素」ともいう。
 TFHEを扱う暗号処理装置は、このようなTLWE暗号文同士の演算として加法演算など一般的な準同型演算を実行し、その演算結果の誤差をGate Bootstrappingによって適切な範囲内に収めることによって、再度(後段での)論理演算が可能な完全準同型暗号(FHE)を実現する。
[TLWE暗号]
 TLWE暗号を説明する。
 円周群{T}上の要素として、一様分布な乱数をN個集めたベクトル[a]を用意する。また、0,1の2値をN個集めた秘密鍵[s]を用意する。
 平均値が平文μであり、分散が事前に定めたαとなるようなガウス分布(正規分布)の乱数をeとしたときに、([a],[s]・[a]+e)の組がTLWE暗号文の一例となる。
 同一の平文μに対して無限個のTLWE暗号文を生成した時のeの平均値が平文μであり、μは誤差なしの平文、eは誤差付きの平文である。
 なお、「・」は、ベクトルの内積を表す。以降についても同様である。
 上記[s]・[a]+eをbとおくと、TLWE暗号文は([a],b)と表すことができる。
 φ(([a],b))=b-[s]・[a]=eは、TLWE暗号文を復号する関数である。TLWE暗号は平文に秘密鍵ベクトルと乱数ベクトルの内積と誤差を付加して暗号化するため、秘密鍵ベクトルと乱数ベクトルの内積を算出することで、TLWE暗号を誤差付きで復号することができる。この時、秘密鍵ベクトルが未知の場合は、内積となる成分が算出できないため、復号することができない。
 このTLWE暗号は加法準同型であり、TLWE暗号文の平文同士の加法演算を、暗号文を復号することなく行うことができる。
 2つのTLWE暗号文([a],b)、([a’],b’)をそのまま足して、([a]+[a’],b+b’)としたものを、上記の復号関数φに入力すると、
φ(([a]+[a’],b+b’))=(b+b’)-[s]・([a]+[a’])=(b-[s]・[a])+(b’-[s]・[a’])=φ([a],b)+φ([a’],b’)
となり、2つの平文の和が得られる。これにより、TLWE暗号文が「加法準同型暗号」であることがわかる。
 上記論文のTFHEでは「平文に誤差を付加したTLWE暗号文に対して加法演算を行い、Gate Bootstrappingで誤差を削減する」ことを繰り返していくことで、様々な演算を実現する。
 なお、下記において、([0],μ)などの「自明な暗号文(trivial)」は、あらゆる秘密鍵で復号が可能なTLWE暗号文であり、すなわち、どのような秘密鍵を用いても同じ平文を復号できる暗号文である。
 ([0],μ)において、[0]は、ゼロベクトルを表す。
 「自明な暗号文」は、TLWE暗号文として扱えるが、実質的に平文がそのまま入っている状態と言える。
 TLWE暗号文([0],μ)は、復号関数φにかけると、φ(([0],μ))=μ-[s]・0=μとなり、秘密鍵[s]がゼロベクトル[0]と掛け合わされて消えるため、容易に平文μが得られる。このような暗号文は、平文μに対して自明な暗号文に他ならない。
 TFHEのGate Bootstrappingで用いる有限巡回群を説明する。
 Gate Bootstrappingでは、多項式環の剰余環を、有限巡回群として用いる。
 多項式環の剰余環が有限巡回群であることを説明する。
 n次の多項式は、一般にa+an-1n-1+…+aと表される。
 これらの全ての集合は、多項式同士の和f(x)+g(x)に対して可換群をなす。
 また、多項式同士の積f(x)g(x)は、逆元が存在するとは限らないことを除き、可換群と同様の性質を持つ。そのようなものをモノイドと呼ぶ。
 多項式同士の和と積に対しては、下記のように分配法則が成り立つ
f(x){g(x)+g’(x)}=f(x)g(x)+f(x)g’(x)
 従って、多項式を要素として多項式同士の和・積を定義すると「環」をなし、これを多項式環と呼ぶ。
 TFHEでは、円周群{T}を係数とする多項式環を用い、このような多項式環をT[X]と表記する。
 多項式環である多項式T(X)をT[X](X+1)+T[X]のかたちに分解し、剰余部分だけを取り出して集めると、これもまた「環」であるため多項式環の剰余環が得られる。
 TFHEでは、多項式環の剰余環をT[X]/(X+1)と表す。
 多項式環の剰余環T[X]/(X+1)の要素(元)として、任意の係数μ(μ∈T)を用いて、多項式F(X)=μXn-1+μXn-2+・・・+μX+μ
を取り出す。
 多項式環の剰余環の要素F(X)にXを掛けると、μXn-1+μXn-2+・・・+μX-μとなって、一番上の項の係数がプラスからマイナスに反転して定数項として現れる。
 さらにXを掛けると、μXn-1+μXn-2+・・・+μX-μX-μのように、もう一度同じことが起きる(一番上の項の係数がプラスからマイナスに反転して定数項として現れる)。
 これを全部でn回繰り返すと、
-μXn-1-μXn-2・・・-μX-μとなって全ての項の係数がマイナスとなる。
 さらにXを掛け続けると、
-μXn-1-μXn-2・・・-μX+μ
-μXn-1-μXn-2・・・+μX+μ
と一番上の項の係数がマイナスからプラスに反転して定数項として現れていき、全部で2n回繰り返すと、元の多項式環の剰余環の要素F(X)=μXn-1+μXn-2+・・・+μX+μに戻る。このように、最上位の係数(μ)が最下位の定数項に符号反転して(-μ)現れて、全体的に項が1つ、ずれている。
 すなわち、多項式F(X)=μXn-1+μXn-2+・・・+μX+μは、多項式環の剰余環T[X]/(X+1)という環のなかで位数2nの有限巡回群になっている。
 TFHEにおいて、暗号処理装置は、このような多項式環の剰余環に基づく多項式F(X)が有する性質を利用して完全準同型暗号を実現する。
[TRLWE暗号]
 Gate Bootstrappingでは、TLWE暗号の他にTRLWE暗号と呼ばれる暗号を利用する。
 TRLWE暗号について説明する。
 TRLWE暗号のRは環を意味し、TRLWE暗号は環で構成したLWE暗号である。TLWE暗号がそうであるように、TRLWEもまた加法準同型暗号である。
 TRLWE暗号における環は、上記した多項式環の剰余環T[X]/(X+1)である。
 TRLWE暗号を得るに当たり、多項式環の剰余環T[X]/(X+1)の要素(元)をランダムに選択する。
 実際には、n-1次多項式の係数n個を、円周群{T}から一様分布な乱数で選出する。
 多項式の次数がn-1であれば、X+1で割れることがなく、剰余を考える必要がないため、次数がn-1の多項式を多項式a(X)とする。
 0,1の2値からランダムにn個を集めて、下記の秘密鍵となる多項式s(X)を組み立てる。
s(X)=sn-1n-1+sn-2n-2+・・・sX+s
 n個の乱数eを、平均値が平文μになり分散がαとなるガウス分布(正規分布)の乱数とし、これらから下記の多項式e(X)を組み立てる。
e(X)=en-1n-1+en-2n-2+・・・eX+e
 s(X)・a(X)+e(X)を、f(X)(X+1)+b(X)と分解して、b(X)を得る。
 その結果、TRLWE暗号文として、(a(X),b(X))が得られる。
 TRLWE暗号は、TLWE暗号と同様に乱数を用いて暗号化を行うため、同一の秘密鍵、平文に対して、無数の暗号文が対応しうる。
 また、TRLWE暗号は、TLWE暗号と同様に、φ((a(X),b(X))=b(X)-s(X)・a(X)+g(X)(X+1)として、φがT[X]/(X+1)の元となるようにg(X)を定めたものが、復号関数として機能する。
[Gadget Decomposition]
 Gadget Decompositionについて説明する。
 TRLWE暗号文で用いている多項式の係数は、図5の円周群{T}の要素である0以上1未満の実数であり小数部分のみを有する。
 これを二進数表記で何ビットずつかに分解する操作を、上記論文のTFHEではGadget Decomposition(Dec)と定義している。
 例えば、TRLWE暗号文の多項式F(X)の次数nがn=2として、分割の1単位をBg=2で、l=3要素に分解する。このとき、各要素は-Bg/2からBg/2の間に入るようにする。
 TRLWE暗号文は、上記の(a(X),b(X))のように、2つの多項式の組み合わせである。従って、TRLWE暗号文dを、多項式環の剰余環の元となる多項式を要素とする2次元のベクトルと見なして、例えば、
d=[0.75X+0.125X+0.5,0.25X+0.5X+0.375]
と書くことができる。そのため、以下では各要素をBg-1=0.25のべき乗の和の形に分解する。
 円周群{T}上では、0.75=-0.25であるので、
d=[0.75X+0.125X+0.5,0.25X+0.5X+0.375]
=[-0.25X+0.125X+0.5,0.25X+0.5X+0.25+0.125]
=[0.25×(-X+2)+0.25×2X+0.25×0,0.25×(X+2X+1)9+0.25X×2+0.25×0]
と分解できる。
 従って、Gadget Decompositionを行うと、
 Dec(d)=[-X+2,2X,0,X+2X+1,2,0]
というベクトルになる。
 ベクトルから暗号文に逆変換する作用素Hも定義する。
 上記の例に基づいて説明すると、
Figure JPOXMLDOC01-appb-I000001
 という行列が、逆変換の作用素Hとなる。Dec(d)・Hを演算することで、TRLWE暗号文d’が得られる。下位ビットは四捨五入をしてまるめられている。
 TRLWE暗号文dに対して、||d-[v]・H||が最小値となる[v]を得る操作が、Gadget Decompositionであるとも言える。ここで||はベクトルのノルム(長さ)である。
 e(X)の係数全てが平均値0となり、分散はαとなる多項式でできた暗号文Zi=(a(X),b(X))を2l(エル)個生成する。
 そして、平文μを以下のように暗号化し、以下の暗号文kを得る。
Figure JPOXMLDOC01-appb-I000002
 この暗号文kをTRGSW暗号文BKとして定義する。
 TRGSW暗号文BKは、下記に用いるBootstrapping Keyを構成する。
 Bootstrapping Keyを説明する。
 Bootstrapping Keyは、Gate Bootstrappingに用いるために、秘密鍵を暗号化しておくために利用する。
 TLWE暗号文に用いる秘密鍵[s](N次)とは別に、Gate Bootstrappingに使うために、秘密鍵[s]を暗号化するための秘密鍵[s’]の各要素を0か1の2値で選択する。
 秘密鍵[s’]の次数は、TRLWE暗号で使用する多項式の次数nとそろえる必要がある。
 秘密鍵[s]の要素ごとにTRGSW暗号文BKを作成する。
 秘密鍵[s’]で復号するとφs’(Zj)=0となるTRLWE暗号文Zjを2l(エル)個作成する。
 そして、上記したTRGSW暗号文の構成どおり、
Figure JPOXMLDOC01-appb-I000003
とする。
 このTRGSW暗号文を、秘密鍵[s]の次数と同じN個用意したセットを、Bootstrapping Keyと呼ぶ。
 TRGSW暗号文BKiとTRLWE暗号文dの外積を、
BKi×d=Dec(d)・BKi
と定義する。
 Gadget Decompositionは、TRLWE暗号文dに対して||d-[v]・H||が最小値となる[v]を得る操作であった。
 従って、[v]=Dec(d)と誤差(ε(X),ε(X))を用いて、
[v]・H=d+(ε(X),ε(X))と書ける。
 その結果、BKi×d=Dec(d)・BKi
Figure JPOXMLDOC01-appb-I000004
となる。
 左半分は内積を計算し、右半分には[v]・H=d+(ε(X),ε(X))を代入すると、

Figure JPOXMLDOC01-appb-I000005
となり、下記の3つの暗号文c1、c2、c3の和の計算と同じとなる。
Figure JPOXMLDOC01-appb-I000006
 TRLWE暗号は加法準同型暗号であるため、暗号文同士の和をとると平文同士の和をとったことと同じである。
 Cは、Zを何倍かして足したものなので、平文φs’(c)の期待値は0となる。
 また復号したφs’(c)は、平文の絶対値の大きさをシステムパラメータで制約することができるので、この後の演算も含めて十分小さくなるように設定する。
 そうするとφs’(BKi×d)=φs’(s×d)となるが、sが0であっても1であっても計算結果は上記3つの暗号文c1、c2、c3の和になる。単純な比較でsが0と1の何れであるかを判別することができない。
 2つの平文μ、μに対応するTRLWE暗号文d、dがあるとして、d=d-dと代入して、最後にdを加算すると、下記のようなCMux関数が完成する。
 CMux(BK,d,d)=BKi×(d-d)+d=Dec(d-d)・BK+d
 CMux関数は、sが0であると平文μの暗号文を復号することなく出力し、sが1であると平文μの暗号文を復号することなく出力する。
 CMux関数は、平文μもしくは平文μの暗号文を計算することができるが、どちらを選択したかは分からない。
 TFHEの2値Gate Bootstrappingは、上記に説明した様々な情報を用いて行われる。
 2値Gate Bootstrappingは、以下に説明する3つのステップ、(1)BlindRotate、(2)SampleExtract、(3)キースイッチングから構成される。
 図4は、2値Gate Bootstrappingの動作イメージ図である。
 2値Gate Bootstrappingは、下記に説明する3つのステップによってTLWE暗号文同士の準同型演算結果が有する平文に対する誤差の削減を行う。
 以下の説明で、特に説明をしない場合、平文とは、TLWE暗号文同士で演算した結果の平文同士の演算結果を意味するものとする。
 図3の円周群{T}における0~0.25(1/4)、0.75(3/4)~1の区間の平文を0のTLWE暗号文に変換し、0.25(1/4)~0.75(3/4)の区間の平文を0.25(1/4)の暗号文に変換する。
 この変換の際、平文に付加される誤差は±1/16の範囲のいずれかである。
(1)BlindRotate
 Gate Bootstrappingの最初のステップとしてBlindRotateが行われる。
 BlindRotateは、TRLWE暗号文を作成する工程である。
 BlindRotateでは、多項式T(X)を平文とする自明なTRLWE暗号文(0,T(X))から、X-φs(c’)を乗算したTRLWE暗号文を復号することなく得る。0は、0次の多項式0を示す。
 ここでφs(c’)は、下記のLWE暗号文c’を復号関数にかけた平文である。
 BlindRotateでは、上記した有限巡回群をなす、テストベクタとしての下記の多項式F(X)
F(X)=μXn-1+μXn-2+…μX+μ
ただし、μ=1/8
にXn/2を掛けて得た下記の多項式T(X)
T(X)=F(X)・Xn/2
を用意する。
 平文μ1を秘密鍵[s]で暗号化したTLWE暗号文cがあるとする。
 このTLWE暗号文c=([a],b)の各要素を2n倍して四捨五入したLWE暗号文c’=([a’],b’)を得る。
 LWE暗号文c’=([a’],b’)を復号すると、μ1’=φ(c’)≒2n×φ(c)=2nμ1となる。nが大きくなるほど相対的に誤差は小さくなる。
 多項式T(X)を平文とする自明なTRLWE暗号文(0,T(X))を用意して、
=X-b’×(0,T(X))=(0,X-b’×T(X))とする。0は、0次の多項式0を示す。この時、b’は整数であるため、累乗が自然に定義できる。
 以降、上記に説明したBootstrapping KeyであるBKを用いて、順番にA=CMux(BK,Ai-1,Xa’ii-1)を計算する。ここでも、a’iが整数になっているため、Xの累乗が自然に定義できる。
 そうすると、sが0の時は、平文はそのまま変わらず、sが1の時は、Xa’iが順番に乗算されていく。
 従って、
Figure JPOXMLDOC01-appb-I000007
と繰り返すと、
Figure JPOXMLDOC01-appb-I000008
となる。
 ここで、
Figure JPOXMLDOC01-appb-I000009
は、復号関数φs(c’)の符号を反転したものに等しいので、
Figure JPOXMLDOC01-appb-I000010
となる。ここでφs’(A)は、多項式T(X)にX-1をμ1’回乗算した多項式の暗号文である。
 BlindRotateに係るTLWE暗号文cの平文μ1に対応して、多項式T(X)にXをかける回数μ1’(=2nμ1)に応じたユニークな値(n個の係数とその符号反転で最大2n個)が得られるので、一種のルックアップテーブル(Look UP Table)とみなすことが出来る。
(2)SampleExtract
 (1)のBlindRotateで得たTRLWE暗号文Aを復号して得られる平文多項式φs’(A)を見ると、下位の項から数えてn/2-φ(c’)個分の項は係数が-μとなり、負になった場合、逆に上の項から順に係数が-μとなる。
 TRLWE暗号文Aを復号して得られる平文多項式φs’(A)の定数項だけを見ると、φ(c’)がn/2以上3n/2未満、すなわちφ(c)が1/2±1/4の場合、定数項はμとなる。それ以外、すなわちφs(c)が±1/4の場合、定数項は-μとなる。
 SampleExtractは、(1)のBlindRotateで得たTRLWE暗号文Aから、これを復号することなく平文多項式φs’(A)の定数項の係数だけを取り出して、その結果、TLWE暗号文csを得るための処理である。
 TLWE暗号文csを得るための処理を説明する。
 全てのTRLWE暗号文は、次数をnとして、
Figure JPOXMLDOC01-appb-I000011
と多項式をおいて、(A(X),B(X))と表現することができる。
 これを秘密鍵[s’]で復号したとき、秘密鍵の多項式を
Figure JPOXMLDOC01-appb-I000012
とおいて、
Figure JPOXMLDOC01-appb-I000013
と展開することができる。
 これに対して下記の演算を行い、
Figure JPOXMLDOC01-appb-I000014
を得る。
 「多項式環の剰余環」であるので(X+1)で割った余りを求めると、
Figure JPOXMLDOC01-appb-I000015
が得られる。
 さらに、
Figure JPOXMLDOC01-appb-I000016
とおくと、
Figure JPOXMLDOC01-appb-I000017
となり、
Figure JPOXMLDOC01-appb-I000018
から、平文多項式の各項の係数が求まる。
 そのうち必要なのは定数項の係数であるので、j=0の場合の係数を取り出すと、
Figure JPOXMLDOC01-appb-I000019
が得られる。
Figure JPOXMLDOC01-appb-I000020
とおくと、
Figure JPOXMLDOC01-appb-I000021
のように、TLWE暗号の復号関数に変形することができる。
 つまり、(1)のBlindRotateで得たTRLWE暗号文A=(A(X),B(X))から、係数を
Figure JPOXMLDOC01-appb-I000022
として取り出すと、元のTRLWE暗号文Aに対応する平文多項式の定数項と同じ値を平文とする、新しいTLWE暗号文([a”],b)が得られた。この新しいTLWE暗号文がSampleExtractの出力であり、平文として-μ又はμの2種類を有する。
 得られたTLWE暗号文に対して、平文がμとなる自明な暗号文([0],μ)を加えたTLWE暗号文cs=([a”],b1)+([0],μ)を得る。
 具体的には、テストベクタとしての多項式F(X)ではμ=1/8であるので、この段階では、-1/8、1/8の暗号文が得られている。
 これに、平文がμ=1/8となる自明なTLWE暗号文([0],1/8)を加えると、
-1/8+1/8=0
1/8+1/8=1/4
から、0、1/4の2値のうちいずれかの値を平文として持つ新たなTLWE暗号文csが得られた。
(3)キースイッチング
 (2)のSampleExtractで得られたTLWE暗号文csは、秘密鍵[s]ではなく、秘密鍵[s']で暗号化されている
 従って、TLWE暗号文csを復号することなく、TLWE暗号文csの鍵を秘密鍵[s]に差し替え、秘密鍵[s]で暗号化された状態に戻す必要がある。
 そのためキースイッチングの手法を説明する。
 TFHEで用いるTLWE暗号文の秘密鍵[s]はN次のベクトルであった。
 これを用い、Bootstrapping Keyを作成したときのn次のベクトルの秘密鍵[s’]を暗号化する。
 すなわち、
Figure JPOXMLDOC01-appb-I000023
と、円周群{T}の要素、0から1の実数を二進数で表現したときの各桁にずらした値として暗号化する。秘密鍵は[s]である。「桁数」tはシステムパラメータである。
 秘密鍵[s]で復号すると、
Figure JPOXMLDOC01-appb-I000024
となる。これが「キースイッチングキー」である。
 上記したように(2)で得られたTLWE暗号文cs=([a],b)は秘密鍵[s’]で暗号化された0又は1/4の値である。[a]の要素数は、秘密鍵[s’]と同じくn個である。
 これを一つずつ、夫々tビットの固定小数に変換すると、
Figure JPOXMLDOC01-appb-I000025
の形式で書くことができる。
 この段階で誤差が増えるが、システムパラメータで絶対値の最大値を制約することができる。
 キースイッチング本体の処理として、以下のTLWE暗号文cxを計算する。
Figure JPOXMLDOC01-appb-I000026
 ([0],b)の項は自明な暗号文なので、復号するとbであり、TLWE暗号文cxを復号した結果を計算すると、
Figure JPOXMLDOC01-appb-I000027
である。
 s’は、jに対して定数なのでくくりだして
Figure JPOXMLDOC01-appb-I000028
とし、上記で固定小数に分解したときの式を代入する。
Figure JPOXMLDOC01-appb-I000029
 その結果、
Figure JPOXMLDOC01-appb-I000030
となって鍵の切り替えが成功したことになる。
 ここで得られたTLWE暗号文cxは、Gate Bootstrappingの入力としたTLWE暗号文cと同じ秘密鍵[s]で暗号化されている。
 キースイッチングの処理を行うことにより、秘密鍵[s]で暗号化されたTLWE暗号文に戻っており、φ(c)が±1/4の範囲なら平文φ(cx)は0に、φ(c)が1/2±1/4の範囲なら、平文φ(cx)は1/4になっている。
 以上の処理により、Gate Bootstrappingの結果として、0、1/4の2値のうちのいずれかであって誤差が±1/16以内のいずれかになるTLWE暗号文が得られた。
 誤差の最大値は、入力となるTLWE暗号文cに依存せず、システムパラメータによって固定された値となる。
 従って、誤差の最大値が入力となるTLWE暗号文と同じ±1/16以内のいずれかの値となるように、システムパラメータを設定する。
 これにより、何度でもNAND演算ができるようになり、加算、乗算をはじめとしてあらゆる演算が可能となる。
 Gate Bootstrappingから出力されるTLWE暗号の「平文」に乗っている誤差は、TLWE暗号文の整数化で加わる誤差、CMuxで加わる誤差、キースイッチングで固定小数化した時の誤差等である。これらの誤差は全てシステムパラメータで制約でき、全てを考慮した誤差が±1/16となるようにシステムパラメータを調整することができる。
 以上が、TFHEのGate Bootstrappingの処理である。
 上記したように、TFHEは0もしくは非0を平文として持ち、論理演算を行うBit-wise型の準同型暗号である。ただし図4で説明したように平文は円周群{T}に対応づけられた0~1の実数である。従って、円周群{T}を区切った区間を順番に整数と対応付けることにより、整数を平文として持つInteger-wise型の準同型暗号として応用することが出来る。
 TFHEで用いるTLWE暗号文は円周群の平文に対して加法準同型であることが上記論文によって示されており、加算(減算)の演算ができることは自明である。
 以下に説明する方法で、スカラ除算又はスカラ剰余算が可能である。スカラ除算、スカラ剰余算は、Integer-wise型の暗号文を暗号文ではない実数で割ったときの商、剰余を求める演算である。スカラ除算又はスカラ剰余算が可能となることで、TFHEをInteger-wise型での四則演算が可能な準同型暗号として利用することができる。Bit-wise型のTFHEによって1ビットずつ計算するよりも効率的に処理を行うことができる。
 さらにスカラ除算又はスカラ剰余算の結果を用いて、準同型暗号の多倍長演算を実現することができる。
 図5は、Integer-wise型に適用したTFHEを説明する図である。
 図5に示すように、円周群{T}に対応づけた0~1の値域をt個に分割する。TLWE暗号文において、平文が取り得る値は、値域0~1を分割したt個の値-(t/2)から(t/2)-1であり、(t/2)-1が1つのTLWE暗号文に記録できる整数の最大値である。
 図5に例示するように、t=10として0~1の値域を10個に分割する場合に、暗号文は-5、-4、-3、-2、-1、0、1、2、3、4の整数を表現することが出来る。
 この場合、これらの整数値は、円周群{T}の0~1の値域をt=10個に区切った-4/t、-3/t、-2/t、-1/t、-0/t、4/t、3/t、2/t、1/t、0/tの区間に割り当てられている。
 tの値を大きくして円周群{T}を細かく分割するとTLWE暗号文に記録可能な整数値をより大きくできるが、細かく分割しすぎると平文に付加する誤差範囲が小さくなりすぎ、暗号の強度が低下するという問題がある。この点については後に説明する。
 上記したように本実施形態では、準同型暗号に対するスカラ除算・剰余算を実現し、さらに、スカラ除算・スカラ剰余算の結果を用いて準同型暗号の多倍長演算を実現する。多倍長演算は、1つの数を1つ以上の演算単位に分割して計算を行う。多倍長演算によって、暗号の強度を損なうことなく大きな数値を扱うことができるようになる。
 スカラ除算・スカラ剰余算を実現するために、暗号処理装置1は、上記論文で提示されるGate Bootstrappingに改良を行う。
 暗号処理装置1は、BlindRotateに入力するTRLWE暗号文(テストベクタとしての多項式F(X))を、夫々階段関数、ノコギリ波関数の結果を係数とする多項式とする。
 暗号処理装置1は、このようなTRLWE暗号文を除数から算出し、このようなTRLWE暗号文を用いてBlindRotateを行うことで、スカラ除算・スカラ剰余算を実現する。
 多倍長演算の中身や、それを用いて行う暗号などの処理は一般的に知られているものがそのまま使える。
 図2を用いて、本実施形態を詳細に説明する。
[スカラ除算・スカラ剰余算]
 まず、図2(a)に対応して、多倍長演算に用いるスカラ除算、スカラ剰余算の方法を説明する。
 図5で説明したように、暗号処理装置1は円周群{T}の値域0~1を分割する個数tを設定する。(t/2)-1が、1つのTLWE暗号文に記録できる整数の最大値となる。
 暗号処理装置1は、TFHE暗号のシステムパラメータを設定する。手順は上記論文と変わらないが、TRLWE暗号の多項式(テストベクタとしての多項式F(X))の次数nはtの倍数が好ましい。またGate Bootstrapping後に得られる暗号文において、平文に付加される誤差の範囲が±1/(2t)未満となるように、システムパラメータを設定する。
 被除数(割られる数)のTLWE暗号文cxがあるとする。
 TLWE暗号文cxは、秘密鍵がなければ知ることができない、整数x(被除数)に対応する実数
Figure JPOXMLDOC01-appb-I000031

を平文として有する。1/(2t)は、図5の円周群{T}を分割したスライスの中心に平文を位置させるためのオフセットである。
 本実施形態では、TLWE暗号文cxを実数yで除算あるいは剰余算する。
 暗号化された平文の値に対する一変数関数を演算するには、上記論文(非特許文献1)のGate Bootstrappingを拡張した手法を用いることが出来る。この手法は、論文「Bootstrapping in FHEW-like Cryptosystems, Daniele Micciancio and Yuriy Polyakov Duality Technologies February 23,2020」に記載されている。開示されている手法では、テストベクタの係数を一定の定数μにせず関数の結果を設定することで、TLWE暗号文の値によって異なる結果を得る。同論文では、テストベクタ多項式として、
Figure JPOXMLDOC01-appb-I000032

を用いることを提案している。
 暗号処理装置1は、以下のテストベクタ多項T1(X)、T2(X)を用いる。
 テストベクタ多項式T1は、除算用のテストベクタ多項式である。
 テストベクタ多項式T2は、剰余算用のテストベクタ多項式である。
Figure JPOXMLDOC01-appb-I000033

 2つのテストベクタ多項式に共通する
Figure JPOXMLDOC01-appb-I000034

は、円周群をtで分割した1区間に対応する。
 テストベクタ多項式T1(X)は、上記で説明した一変数関数を演算する方法を適用し、割られる数(被除数)の暗号文を平文y(除数)で割った除算を得る関数(t/y)の結果を係数として設定している。
 暗号処理装置1は、TLWE暗号文cx、平文yを夫々Gate Bootstrappingの入力とし、テストベクタ多項式T1を用いてBlindRotateを行い、さらにSampleExtract、キースイッチングを行うことで、除算結果(商)に対応するx/yを平文とするTLWE暗号文を得ることが出来る。
 テストベクタ多項式T2(X)は、上記で説明した一変数関数を演算する方法を適用し、割られる数(被除数)の暗号文を平文y(除数)で割った余り(剰余)を得る関数(t mod y)の結果を係数として設定している。
 暗号処理装置1は、TLWE暗号文cx、平文yを夫々Gate Bootstrappingの入力とし、テストベクタ多項式T2を用いてBlindRotateを行い、さらにSampleExtract、キースイッチングを行うことで、剰余算の結果(剰余)に対応するt mod yを平文とするTLWE暗号文を得ることが出来る。
 まず、暗号処理装置1は、上記テストベクタ多項式T1(X)、T2(X)を夫々平文として有する自明な暗号文(0,T1(X))及び(0,T2(X))を作成する。
 暗号処理装置1(第1演算部12)は、TLWE暗号文cxの各係数を2n倍して四捨五入し、TLWE暗号文cx’を得る。TLWE暗号文cx’は、平文として、
Figure JPOXMLDOC01-appb-I000035

を有する。
 暗号処理装置1(第1Gate Bootstrapping部15)は、TLWE暗号文cx’を入力として、テストベクタ多項式T1(X)を用いたBlindRotateを行う。BlindRotateの結果得られる平文多項式の定数項の係数は
Figure JPOXMLDOC01-appb-I000036

である。εは、BlindRotateによって発生する誤差である。
 また暗号処理装置1(第2Gate Bootstrapping部16)は、TLWE暗号文cx’を入力として、テストベクタ多項式T2(X)を用いたBlindRotateを行う。
 BlindRotateの結果得られる平文多項式の定数項の係数は、
Figure JPOXMLDOC01-appb-I000037

である。ここでεは、BlindRotateによって発生する誤差である。
 暗号処理装置1は、夫々のBlindRotateの結果得られるTRLWE暗号文に対して、通常のGate Bootstrappingと同様に、SampleExtractとキースイッチングを行う。その結果、暗号処理装置1は、除算の演算結果(商)に対応するTLWE暗号文cqと、剰余算の演算結果(剰余)に対応するTLWE暗号文crを得る。
 TLWE暗号文cqは、平文として、テストベクタ多項式T1(X)を用いたBlindRotateの結果得られた平文多項式の定数項の係数に対応する
Figure JPOXMLDOC01-appb-I000038

を有する。
 TLWE暗号文crは、平文として、テストベクタ多項式T2(X)を用いたBlindRotateの結果得られた平文多項式の定数項の係数に対応する
Figure JPOXMLDOC01-appb-I000039

を有する。
 以上説明した処理が、暗号処理装置1が行うことが出来るスカラ除算、スカラ剰余算の処理である。
[多倍長演算]
 暗号処理装置1は、上記に説明したスカラ除算、スカラ剰余算を用いて大きな平文の数(多倍長整数BIG INTEGER)について多倍長演算を行う。
 図2(b)に対応して、暗号処理装置1が行う多倍長演算を説明する。
 暗号処理装置1は、暗号としての強度を十分に維持できる程度に小さいt(図5で説明した円周群の分割数)を、適当な自然数t’を用いてt≧t’とする。
 t’は、2のべき乗であると平文との換算をコンピュータで計算しやすいが他の数でも構わない。
 また暗号処理装置1は、多倍長のフィールド数(多倍長整数を分割するビット単位、区間)として適当な自然数uを定める。uは1つの平文(多倍長整数)を分割するTLWE暗号文の数である。
 u個のフィールド又はフィールドt’、t’、t’、・・・t’u-1毎に多倍長整数を分割する。
 暗号処理装置1は、加法、乗法で共通して、平文Xを、
Figure JPOXMLDOC01-appb-I000040

の形でu個のXに分割する。
 暗号処理装置1は、Xを夫々暗号化し、u個のTLWE暗号文ca(0≦i≦u-1)を作成する。
 暗号文caが多倍長整数を分割したフィールドt’の暗号文であり、暗号文caが多倍長整数を分割したフィールドt’の暗号文であり、暗号文caが多倍長整数を分割したフィールドt’の暗号文であり、暗号文cau-1が多倍長整数を分割したフィールドt’u-1の暗号文である。
 なお、caを復号して得たXを上記の式で計算すれば、元の平文Xを得ることが出来る。
 暗号処理装置1は、もう1つの平文Yを、平文Xと同様に、
Figure JPOXMLDOC01-appb-I000041

の形でu個のYiに分割する。暗号処理装置1は、Yiを夫々暗号化し、u個のTLWE暗号文cb(0≦i≦u-1)を作成する。
 上記と同様に、暗号文cbが多倍長整数を分割したフィールドt’の暗号文であり、暗号文cbが多倍長整数を分割したフィールドt’の暗号文であり、暗号文cbが多倍長整数を分割したフィールドt’の暗号文であり、暗号文cbu-1が多倍長整数を分割したフィールドt’u-1の暗号文である。
 多倍長整数X、Yを分割して暗号化することで、TLWE暗号文ca、TLWE暗号文cbがとる平文の値を小さくし、円周群の分割数を小さくすることが出来る。これにより、暗号処理装置1は、暗号文のセキュリティを保ったまま多倍長の四則演算を行うことが出来る。
 以下に説明するのは、多倍長整数X、Yの和の演算(X+Y)に対応する暗号文同士の多倍長演算(加算)である。
 暗号処理装置1は、平文X+平文Yに対応する暗号文同士の多倍長演算は、以下の手順で実行する。
 初期化として、i=0とする。
(1)cdi-1を、0を平文とするTLWE暗号文とする。
(2)caとcbとcdi-1を暗号化したまま加算(準同型加算)して、ccを得る(第2演算部13)。図2(a)でいえば、暗号文ccが暗号文cxに相当する。
(3)ccを、スカラ除算・スカラ剰余算によりt’で割った商の暗号文cd及び剰余の暗号文cmを得る(スカラ除算部、スカラ剰余算部)。図2(a)でいえば、暗号文cdが暗号文cq、暗号文cmが暗号文crに夫々相当する。
 t’における準同型加算に対してスカラ除算して得られた商の暗号文cdは、t’の演算によるt’i+1に対する繰り上がりである。t’i+1のためのcai+1とcbi+1の準同型演算において暗号文cdも加算されている。
 暗号処理装置1は、iを1増やし、(1)~(3)の処理をu回繰り返す。u回繰り返したあとのcmの列が、平文X+平文Yに対応する多倍長暗号文cmとなる。
 これをふまえ、平文Xと平文Yの暗号文同士の加算を具体的に説明する。
 平文Xをフィールドt’毎にu個のXに分割して暗号化しu個のTLWE暗号文caを作成すること、平文Yをフィールドt’毎にu個のYiに分割して暗号化しu個のTLWE暗号文cbを作成することは上記と同じである。
 説明の簡単化のため、平文Xを分割したフィールドt’の暗号文をa、フィールドt’の暗号文をbとし、平文Yを分割したフィールドt’の暗号文をc、フィールドt’の暗号文をdとする。
 暗号処理装置1は、平文Xと平文Yのフィールドt’の暗号文同士でb+dの演算を行う。
 暗号処理装置1は、まず、b+dの演算結果に対してスカラ除算部によるスカラ除算とスカラ剰余算部によるスカラ剰余算を行う。
 スカラ剰余算の結果得られる剰余は、加算結果である暗号文の、区間(あるいはケタ)t’の値である。
 一方、スカラ除算の結果得られる商はt’に繰り上げられる。
 暗号処理装置1は、a+c+繰り上げの演算結果に対してスカラ除算とスカラ剰余算を行う。
 スカラ剰余算の結果得られる剰余は、加算結果である暗号文の区間(あるいはケタ)t’の値である。
 一方、スカラ除算の結果得られる商はt’に繰り上げられる。
 t’がより多い場合には、さらにフィールドt’の暗号文の和に繰り上げを加算した結果に対してスカラ除算とスカラ剰余算を行うことを繰り返していく。
 繰り上げを含めて、t’、t’・・・に夫々該当する値を全て加算することにより各区間の値を得ることができ、暗号処理装置1は多倍長演算を行うことが出来る。
 平文X-Yに対応する暗号文同士の多倍長演算も、(2)の準同型加算に代えて準同型減算(ca-cb-cdi-1)を行うことで計算できる。
 この場合、t’における準同型減算に対してスカラ除算して得られた商の暗号文cdは、t’の演算によるt’i+1からの繰り下がりである。t’i+1のためのcai+1とcbi+1の準同型演算において暗号文cdも減算されている。
 平文X×平文Yに対応する暗号文同士の多倍長演算も、一般的な多倍長乗算と同様に、ひっ算や、カラツバ法、FFTを用いた方法などで計算できる。平文X÷平文Yに対応する暗号文同士の多倍長演算も公知のアルゴリズムが利用できる。
 平文X+平文Yの最大公約数GCD(X,Y)もユークリッドの互除法など、公知のアルゴリズムが利用できる。
 適当な素数pに対するaの逆元も、拡張ユークリッドの互除法や、フェルマーの小定理など、公知のアルゴリズムで計算できる。
 以上説明をしたように、準同型暗号の多倍長整数は通常の整数と同様の扱いが可能である。またTLWE暗号文の個数uを増やすことで、一つのTLWE暗号文が有する平文の数値を小さくして円周群の分割数tを小さくしつつ、演算全体としては扱える平文の数値を小さくせずともよい。従って、本実施形態は、暗号の強度を犠牲することもなく大きな数を扱うことが出来る。
 図6は、暗号文同士の多倍長乗算をひっ算で実現する仕組みを説明する図である。
 上記と同様に、平文Xを分割したフィールドt’の暗号文をa、フィールドt’の暗号文をbとし、平文Yを分割したフィールドt’の暗号文をc、フィールドt’の暗号文をdとして説明する。
 暗号処理装置1は、平文Xと平文Yのフィールドt’の暗号文同士でd×bの演算を行う。
 暗号処理装置1は、まず、d×bの演算結果に対してスカラ除算部によるスカラ除算とスカラ剰余算部によるスカラ剰余算を行う。
 スカラ剰余算の結果得られる剰余は、乗算結果である暗号文のフィールドt’の値である。
 スカラ除算の結果得られる商はt’に繰り上げられる。
 暗号処理装置1は、d×aの演算結果に対してスカラ除算とスカラ剰余算を行う。
 スカラ剰余算の結果得られる剰余は、乗算結果である暗号文のフィールドt’の値である。
 スカラ除算の結果得られる商は、t’に繰り上げられる。
 暗号処理装置1は、c×bの演算結果に対してスカラ除算とスカラ剰余算を行う。
 スカラ剰余算の結果得られる剰余は、乗算結果である暗号文のフィールドt’の値である。
 スカラ除算の結果得られる商は、t’に繰り上げられる。
 暗号処理装置1は、c×aの演算結果に対してスカラ除算とスカラ剰余算を行う。
 スカラ剰余算の結果得られる剰余は、乗算結果である暗号文のフィールドt’の値である。
 スカラ除算の結果得られる商は、t’に繰り上げられる。
 繰り上げを含めて、t’、t’1、t’2、t’・・・に該当する値を全て加算することにより各区間の値を得ることができ、暗号処理装置1は多倍長演算(乗算)を行うことが出来る。
 ところで、Integer-wise型のTFHEを開示している非特許文献2は、本実施形態で用いているスカラ除算を行うためのテストベクタと同様のテストベクタを記載している。
 しかしながら、非特許文献2には、スカラ剰余算を行うためのテストベクタは開示されていないため、非特許文献2に開示の方法で、上記に説明したスカラ剰余算を用いた多倍長演算を行うことは出来ない。
 非特許文献2では4ビット整数で実験を行っているが、非特許文献2に開示されている構成を用いてスカラ剰余算を用いずに大きな数(128ビットなど)の演算をするには、円周群の分割数を増やすほかない。
 非特許文献2では、円周群の分割数を大きくして一つの暗号文で表現し、これらの暗号文同士で演算を行うことになる。
 しかしながら、下記にも説明しているが、円周群の分割数を増やすと平文に付加する許容誤差が小さくなり、暗号文のセキュリティが犠牲になる。TFHEで用いるTLWE暗号文を含むLWE系暗号は、平文に付加する誤差によって安全性が担保されるからである。
 それに対して、暗号処理装置1は、加法(加算、減算)と、乗算の多倍長演算を、夫々剰余演算を用いた一桁ずつの足し算と引き算と、一桁ずつの掛け算と、にすることが出来る。すなわち、本実施形態の暗号処理装置1は、多倍長整数を分割して暗号化した暗号文に対し、剰余演算を利用して多倍長演算を行う。
 従って、暗号処理装置1は、円周群の分割数を増やさずに暗号文のセキュリティ強度を維持しながら、TFHEで大きな数の演算を行うことが出来る。
 本実施形態のように剰余演算を用いて、円周群の分割数を増やさずにセキュリティ強度を維持した多倍長演算を構成することは、非特許文献2には記載されていない。
 図7は、暗号処理装置が実行するスカラ除算処理の流れを示すフローチャートである。
 暗号処理装置1(第1演算部12)は、ステップS101において、割られる数xの暗号文cxの各係数を2n倍して、暗号文cx’を得る。
 暗号処理装置1(第1Bootstrapping部15)は、暗号文cx’を入力とするGate Bootstrappingを行うことによって除算を行う。
 暗号処理装置1は、ステップS102において、暗号文cx’とテストベクタ多項式T1(X)を用いてBlindRotateを行う。
 暗号処理装置1は、ステップS103において、SampleExtractを行う。
 暗号処理装置1は、ステップS104において、キースイッチングを行い、得られた暗号文を除算結果として出力する。
 図8は、暗号処理装置が実行するスカラ剰余算処理の流れを示すフローチャートである。
 暗号処理装置1(第1演算部12)は、ステップS111において、割られる数xの暗号文cxの各係数を2n倍して、暗号文cx’を得る。
 暗号処理装置1(第2Bootstrapping部16)は、暗号文cx’を入力とするGate Bootstrappingを行うことによって剰余算を行う。
 暗号処理装置1は、ステップS112において、暗号文cx’とテストベクタ多項式T(X)を用いてBlindRotateを行う。
 暗号処理装置1は、ステップS113において、SampleExtractを行う。
 暗号処理装置1は、ステップS114において、キースイッチングを行い、得られた暗号文を剰余算結果として出力する。
 図9は、暗号処理装置が実行する多倍長演算処理の流れを示すフローチャートである。
 暗号処理装置1(第2演算部13)は、ステップS201において、初期化として、変数iに0を代入する。
 暗号処理装置1(第2演算部13)は、ステップS202において、caとcbとcdi-1を準同型加算して、ccを得る。
 暗号処理装置1(第1演算部12、第1Bootstrapping部15)は、ステップS203において、図7で説明した方法を用いてccを入力としたスカラ除算を行い、暗号文cdiを得る。
 暗号処理装置1(第1演算部12、第2Bootstrapping部16)は、ステップS204において、図8で説明した方法を用いてccを入力としたスカラ剰余算を行い、暗号文cmiを得る。
 暗号処理装置1は、ステップS205において、iがuに達したか否かを判定する。
 iがuに達していないと判定した場合(ステップS205でNo)、暗号処理装置1は、ステップS206において、iの値を1増やし、ステップS202~ステップS204の処理を繰り返す。
 iがuに達したと判定した場合(ステップS205でYes)、暗号処理装置1は、このときまで得られたcmの列を多倍長演算結果として出力する。以上の処理によって、Integer-wise型のTLWE暗号文同士の多倍長演算(加算)を実行することが出来た。
[暗号文同士の準同型乗算について]
 下記に説明するように、暗号処理装置1は(1)整数と二進数の暗号文の準同型乗算、(2)暗号文と定数との準同型一致テストを用いて、整数の暗号文同士の準同型乗算を行う。
 (1)整数と二進数の暗号文の準同型乗算、(2)暗号文と定数との準同型一致テストを説明する。
(1)バイナリ乗算部による整数の暗号文cyと二進数の暗号文czとの乗算は、例えば以下のように行うことが出来る。
 図5に示したように本実施形態では、円周群{T}に対応づけた0~1の値域をt個に分割しており、暗号文cyは0~(t/2)-1の暗号文である。
 暗号文czは、平文が0のときに二進数のシンボル1となり、平文が1/2のときに二進数のシンボル0となる。
 下記では、平文として整数0又は整数t/2を有する暗号文に暗号文czを対応付けて説明する。tは偶数である。
 暗号文czの平文0を整数0に対応づけ、暗号文czの平文1/2を下記の整数t/2に対応づける。
 平文が整数0のときシンボル1であり、平文が整数t/2のときシンボル0である暗号文czとして暗号文czを説明する。
 整数の暗号文cyと二進数の暗号文czの乗算を行うために、Gate Bootstrappingの要素として、2つの一変数関数FidとFhalfを用いる。
 暗号化された整数値に対する一変数関数を演算するには、上記論文(非特許文献1)のGate Bootstrappingを拡張した手法を用いることが出来る。この手法は、論文「Bootstrapping in FHEW-like Cryptosystems, Daniele Micziancio and Yuriy Polyakov Duality Technologies February 23,2020」に記載されている。開示されている手法では、テストベクタの係数を一定の定数μにせず関数の結果を設定することで、TLWE暗号文の値によって異なる結果を得る。
 一変数関数Fidは、整数0~(t/2)-1の暗号文cyの入力に対して、同じ整数0~(t/2)-1の暗号文を出力する。
 BlindRotateと同時に一変数関数fidを実行するためのテストベクタTid(X)は、0次からn-1次の各次数の係数として、
Figure JPOXMLDOC01-appb-I000042
を設定する。
 一変数関数fhalfは、整数0~(t/2)-1の暗号文cyの入力に対して、平文整数の値が偶数であれば、cy/2を算出し、それ以外では-(cy+1)/2-((t/2)-1)/2を算出する関数である。
 BlindRotateと同時に一変数関数fhalfを実行するためのテストベクタThalf(X)は、0次からn-1次の各次数の係数として、
Figure JPOXMLDOC01-appb-I000043
を設定する。
 まず暗号処理装置1は、二値の暗号文であるTLWE暗号文czと、整数の暗号文であるTLWE暗号文cyと、の準同型演算を行う。
 暗号処理装置1は、準同型演算の結果を入力として、上記テストベクタ多項式Tid(X)を用いてGate Bootstrappingを行い、一時暗号文ctmpを得る。
 TLWE暗号文czがt/2(暗号文czの平文0に対応、シンボル0)の暗号文である場合、cz+cyの結果はy/t+1/2の暗号文であり、TLWE暗号文cyの平文は、原点に対して対称な位置に回転する。テストベクタ多項式Tid(X)を用いたGate Bootstrappingのあとの暗号文ctmpの平文は、左右対称の位置に移動する。暗号文ctmpは暗号文cyの符号を反転させた暗号文である。
 TLWE暗号文czが0(暗号文czの平文1/tに対応、シンボル1)の暗号文である場合、cz+cyの結果はy/tの暗号文であり、Bootstrappingのあとの暗号文ctmpは暗号文cyの平文と同じ平文のままである。
 そこで暗号処理装置1は暗号文cy+暗号文ctmpの準同型演算を行う。
 TLWE暗号文czが0(シンボル1)の暗号文である場合、暗号文cy+暗号文ctmpの準同型演算結果は、暗号文cy+暗号文cyである。
 TLWE暗号文czがt/2(シンボル0)の暗号文である場合、暗号文cy+暗号文ctmpの準同型演算結果は、平文が0となる暗号文cである。
 暗号処理装置1は、準同型加算の結果を入力として、上記テストベクタ多項式Thalf(X)を用いてGate Bootstrappingを行う。Gate Bootstrappingの結果、暗号文cy+暗号文cyは暗号文cyに変換され、暗号文cは暗号文cのままである。
 整数の暗号文cyに乗算するTLWE暗号文czが0の暗号文である場合に、Gate Bootstrappingにおいて暗号文cyが得られ、TLWE暗号文czがt/2の暗号文である場合に暗号文cが得られる。
 以上のようにすることで、暗号処理装置1は、整数の暗号文cyと二進数の暗号文czとの乗算を行うことが出来る。
 なお、上記したように暗号文czで利用する円周群上の値が異なるため、Gate Bootstrappingで得られた値を2t倍することにより調整を行う必要がある。ここで2tは整数であるため、円周群上で乗算が定義されている。
(2)暗号文と定数との準同型一致テスト
 整数の暗号文と平文整数との一致テストを説明する。
 例として、整数の暗号文cm1と平文整数m2の場合を説明する。
 暗号文cm1は、平文m1として、0,1,~(t/2)-1の整数を有する。
 平文整数m2は、0,1,~(t/2)-1の整数である。
 まず暗号処理装置1は、平文m2を暗号化してvm2を得る。
 暗号処理装置1は、暗号文cm1-(0,vm2)を準同型演算し、演算結果を入力として、
Figure JPOXMLDOC01-appb-I000044
を係数とするテストベクタ多項式を用いたGate Bootstrappingを行う。(0,vm2)は、vm2を平文とする自明な暗号文である。
 Gate Bootstrappingの結果得られる新たな暗号文cfは、暗号文と定数との一致不一致を示す2値(二進数)の暗号文であり、cm1=(0,vm2)の場合は平文としてt/2を有し、cm1≠(0,vm2)の場合、平文として0を有する。
 以上に説明した、(1)整数と二進数の暗号文の準同型乗算、(2)暗号文と定数との準同型一致テストに基づいて、整数の暗号文同士の準同型乗算を行う方法を説明する。
 整数同士の乗算は、乗数に応じた回数だけ被乗数を足し合わせることにより行うことが出来るが、暗号化された整数同士の乗算を暗号文のまま準同型で行うためには、暗号処理装置1は、以下に説明する処理を行う。
 乗算結果を示す暗号文を、暗号文csumとする。
 暗号処理装置1は、初期値として暗号文csumに0を代入し、また繰り返し数を示す変数iの初期値として0を代入する。
 暗号処理装置1は、被乗数を入力として、上記論文の多項式F(X)をテストベクタとしたGate Bootstrappingを行い、暗号文ceを得る。
 暗号処理装置1は、上記した暗号文と定数との準同型一致テストの方法を用いて、乗数と変数iの値が一致するかをテストする。
 上記に従えば、乗数と変数iが一致するときに、平文としてt/2を有し、乗数と変数iが一致しないときには平文として0を有する暗号文cfが得られる。
 暗号処理装置1は、上記した整数と二進数の暗号文の準同型乗算の方法を用いて、整数の暗号文ce(cyに対応)に、二進数の暗号文cf(czに対応)を乗算する。
 乗数と変数iが一致するときには、被乗数にt/2を乗算し、乗数と変数iが一致しないときには、被乗数に0を乗算する。
 暗号処理装置1は、この演算結果を乗算結果の暗号文csumに加算した結果を入力として、上記一変数関数Fidを実行するテストベクタ多項式を用いたGate Bootstrappingを行う。
 これを、変数iをインクリメントしながらt/2回(暗号文が平文としてとりうる0以上の整数の個数)処理を繰り返した結果が、整数の暗号文同士を乗算した結果である。
 上記の説明において、例えば被乗数を暗号文b、乗数を暗号文dとすることで、実施例で説明したd×bを算出することが出来る。
 図10は、本実施形態のGate Bootstrappingに入出力される暗号文を示す図である。
 上記の説明では、図10(a)に示すように、BlindRotate、SampleExtract、キースイッチングの順番でGate Bootstrappingを行うように説明をしていた。
 それに限らず、図10(b)に示すように、Gate Bootstrappingにおいてキースイッチングを最初に実行し、その後で、BlindRotateとSampleExtractを行うことが出来る。
 TLWE暗号文にはセキュリティ強度に応じたレベルの概念がある。
 図10(a)のGate Bootstrappingでは入出力となるTLWE暗号文はLEVEL0である。LEVEL0のTLWE暗号文に対してBlindRotateを行い、その出力のTRLWE暗号文に対するSampleExtractによって得られるTLWE暗号文はLEVEL1となるが、キースイッチングの結果、LEVEL0のTLWE暗号文が出力される。
 それに対して図10(b)に示す方法では、Gate Bootstrappingの入出力となるTLWE暗号文をLEVEL1とし、最初にキースイッチングを行ってLEVEL0に下げた状態でBlindRotateを行い、その出力のTRLWE暗号文に対するSampleExtractを行うとLEVEL1のTLWE暗号文が出力される。
 LEVEL0の暗号文は、N次の秘密鍵[s]で暗号化された円周群{T}上の要素のN次のベクトル[a]よりなっている。一方、SampleExtractの結果得られるLEVEL1の暗号文は、n次の秘密鍵[s’]で暗号化された円周群{T}上の要素のn次のベクトル[a']よりなっている。
 LEVEL0の暗号文は、LWE問題の難易度となる係数の数(ベクトルの次数)がLEVEL1の暗号文よりも少ないので、LEVEL1と比較して準同型加算の計算量が少ない。
 一方でLEVEL0の暗号文は、平文に付加する許容誤差を小さくすると、セキュリティ強度が下がりやすい問題がある。LWE系暗号は、平文に付加する誤差によって安全性が担保されるからである。
 TLWE暗号は、平文に付加する誤差が大きいほど、係数の数(ベクトルの次数)が多いほど計算(解読)が難しい。
 裏を返すと、TLWE暗号は、平文に付加する誤差が小さいほど、係数の数(ベクトルの次数)が少ないほど、計算(解読)が容易となるのである。
 特に、Integer-wise型に適用したTFHEの場合、TLWE暗号文に格納する平文(整数)の値が大きくなるほど、円周群{T}における0~1の値域を細かく分割する必要があり、後述する復号時エラーの問題もあって誤差を小さくする必要がある。その場合、セキュリティ強度が下がりやすいのは上記の通りであるため、誤差を小さくする場合には暗号文の係数の数(ベクトルの次数)を上げてセキュリティを確保する必要がある。
 平文に付加する誤差を小さくすることで計算(解読)が容易となった暗号文のセキュリティを確保するために、キースイッチングをGate Bootstrappingの先頭に移動し、係数の数(ベクトルの次数)が多く誤差の範囲を小さくしやすいLEVEL1の暗号文をGate Bootstrappingの入出力とすることが望ましい。そして、Gate Bootstrappingの先頭でLEVEL0に変換してから、最後にLEVEL0に戻さないようにする。LEVEL0に戻さないことで、次段でも同様にTLWE暗号文の計算を安全に行うことが出来る。
 BlindRotateの所要時間は、CMuxの回数が次数と同じ回数であるため、入力となるTLWE暗号文の係数の数(ベクトルの次数)に比例する。よって、LEVEL1の暗号文を入力とした場合は、LEVEL0の暗号文を入力とした場合よりも、係数の数(ベクトルの次数)に比例してBlindRotateの所要時間が長くなる。
 暗号文のセキュリティを確保するためにLEVEL1の暗号文をGate Bootstrappingの入力としても、キースイッチングで変換したLEVEL0のTLWE暗号文を入力としてBlindRotateを行うことで、所要時間の増加を避けることが出来る。
 また、平文に付加する誤差を小さくすることには、上記のセキュリティ強度の以外に復号時エラーの問題もある。
 上記したように、Integer-wise型に適用したTFHEでは、円周群{T}に対応づけた0~1の値域をt個に分割する。tの値を大きくして円周群を細かく分割するとTLWE暗号文に記録可能な整数値をより大きくできる。円周群を分割した個数tで格納できる値の最大値が決まるが、大きな値を格納しようとすると誤差範囲をより小さくとる必要があるため、セキュリティ強度が低下したり、復号エラー率が上がったりする問題もある。
 TFHE含めLWE系の準同型暗号では平文に付加する誤差は正規分布で分布しており、厳密に「誤差の範囲」を設定することはできない。
 0付近に集中することに変わりはないが、原理的には、誤差を指定範囲により多く集中させることが出来るのみである。
 設定した範囲から誤差がはみ出した場合、その平文は別の平文として解釈されるため、予期せぬ計算結果が得られる可能性がある。
 計算自体ができなくなるのではなく異なる結果が得られるのみである。異なる計算結果が得られる確率をどの程度許容できるかは、準同型暗号を応用するアプリケーション次第である。
 計算にエラーが発生する確率を抑える、BlindRotateの数を減らして計算を高速化する、セキュリティを高く保つ、という3つの目標をバランスが最もとれるよう、誤差範囲の重なりが一定値内に収まるようにシステムパラメータを設定することが必要である。
 本実施形態を適用するシステムや装置に応じて、特に重視する条件を満たすように誤差を設定してもよい。
[応用例]
 暗号処理装置1が行う処理は、以下のように応用することが出来る。
 例えば、フィールドやレコードがTLWE暗号で暗号化されているデータベースから、特定のフィールドが一定の範囲内のものを集約したい場合(例えば、30~39歳の平均年収を求めたい場合など)を考える。
 このとき、暗号処理装置1は暗号化されたデータベースを管理するデータベースサーバであり、ネットワーク等を介して接続された端末装置から、TLWE暗号で暗号化されたクエリを受け付け、クエリに対する応答を、TLWE暗号で暗号化した状態で端末装置に返却する。
 暗号化されたデータベースではインデックスを作成することができないため、データベース全体に対する比較と集約が必要である。
 暗号処理装置1は、第1演算部12、第2演算部13、第1Bootstrapping部14、第1Bootstrapping部15の機能によって、暗号化されたデータベースの全てのレコードをクエリと比較する比較演算を行う。
 比較演算は、レコードとクエリの暗号文同士で減算を行うことであり、減算結果の正負が比較演算の等価となる。
 暗号処理装置1はさらに、比較演算でクエリと一致したレコードに対する集約演算を行うことが出来る。
 集約演算において、暗号処理装置1は、比較演算でクエリと一致したレコードを加算して合計を演算し、さらに除算を用いて平均値を求める。
 このように、暗号化されたデータベースに対するクエリの処理には、暗号文を構成する整数同士の加算、減算、乗算、除算などの四則演算、や比較(比較は減算結果の正負と等価である)を行う必要がある。そして、Bit-wise型の暗号文を用いる場合、処理には全加算器演算が多用されることが考えられる。そして、扱う整数のビット長が大きくなれば必要となる全加算器の数も増加する。四則演算とは、入力された暗号文を用いた順列を二進数で表記した際の各ビットの暗号文とみなした暗号化された数値同士に対して準同型な四則演算である。
 本実施形態の暗号処理装置1は、Bit-wise型の暗号文に対して全加算器を用いてビット単位で四則演算を行うのではなく、整数を平文として有するInteger-wise型の暗号文同士で四則演算や比較を行うことにより、クエリの実行時間を著しく低減することが可能となる。
 このようなデータベースの集約に限らず、整数同士の四則演算や比較は、暗号文を用いた様々なデータ処理で多用される。
 他の例として、ファジー認証やファジー検索が挙げられる。
 ファジー認証は、例えば生体認証データを使った生体認証であり、生涯不変の生体認証データは暗号化して秘匿するのが絶対条件である。
 ファジー認証は、認証要求として提示された生体認証データとデータベースに登録された生体認証データとの対応に基づいて認証をするものであるが、両者の完全な一致ではなく、閾値付きで一致するか否かを判定する。
 ファジー検索は、クエリとレコードが完全に一致しなくても、クエリに近しいデータをデータベースから検索結果として提示する、曖昧な検索方法である。
 ファジー認証やファジー検索では、上記の暗号化されたデータベースにおける比較演算・集約演算と同様に、暗号化されたデータベースとクエリとの比較を行い、その際には、準同型暗号により暗号化されたデータで比較演算を行う必要がある。
 またファジー認証やファジー検索において比較を行う際、ユークリッド距離が用いられることが多い。ユークリッド距離を演算する際には2乗の演算が必要となる。従って、Bit-wise型の準同型暗号では、乗算を行う際にデータのビット長に対して、O(N)の全加算器を演算しなければならない。また単純な減算による比較演算でも、O(N)の全加算器を演算する必要がある。本実施形態の暗号処理装置1は、Bit-wise型の暗号文に対して全加算器を用いてビット単位で四則演算を行うのではなく、整数を平文として有するInteger-wise型の暗号文同士で四則演算や比較を行うことにより、ファジー認証やファジー検索に要する処理時間を大幅に低減することが出来る。
 また、本実施形態によっては、TFHEで暗号化されたデータに対して、属性ベース暗号などの高機能暗号を実装することができる。属性ベース暗号は、暗号化されたデータについての、ユーザやユーザが属するグループに対するアクセスコントロールなど、高度な付加価値を有する。
 しかしながら、高機能暗号は楕円曲線やペアリング写像など、比較的計算量の多いものが多く、マイコンのような非力な環境では採用が難しい。
 それに対して、上記に説明した多倍長演算によって、TFHEにおいて暗号強度を落とすことなく大きな値が扱えるようになることで、高機能暗号の秘密鍵などをTFHEで暗号化することが出来る。
 それにより、高機能暗号の処理をより高機能、高性能な外部サーバやクラウドサービスに委譲することが出来るため、高機能暗号をより実用的なものとすることが出来る。また、TFHEで暗号化されたデータの中身を暗号化・復号することで、二重暗号化の内側を処理することが出来る。
 図11は、コンピュータ装置の一実施例を示すブロック図である。
 図11を参照して、コンピュータ装置100の構成について説明する。
 コンピュータ装置100は、例えば、各種情報を処理する暗号処理装置である。そして、コンピュータ装置100は、制御回路101と、記憶装置102と、読書装置103と、記録媒体104と、通信インターフェイス105と、入出力インターフェイス106と、入力装置107と、表示装置108とを含む。また、通信インターフェイス105は、ネットワーク200と接続される。そして、各構成要素は、バス110により接続される。
 暗号処理装置1は、コンピュータ装置100に記載の構成要素の一部又は全てを適宜選択して構成することができる。
 制御回路101は、コンピュータ装置100全体の制御をする。制御回路101は、例えば、Central Processing Unit(CPU)、Field Programmable Gate Array(FPGA)、Application Specific Integrated Circuit(ASIC)及びProgrammable Logic Device(PLD)などのプロセッサである。制御回路101は、例えば、図1における制御部10として機能する。
 記憶装置102は、各種データを記憶する。そして、記憶装置102は、例えば、Read Only Memory(ROM)及びRandom Access Memory(RAM)などのメモリや、Hard Disk(HD)、Solid State Drive(SSD)などである。記憶装置102は、制御回路101を、図1における制御部10として機能させる情報処理プログラムを記憶してもよい。記憶装置102は、例えば、図1における記憶部20として機能する。
 暗号処理装置1は、情報処理を行うとき、記憶装置102に記憶されたプログラムをRAMに読み出す。
 暗号処理装置1は、RAMに読み出されたプログラムを制御回路101で実行することにより、受付処理、第1演算処理、第2演算処理、第1Bootstrapping処理、第2Bootstrapping処理、出力処理のいずれか1以上を含む処理を実行する。
 なお、プログラムは、制御回路101が通信インターフェイス105を介してアクセス可能であれば、ネットワーク200上のサーバが有する記憶装置に記憶されていても良い。
 読書装置103は、制御回路101に制御され、着脱可能な記録媒体104のデータのリード/ライトを行なう。
 記録媒体104は、各種データを保存する。記録媒体104は、例えば、情報処理プログラムを記憶する。記録媒体104は、例えば、Secure Digital(SD)メモリーカード、Floppy Disk(FD)、Compact Disc(CD)、Digital Versatile Disk(DVD)、Blu-ray(登録商標) Disk(BD)、及びフラッシュメモリなどの不揮発性メモリ(非一時的記録媒体)である。
 通信インターフェイス105は、ネットワーク200を介してコンピュータ装置100と他の装置とを通信可能に接続する。通信インターフェイス105は、例えば、図1において、通信部25として機能する。
 入出力インターフェイス106は、例えば、各種入力装置と着脱可能に接続するインターフェイスである。入出力インターフェイス106と接続される入力装置107には、例えば、キーボード、及びマウスなどがある。入出力インターフェイス106は、接続された各種入力装置とコンピュータ装置100とを通信可能に接続する。そして、入出力インターフェイス106は、接続された各種入力装置から入力された信号を、バス110を介して制御回路101に出力する。また、入出力インターフェイス106は、制御回路101から出力された信号を、バス110を介して入出力装置に出力する。入出力インターフェイス106は、例えば、図1において、入力部26として機能する。
 表示装置108は、各種情報を表示する。表示装置108は、例えば、例えばCRT(Cathode Ray Tube)、LCD(Liquid Crystal Display)、PDP(Plasma Display Panel)、およびOELD(Organic Electroluminescence Display)などである。ネットワーク200は、例えば、LAN、無線通信、P2Pネットワーク、又はインターネットなどであり、コンピュータ装置100と他の装置を通信接続する。
 なお、本実施形態は、以上に述べた実施形態に限定されるものではなく、本実施形態の要旨を逸脱しない範囲内で種々の構成又は実施形態を取ることができる。
1 暗号処理装置、10 制御部、11 受付部、12 第1演算部、13 第2演算部、15 第1Bootstrapping部(算出部)、16 第2Bootstrapping部(算出部)、18 出力部、20 記憶部、25 通信部、26 入力部、100 コンピュータ装置、101 制御回路、102 記憶装置、103 読書装置、104 記録媒体、105 通信インターフェイス、106 入出力インターフェイス、107 入力装置、108 表示装置、110 バス、200 ネットワーク

Claims (11)

  1.  暗号文を処理する暗号処理装置であって、
     前記暗号文は、所定の値に所定の分散を持つ誤差を与えた値を、整数に対応付けた平文として有し、復号することなく整数同士の所定の演算が可能な完全準同型暗号文であり、
     割られる数の暗号文に対して、割る数の平文から得られる第1の多項式に基づいてスカラ剰余算を行い、剰余に対応する新たな暗号文を算出する算出部を備える、
    ことを特徴とする暗号処理装置。
  2.  請求項1に記載の暗号処理装置において、
     前記算出部は、割られる数の暗号文に対して、割る数の平文から得られる第2の多項式に基づいてスカラ除算を行い、商に対応する新たな暗号文を算出することを特徴とする暗号処理装置。
  3.  請求項2に記載の暗号処理装置において、
     所定の演算として、第1の整数に対応する第1の暗号文及び第2の整数に対応する第2の暗号文の多倍長演算を実行し、
     前記第1の暗号文は、前記第1の整数を区間毎に所定数に分割した結果を夫々暗号化した暗号文を有し、
     前記第2の暗号文は、前記第2の整数を区間毎に前記所定数に分割した結果を夫々暗号化した暗号文を有し、
     前記第1の暗号文と前記第2の暗号文との対応する暗号文同士を準同型演算することにより前記多倍長演算を実行する、
    ことを特徴とする暗号処理装置。
  4.  請求項3に記載の暗号処理装置において、
     前記算出部は、
     前記第1の暗号文と前記第2の暗号文との同一区間の暗号文同士と、第3の暗号文と、の準同型演算を行って第4の暗号文を算出し、
     前記第4の暗号文に対して前記スカラ除算を行って新たな前記第3の暗号文を算出し、
     前記第4の暗号文に対して前記スカラ剰余算を行って第5の暗号文を算出し、
     前記準同型演算を所定回数繰り返したときの前記第4の暗号文の列を多倍長演算結果に対応する暗号文として出力する、
    ことを特徴とする暗号処理装置。
  5.  請求項3又は4に記載の暗号処理装置において、
     前記算出部は、入力される暗号文に対して前記所定の多項式を用いて新たな暗号文を算出するまえに、暗号文の係数の数を削減する処理を行う、
    ことを特徴とする暗号処理装置。
  6.  請求項3乃至5の何れか一項に記載の暗号処理装置において、
     前記所定の演算を行うことにより、入力された前記暗号文を用いたファジー認証又はファジー検索に係る処理を行う、
    ことを特徴とする暗号処理装置。
  7.  請求項3乃至5の何れか一項に記載の暗号処理装置において、
     前記所定の演算を行うことにより、入力された前記暗号文に基づく暗号化データベースに対するクエリを処理する、
    ことを特徴とする暗号処理装置。
  8.  請求項3乃至5の何れか一項に記載の暗号処理装置において、
     前記所定の演算を行うことにより、入力された前記暗号文を暗号化したまま拡張ユークリッドの互除法で逆元を求める、
    ことを特徴とする暗号処理装置。
  9.  請求項3乃至5の何れか一項に記載の暗号処理装置において、
     前記所定の演算を行うことにより、入力された前記暗号文したまま、中身を高機能暗号によって処理する、
    ことを特徴とする暗号処理装置。
  10.  プロセッサによって実行される、暗号文を処理する暗号処理方法であって、
     前記暗号文は、所定の値に所定の分散を持つ誤差を与えた値を、整数に対応付けた平文として有し、復号することなく整数同士の所定の演算が可能な完全準同型暗号文であり、
     割られる数の暗号文に対して、割る数の平文から得られる多項式に基づいてスカラ剰余算を行い、剰余に対応する新たな暗号文を算出する、
    ことを特徴とする暗号処理方法。
  11.  暗号文を処理する暗号処理方法をプロセッサに実行させる暗号処理プログラムであって、
     前記暗号文は、所定の値に所定の分散を持つ誤差を与えた値を、整数に対応付けた平文として有し、復号することなく整数同士の所定の演算が可能な完全準同型暗号文であり、
     割られる数の暗号文に対して、割る数の平文から得られる多項式に基づいてスカラ剰余算を行い、剰余に対応する新たな暗号文を算出する、
    ことを特徴とする暗号処理プログラム。
PCT/JP2022/033600 2021-10-26 2022-09-07 暗号処理装置、暗号処理方法、及び暗号処理プログラム WO2023074133A1 (ja)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2021174746A JP7187074B1 (ja) 2021-10-26 2021-10-26 暗号処理装置、暗号処理方法、及び暗号処理プログラム
JP2021-174746 2021-10-26

Publications (1)

Publication Number Publication Date
WO2023074133A1 true WO2023074133A1 (ja) 2023-05-04

Family

ID=84418193

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2022/033600 WO2023074133A1 (ja) 2021-10-26 2022-09-07 暗号処理装置、暗号処理方法、及び暗号処理プログラム

Country Status (2)

Country Link
JP (2) JP7187074B1 (ja)
WO (1) WO2023074133A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117478305A (zh) * 2023-12-28 2024-01-30 粤港澳大湾区数字经济研究院(福田) 基于两方安全协作的全同态加密方法、系统、终端及介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017223822A (ja) * 2016-06-15 2017-12-21 株式会社日立製作所 暗号文処理システム、暗号文処理サーバ、及び暗号文処理方法
JP2019517684A (ja) * 2016-12-13 2019-06-24 深▲せん▼市全同態科技有限公司 モジュロ演算に基づく完全準同型暗号化の処理方法
JP2020053860A (ja) * 2018-09-27 2020-04-02 Kddi株式会社 秘匿計算装置、秘匿計算方法及び秘匿計算プログラム

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2017223822A (ja) * 2016-06-15 2017-12-21 株式会社日立製作所 暗号文処理システム、暗号文処理サーバ、及び暗号文処理方法
JP2019517684A (ja) * 2016-12-13 2019-06-24 深▲せん▼市全同態科技有限公司 モジュロ演算に基づく完全準同型暗号化の処理方法
JP2020053860A (ja) * 2018-09-27 2020-04-02 Kddi株式会社 秘匿計算装置、秘匿計算方法及び秘匿計算プログラム

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
BABENKO MIKHAIL; GOLIMBLEVSKAIA ELENA: "Euclidean Division Method for the Homomorphic Scheme CKKS", 2021 IEEE CONFERENCE OF RUSSIAN YOUNG RESEARCHERS IN ELECTRICAL AND ELECTRONIC ENGINEERING (ELCONRUS), 26 January 2021 (2021-01-26), pages 217 - 220, XP033897286, DOI: 10.1109/ElConRus51938.2021.9396347 *
CHATTERJEE AYANTIKA, INDRANIL SENGUPTA: "Translating Algorithms to Handle Fully Homomorphic Encrypted Data on Cloud.", IEEE TRANSACTIONS ON CLOUD COMPUTING, vol. 6, no. 1, 1 January 2018 (2018-01-01), pages 287 - 300, XP093062060 *
OKADA HIROKI, KIYOMOTO SHINSAKU, CID CARLOS: "Integer-Wise Functional Bootstrapping on TFHE: Applications in Secure Integer Arithmetics", INFORMATION, vol. 12, no. 8, pages 297, XP093059548, DOI: 10.3390/info12080297 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117478305A (zh) * 2023-12-28 2024-01-30 粤港澳大湾区数字经济研究院(福田) 基于两方安全协作的全同态加密方法、系统、终端及介质
CN117478305B (zh) * 2023-12-28 2024-04-16 粤港澳大湾区数字经济研究院(福田) 基于两方安全协作的全同态加密方法、系统、终端及介质

Also Published As

Publication number Publication date
JP2023064452A (ja) 2023-05-11
JP7187074B1 (ja) 2022-12-12
JP2023064757A (ja) 2023-05-11

Similar Documents

Publication Publication Date Title
WO2023074133A1 (ja) 暗号処理装置、暗号処理方法、及び暗号処理プログラム
Chung et al. Encoding rational numbers for fhe-based applications
WO2023067928A1 (ja) 暗号処理装置、暗号処理方法、及び暗号処理プログラム
WO2022201791A1 (ja) 暗号処理装置、暗号処理方法、及び暗号処理プログラム
JP7069460B2 (ja) 暗号処理装置、暗号処理方法、及び暗号処理プログラム
JP7187076B1 (ja) 暗号処理装置、暗号処理方法、及び暗号処理プログラム
Chung et al. Encoding of rational numbers and their homomorphic computations for FHE-based applications
JP7228287B1 (ja) 暗号処理装置、暗号処理方法、及び暗号処理プログラム
JP7261502B2 (ja) 暗号処理装置、暗号処理方法、及び暗号処理プログラム
JP2024517800A (ja) 完全準同型暗号化で使用するためのブラインド回転
WO2022270080A1 (ja) 暗号処理装置、暗号処理方法、及び暗号処理プログラム
CN115208548A (zh) 用于处理关于同态加密消息的非多项式运算的设备及其方法
JP7185346B1 (ja) 暗号処理装置、暗号処理方法、及び暗号処理プログラム
CN115918028A (zh) 对同态密文执行统计操作的装置及其方法
US20240039698A1 (en) Encryption processing device and encryption processing method
US20240187210A1 (en) Encryption processing apparatus and encryption processing method
US20240048353A1 (en) Encryption processing device and encryption processing method
WO2022044464A1 (ja) 暗号処理装置、暗号処理方法、及び暗号処理プログラム
JP2024013184A (ja) 暗号処理装置、暗号処理方法、暗号処理プログラム
JP2024053392A (ja) 暗号処理装置、暗号処理方法、暗号処理プログラム
JP2024088134A (ja) 暗号処理装置、暗号処理方法、暗号処理プログラム
US20240214201A1 (en) Encryption processing apparatus and encryption processing method
KR102522393B1 (ko) 동형암호로 암호화된 데이터 연산 방법
JP3435473B2 (ja) 暗号化・復号化方法及び装置
Pradhan A New CRT-based Fully Homomorphic Encryption

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22886467

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE