WO2021182908A1 - 모듈러 곱셈 연산을 수행하는 연산 장치 및 방법 - Google Patents

모듈러 곱셈 연산을 수행하는 연산 장치 및 방법 Download PDF

Info

Publication number
WO2021182908A1
WO2021182908A1 PCT/KR2021/003088 KR2021003088W WO2021182908A1 WO 2021182908 A1 WO2021182908 A1 WO 2021182908A1 KR 2021003088 W KR2021003088 W KR 2021003088W WO 2021182908 A1 WO2021182908 A1 WO 2021182908A1
Authority
WO
WIPO (PCT)
Prior art keywords
information
prime
decimal
base
prime information
Prior art date
Application number
PCT/KR2021/003088
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
Priority claimed from KR1020210032033A external-priority patent/KR102498133B1/ko
Application filed by 주식회사 크립토랩 filed Critical 주식회사 크립토랩
Priority to US17/905,693 priority Critical patent/US20230145760A1/en
Publication of WO2021182908A1 publication Critical patent/WO2021182908A1/ko

Links

Images

Classifications

    • 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/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • G06F7/722Modular multiplication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F15/00Digital computers in general; Data processing equipment in general
    • G06F15/76Architectures of general purpose stored program computers
    • G06F15/78Architectures of general purpose stored program computers comprising a single central processing unit
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F5/00Methods or arrangements for data conversion without changing the order or content of the data handled
    • G06F5/01Methods or arrangements for data conversion without changing the order or content of the data handled for shifting, e.g. justifying, scaling, normalising
    • 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
    • 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/483Computations with numbers represented by a non-linear combination of denominational numbers, e.g. rational numbers, logarithmic number system or floating-point numbers
    • 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/50Adding; Subtracting
    • 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/60Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers
    • G06F7/72Methods or arrangements for performing computations using a digital non-denominational number representation, i.e. number representation without radix; Computing devices using combinations of denominational and non-denominational quantity representations, e.g. using difunction pulse trains, STEELE computers, phase computers using residue arithmetic
    • 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/008Cryptographic mechanisms or cryptographic arrangements for secret or secure communications; Network security protocols involving homomorphic encryption
    • 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
    • H04L9/3006Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters
    • H04L9/3033Public key, i.e. encryption algorithm being computationally infeasible to invert or user's encryption keys not requiring secrecy underlying computational problems or public-key parameters details relating to pseudo-prime or prime number generation, e.g. primality test
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2209/00Additional information or applications relating to cryptographic mechanisms or cryptographic arrangements for secret or secure communication H04L9/00
    • H04L2209/12Details relating to cryptographic hardware or logic circuitry

Definitions

  • the present disclosure relates to an arithmetic apparatus and method for performing a modular multiplication operation, and more particularly, to perform a modular operation by generating decimal information (or square root information) necessary for each modulus for each cycle using pre-stored basis decimal information. It relates to a computing device and method.
  • Machine learning is attracting a lot of attention as an excellent solution for various applications such as speech recognition, image classification, and precision medicine.
  • Traditional machine learning services require large data sets for both training and inference to obtain meaningful results. Therefore, privacy is a major concern when providing cloud-based data analysis services.
  • HE Homomorphic encryption
  • Homomorphic encryption includes a homomorphic encryption system (SHE), which can be computed only a limited number of times, and a complete homomorphic system (FHE), which can perform an unlimited number of calculations.
  • SHE homomorphic encryption system
  • FHE complete homomorphic system
  • the fully homogeneous scheme can perform modular multiplication operations on an unlimited number of calculations by using bootstrapping, which is a method of initializing errors in encrypted data.
  • the present disclosure is devised to solve the above-described problems, and a arithmetic apparatus and method for performing a modular operation by generating decimal information (or square root information) required for each modulus for each cycle using pre-stored base decimal information. is to provide
  • the present disclosure is intended to achieve the above object, and the present arithmetic device includes a memory for storing at least one instruction, and a processor for executing the at least one instruction, wherein the processor includes the at least one By executing the instruction of , the predetermined base prime information is stored, the previously stored base prime information is bit-inverted to generate first fraction information different from the base fraction information, and the generated first fraction information is used to A module operation is performed on the plurality of ciphertexts.
  • the base decimal information and the first decimal information may be subtracted values of three, four, or five exponential powers of 2 composed of different exponents.
  • the processor reads the base fraction information from the internal memory for storing the base prime information, the GBU including a plurality of BUs including a plurality of operators for performing different preset isomorphic operations, and the internal memory, and the and a prime number generator that generates decimal information required for each of the plurality of BUs by bit-inverting the base fraction information and provides the generated fraction information to each of the plurality of BUs.
  • the prime number generator may generate decimal information by converting the k-th bit of the base decimal information into a log h-th bit integer.
  • the prime number generator generates first prime information required for a first cycle by using the base prime information, and second prime information required for a second cycle using the generated first prime information and the base prime information.
  • the processor includes a plurality of the GBUs, the plurality of GBUs are arranged in series, and the processor stores an output value of the one GBU and provides the output value stored in an order different from the storage order to another GBU It may further include a reordering buffer (RB).
  • RB reordering buffer
  • the GBU constitutes a plurality of stages, and a plurality of BUs may be arranged in parallel in each of the plurality of stages.
  • At least two of the plurality of BUs in the one GBU may perform the isomorphic operation using the same decimal information.
  • each of the BUs uses a modulus subtractor that receives two homomorphic ciphertexts and outputs a difference value, a modulus adder that receives two homomorphic ciphertexts and outputs the summed value, and an output value of the modulus subtracter and decimal information.
  • it may include a modulus multiplier for performing a modular multiplication operation.
  • the modulus multiplier may perform an individual shift operation based on each exponent of a plurality of powers of two constituting the decimal information, and perform a modular multiplication operation by adding or subtracting the shift operation results. .
  • the processor may be a Field Programmable Gate Array (FPGA).
  • FPGA Field Programmable Gate Array
  • the ciphertext calculation method includes the steps of receiving a module operation command for a plurality of ciphertexts, and performing a module operation on the plurality of ciphertexts using decimal information expressed as a combination of powers of two. performing the operation, and outputting the operation result, wherein the performing of the module operation includes storing basis decimal information and performing bit inversion processing on the basis decimal information to obtain a first prime number different from the basis decimal information.
  • Information may be generated, and a module operation may be performed on the plurality of ciphertexts using the generated first decimal information.
  • the base decimal information and the first decimal information may be subtracted values of 3, 4, or 5 exponential powers of 2 composed of different exponents.
  • performing the module operation may generate the first decimal information by converting the k-th bit of the base decimal information into a log h-th bit integer.
  • performing the module operation may include generating first decimal information necessary for a first cycle using the basis prime information, and using the generated first decimal information and the basis decimal information necessary for a second cycle. Second decimal information may be generated.
  • the ciphertext calculation method of the present disclosure can perform a fast operation by performing a modulus operation using decimal information expressed as a combination of powers of two.
  • decimal information or square root information
  • FIG. 1 is a diagram for explaining the structure of a network system according to an embodiment of the present disclosure
  • FIG. 2 is a block diagram showing the configuration of a computing device according to an embodiment of the present disclosure
  • FIG. 3 is a flowchart for explaining a ciphertext calculation method according to an embodiment of the present disclosure
  • FIG. 4 is a diagram for explaining an INTT algorithm according to a first embodiment of the present disclosure
  • FIG. 5 is a diagram illustrating an example of a first prime number set according to an embodiment of the present disclosure
  • FIG. 6 is a diagram illustrating an example of a second prime set according to an embodiment of the present disclosure.
  • FIG. 7 is a view for explaining an INTT algorithm according to a second embodiment of the present disclosure.
  • FIG. 8 is a diagram illustrating the configuration of a BU according to the first embodiment of the present disclosure.
  • FIG. 9 is a diagram for explaining the operation timing of the BU of FIG. 8;
  • FIG. 10 is a diagram for explaining the operation timing when the BU is operated by the algorithm of FIG. 7;
  • 11 is a diagram for explaining the operation timing when a plurality of BUs are parallelized
  • FIG. 12 is a diagram illustrating a configuration of a GBU according to an embodiment of the present disclosure.
  • 13 is a diagram for explaining the operation timing when INTT is designed with SET B of Table 1;
  • FIG. 14 is a diagram illustrating a configuration of an RB according to an embodiment of the present disclosure.
  • 15 is a diagram illustrating a configuration of a prime number generator according to an embodiment of the present disclosure.
  • 16 is a view for explaining an example of data stored in an internal memory according to an embodiment of the present disclosure.
  • 17 is a diagram for explaining the structure of a processor according to an embodiment of the present disclosure.
  • each step should be understood as non-limiting unless the preceding step must be logically and temporally performed before the subsequent step. That is, except for the above exceptional cases, even if the process described as a subsequent step is performed before the process described as the preceding step, the essence of the disclosure is not affected, and the scope of rights should also be defined regardless of the order of the steps.
  • “A or B” is defined as meaning not only to selectively indicate any one of A and B, but also to include both A and B.
  • the term "comprising" has the meaning of encompassing the inclusion of other components in addition to the elements listed as including.
  • value is defined as a concept including not only a scalar value but also a vector and polynomial form.
  • Each of S1 and S2 is an element in the R set.
  • FIG. 1 is a diagram for explaining the structure of a network system according to an embodiment of the present disclosure.
  • a network system may include a plurality of electronic devices 100 - 1 to 100 - n , a first server device 200 , and a second server device 300 , and each configuration includes a network 10 . ) can be connected to each other.
  • the network 10 may be implemented as various types of wired and wireless communication networks, broadcast communication networks, optical communication networks, cloud networks, etc., and each device may be connected in a manner such as Wi-Fi, Bluetooth, NFC (Near Field Communication), etc. without a separate medium. may be
  • FIG. 1 Although it is illustrated in FIG. 1 that there are a plurality of electronic devices (100-1 to 100-n), a plurality of electronic devices is not necessarily used, and one device may be used.
  • the electronic devices 100-1 to 100-n may be implemented as various types of devices such as smartphones, tablets, game players, PCs, laptop PCs, home servers, kiosks, etc. It can also be implemented in the form of home appliances.
  • the user may input various information through the electronic devices 100-1 to 100-n used by the user.
  • the input information may be stored in the electronic devices 100-1 to 100-n itself, but may also be transmitted to and stored in an external device for reasons of storage capacity and security.
  • the first server device 200 serves to store such information
  • the second server device 300 may serve to use some or all of the information stored in the first server device 200 . have.
  • Each of the electronic devices 100 - 1 to 100 - n may homomorphically encrypt the input information and transmit the same type ciphertext to the first server device 200 .
  • Each of the electronic devices 100-1 to 100-n may include encryption noise, ie, an error, generated in the process of performing homomorphic encryption in the ciphertext.
  • the homomorphic cipher text generated by each electronic device 100-1 to 100-n may be generated in a form in which a result value including a message and an error value is restored when it is later decrypted using a secret key. have.
  • the homomorphic ciphertext generated by the electronic devices 100-1 to 100-n may be generated in a form satisfying the following properties when it is decrypted using a secret key.
  • > denotes a normal inner product
  • ct denotes a ciphertext
  • sk denotes a secret key
  • M denotes a plaintext message
  • e denotes an encryption error value
  • mod q denotes the modulus of the ciphertext.
  • q should be chosen to be greater than the resulting value M of the message multiplied by the scaling factor ( ⁇ ). If the absolute value of the error value e is sufficiently small compared to M, the decryption value M+e of the ciphertext is a value that can replace the original message with the same precision in significant digit operation.
  • an error may be disposed on the least significant bit (LSB) side, and M may be disposed on the least significant bit side.
  • the size of the message may be adjusted using a scaling factor.
  • the scaling factor is used, not only integer type messages but also real number type messages can be encrypted, so that usability can be greatly increased.
  • the size of the message using the scaling factor the size of the area in which messages exist in the ciphertext after the operation is performed, that is, the size of the effective area can also be adjusted.
  • the cipher text modulus q may be set and used in various forms.
  • q may be expressed as a combination of powers of 2 that satisfy a certain condition as shown in FIG. 8 .
  • the ciphertext modulus may be set to a value obtained by multiplying a plurality of different scaling factors.
  • Each factor may be set to a value within a similar range, that is, a value having a similar size to each other.
  • q q 1 q 2 q 3 ...
  • q x each have a size similar to the scaling factor ⁇ and can be set to a value with a small relationship to each other.
  • the entire calculation can be divided into a plurality of modulus calculations according to CRT (Chinese Remainder Theorem), so that the calculation burden can be reduced.
  • CRT Choinese Remainder Theorem
  • the first server device 200 may store the received homomorphic ciphertext as an ciphertext without decrypting it.
  • the second server device 300 may request a specific processing result for the homomorphic ciphertext from the first server device 200 .
  • the first server device 200 may perform a specific operation according to the request of the second server device 300 , and then transmit the result to the second server device 300 .
  • the second server device 300 transmits the two electronic devices 100
  • a value obtained by adding up information provided from -1 and 100-2) may be requested from the first server device 200 .
  • the first server device 200 may perform an operation for summing two ciphertexts according to a request, and then transmit the result value (ct 1 + ct 2 ) to the second server device 300 .
  • the first server device 200 may perform an operation without decryption, and the result value may also be in the form of an ciphertext.
  • the first server device 200 may perform bootstrapping on the operation result, and in the process, apply an algorithm as described below to perform fast and fast bootstrapping.
  • a fast boot strapping method according to the present disclosure will be described later with reference to FIG. 4 .
  • the first server device 200 may transmit the operation result ciphertext to the second server device 300 .
  • the second server device 300 may decrypt the received operation result ciphertext to obtain operation result values of data included in each homomorphic ciphertext.
  • the first server device 200 may perform an operation several times according to a user request.
  • FIG. 1 illustrates a case in which encryption is performed by the first electronic device and the second electronic device and decryption is performed by the second server device, the present invention is not limited thereto.
  • FIG. 2 is a block diagram illustrating a configuration of a computing device according to an embodiment of the present disclosure.
  • a device for performing homomorphic encryption such as a first electronic device and a second electronic device, a device for calculating a homomorphic ciphertext such as a first server device, and a second server device, etc.
  • a device that does this may be referred to as an arithmetic device.
  • the computing device may be various devices such as a personal computer (PC), a laptop computer, a smart phone, a tablet, and a server.
  • the computing device 400 may include a communication device 410 , a memory 420 , a display 430 , a manipulation input device 440 , and a processor 450 .
  • the communication device 410 is formed to connect the computing device 400 with an external device (not shown), and is connected to an external device through a local area network (LAN) and the Internet network, as well as a USB ( Universal Serial Bus) port or a wireless communication (eg, WiFi 802.11a/b/g/n, NFC, Bluetooth) port may be connected through a port.
  • LAN local area network
  • USB Universal Serial Bus
  • a wireless communication eg, WiFi 802.11a/b/g/n, NFC, Bluetooth
  • Such a communication device 410 may be referred to as a transceiver.
  • the communication device 410 may receive the public key from the external device, and may transmit the public key generated by the computing device 400 itself to the external device.
  • the communication device 410 may receive a message from the external device and transmit the generated homomorphic cipher text to the external device.
  • the communication device 410 may receive various parameters necessary for generating a ciphertext from an external device. Meanwhile, in implementation, various parameters may be directly input from a user through a manipulation input device 440 to be described later.
  • the communication device 410 may receive a request for an operation on the homomorphic ciphertext from the external device, and may transmit the calculated result to the external device.
  • the requested operation may be an operation such as addition, subtraction, and multiplication (eg, modular multiplication operation).
  • the modular multiplication operation means performing a modular operation with q elements.
  • the element q a value expressed as a combination of powers of 2 as shown in FIG. 5 or 6 may be used.
  • At least one instruction related to the computing device 400 may be stored in the memory 420 .
  • various programs (or software) for operating the computing device 400 according to various embodiments of the present disclosure may be stored in the memory 420 .
  • the memory 420 may be implemented in various forms such as RAM, ROM, Buffer, cache, flash memory, HDD, external memory, memory card, etc., but is not limited thereto.
  • the memory 420 may store a message to be encrypted.
  • the message may be various types of credit information and personal information cited by the user, and may be information related to a usage history, such as location information used in the computing device 400 , Internet use time information, and the like.
  • the memory 420 may store the public key, and when the computing device 400 directly generates the public key, it may store the public key and various parameters necessary for generating the private key as well as the private key.
  • the memory 420 may store a plurality of decimal information.
  • each of the plurality of decimal pieces of information may be expressed as a combination of powers of two.
  • the decimal information stored in the memory 420 may be base decimal information that can be used to generate other decimal information as will be described later.
  • the memory 420 may store inverse information corresponding to the corresponding decimal information together with the decimal information.
  • the memory 420 may store the isomorphic ciphertext generated in the process described below. In addition, the memory 420 may store the same type cipher text transmitted from the external device. Also, the memory 420 may store an operation result ciphertext that is a result of an operation process to be described later.
  • the display 430 displays a user interface window for receiving a selection of a function supported by the computing device 400 .
  • the display 430 may display a user interface window for selecting various functions provided by the computing device 400 .
  • the display 430 may be a monitor such as a liquid crystal display (LCD), organic light emitting diodes (OLED), etc., and may be implemented as a touch screen capable of simultaneously performing the functions of the manipulation input device 440 to be described later. .
  • the display 430 may display a message requesting input of parameters necessary for generating a private key and a public key.
  • the display 430 may display a message in which the encryption target selects a message.
  • the encryption target may be directly selected by the user or may be automatically selected. That is, personal information that requires encryption may be automatically set even if the user does not directly select a message.
  • the manipulation input device 440 may receive a function selection of the arithmetic device 400 and a control command for the corresponding function from the user. For example, the manipulation input device 440 may receive parameters necessary for generating a private key and a public key from a user. Also, the manipulation input device 440 may receive a message to be encrypted from the user.
  • the processor 450 controls the overall operation of the computing device 400 .
  • the processor 450 may control the overall operation of the computing device 400 by executing at least one instruction stored in the memory 420 .
  • the processor 450 may be configured as a single device such as a central processing unit (CPU) and an application-specific integrated circuit (ASIC), or may include a plurality of components such as a CPU and a graphics processing unit (GPU).
  • the processor 450 may store it in the memory 420 .
  • the processor 450 may homogeneously encrypt the message by using various setting values and programs stored in the memory 420 .
  • the public key may be used.
  • the processor 450 may generate and use the public key required to perform encryption by itself, or may receive and use the public key from an external device.
  • the second server device 300 performing decryption may distribute the public key to other devices.
  • the processor 450 may generate a public key using the Ring-LWE technique. For example, the processor 450 may first set various parameters and rings, and store them in the memory 420 . Examples of parameters may include the length of the plaintext message bits, the sizes of public and private keys, and the like. Examples of various parameters used in the present disclosure and their values will be described in detail with reference to FIG. 4 .
  • the ring may be expressed by Equation 2 below.
  • R is a ring
  • Zq is a coefficient
  • f(x) is an nth-order polynomial
  • a ring is a set of polynomials having predetermined coefficients, and refers to a set in which addition and multiplication are defined between elements and closed with respect to addition and multiplication. Such a ring may be referred to as a ring.
  • the ring means a set of nth-order polynomials having a coefficient Zq.
  • n when n is ⁇ (N), it may mean an N-th cyclotomic polynomial.
  • (f(x)) represents the ideal of Zq[x] generated by f(x).
  • the Euler totient function ⁇ (N) means the number of natural numbers that are prime to N and smaller than N. If ⁇ N (x) is defined as an Nth-order cyclotonic polynomial, the ring can also be expressed by the following Equation (3). Here, N may be 2 17 .
  • the secret key sk may be expressed as follows.
  • the ring of Equation 3 described above has a complex number in the plaintext space. Meanwhile, in order to improve the operation speed for homomorphic cipher text, only a set having a real space in the plaintext space among the set of rings described above may be used.
  • the processor 450 may calculate a secret key sk from the ring.
  • s(x) denotes a polynomial randomly generated with small coefficients.
  • the processor 450 may calculate a first random polynomial (a(x)) from the ring.
  • the first random polynomial can be expressed as follows.
  • the processor 450 may calculate an error.
  • the processor 450 may extract an error from a discrete Gaussian distribution or a distribution having a close statistical distance thereto. This error can be expressed as follows.
  • the processor 450 may calculate the second random polynomial by modularly calculating the error on the first random polynomial and the secret key.
  • the second random polynomial can be expressed as follows.
  • the public key pk is set in a form including the first random polynomial and the second random polynomial as follows.
  • the processor 450 provides a plurality of public keys corresponding to each of a plurality of integers that are prime to each other. can create
  • the present invention is not limited thereto, and it goes without saying that the public key and the private key may be generated by other methods.
  • the processor 450 may control the communication device 410 to be transmitted to other devices.
  • the processor 450 may generate a homomorphic cipher text for the message.
  • the processor 450 may generate a homomorphic ciphertext by applying the previously generated public key to the message.
  • the processor 450 may perform an encryption operation using decimal information as shown in FIG. 5 or FIG. 6 in the process of generating the homomorphic ciphertext.
  • the message to be decoded may be received from an external source or may be input from an input device directly provided or connected to the computing device 400 .
  • the processor 450 stores data input by the user through the touch screen or the keypad in the memory 420 and then encrypts it. have.
  • the generated homomorphic ciphertext is decrypted, it may be restored as a result value obtained by adding an error to a value reflecting the scaling factor in the message.
  • the scaling factor may be input and set in advance to be used as it is.
  • the processor 450 uses a plurality of public keys corresponding to each of a plurality of integers swept to each other in a message, and is a homomorphic ciphertext expressed as a plurality of basis(s). can create
  • the processor 450 may directly encrypt the message using the public key while multiplying the message and the scaling factor.
  • an error calculated in the encryption process may be added to a result value obtained by multiplying the message and the scaling factor.
  • the processor 450 may generate the length of the cipher text to correspond to the size of the scaling factor.
  • the processor 450 may control the communication device 410 to store the same ciphertext in the memory 420 or to transmit the homomorphic ciphertext to another device according to a user request or a preset default command.
  • packing may be performed. If packing is used in homomorphic encryption, it becomes possible to encrypt multiple messages with one ciphertext. In this case, when the operation device 400 performs an operation between each ciphertext, as a result, the operation is processed in parallel for a plurality of messages, so that the operation burden is greatly reduced.
  • the processor 450 converts the plurality of message vectors into a polynomial in a form that can be encrypted in parallel, then multiplies the polynomial by a scaling factor and generates a public key. It can also be used for homomorphic encryption. Accordingly, the processor 450 may generate a ciphertext in which a plurality of message vectors are packed.
  • the processor 450 may apply a secret key to the homomorphic ciphertext to generate a polynomial-type decrypted text, and may generate a message by decoding the polynomial-type decrypted text.
  • the generated message may include an error as described in Equation 1 described above.
  • the processor 450 may perform an operation on the ciphertext.
  • the processor 450 may perform an operation such as addition, subtraction, or multiplication with respect to the homomorphic ciphertext while maintaining the encrypted state.
  • the multiplication may be a modular operation, and may be performed in a manner to be described later.
  • the processor 120 may perform addition and multiplication separately based on the generated homomorphic ciphertext.
  • the terminal device 100 may detect data of the effective area from the operation result data. For example, the terminal device 100 may detect data of an effective area by performing a rounding process on the operation result data.
  • the rounding process refers to performing round-off of a message in an encrypted state, and may also be referred to as rescaling.
  • the terminal device 100 may remove the noise region by multiplying and rounding each component of the ciphertext by ⁇ 1 which is the reciprocal of the scaling factor.
  • the noise region may be determined to correspond to the size of the scaling factor. As a result, it is possible to detect a message in the valid region from which the noise region is excluded. An additional error occurs because it proceeds in the encrypted state, but the size is small enough and can be ignored.
  • the processor 120 rounds the message for each of the plurality of bases in the generated homomorphic ciphertext if the weight of any one of the plurality of bases exceeds a threshold value can be performed to rescale the homomorphic ciphertext.
  • the terminal device 100 may expand the plaintext space of the cipher text as a result of the operation. For example, if q is smaller than M in Equation 1, M+e (mod q) has a different value from M+e, and thus decoding becomes impossible. Therefore, the value of q should always be kept greater than M. However, as the operation proceeds, the value of q gradually decreases. Expansion of the plaintext space means changing the ciphertext ct into a ciphertext having a larger modulus.
  • the operation of extending the plaintext space may be referred to as rebooting otherwise. As the reboot is performed, the ciphertext may be in a state where computation is possible again.
  • encryption, decryption, addition, multiplication, rescaling, and rebooting of homomorphic encryption based on the Ring LWE problem are polynomial It can be composed of the operations of the elements of .
  • the polynomial multiplication operation is the most time-consuming operation process in encryption, decryption, polynomial multiplication, and rebooting.
  • a method for speeding up the operation is very important.
  • FIG. 3 is a flowchart illustrating a ciphertext calculation method according to an embodiment of the present disclosure.
  • a module operation command for a plurality of cipher texts may be input ( S310 ).
  • Such a command may be input from an external device, or may be directly input from the arithmetic device.
  • this operation command may be a command for message encryption or homomorphic ciphertext operation.
  • a module operation may be performed on a plurality of ciphertexts using a plurality of predetermined decimal information (S320).
  • each of the plurality of decimal pieces of information may be expressed as a combination of powers of two.
  • An example of decimal information is shown in FIG. 5 or 6 .
  • the calculation result may be output (S330).
  • the operation result may be output to the device that requested the operation.
  • the operation result may be transmitted to another operator (or operation program).
  • the ciphertext calculation method performs an operation using decimal information expressed as a combination of powers of two, so that a fast operation can be performed.
  • decimal information expressed as a combination of powers of two
  • not all decimal information is stored and used, only some decimal information is stored, and the remaining decimal information is calculated and used using pre-stored decimal information every cycle.
  • the first module operation method ModMult may be expressed by subtracting the multiplication operation value of [A/q] and q from the number A as shown in Equation 9 below.
  • A is an element for the ciphertext (or polynomial)
  • q is an element for the modulus
  • ModMult may include a first multiplier, a second multiplier, a third multiplier, a shifter, and a subtractor.
  • a modulus calculator may be the arithmetic device of FIG. 2 or may be one arithmetic module in a Field Programmable Gate Array (FPGA).
  • FPGA Field Programmable Gate Array
  • a modulus multiplication operation for two ciphertexts will be described.
  • a modulus multiplication operation for a polynomial rather than a ciphertext may be used.
  • Equation 9 and other Equations operations including multiplication for homomorphic encryption
  • the first multiplier may perform a first multiplication operation on the first ciphertext A (or the first polynomial) and the second ciphertext B (or the second polynomial).
  • the first multiplier may be a Full-IntMult that outputs a multiplication result (V) having a size of 2n bits using an n-bit first ciphertext (A) and an n-bit second ciphertext (B). have.
  • the second multiplier may perform a second multiplication operation on the reciprocal information T corresponding to one piece of decimal information q among the plurality of pieces of decimal information and the first multiplication operation result U.
  • the second multiplier 520 ( IntMult2 ) may perform an operation of multiplying the upper bit of the output of the first multiplier by T scaled by 1/q.
  • the second multiplier since the coefficient q of the third multiplier, which will be described later, is applied only to the upper bit of the output value of the second multiplier, the second multiplier receives two n-bit ciphertexts and receives a multiplication result ( You can use Upper Half(UH)-IntMult that outputs W).
  • the reciprocal information is a number multiplied by the decimal information to become 1, that is, the inverse proportional value (1/q) of the decimal, and the value may be stored in advance in a lookup table, and calculated through the basis decimal information (or basis square root information) can also be used.
  • the third multiplier may perform a third multiplication operation using the second multiplication result W and one piece of decimal information q. For example, only the lower bit of the output value of the third multiplier is calculated with the output bit of the shifter, and the third multiplier is a Lower that outputs a multiplication result (W) having a size of n bits by inputting two ciphertexts of n bits. It can be implemented as Half(LH)-IntMult.
  • the shifter may delay the output value of the first multiplier and provide it to the subtractor.
  • the shifter may delay the lower bit of the output of the first multiplier, and may be implemented as a flip-flop (FF).
  • the subtractor may subtract the output value of the third multiplier from the output value of the shifter, and output the result.
  • each of the second multiplier and the third multiplier may perform a multiplication operation using the reciprocal information T and the decimal information q.
  • a prime number having a low Hamming weight with a low reciprocal (T) corresponding to the prime number can be expressed as a subtraction value of 3, 4, and 5 exponential powers of 2 composed of different indices as shown in FIG. 5 or FIG. 6 . have.
  • the prime number used in the present disclosure is expressed as a combination of powers of two, and in the operation process for the prime number or the reciprocal value of the prime number, decimal multiplication can be performed only by shift operation and subtraction operation.
  • each of the above-described second multiplier and third multiplier performs an individual shift operation based on each exponent of a plurality of powers of two, and adds or subtracts the results of the shift operation to perform the above-described second multiplication operation or the second multiplier operation.
  • 3 Multiplication operations can be performed.
  • the modular multiplication operation has been illustrated and described as receiving and processing the ciphertext, but various values may be used for the input of the modular multiplication operation when implemented. That is, the modular multiplication operation can be used not only for the ciphertext operation but also for calculating the values necessary for the encryption process, or for scaling or decrypting.
  • the algorithm of the second module calculation method is similar to the first module calculation method, but is different in that a pre-calculation value is used. Specifically, the 'pre-calculated value (B') obtained by multiplying the reciprocal number corresponding to one decimal information and the second cipher text' may be stored and used. This pre-calculated value (B') is an approximation to B/q, and by using the value of B', A x B /q can be approximated to W.
  • the second module calculation method a method in which a value necessary for calculation is calculated in advance and stored, and the calculation speed can be improved by using the value calculated in advance during calculation has been described.
  • this method increases the operation speed, but requires a lot of storage space. Accordingly, a method for performing a modulus calculation using only a relatively small storage space while increasing the calculation speed will be described below.
  • w is referred to as the N th square root of the modular prime p (modulo). This is w n 1 (mod N) is satisfied.
  • N th primitive roots a square root for generating N th multiplying every N th root.
  • the primitive N th square root is required to DFT a vector of size N. p It is known that if we have 1 (mod N), then there is an N th square root of p.
  • FIG. 4 is a diagram for explaining an INTT algorithm according to a first embodiment of the present disclosure.
  • the rescaling step is omitted for the sake of simplification of the description, but in actual implementation, the rescaling step may be added.
  • NTT/INTT may be performed using BUs, which are building blocks.
  • BUs which are building blocks.
  • BUs building blocks
  • the function block (Function ButterflyUnit) of FIG. 4 is a[j], a[j+t], W, p, and a[j]-a[j+t](mode p) and (a[j]+ a[j+t]) ⁇ W(mod p) can be calculated, and each can be stored in a[j] and a[j+t].
  • the number of input samples is N
  • the number of stages in NTT is log N
  • each stage is may be composed of BUs of Therefore, the total number of BUs required is B am.
  • the sample refers to input data provided to the operator (or BU), and may be a homomorphic ciphertext or a polynomial.
  • RNS-HEAAN RNS homomorphism operation
  • RNS-HEAAN is a major solution for homomorphic encryption because it supports approximation with a fixed point.
  • RNS-HEAAN enables parallel operation by dividing large coefficients of polynomials into small coefficients and performing operations.
  • Homomorphic multiplication is an operation frequently used in homomorphic operations, but it takes a lot of time, so it is the biggest obstacle in actual use of homomorphic encryption-based applications.
  • the biggest bottleneck here is that large-order polynomial ring multiplication is still slow even with NTT/INTT.
  • RNS-HEAAN has an additional function that is different from the existing situation.
  • the input coefficients of polynomials in RNS-HEAAN are converted into NTT domains in advance for efficient isomorphic operation.
  • untransformed coefficients also require isomorphic products.
  • the product of the ciphertext can be calculated using the following equation.
  • ⁇ , ⁇ > represents the dot product of two vectors.
  • Equation 12 the switching key swk on the cyclotonic ring R 2 PQ can be defined as in Equation 12 below.
  • e swk may be referred to as an error caused when the switching key decrypts.
  • the domains on a 1 , a 2 R 2 Q may be converted to R 2 PQ domains.
  • This conversion process may be referred to as basis conversion, and requires INTT to inversely transform a 1 a 2 on the NTT domain. After this transformation, the NTT is reapplied to the transformed a 1 a 2 .
  • Partial moduli on (q i , p i ) can be classified into the following three types.
  • Mod-up modulus (p i , where 1 ⁇ i ⁇ k): Used to reduce the size of the error generated during isomorphic product.
  • Homomorphic encryption schemes use errors to encrypt messages. However, whenever an operation on a homomorphic ciphertext is performed, the internal error increases, and in particular, the internal error increases rapidly whenever a homomorphic product is performed. Moreover, when the size of the error exceeds a certain level, it is impossible to obtain a correct message during decoding.
  • the number of isomorphic products before reaching a certain level (or threshold) is referred to as the circuit depth.
  • Typical bootstrapping consumes 15-20 circuit depths.
  • the circuit depth required for bootstrapping is subtracted from the initial depth.
  • the initial circuit depth should be set to approximately 40, so that the circuit depth after bootstrapping is 20-25.
  • a security parameter ( ⁇ ) of approximately 80 is widely used in the existing technology.
  • the security parameter needs to be increased to 128.
  • the security parameters in the existing RNS-HEAAN scheme do not satisfy 128 security.
  • the existing HEAX scheme satisfies 128 security, but since the scheme does not consider bootstrapping, only 8 isomorphic products are allowed.
  • the parameters most different from the existing ones are the number of evaluation keys and dnum. Referring to the second row, it can be seen that the size of logP and the size of logQ are set similarly.
  • logQ in order to increase the initial circuit depth to approximately 40, logQ must be increased, but there is a limit to the size of logPQ for security.
  • the ciphertext can be decomposed by increasing dnum.
  • logQ is set to LogP ⁇ dnum. That is, if dnum increases, the size of the memory to store the evaluation key increases, so that the evaluation key cannot be stored in the internal memory.
  • NTT must be performed by a multiple of dnum, causing a large delay. Therefore, in the present disclosure, a dnum value of 2 or 3 that can optimize the increase of the initial circuit depth and the increase of the evaluation key is used.
  • the reference modulus (log q 0 ) was set to 62, and the rescaling modulus (log qi) was set to 52 to satisfy the following two criteria.
  • the first criterion is large enough to perform the approximate computation of RNS-HEAAN, and the second criterion is sufficient to find many lightweight primes. By using these primes, we can speed up the modMult by replacing the isomorphic product with a bit shift and addition.
  • FIG. 5 is a diagram illustrating an example of a first prime number set according to an embodiment of the present disclosure.
  • each of the 42 prime numbers is expressed as a combination of powers of 2 within a maximum of 61 powers.
  • prime numbers greater than 1 and less than l are prime numbers used in the rescale modulus.
  • i > 1 it can be seen that all prime numbers have a size smaller than 2 52 at most.
  • a prime number that can be expressed by a combination of powers of two is used, and multiplication of the prime number can be performed only by shift operation and addition/subtraction operation.
  • decimal value information when storing the information on the prime number described above, only information about the power constituting the prime number may be stored without storing the decimal value itself.
  • decimal value information By storing decimal information in this way, a decimal value can be stored with bits smaller than 2 61 bits.
  • the above-described expression method is an example, and decimal value information may be stored in a method different from the above-described method. In particular, since the present application uses a prime number composed of only powers of 3 to 5, only a small resource is required to store decimal information.
  • FIG. 6 is a diagram illustrating an example of a second prime number set according to an embodiment of the present disclosure.
  • each of the 16 prime numbers is expressed as a combination of powers of 2 within a maximum of 61 powers.
  • a prime number that can be expressed by a combination of powers of two is used, multiplication of the prime number during the mode-up operation can be performed only by shift operation and addition/subtraction operation.
  • the present disclosure used an N parameter with a value of 2 17 .
  • the execution time of the NTT and the execution time of the INTT may increase. Therefore, the following describes a hardware system design method to have faster NTT and INTT operation speeds than before despite the increase of N parameters.
  • decimal information instead of storing and using all decimal information (or all square root information), only some decimal information (or partial square root information) is stored, and the necessary decimal information (or square root information) can be calculated and used with the information in the operation process.
  • a method is required Hereinafter, a detailed configuration and method for such an operation will be described.
  • the scheme according to the present disclosure balances computation and storage. Also, such a correction does not asymmetrically increase the amount of computation. For example, even if the changed algorithm is used, the computational cost is still the same as O(NlogN). Conversely, the storage space is reduced from o(N) bits to O(logN) bits.
  • FIG. 7 is a diagram for explaining an INTT algorithm according to a second embodiment of the present disclosure. Although the rescaling step is omitted in FIG. 7 for simplification of the description as in FIG. 4 , the rescaling step may be added in actual implementation.
  • Is includes BitReverse(k, log h) of FIG. 7 is to convert the bit value of k bitwise and use it as a log h bit integer.
  • Algorithm 1 shown in FIG. 4 The difference from Algorithm 1 shown in FIG. 4 is as follows. i) to reduce the size of the input, Instead of is used, ii) the bit conversion processing of line 7 of FIG. 7 is performed instead of taking the pre-stored square root, and iii) all square roots are not calculated in advance, and the necessary square roots are used as generation and update.
  • NTT and INTT have almost the same system design, except that the progress direction is different, and in the case of INTT, a scaling step is added.
  • NTT and INTT may use the same circuit, and only an implementation example of INTT will be described below.
  • FIG. 8 is a diagram illustrating a configuration of a BU according to the first embodiment of the present disclosure. Specifically, FIG. 8 shows radix-2BU for INTT.
  • the BU 800 may include a modular subtractor 810 , a modular adder 820 , and a modular multiplier 830 .
  • a and B represent input samples
  • A' and B' represent output samples
  • W represents square root information.
  • the modular subtractor 810 may receive A and B, and may output a modular subtraction operation result of two input samples to the modular multiplier.
  • the modular adder 820 may receive A and B, and may output a result of a modular addition operation of two input samples as A'.
  • the modular subtractor 810 and the modular adder 820 have the same system design as a general subtractor and adder, and the calculation result of the subtractor or adder is output after a delay of 2 cycles.
  • the modular multiplier 830 receives the output and W of the modular subtractor 810 and outputs a modular multiplication operation thereon.
  • the modular multiplier 830 may utilize a fully pipelined system design with lightweight modularity. A detailed configuration of such a modular multiplier has been described above with reference to FIG. 3 , so a redundant description thereof will be omitted.
  • the output of the calculation result of the modular multiplier 830 used in the present disclosure requires one more cycle than before, so that 21 cycles of output after delay.
  • the delay cycle is an example, and the delay cycle may be different from the above-described value according to an applied hardware environment and an implementation algorithm.
  • decimal information may be provided to the modular multiplier instead of the square root information, and the operation result of the modular multiplier may be applied to the modular subtractor or the modular adder.
  • FIG. 9 is a diagram for explaining the operation timing of the BU of FIG. 8 .
  • the first output value (A') is output 2 cycles after the two input values (A, B) are input, and the second output value (B') is the first output value (A') It can be seen that the output is output 21 cycles after it is input to the modular multiplier 830 .
  • the BU according to the present disclosure is designed as a complete pipeline, it can be confirmed that two input samples are continuously inputted every cycle, and an output is also outputted every cycle after a predetermined delay.
  • the output sample may be the input sample of the next BU.
  • each BU includes an expensive modular operator, it is difficult to employ N/2*logN BUs when N is very large.
  • the first method is to arrange a plurality of BUs in parallel on the same stage
  • the second method is to arrange a single BU (or several BUs) for each stage and arrange the plurality of BUs in series.
  • the first method is intuitive and the order of the intermediate data is simple. However, as BUs are arranged in parallel, high input/output and memory bandwidth are required for a short time. Accordingly, in the present disclosure, an example using the second method will be described. However, the first method may be used in an environment capable of solving high input/output and memory bandwidth.
  • FIG. 10 is a diagram for explaining an operation timing when a BU is operated by the algorithm of FIG. 7 . Specifically, FIG. 10 shows the operation timing when a plurality of BUs are arranged in series when N is 32. As shown in FIG.
  • the stage order is indicated in the first row, and the index of the input sample is indicated in the first column and the second column of each stage.
  • the square root displayed in the third column of each stage is an exponent, which increases in fixed units and is referred to as the update constant. As the stage increases, it can be seen that the update constant increases exponentially.
  • the first case in which the output of the first stage is input to the second stage is indicated by an arrow.
  • each stage has a dependency, so delays are accumulated. Accordingly, in order to solve such a delay, BUs may be additionally arranged for each stage. Specifically, since the number of DSP slices is limited by the lookup table and flip-flops, the number of BUs (hereinafter, c) for each stage can be determined based on the total number of available DSP slices. Then, the input sample sequence for each stage is divided by c, and the divided partial sequence can be input to each BU.
  • 11 is a diagram for explaining the operation timing when a plurality of BUs are parallelized.
  • c is 4, and ci denotes an i-th BU core.
  • the input samples with 0, 2, 4, 5 of stage 1 are processed in each modAdd of C1, C3, C2, C4, so C5, C5 of stage 2 are started with a delay of 2 cycles.
  • modSub and modMult are applied with input samples marked 1, 3, 5, and 7, so that C7 and C8 of step 2 are started after a delay of 23 cycles.
  • the subsequent BU cores of stage 3 may operate in the same manner.
  • the BU core of the fourth stage receives input samples with an index difference of 8, but each input sample can be calculated after N/(2*2*4) cycles (when N is 2 17 ). Therefore, a reordering buffer for changing the order is required. Between the two reordering buffers, the BU core may include a BU group (BGU). The number of stages in a single GBU and the number of GBUs in the entire INTT design can be calculated as 1+logc, [logN/(1+logc)].
  • FIG. 12 is a diagram illustrating a configuration of a GBU according to an embodiment of the present disclosure. Specifically, FIG. 12 is a diagram illustrating the GBU configuration in the case where c is 4 as described above. In this example, the case where c is 4 has been described, but in implementation, the GBU may be configured to have a different value of c.
  • one GBU 1200 includes 12 BUs.
  • the GBU is composed of three stages, and each stage may be composed of four BUs.
  • Such a 3*4 arrangement is merely an example, and in implementation, it may be arranged to have a different number of stages and a different number of BUs for each stage according to design parameters.
  • the output of the modular multiplication operation (ModMults) of each BU is indicated by a bold line.
  • the GBU receives 8 input samples and 12 square roots every cycle. Eight samples are generated after a delay of one cycle, and may be delivered to the RB every cycle.
  • each pipe time requires approximately 16K cycles (approximately 16K*(5+42)).
  • FIG. 14 is a diagram illustrating a configuration of an RB according to an embodiment of the present disclosure.
  • the i-th RB may store an output sample generated in the i-th GBU and transfer the reordered sample to the i+1th GBU.
  • each of the four BU cores of stage 4 may read eight samples and samples having indexes different from each other by eight values. For example, samples indexed by 0, 8, ..., 48, 56 may be read in the first cycle.
  • the BRAM performs a storage function as an internal cache in the FPGA and has a faster read/write speed than the general DDR method.
  • 8 samples When transferring to the 8 BU cores in the fourth stage, 8 samples may be read out horizontally as shown in FIG. 14 .
  • the next RB may read 8 i-1 samples from the same buffer vertically from the same buffer, and then horizontally pass it to the next buffer.
  • FIG. 15 is a diagram illustrating a configuration of a prime number generator according to an embodiment of the present disclosure.
  • a prime number is generated for ease of explanation, the above-described prime number generator may be used even when generating a square root corresponding to the prime number (ie, during INTT operation). That is, the prime number generator may not only generate a prime number, but also generate a square root corresponding to the prime number. In this case, the prime generator may be referred to as a square root generator.
  • FIG. 15 illustrates an example of a prime generator when N is 2 17 and c is 4, but the configuration of the prime generator may be changed to support other N and other c values in implementation.
  • the prime number generator 1500 may generate all square roots (or all prime numbers) from base square roots (or base prime numbers) that are O(logN). Each GBU requires 12 square roots. Specifically, since C5 and C7, C6 and C9, and C9 to C12 each use the same square root, the prime number generator may generate 7 square roots. Each square root is denoted as W C1 , W C2 , W C3 , W C4 , W C5&7 , W C6&8 , W C9-12 .
  • Seven square roots include a group of square roots (W Gi ), and may be transferred to the i-th GBU. At the same time, they can be provided to the modulus operation (ModMULTS) in the RUG, and after the square root is generated, the square root (or decimal) required for the operation of the next cycle can be generated.
  • the prime number generator 1500 may generate square root information (or decimal information) to be used in a next cycle by using the square root and basis square root information (or basis decimal information) generated in the current cycle.
  • 16 is a diagram for explaining an example of data stored in an internal memory according to an embodiment of the present disclosure.
  • each different hatching represents a basis square root used in a different module.
  • each LUG requires 7 basis square roots.
  • a delay of 21 cycles may occur.
  • the square root stored in ROM is used as the input operand of ModMults to increase the number of square roots to be stored, and the square root generated by ModMults after delay is used as the input operand.
  • the square root is generated in ModMults and can be used for input operations.
  • 21 basis square roots are required.
  • the square root for the second GBU is changed every 8 cycles, three base square roots can be stored.
  • the 3rd GBU, 4th GBU, 5th GBU, and 6th GBU are changed every 64 cycles, only one basis square root is required.
  • the 21 basis square roots for the first GBU can be passed directly to ModMULTS.
  • the basis square root for the other GBU is stored in a register marked R1 and can be used at the next modulus during the next pipeline.
  • update constants can be read from ROM (or internal memory within the FPGA) and stored in a register marked R2. Since the BU receives 7 basis square roots simultaneously, the basis square roots can each be stored in 7 ROMs (or internal memory, internal registers, internal buffers, etc.). Basically, the basis square root for mod-up and basis modulus may be stored in 62-bit ROM, and the basis square root for scale modulus may be stored in 52-bit ROM.
  • the basis square root for q 1 to q 5 may be stored in 62-bit ROM to increase the usability of the BRAM.
  • another configuration may be used for Set-A of Table 1. Specifically, p 1 to p 16 , q 0 , and q 1 may be stored in a 62-bit ROM, and q 2 to q 35 may be stored in a 52-bit ROM.
  • the boot strapping parameter set of the present disclosure has a modulus of 50 or more and a scaling inverse value. These values are stored in a modulus table (MT), and a pair corresponding to the pipeline time may be selected according to a selection signal for the first GBU and RUG. This pair is delayed in a register and can be provided to the next GBU and RUG.
  • MT modulus table
  • 17 is a diagram for explaining the structure of a processor according to an embodiment of the present disclosure.
  • FIG. 17 shows an example in which the value of c is 4, it may be implemented in a form having a different value of c. Specifically, high c results in high throughput, short delay and less BRAM, but requires many DSP slices.
  • the hardware system 1700 for performing INTT is composed of an internal memory 1710, six GBUs 1720 and five RBs 1740 and six RGUs 1730 and one MT 1750.
  • the last stage can be used for scaling.
  • the BU in the last stage is replaced with two ModMults, and a scaling constant may be input into ModMults instead of the square root.
  • the target platform is 1800 DSP slices, 132.9 Mbit BRAMs, 1M LUTs, 2M FFs. It is assumed that input samples are continuously fed into the iNTT design, and the data transfer time over the I/O interface is hidden by pipeline scheduling.
  • Table 2 compares the proposed iNTT design with the conventional method.
  • the second row represents the Xilinx TM FPGA device. It was previously designed for larger functions such as polynomial multiplication, but was adopted for this evaluation because it reuses the same circuit for INTT and other functions.
  • Chen has the lowest resource usage in the design since only two BUs are deployed in the FPGA and shows the second lowest throughput out of the four designs. In this respect, it cannot be used in the RNS-based homomorphic encryption system. Roy shows the lowest throughput in the table, but the throughput can be further improved by placing more core processors in the FPGA.
  • the normalized throughput according to the present disclosure is 2-3 times greater than the throughput of the existing schemes. This result occurs because the hardware design method according to the present disclosure uses a high degree of parallelism.
  • Table 3 shows the improvement of the internal memory size in the case where all of the decimal information is not stored and used, but is calculated and used every cycle.
  • the first column shows the parameters used in the present disclosure
  • the second and third columns show the memory size for storing square root information stored in the existing method and the proposed method, respectively.
  • the FPGA implementation compares the implementation of the iNTT software with the FPGA implementation in order to check the effect of hardware acceleration.
  • Table 4 it shows the execution time when the algorithm is implemented in software and when the FPGA is implemented in the present disclosure.
  • the second and third rows of Table 4 show the results when using parameter sets A and B.
  • the frequency is 200 MHz
  • the execution times of the FPGA implementations for set A and set B are 3.23 ms and 3.76 ms, respectively, which is 115 times faster than the software implementation.
  • the cipher text processing method may be implemented in the form of a program code for performing each step, stored in a recording medium, and distributed.
  • the device on which the recording medium is mounted may perform operations such as encryption or cipher text processing described above.
  • These recording media may be various types of computer readable media such as ROM, RAM, memory chip, memory card, external hard drive, hard disk, CD, DVD, magnetic disk or magnetic tape.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Mathematics (AREA)
  • Mathematical Analysis (AREA)
  • Pure & Applied Mathematics (AREA)
  • Mathematical Optimization (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Mathematical Physics (AREA)
  • Computer Security & Cryptography (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • Nonlinear Science (AREA)
  • Storage Device Security (AREA)

Abstract

연산 장치가 개시된다. 본 연산 장치는 적어도 하나의 인스트럭션(instruction)을 저장하는 메모리, 및 상기 적어도 하나의 인스트럭션을 실행하는 프로세서;를 포함하고, 상기 프로세서는, 상기 적어도 하나의 인스트럭션을 실행함으로써, 기결정된 기저 소수 정보를 저장하고, 상기 기저장된 기저 소수 정보를 비트 반전 처리하여 상기 기저 소수 정보와 다른 제1 소수 정보를 생성하고, 상기 생성된 제1 소수 정보를 이용하여 상기 복수의 암호문에 대한 모듈 연산을 수행한다.

Description

모듈러 곱셈 연산을 수행하는 연산 장치 및 방법
본 개시는 모듈러 곱셈 연산을 수행하는 연산 장치 및 방법에 관한 것으로, 보다 상세하게는 기저장된 기저 소수 정보를 이용하여 사이클마다 각 모듈러스에 필요한 소수 정보(또는 제곱근 정보)를 생성하여 모듈러 연산을 수행하는 연산 장치 및 방법에 관한 것이다.
기계 학습은 음성 인식, 이미지 분류, 정밀 의학 등 다양한 응용분야에 대한 뛰어난 솔루션으로 많은 주목을 받고 있다. 전통적인 머신러닝 서비스는 의미 있는 결과를 얻기 위해서는 훈련 및 추론 모두에 있어서 대량의 데이터 세트가 요구되었다. 따라서, 개인 정보 보호는 클라우드 기반 데이터 분석 서비스를 제공할 때 주요 관심 분야이다.
암호화된 데이터 간의 계산을 허용하는 암호화 체계인 동형 암호(HE, Homomorphic encryption)는 암호화된 상태에서 연산을 허용하기 때문에, 상술한 개인 정보 보호에 이상적인 솔류션이다.
동형 암호는 제한된 횟수만큼만 연산할 수 있는 동형 암호 체계(SHE)와 무제한의 계산이 가능한 완전 동형 체계(FHE)가 존재한다. 완전 동형 체계는 암호화된 데이터 내의 에러를 초기화하는 방법인 부트 스트래핑(bootstrapping)을 이용함으로써 무제한의 계산을 모듈러 곱셈 연산할 수 있다.
그러나 이러한 부트 스트래핑은 큰 동형 계산이 요구되며, 큰 다항식 차수(N)와 같은 큰 파라미터를 요구하기 때문에, 전체 처리 속도의 저하가 발생하는 문제점이 있었다. 따라서, 동형 암호에 대한 부트 스트래핑의 시간 및 속도를 향상할 수 있는 방법이 요구되었다.
따라서, 본 개시는 상술한 바와 같은 문제점을 해결하기 위하여 고안된 것으로, 기저장된 기저 소수 정보를 이용하여 사이클마다 각 모듈러스에 필요한 소수 정보(또는 제곱근 정보)를 생성하여 모듈러 연산을 수행하는 연산 장치 및 방법을 제공하는 데 있다.
본 개시는 이상과 같은 목적을 달성하기 위한 것으로, 본 연산 장치는 적어도 하나의 인스트럭션(instruction)을 저장하는 메모리, 및 상기 적어도 하나의 인스트럭션을 실행하는 프로세서를 포함하고, 상기 프로세서는, 상기 적어도 하나의 인스트럭션을 실행함으로써, 기결정된 기저 소수 정보를 저장하고, 상기 기저장된 기저 소수 정보를 비트 반전 처리하여 상기 기저 소수 정보와 다른 제1 소수 정보를 생성하고, 상기 생성된 제1 소수 정보를 이용하여 상기 복수의 암호문에 대한 모듈 연산을 수행한다.
여기서, 상기 기저 소수 정보 및 상기 제1 소수 정보는 서로 다른 지수로 구성된 3개, 4개 또는 5개의 2의 지수승들의 감가산 값일 수 있다.
한편, 상기 프로세서는 상기 기저 소수 정보를 저장하는 내부 메모리, 서로 다른 기설정된 동형 연산을 수행하는 복수의 연산기를 포함하는 BU를 복수개 포함하는 GBU, 및 상기 내부 메모리로부터 기저 소수 정보를 읽어 오고, 상기 기저 소수 정보를 비트 반전하여 상기 복수의 BU 각각에 필요한 소수 정보를 생성하여 복수개의 BU 각각에 제공하는 소수 생성기;를 포함할 수 있다.
이 경우, 상기 소수 생성기는 상기 기저 소수 정보의 k번째 비트를 log h번째 비트 정수로 비트값 전환하여 소수 정보를 생성할 수 있다.
한편, 상기 소수 생성기는 상기 기저 소수 정보를 이용하여 제1 사이클에 필요한 제1 소수 정보를 생성하고, 상기 생성된 제1 소수 정보와 상기 기저 소수 정보를 이용하여 제2 사이클에 필요한 제2 소수 정보를 생성할 수 있다.
한편, 상기 프로세서는 상기 GBU를 복수개 포함하며, 상기 복수개의 GBU는 직렬 배치되며, 상기 프로세서는, 상기 하나의 GBU의 출력 값을 저장하고, 저장 순서와 다른 순서로 저장된 출력값을 다른 GBU에 제공하는 리오더링 버퍼(RB)를 더 포함할 수 있다.
한편, 상기 GBU는 복수의 스테이지를 구성하며, 상기 복수의 스테이지 각각은 복수의 BU가 병렬 배치될 수 있다.
이 경우, 상기 하나의 GBU 내의 복수의 BU 중 적어도 두개는 동일한 소수 정보를 이용하여 동형 연산을 수행할 수 있다.
한편, 상기 BU 각각은 두개의 동형 암호문을 입력받아 그 차이값을 출력하는 모듈러스 감산기, 두개의 동형 암호문을 입력받아 그 합산 값을 출력하는 모듈러스 가산기, 및 상기 모듈러스 감산기의 출력 값과 소수 정보를 이용하여 모듈러 곱셈 연산을 수행하는 모듈러스 곱셈기를 포함할 수 있다.
이 경우, 상기 모듈러스 곱셈기는 상기 소수 정보를 구성하는 복수의 2의 지수승 각각의 지수에 기초하여 개별적인 시프트 연산을 수행하고, 시프트 연산 결과들을 가산 연산 또는 감산 연산하여 모듈러 곱셈 연산을 수행할 수 있다.
한편, 상기 프로세서는 FPGA(Field Programmable Gate Array)일 수 있다.
한편, 본 개시의 일 실시 예에 따른 암호문 연산 방법은 복수의 암호문에 대한 모듈 연산 명령을 입력받는 단계, 2의 지수승들의 조합으로 표현되는 소수 정보를 이용하여 상기 복수의 암호문에 대한 모듈 연산을 수행하는 단계, 및 상기 연산 결과를 출력하는 단계를 포함하고, 상기 모듈 연산을 수행하는 단계는, 기저 소수 정보를 저장하고, 상기 기저 소수 정보를 비트 반전 처리하여 상기 기저 소수 정보와 다른 제1 소수 정보를 생성하고, 상기 생성된 제1 소수 정보를 이용하여 상기 복수의 암호문에 대한 모듈 연산을 수행할 수 있다.
이 경우, 상기 기저 소수 정보 및 상기 제1 소수 정보는 서로 다른 지수로 구성된 3개, 4개 또는 5개의 2의 지수승들의 감가산 값일 수 있다.
한편, 상기 모듈 연산을 수행하는 단계는 상기 기저 소수 정보의 k번째 비트를 log h번째 비트 정수로 비트값 전환하여 제1 소수 정보를 생성할 수 있다.
한편, 상기 모듈 연산을 수행하는 단계는 상기 기저 소수 정보를 이용하여 제1 사이클에 필요한 제1 소수 정보를 생성하고, 상기 생성된 제1 소수 정보와 상기 기저 소수 정보를 이용하여 제2 사이클에 필요한 제2 소수 정보를 생성할 수 있다.
이상과 같은 본 개시의 다양한 실시 예들에 따르면, 본 개시의 암호문 연산 방법은 2의 지수승들의 조합으로 표현되는 소수 정보를 이용하여 모듈러스 연산을 수행하는바 빠른 연산을 수행할 수 있다. 또한, 연산에 필요한 모든 소수 정보를 저장하여 이용하지 않고, 기저 소수 정보만 저장하고 사이클마다 모듈러스 연산에 필요한 소수 정보(또는 제곱근 정보)를 생성하여 이용하는바, 적은 내부 메모리를 갖는 하드웨어에서 모듈러스 연산을 고속으로 수행할 수 있다.
도 1은 본 개시의 일 실시 예에 따른 네트워크 시스템의 구조를 설명하기 위한 도면,
도 2는 본 개시의 일 실시 예에 따른 연산 장치의 구성을 나타낸 블럭도,
도 3은 본 개시의 일 실시 예에 따른 암호문 연산 방법을 설명하기 위한 흐름도,
도 4는 본 개시의 제1 실시 예에 따른 INTT 알고리즘을 설명하기 위한 도면,
도 5는 본 개시의 일 실시 예에 따른 제1 소수 세트의 예를 도시한 도면,
도 6은 본 개시의 일 실시 예에 따른 제2 소수 세트의 예를 도시한 도면,
도 7은 본 개시의 제2 실시 예에 따른 INTT 알고리즘을 설명하기 위한 도면,
도 8은 본 개시의 제1 실시 예에 따른 BU의 구성을 도시한 도면,
도 9는 도 8의 BU의 동작 타이밍을 설명하기 위한 도면,
도 10은 도 7의 알고리즘으로 BU를 동작하는 경우의 동작 타이밍을 설명하기 위한 도면,
도 11은 복수의 BU를 병렬화한 경우의 동작 타이밍을 설명하기 위한 도면,
도 12는 본 개시의 일 실시 예에 따른 GBU의 구성을 도시한 도면,
도 13은 표 1의 SET B로 INTT를 설계한 경우의 동작 타이밍을 설명하기 위한 도면,
도 14는 본 개시의 일 실시 예에 따른 RB의 구성을 도시한 도면,
도 15는 본 개시의 일 실시 예에 따른 소수 생성기의 구성을 도시한 도면,
도 16은 본 개시의 일 실시 예에 따른 내부 메모리에 저장되는 데이터 예를 설명하기 위한 도면, 그리고,
도 17은 본 개시의 일 실시 예에 따른 프로세서 구조를 설명하기 위한 도면이다.
-
이하에서는 첨부 도면을 참조하여 본 개시에 대해서 자세하게 설명한다. 본 개시에서 수행되는 정보(데이터) 전송 과정은 필요에 따라서 암호화/복호화가 적용될 수 있으며, 본 개시 및 특허청구범위에서 정보(데이터) 전송 과정을 설명하는 표현은 별도로 언급되지 않더라도 모두 암호화/복호화하는 경우도 포함하는 것으로 해석되어야 한다. 본 개시에서 "A로부터 B로 전송(전달)" 또는 "A가 B로부터 수신"과 같은 형태의 표현은 중간에 다른 매개체가 포함되어 전송(전달) 또는 수신되는 것도 포함하며, 반드시 A로부터 B까지 직접 전송(전달) 또는 수신되는 것만을 표현하는 것은 아니다.
본 개시의 설명에 있어서 각 단계의 순서는 선행 단계가 논리적 및 시간적으로 반드시 후행 단계에 앞서서 수행되어야 하는 경우가 아니라면 각 단계의 순서는 비제한적으로 이해되어야 한다. 즉, 위와 같은 예외적인 경우를 제외하고는 후행 단계로 설명된 과정이 선행단계로 설명된 과정보다 앞서서 수행되더라도 개시의 본질에는 영향이 없으며 권리범위 역시 단계의 순서에 관계없이 정의되어야 한다. 그리고 본 명세서에서 "A 또는 B"라고 기재한 것은 A와 B 중 어느 하나를 선택적으로 가리키는 것뿐만 아니라 A와 B 모두를 포함하는 것도 의미하는 것으로 정의된다. 또한, 본 개시에서 "포함"이라는 용어는 포함하는 것으로 나열된 요소 이외에 추가로 다른 구성요소를 더 포함하는 것도 포괄하는 의미를 가진다.
본 개시에서는 본 개시의 설명에 필요한 필수적인 구성요소만을 설명하며, 본 개시의 본질과 관계가 없는 구성요소는 언급하지 아니한다. 그리고 언급되는 구성요소만을 포함하는 배타적인 의미로 해석되어서는 안 되며 다른 구성요소도 포함할 수 있는 비배타적인 의미로 해석되어야 한다.
그리고 본 개시에서 "값"이라 함은 스칼라값뿐만 아니라 벡터, 다항식 형태도 포함하는 개념으로 정의된다.
후술하는 본 개시의 각 단계의 수학적 연산 및 산출은 해당 연산 또는 산출을 하기 위해 공지되어 있는 코딩 방법 및/또는 본 개시에 적합하게 고안된 코딩에 의해서 컴퓨터 연산으로 구현될 수 있다.
이하에서 설명하는 구체적인 수학식은 가능한 여러 대안 중에서 예시적으로 설명되는 것이며, 본 개시의 권리 범위가 본 개시에 언급된 수학식에 제한되는 것으로 해석되어서는 아니된다.
설명의 편의를 위해서, 본 개시에서는 다음과 같이 표기를 정하기로 한다.
a ← D : 분포(D)에 따라서 원소(a)를 선택함
s 1, s 2 ∈ R : S1, S2 각각은 R 집합에 속하는 원소이다.
mod(q) : q 원소로 모듈(modular) 연산
Figure PCTKR2021003088-appb-img-000001
: 내부 값을 반올림함
이하에서는 첨부된 도면을 이용하여 본 개시의 다양한 실시 예들에 대하여 구체적으로 설명한다.
도 1은 본 개시의 일 실시 예에 따른 네트워크 시스템의 구조를 설명하기 위한 도면이다.
도 1을 참조하면, 네트워크 시스템은 복수의 전자 장치(100-1 ~ 100-n), 제1 서버 장치(200), 제2 서버 장치(300)를 포함할 수 있으며, 각 구성들은 네트워크(10)를 통해 서로 연결될 수 있다.
네트워크(10)는 다양한 형태의 유무선 통신 네트워크, 방송 통신 네트워크, 광통신 네트워크, 클라우드 네트워크 등으로 구현될 수 있으며, 각 장치들은 별도의 매개체 없이 와이파이, 블루투스, NFC(Near Field Communication) 등과 같은 방식으로 연결될 수도 있다.
도 1에서는 전자 장치가 복수개(100-1 ~ 100-n)인 것으로 도시하였으나, 반드시 복수개의 전자 장치가 사용되어야 하는 것은 아니며 하나의 장치가 사용될 수도 있다. 일 예로, 전자 장치(100-1 ~ 100-n)는 스마트폰, 태블릿, 게임 플레이어, PC, 랩톱 PC, 홈서버, 키오스크 등과 같은 다양한 형태의 장치로 구현될 수 있으며, 이밖에 IoT 기능이 적용된 가전 제품 형태로도 구현될 수 있다.
사용자는 자신이 사용하는 전자 장치(100-1 ~ 100-n)를 통해서 다양한 정보를 입력할 수 있다. 입력된 정보는 전자 장치(100-1 ~ 100-n) 자체에 저장될 수도 있지만, 저장 용량 및 보안 등을 이유로 외부 장치로 전송되어 저장될 수도 있다. 도 1에서 제1 서버 장치(200)는 이러한 정보들을 저장하는 역할을 수행하고, 제2 서버 장치(300)는 제1 서버 장치(200)에 저장된 정보의 일부 또는 전부를 이용하는 역할을 수행할 수 있다.
각 전자 장치(100-1 ~ 100-n)는 입력된 정보를 동형 암호화하여, 동형 암호문을 제1 서버 장치(200)로 전송할 수 있다.
각 전자 장치(100-1 ~ 100-n)는 동형 암호화를 수행하는 과정에서 산출되는 암호화 노이즈, 즉, 에러를 암호문에 포함시킬 수 있다. 예를 들어, 각 전자 장치(100-1 ~ 100-n)에서 생성하는 동형 암호문은, 추후에 비밀 키를 이용하여 복호화하였을 때 메시지 및 에러 값을 포함하는 결과 값이 복원되는 형태로 생성될 수 있다.
일 예로, 전자 장치(100-1 ~ 100-n)에서 생성하는 동형 암호문은 비밀 키를 이용하여 복호화 하였을 때 다음과 같은 성질을 만족하는 형태로 생성될 수 있다.
[수학식 1]
Dec(ct, sk) = <ct, sk> = M+e(mod q)
여기서 < , >는 내적 연산(usual inner product), ct는 암호문, sk는 비밀 키, M은 평문 메시지, e는 암호화 에러 값, mod q는 암호문의 모듈러스(Modulus)를 의미한다. q는 스케일링 팩터(scaling factor)(Δ)가 메시지에 곱해진 결과 값 M보다 크게 선택되어야 한다. 에러 값 e의 절대값이 M에 비해서 충분히 작다면, 암호문의 복호화 값 M+e 는 유효숫자연산에서 원래의 메시지를 동일한 정밀도로 대체할 수 있는 값이다. 복호화된 데이터 중에서 에러는 최하위 비트(LSB) 측에 배치되고, M은 차하위 비트 측에 배치될 수 있다.
메시지의 크기가 너무 작거나 너무 큰 경우, 스케일링 팩터를 이용하여 그 크기를 조절할 수도 있다. 스케일링 팩터를 사용하게 되면, 정수 형태의 메시지뿐만 아니라 실수 형태의 메시지까지도 암호화할 수 있게 되므로, 활용성이 크게 증대할 수 있다. 또한, 스케일링 팩터를 이용하여 메시지의 크기를 조절함으로써, 연산이 이루어지고 난 이후의 암호문에서 메시지들이 존재하는 영역, 즉, 유효 영역의 크기도 조절될 수 있다.
실시 예에 따라, 암호문 모듈러스 q는 다양한 형태로 설정되어 사용될 수 있다. 일 예로, 암호문의 모듈러스는 스케일링 팩터 Δ의 지수승 q=Δ L 형태로 설정될 수 있다. Δ가 2라면, q=2 10 과 같은 값으로 설정될 수 있다. 또는, q는 도 8에 도시된 바와 같이 일정 조건을 만족하는 2의 지수승의 조합으로 표현될 수 있다.
또 다른 예로, 암호문 모듈러스는 복수의 서로 다른 스케일링 팩터들을 곱한 값으로 설정될 수도 있다. 각 팩터들은 유사 범위 이내의 값, 즉, 서로 비슷한 크기의 값으로 설정될 수 있다. 예를 들어, q=q 1 q 2 q 3…q x로 설정될 수 있으며, q 1, q 2, q 3 ,…, q x 각각은 스케일링 인수 Δ와 비슷한 크기이며 서로 소 관계의 값으로 설정될 수 있다.
스케일링 팩터를 이와 같은 방식으로 설정하게 되면, CRT(Chinese Remainder Theorem)에 따라 전체 연산을 복수개의 모듈러스 연산으로 분리하여 진행할 수 있게 되므로, 연산 부담을 경감시킬 수 있다.
또한, 서로 비슷한 크기의 팩터를 사용함에 따라, 후술하는 단계에서 라운딩 처리를 수행하였을 때, 앞선 예에서의 결과값과 거의 같은 결과를 얻을 수 있다.
제1 서버 장치(200)는 수신된 동형 암호문을 복호화하지 않고, 암호문 상태로 저장할 수 있다.
제2 서버 장치(300)는 동형 암호문에 대한 특정 처리 결과를 제1 서버 장치(200)로 요청할 수 있다. 제1 서버 장치(200)는 제2 서버 장치(300)의 요청에 따라 특정 연산을 수행한 후, 그 결과를 제2 서버 장치(300)로 전송할 수 있다.
일 예로, 두 개의 전자 장치(100-1, 100-2)가 전송한 암호문 ct 1, ct 2가 제1 서버 장치(200)에 저장된 경우, 제2 서버 장치(300)는 두 전자 장치(100-1, 100-2)로부터 제공된 정보들을 합산한 값을 제1 서버 장치(200)로 요청할 수 있다. 제1 서버 장치(200)는 요청에 따라 두 암호문을 합산하는 연산을 수행한 후, 그 결과 값(ct 1 + ct 2)을 제2 서버 장치(300)로 전송할 수 있다.
동형 암호문의 성질상, 제1 서버 장치(200)는 복호화를 하지 않은 상태에서 연산을 수행할 수 있고, 그 결과 값도 암호문 형태가 될 수 있다. 이때, 제1 서버 장치(200)는 연산 결과에 대한 부트 스트래핑을 수행할 수 있으며, 그 과정에서 후술하는 바와 같은 알고리즘을 적용하여 빠른 고속 부트 스트래핑을 수행할 수 있다. 본 개시에 따른 고속 부트 스트래핑 방법에 대해서는 도 4를 참조하여 후술한다.
제1 서버 장치(200)는 연산 결과 암호문을 제2 서버 장치(300)로 전송할 수 있다. 제2 서버 장치(300)는 수신된 연산 결과 암호문을 복호화하여, 각 동형 암호문들에 포함된 데이터들의 연산 결과값을 획득할 수 있다. 그리고 제1 서버 장치(200)는 사용자 요청에 따라 연산을 수차례 수행할 수 있다.
한편, 도 1에서는 제1 전자 장치 및 제2 전자 장치에서 암호화를 수행하고, 제2 서버 장치가 복호화를 수행하는 경우를 도시하였으나, 이에 한정되는 것은 아니다.
도 2는 본 개시의 일 실시 예에 따른 연산 장치의 구성을 나타낸 블럭도이다.
예를 들어, 도 1의 시스템에서 제1 전자 장치, 제2 전자 장치 등과 같이 동형 암호화를 수행하는 장치, 제1 서버 장치 등과 같이 동형 암호문을 연산하는 장치, 제2 서버 장치 등과 같이 동형 암호문을 복호하는 장치 등을 연산 장치라고 지칭할 수 있다. 이러한 연산 장치는 PC(Personal computer), 노트북, 스마트폰, 태블릿, 서버 등 다양한 장치일 수 있다.
도 2를 참조하면, 연산 장치(400)는 통신 장치(410), 메모리(420), 디스플레이(430), 조작 입력 장치(440) 및 프로세서(450)를 포함할 수 있다.
통신 장치(410)는 연산 장치(400)를 외부 장치(미도시)와 연결하기 위해 형성되고, 근거리 통신망(LAN: Local Area Network) 및 인터넷망을 통해 외부 장치에 접속되는 형태뿐만 아니라, USB(Universal Serial Bus) 포트 또는 무선 통신(예를 들어, WiFi 802.11a/b/g/n, NFC, Bluetooth) 포트를 통하여 접속되는 형태도 가능하다. 이러한 통신 장치(410)는 송수신부(transceiver)로 지칭될 수도 있다.
통신 장치(410)는 공개 키를 외부 장치로부터 수신할 수 있으며, 연산 장치(400) 자체적으로 생성한 공개 키를 외부 장치로 전송할 수 있다.
그리고 통신 장치(410)는 외부 장치로부터 메시지를 수신할 수 있으며, 생성한 동형 암호문을 외부 장치로 송신할 수 있다.
또한, 통신 장치(410)는 암호문 생성에 필요한 각종 파라미터를 외부 장치로부터 수신할 수 있다. 한편, 구현시에 각종 파라미터는 후술하는 조작 입력 장치(440)를 통하여 사용자로부터 직접 입력받을 수 있다.
또한, 통신 장치(410)는 외부 장치로부터 동형 암호문에 대한 연산을 요청받을 수 있으며, 그에 따라 계산된 결과를 외부 장치에 전송할 수 있다. 여기서 요청받은 연산은 덧셈, 뺄셈, 곱셈(예를 들어, 모듈러 곱셈 연산)과 같은 연산일 수 있다. 여기서 모듈러 곱셈 연산이란 q 원소로 모듈(modular) 연산하는 것을 의미한다. 그리고 q 원소는 도 5 또는 도 6에 도시된 바와 같은 2의 지수승들의 조합으로 표현되는 값이 이용될 수 있다.
메모리(420)에는 연산 장치(400)에 관한 적어도 하나의 인스트럭션(instruction)이 저장될 수 있다. 예를 들어, 메모리(420)에는 본 개시의 다양한 실시 예에 따라 연산 장치(400)가 동작하기 위한 각종 프로그램(또는 소프트웨어)이 저장될 수 있다.
이러한 메모리(420)는 RAM 이나 ROM, Buffer, 캐쉬(Cache), 플래시 메모리, HDD, 외장 메모리, 메모리 카드 등과 같은 다양한 형태로 구현될 수 있으며, 어느 하나로 한정되는 것은 아니다.
메모리(420)는 암호화할 메시지를 저장할 수 있다. 여기서 메시지는 사용자가 각종 인용한 각종 신용 정보, 개인 정보 등일 수 있으며, 연산 장치(400)에서 사용되는 위치 정보, 인터넷 사용 시간 정보 등 사용 이력 등과 관련된 정보일 수도 있다.
그리고 메모리(420)는 공개 키를 저장할 수 있으며, 연산 장치(400)가 직접 공개 키를 생성한 경우, 비밀 키뿐만 아니라, 공개 키 및 비밀 키 생성에 필요한 각종 파라미터를 저장할 수 있다.
그리고 메모리(420)는 복수의 소수 정보를 저장할 수 있다. 여기서 복수의 소수 정보 각각은 2의 지수승들의 조합으로 표현될 수 있다. 구체적으로, 메모리(420)에 저장되는 소수 정보는 후술하는 바와 같은 다른 소수 정보를 생성하는데 이용될 수 있는 기저 소수 정보일 수 있다. 또한, 메모리(420)는 소수 정보와 함께 해당 소수 정보에 대응되는 역수 정보도 저장할 수 있다.
그리고 메모리(420)는 후술한 과정에서 생성된 동형 암호문을 저장할 수 있다. 그리고 메모리(420)는 외부 장치에서 전송한 동형 암호문을 저장할 수도 있다. 또한, 메모리(420)는 후술하는 연산 과정에서의 결과물인 연산 결과 암호문을 저장할 수도 있다.
디스플레이(430)는 연산 장치(400)가 지원하는 기능을 선택받기 위한 사용자 인터페이스 창을 표시한다. 예를 들어, 디스플레이(430)는 연산 장치(400)가 제공하는 각종 기능을 선택받기 위한 사용자 인터페이스 창을 표시할 수 있다. 이러한 디스플레이(430)는 LCD(liquid crystal display), OLED(Organic Light Emitting Diodes) 등과 같은 모니터일 수 있으며, 후술할 조작 입력 장치(440)의 기능을 동시에 수행할 수 있는 터치 스크린으로 구현될 수도 있다.
디스플레이(430)는 비밀 키 및 공개 키 생성에 필요한 파라미터의 입력을 요청하는 메시지를 표시할 수 있다. 그리고 디스플레이(430)는 암호화 대상이 메시지를 선택하는 메시지를 표시할 수 있다. 한편, 구현시에 암호화 대상은 사용자가 직접 선택할 수도 있고, 자동으로 선택될 수 있다. 즉, 암호화가 필요한 개인 정보 등은 사용자가 직접 메시지를 선택하지 않더라도 자동으로 설정될 수 있다.
조작 입력 장치(440)는 사용자로부터 연산 장치(400)의 기능 선택 및 해당 기능에 대한 제어 명령을 입력받을 수 있다. 예를 들어, 조작 입력 장치(440)는 사용자로부터 비밀 키 및 공개 키 생성에 필요한 파라미터를 입력받을 수 있다. 또한, 조작 입력 장치(440)는 사용자로부터 암호화될 메시지를 설정받을 수 있다.
프로세서(450)는 연산 장치(400)의 전반적인 동작을 제어한다. 예를 들어, 프로세서(450)는 메모리(420)에 저장된 적어도 하나의 인스트럭션을 실행함으로써 연산 장치(400)의 동작을 전반적으로 제어할 수 있다. 이러한 프로세서(450)는 CPU(central processing unit), ASIC(application-specific integrated circuit)과 같은 단일 장치로 구성될 수 있으며, CPU, GPU(Graphics Processing Unit) 등의 복수의 구성으로 구성될 수도 있다.
프로세서(450)는 전송하고자 하는 메시지가 입력되면 메모리(420)에 저장할 수 있다. 그리고 프로세서(450)는 메모리(420)에 저장된 각종 설정 값 및 프로그램을 이용하여, 메시지를 동형 암호화할 수 있다. 이 경우, 공개 키가 사용될 수 있다.
프로세서(450)는 암호화를 수행하는데 필요한 공개 키를 자체적으로 생성하여 사용할 수도 있고, 외부 장치로부터 수신하여 사용할 수도 있다. 일 예로, 복호화를 수행하는 제2 서버 장치(300)가 공개 키를 다른 장치들에게 배포할 수 있다.
자체적으로 키를 생성하는 경우, 프로세서(450)는 Ring-LWE 기법을 이용하여 공개 키를 생성할 수 있다. 예를 들면, 프로세서(450)는 먼저 각종 파라미터 및 링을 설정하여, 메모리(420)에 저장할 수 있다. 파라미터의 예로는 평문 메시지 비트의 길이, 공개 키 및 비밀 키의 크기 등이 있을 수 있다. 본 개시에 이용하는 각종 파라미터의 예 및 그 값들에 대해서는 도 4에서 자세히 설명한다.
링은 다음과 같은 수학식 2로 표현될 수 있다.
[수학식 2]
Figure PCTKR2021003088-appb-img-000002
여기서 R은 링, Zq는 계수, f(x)는 n차 다항식이다.
링(Ring)이란 기설정된 계수를 가지는 다항식의 집합으로, 원소들 사이에 덧셈과 곱셈이 정의되어 있으며 덧셈과 곱셈에 대해서 닫혀 있는 집합을 의미한다. 이러한 링은 환으로 지칭될 수 있다.
일 예로, 링은 계수가 Zq인 n차 다항식의 집합을 의미한다. 예를 들어, n이 Φ(N)일 때, N차 사이클로토믹 다항식 (N-th cyclotomic polynomial)을 의미할 수 있다. (f(x))란 f(x)로 생성되는 Zq[x]의 이데알(ideal)을 나타낸다. Euler totient 함수 Φ(N)이란 N과 서로 소이고 N보다 작은 자연수의 개수를 의미한다. Φ N(x)를 N차 사이클로토믹 다항식으로 정의하면, 링은 다음과 같은 수학식 3으로도 표현될 수 있다. 여기서 N은 2 17이 이용될 수 있다.
[수학식 3]
Figure PCTKR2021003088-appb-img-000003
비밀 키(sk)는 다음과 같이 표현될 수 있다.
한편, 상술한 수학식 3의 링은 평문 공간에서 복소수를 갖는다. 한편, 동형 암호문에 대한 연산 속도를 향상하기 위하여, 상술한 링의 집합 중 평문 공간이 실수인 집합만을 이용할 수도 있다.
이와 같은 링이 설정되면, 프로세서(450)는 링으로부터 비밀 키(sk)를 산출할 수 있다.
[수학식 4]
sk ← (1, s(x)), s(x) ∈ R
여기서, s(x)는 작은 계수로 랜덤하게 생성한 다항식을 의미한다.
그리고 프로세서(450)는 링으로부터 제1 랜덤 다항식(a(x))을 산출할 수 있다. 제1 랜덤 다항식은 다음과 같이 표현될 수 있다.
[수학식 5]
a(x) ← R
또한, 프로세서(450)는 에러를 산출할 수 있다. 예를 들어, 프로세서(450)는 이산 가우시안 분포 또는 그와 통계적 거리가 가까운 분포로부터 에러를 추출할 수 있다. 이러한 에러는 다음과 같이 표현될 수 있다.
[수학식 6]
e(x) ←D n αq
에러까지 산출되면, 프로세서(450)는 제1 랜덤 다항식 및 비밀 키에 에러를 모듈러 연산하여 제2 랜덤 다항식을 산출할 수 있다. 제2 랜덤 다항식은 다음과 같이 표현될 수 있다.
[수학식 7]
b(x) = -a(x)s(x) + e(x)(mod q)
최종적으로 공개 키(pk)는 제1 랜덤 다항식 및 제2 랜덤 다항식을 포함하는 형태로 다음과 같이 설정된다. 한편, 연산 장치(400)가 RNS(Residue Number System) HEAAN(Homomorphic Encryption for Approximate Number)(또는 HEaaN TM)을 지원하는 경우, 프로세서(450)는 서로 소인 복수의 정수 각각에 대응되는 복수의 공개키를 생성할 수 있다.
여기서, RNS-HEAAN은 기존의 HEAAN 방식이 중국인의 나머지 정리와 같은 방법이 적용 불가했던 문제를 해결하기 위해 기존의 암호문 공간인 R qi(q ii))을 R qi(q i=Πp ii), pi
Figure PCTKR2021003088-appb-img-000004
Δ) 으로 대체하여 사용하는 방식으로, 이에 따라 에러 비트사이즈가 5~10 정도 큰 근사계산 결과를 갖게 되지만, 연산 속도에서 3~10배의 성능 개선이 있을 수 있다. RNS-HEAAN을 이용한 구체적인 암호문 연산은 도 4와 관련하여 후술한다.
[수학식 8]
pk = (b(x), a(x))
상술한 키 생성 방법은 일 예에 불과하므로, 반드시 이에 한정되는 것은 아니며, 이 밖에 다른 방법으로 공개 키 및 비밀 키를 생성할 수도 있음은 물론이다.
한편, 프로세서(450)는 공개 키가 생성되면, 다른 장치들에 전송되도록 통신 장치(410)를 제어할 수 있다.
그리고 프로세서(450)는 메시지에 대한 동형 암호문을 생성할 수 있다. 예를 들어, 프로세서(450)는 메시지에 대해서 앞서 생성된 공개 키를 적용하여 동형 암호문을 생성할 수 있다. 이때, 프로세서(450)는 동형 암호문 생성 과정에서, 도 5 또는 도 6에 도시된 바와 같은 소수 정보를 이용하여 암호화 동작을 수행할 수 있다.
복호화할 메시지는 외부 소스로부터 수신할 수도 있고, 연산 장치(400)에 직접 구비 또는 연결된 입력 장치로부터 입력될 수도 있다. 예를 들어, 연산 장치(400)가 터치 스크린이나 키 패드를 포함하는 경우, 프로세서(450)는 사용자가 터치 스크린이나 키 패드를 통해 입력하는 데이터를 메모리(420)에 저장한 후, 암호화할 수 있다. 생성된 동형 암호문은 복호화하였을 때 메시지에 스케일링 팩터를 반영한 값에 에러를 더한 결과값으로 복원되는 형태가 될 수 있다. 스케일링 팩터는 사전에 입력되어 설정된 값을 그대로 사용할 수도 있다.
한편, 연산 장치(400)가 RNS-HEAAN을 지원하는 경우, 프로세서(450)는 메시지에 서로 소인 복수의 정수 각각에 대응되는 복수의 공개키를 이용하여 복수의 기저(basis)로 표현되는 동형 암호문을 생성할 수 있다.
또는, 프로세서(450)는 메시지 및 스케일링 팩터를 승산한 상태에서 바로 공개 키를 이용하여 암호화할 수도 있다. 이 경우, 암호화 과정에서 산출되는 에러가 메시지 및 스케일링 팩터를 승산한 결과값에 가산될 수 있다.
또한, 프로세서(450)는 암호문의 길이를 스케일링 팩터의 크기에 대응되도록 생성할 수 있다.
그리고 프로세서(450)는 동형 암호문이 생성되면 메모리(420)에 저장하거나, 사용자 요청 또는 기설정된 디폴트 명령에 따라 동형 암호문을 다른 장치에 전송하도록 통신 장치(410)를 제어할 수 있다.
한편, 본 개시의 일 실시 예에 따르면, 패킹(packing)이 이루어질 수도 있다. 동형 암호화에서 패킹을 이용하게 되면, 다수의 메시지를 하나의 암호문으로 암호화하는 것이 가능해진다. 이 경우, 연산 장치(400)에서 각 암호문들 간의 연산을 수행하게 되면, 결과적으로 다수의 메시지에 대해 연산이 병렬적으로 처리되므로 연산 부담이 크게 줄어들게 된다.
예를 들어, 프로세서(450)는 메시지가 복수의 메시지 벡터로 이루어지는 경우, 복수의 메시지 벡터를 병렬적으로 암호화할 수 있는 형태의 다항식으로 변환한 후, 그 다항식에 스케일링 팩터를 승산하고 공개 키를 이용하여 동형 암호화할 수도 있다. 이에 따라, 프로세서(450)는 복수의 메시지 벡터를 패킹한 암호문을 생성할 수 있다.
그리고 프로세서(450)는 동형 암호문에 대한 복호가 필요한 경우, 동형 암호문에 비밀 키를 적용하여 다항식 형태의 복호문을 생성하고, 다항식 형태의 복호문을 디코딩하여 메시지를 생성할 수 있다. 이때 생성한 메시지는 앞서 설명한 수학식 1에서 언급한 바와 같이 에러를 포함할 수 있다.
그리고 프로세서(450)는 암호문에 대해 연산을 수행할 수 있다. 예를 들어, 프로세서(450)는 동형 암호문에 대해서 암호화된 상태를 유지한 상태에서 덧셈, 뺄셈, 또는 곱셈 등의 연산을 수행할 수 있다. 이때, 곱셈은 모듈러 연산일 수 있으며, 후술하는 방식으로 수행될 수 있다.
한편, 동형 암호문을 상술한 RNS 방식으로 생성한 경우, 프로세서(120)는 생성된 동형 암호문 내의 기저(basis)별도 덧셈 및 곱셈을 수행할 수 있다.
한편, 단말 장치(100)는 연산이 완료되면, 연산 결과 데이터로부터 유효 영역의 데이터를 검출할 수 있다. 예를 들어, 단말 장치(100)는 연산 결과 데이터를 라운딩 처리를 수행하여 유효 영역의 데이터를 검출할 수 있다.
여기서, 라운딩 처리란 암호화된 상태에서 메시지의 반올림(round-off)을 진행하는 것을 의미하며, 다르게는 리스케일링(rescaling)이라고 할 수도 있다. 예를 들어, 단말 장치(100)는 암호문 각각의 성분에 스케일링 인수의 역수인 Δ -1을 곱하고 반올림하여, 노이즈 영역을 제거할 수 있다. 노이즈 영역은 스케일링 팩터의 크기에 대응되도록 결정될 수 있다. 결과적으로 노이즈 영역이 제외된 유효 영역의 메시지를 검출할 수 있다. 암호화 상태에서 진행되므로 추가적인 에러가 발생하지만 크기는 충분히 작으므로 무시할 수 있다.
그리고 상술한 라운딩 처리는 상술한 바와 같은 모듈러 곱셈 연산이 이용될 수 있다.
만약, 단말 장치(100)가 RNS-HEAAN을 지원하는 경우, 프로세서(120)는 복수의 기저 중 어느 하나의 비중이 임계치를 초과하면, 생성된 동형 암호문 내의 복수의 기저 각각에 대한 메시지의 반올림 처리를 수행하여 동형 암호문을 리스케일링할 수 있다.
또한, 단말 장치(100)는 연산 결과 암호문 내의 근사 메시지 비중이 임계치를 초과하면, 연산 결과 암호문의 평문 공간을 확장할 수 있다. 예를 들어, 상술한 수학식 1에서 q가 M보다 작다면 M+e(mod q)는 M+e와 다른 값을 가지므로 복호화가 불가능해진다. 따라서, q 값은 항상 M보다 크게 유지되어야 한다. 하지만, 연산이 진행됨에 따라 q 값은 점차 감소하게 된다. 평문 공간의 확장이란 암호문 ct를 더 큰 모듈러스(modulus)를 가지는 암호문으로 변화시키는 것을 의미한다. 평문 공간을 확장하는 동작은 다르게는 재부팅(rebooting)이라 할 수도 있다. 재부팅을 수행함에 따라, 암호문은 다시 연산이 가능한 상태가 될 수 있다.
한편, Ring LWE 문제에 기반한 동형암호의 암호화, 복호화, 덧셈, 곱셈, 리스케일, 재부팅 등은 다항식 환
Figure PCTKR2021003088-appb-img-000005
의 원소들의 연산으로 구성될 수 있다.
상술한 연산 중 다항식 곱셈 연산은 암호화, 복호화, 다항식 곱셈, 재부팅 등에서 가장 시간이 많이 소요되는 연산과정이다. 특히 가장 자주 사용되는 Mult 알고리즘을 수행하는 동안에 대략 5번의 다항식의 곱셈 연산이 수행되므로, 해당 연산의 고속화 기법은 매우 중요하다.
도 3은 본 개시의 일 실시 예에 따른 암호문 연산 방법을 설명하기 위한 흐름도이다.
도 3을 참조하면, 복수의 암호문에 대한 모듈 연산 명령을 입력받을 수 있다(S310). 이러한 명령은 외부 장치로부터 입력될 수 있으며, 연산 장치에서 직접 입력될 수도 있다. 그리고 이러한 연산 명령은 메시지 암호화 또는 동형 암호문 연산을 위한 명령일 수 있다.
그리고 기결정된 복수의 소수 정보를 이용하여 복수의 암호문에 대한 모듈 연산을 수행할 수 있다(S320). 여기서 복수의 소수 정보 각각은 2의 지수승들의 조합으로 표현될 수 있다. 소수 정보의 예는 도 5 또는 6에 도시하였다. 한편, 모듈러 연산에 사용되는 소수 정보 모두를 메모리에 저장하는 경우에는 많은 메모리 리소스가 요구된다. 따라서, 일부 소수 정보만을 저장하고, 매 사이클마다 저장된 소수 정보와 앞서 이용한 소수 정보를 이용하여 다음 사이클에 필요한 소수 정보를 생성하여 이용할 수 있다. 이와 같은 소수 정보(또는 제곱근 정보)의 생성 동작에 대해서는 도 7에서 후술한다.
그리고 연산 결과를 출력할 수 있다(S330). 예를 들어, 연산을 요청한 장치에 연산 결과를 출력할 수 있다. 한편, 상술한 연산 명령이 메시지 암호화 등과 같은 전체 명령을 수행하는데 필요한 일부 명령인 경우, 연산 결과를 다른 연산자(또는 연산 프로그램)에 전달할 수 있다.
이상과 같이 본 개시에 따른 암호문 연산 방법은 2의 지수승들의 조합으로 표현되는 소수 정보를 이용하여 연산을 수행하는바, 빠른 연산을 수행할 수 있다. 또한, 구현 예에서 모든 소수 정보를 저장하여 이용하지 않고, 일부 소수 정보만 저장하고, 나머지 소수 정보는 매 사이클마다 기저장된 소수 정보를 이용하여 산출하여 이용하는바 낮은 메모리 리소스만을 이용하여 연산을 수행할 수 있다.
이하에서는 동형 암호문에 대한 제1 모듈 연산 방식을 설명한다.
제1 모듈 연산 방법(ModMult)은 아래의 수학식 9와 같이 숫자 A에서 [A/q]과 q의 곱셈연산 값을 빼는 것으로 나타낼 수 있다.
[수학식 9]
Figure PCTKR2021003088-appb-img-000006
여기서, A는 암호문(또는 다항식), q는 모듈러스(Modulus)를 위한 원소이다.
이와 같은 연산을 수행하기 위한, ModMult(또는 모듈러스 연산기)는 제1 승산기, 제2 승산기, 제3 승산기, 쉬프터, 감산기를 포함할 수 있다. 이러한 모듈러스 연산기는 도 2의 연산 장치일 수 있으며, FPGA(Field Programmable Gate Array) 내의 하나의 연산 모듈일 수도 있다. 이하에서는 설명을 용이하게 하기 위하여, 두 개의 암호문에 대한 모듈러스 곱셈 연산 동작을 설명하나, 구현시에 암호문이 아닌 다항식에 대한 모듈러스 곱셈 연산이 이용될 수 있다. 또한 상술한 수학식 9와 다른 수학식(동형 암호에 대한 곱셈을 포함하는 연산)에 대해서도 적용될 수 있다.
제1 승산기는 제1 암호문(A)(또는 제1 다항식) 및 제2 암호문(B)(또는 제2 다항식)을 제1 곱셈 연산할 수 있다. 여기서 제1 승산기는 n 비트의 제1 암호문(A)과 n 비트의 제2 암호문(B)을 이용하여 2n 비트의 크기를 갖는 곱셈 결과(V)를 출력하는 Full 승산기(Full-IntMult)일 수 있다.
제2 승산기는 복수의 소수 정보 중 하나의 소수 정보(q)에 대응되는 역수 정보(T)와 제1 곱셈 연산 결과(U)를 제2 곱셈 연산할 수 있다. 구체적으로, 제2 승산기(520, IntMult2)는 제1 승산기 출력의 상위 비트에 1/q로 스케일된 T를 곱하는 동작을 수행할 수 있다.
예를 들어, 제2 승산기의 출력 값의 상위 비트에만 후술하는 제3 승산기의 계수(q)가 적용되기 때문에, 제2 승산기는 n 비트의 두 암호문이 입력되어 n 비트의 크기를 갖는 곱셈 결과(W)를 출력하는 Upper Half(UH)-IntMult를 이용할 수 있다. 그리고 역수 정보는 소수 정보와 곱해서 1이 되는 수 즉, 소수의 반비례 값(1/q)이며, 해당 값은 룩업 테이블에 미리 저장되어 있을 수 있으며, 기저 소수 정보(또는 기저 제곱근 정보)를 통하여 산출하여 이용할 수도 있다.
제3 승산기는 제2 곱셈 연산 결과(W)와 하나의 소수 정보(q)를 이용하여 제3 곱셈 연산할 수 있다. 예를 들어, 제3 승산기의 출력 값 중 하위 비트만 쉬프터의 출력 비트와 연산되는바, 제3 승산기는 n 비트의 두 암호문이 입력되어 n 비트의 크기를 갖는 곱셈 결과(W)를 출력하는 Lower Half(LH)-IntMult로 구현될 수 있다.
그리고 쉬프터는 제1 승산기의 출력 값을 지연하여 감산기에 제공할 수 있다. 예를 들어, 쉬프터는 제1 승산기의 출력의 하위 비트를 지연시킬 수 있으며, 플리플롭(FF)으로 구현될 수 있다. 이에 따라 감산기는 쉬프터의 출력 값에 제3 승산기의 출력 값을 감산하고, 그 결과를 출력할 수 있다.
상술한 바와 같이 제2 승산기 및 제3 승산기 각각은 역수 정보(T)와 소수 정보(q)를 이용한 곱셈 연산을 수행할 수 있다.
한편, RNS-HEAAN 방식에서는 기본 모듈러스, 리스케일 모듈러스 및 모드업 모듈러스와 같은 세 가지 유형이 이용되는데, 다항식의 차수가 N-1인 경우, 1 mod 2N에 적합해야 하며, 소수(q) 및 해당 소수에 대응되는 역수(T)가 낮은 해밍 가중치를 갖는 소수는 도 5 또는 도 6에 도시된 바와 같이 서로 다른 지수로 구성된 3개, 4개, 5개의 2의 지수승들의 감가산 값으로 나타낼 수 있다.
이와 같이 본 개시에서 이용하는 소수는 2의 지수승들의 조합으로 표현되는바, 해당 소수 또는 해당 소수에 대한 역수 값에 대한 연산 과정에서는 시프트 연산 및 감가산 동작만으로 소수 곱셈을 수행할 수 있다.
즉, 상술한 제2 승산기 및 제3 승산기 각각은 복수의 2의 지수승 각각의 지수에 기초하여 개별적인 시프트 연산을 수행하고, 시프트 연산 결과들을 가산 연산 또는 감산 연산하여 상술한 제2 곱셈 연산 또는 제3 곱셈 연산을 수행할 수 있다.
이와 같이 복잡한 소수 곱셈 동작을 시프트 연산 및 가산/감산 연산만으로 수행할 수 있다는 점에서, 고속화 연산이 가능하다.
한편, 이상에서는 모듈러 곱셈 연산이 암호문을 입력받아 처리하는 것으로 도시하고 설명하였지만, 구현시에 모듈러 곱셈 연산의 입력은 다양한 값이 이용될 수 있다. 즉, 모듈러 곱셈 연산은 암호문 연산뿐만 아니라, 암호 과정에 필요한 값들을 산출하거나, 스케일링 또는 복호화 과정에서도 이용 가능한데 이러한 과정 중에 이용되는 값이라면 암호문이 아니어도 무방하다.
이하에서는 동형 암호문에 대한 제2 모듈 연산 방식을 설명한다.
제2 모듈 연산 방법(ModMult)의 알고리즘은 제1 모듈 연산 방법과 유사하나, 사전 계산 값을 이용한다는 점에서 차이가 있다. 구체적으로, '하나의 소수 정보에 대응되는 역수와 제2 암호문을 곱셈 연산한 사전 계산 값(B')'을 저장하여 이용할 수 있다. 이와 같은 사전 계산 값(B')은 B/q에 대한 근사 값으로, B' 값을 사용함으로써 A x B /q는 W에 근사될 수 있다.
한편, 제2 모듈 연산 방식에서는 연산에 필요한 값을 미리 사전에 계산하여 저장해 놓고, 연산시에 사전에 계산된 값을 이용하여 연산 속도를 향상할 수 있는 방법에 대해서 설명하였다. 그러나 이와 같은 방식은 연산 속도의 증가를 갖게 하지만, 많은 저장공간이 요구된다. 따라서, 이하에서는 연산 속도를 증가시키면서도 비교적 적은 저장 공간만을 이용하여 모듈러스 연산을 수행할 수 있는 방법에 대해서 설명한다. 먼저, 해당 알고리즘을 설명함에 있어서, 상술한 모듈러스 연산과 NTT 연산, INTT 연산 간의 관계에 대해서 설명한다.
이하에서는, w를 모듈러 소수 p에 대한 N th 제곱근 법(modulo)이라고 지칭한다. 이것은 w N
Figure PCTKR2021003088-appb-img-000007
1(mod N)를 만족하는 것을 의미한다. 프리미티브 N th 제곱근은 모든 N th 제곱근을 곱하여 생성하는 N th 제곱근이다. 정의하면, 프리미티브 N th 제곱근은 N 크기 백터를 DFT하는 것이 요구된다. p
Figure PCTKR2021003088-appb-img-000008
1(mod N) 갖는다면, p에 대한 N th 제곱근이 존재한다는 것이 알려져 있다.
동형 암호를 포함하는 래티스 기반 암호에서,
Figure PCTKR2021003088-appb-img-000009
(여기서 N은 거듭제곱, p는 소수) 링 상에서 작업을 수행한다. 링에서의 곱셈은 음 래핑 합성곱(negative wrapped convolutions)에 대응되는 반면 NTT-곱-INTT 패러다임은 링
Figure PCTKR2021003088-appb-img-000010
에서의 곱, 즉 일반적인 합성곱에 대응된다.
NTT 및 INTT 알고리즘을 조금 수정하면
Figure PCTKR2021003088-appb-img-000011
상의 곱으로 효율적으로 수행할 수 있다. 이 수정을 사용하려면 모듈러스 p가 p
Figure PCTKR2021003088-appb-img-000012
1(mod 2N)을 만족하여야 하나, 일반적인 NTT/INTT는 p
Figure PCTKR2021003088-appb-img-000013
1(mod N)이 요구된다. 따라서 본 개시에서는 효율성을 위해 수정된 프레임워크를 설명하여 이하에서는 이를 수정된 NTT/INTT 알고리즘이라고 지칭한다.
음 합성곱에 대한 효율적인 INTT는 알고리즘 4에 도시된다. 이와 같은 효율적인 INTT 동작에 대해서는 도 4를 참조하여 이하에서 설명한다.
도 4는 본 개시의 제1 실시 예에 따른 INTT 알고리즘을 설명하기 위한 도면이다. 도 4에서는 설명의 단순화를 위하여 리스케일 단계가 생략되었지만, 실제 구현시에는 리스케일 단계가 추가될 수 있다.
도 4를 참조하면, 입력으로써 비트반전(bit reversal) 차수 내의 고정된 프리미티브(2N) th 거듭제곱근(Ψ)의 음의 지수의 리스트(이를
Figure PCTKR2021003088-appb-img-000014
로 나타낸다)를 취할 수 있다. 보다 구체적으로,
Figure PCTKR2021003088-appb-img-000015
Figure PCTKR2021003088-appb-img-000016
를 포함하며, 여기서 j는 i의 비트 반전(bit reverse)이다.
일반적으로, NTT/INTT는 빌딩블록(building block)인 BUs를 이용하여 수행될 수 있다. 이하에서는 BU로 지칭하지만, 기능 블록, 빌딩블록 등으로 지칭될 수도 있다. 여기서 도 4의 기능 블록(Function ButterflyUnit)은 a[j], a[j+t], W, p이고, a[j]-a[j+t](mode p)와 (a[j]+a[j+t])·W(mod p)를 계산하고, 각각을 a[j], a[j+t]에 각각을 저장할 수 있다.
입력 샘플 수가 N일 때, NTT의 스테이지 수는 log N이고, 각 스테이지는
Figure PCTKR2021003088-appb-img-000017
의 BU로 구성될 수 있다. 따라서,요구되는 전체 BU의 개수는 B
Figure PCTKR2021003088-appb-img-000018
이다. 예를 들어, N이 8이고, 스테이지 수가 3이면, 12개의 BU가 필요하다. 여기서 샘플은 연산기(또는 BU)에 제공되는 입력 데이터를 지칭하며, 동형 암호문 또는 다항식 등이 될 수 있다.
이하에서는 RNS 동형 연산(이하에서는 RNS-HEAAN으로 지칭함) 동작을 설명한다.
RNS-HEAAN은 기존의 HEAAN 방식이 중국인의 나머지 정리와 같은 방법이 적용 불가했던 문제를 해결하기 위해 기존의 암호문 공간인 R qi(q ii))을 R qi(q i=Πp ii), pi
Figure PCTKR2021003088-appb-img-000019
Δ) 으로 대체하여 사용하는 방식이다. 이와 같은 RNS-HEAAN은 고정 소수점을 갖는 근사계산을 지원하기 때문에 동형 암호에 주요한 솔루션이다. 특히, RNS-HEAAN은 다항식의 큰 계수를 작은 계수로 분할하여 연산을 수행하는바 병렬 연산을 가능케 한다.
동형 곱셈(HomeMult)은 동형 연산에서 많이 사용되는 연산이나, 많은 시간이 소요되기 때문에 동형 암호 기반의 애플리케이션의 실제 사용에 있어서 가장 큰 장해 요소이다. 여기서 가장 큰 병목은 큰 차수의 다항식 링 곱셈을 NTT/INTT를 사용하더라도 여전히 느리다는 것이다.
이러한 현상은 RNS-HEAAN에서도 동일하나, RNS-HEAAN에서는 기존 상황과 구별되는 추가 기능을 가지고 있다. 기본적으로 효율적인 동형 연산을 위해 RNS-HEAAN에서 다항식의 입력 계수는 사전에 NTT 도메인으로 변환된다. 그러나 변환되지 않는 계수도 동형 곱이 요구된다.
이하에서는, 사이클로토믹 링(R 2 Q) 상에 두개의 암호문(ct 1 = (a 1, b 1 = a 1s +m 1+e 1), ct 2 =(a 2, b 2 = a 2s+m 2+e 2)를 곱한다고 가정한다. 여기서 s, m i, e i, Q 각각은 Xkey로부터의 샘플 다항식, 메시지, 에러, 큰 모듈러스(
Figure PCTKR2021003088-appb-img-000020
)이다.
비밀 키가 (-s, 1)로 설정되었을 때, 암호문의 곱은 아래의 수학식을 이용하여 계산될 수 있다.
[수학식 11]
<Ct mult, sk> = a 1a 2s 2 - (a 1b 2+b 2b 1)s +b 1b 2
여기서 <·, ·>는 두 벡터의 내적(dot product)을 나타낸다.
수학식 11의 첫 번째 항을 선형화하고, 큰 에러(a 1b 1e swk)를 1/P(=
Figure PCTKR2021003088-appb-img-000021
)로 스케일 다운하면, 사이클로토믹 링(R 2 PQ) 상의 스위칭 키(swk)는 아래의 수학식 12와 같이 정의할 수 있다.
[수학식 12]
Figure PCTKR2021003088-appb-img-000022
여기서 e swk는 스위칭 키가 복호화할 때 유발되는 에러로 지칭될 수 있다. 스위칭 키를 곱하기 위하여, a 1, a 2 R 2 Q 상의 도메인은 R 2 PQ 도메인으로 변환될 수 있다. 이러한 변환 프로세스는 기저 변환(basis conversion)으로 지칭될 수 있으며, NTT 도메인 상의 a 1a 2를 역변환하는 INTT를 필요로 한다. 이 변환 후에, NTT는 변환된 a 1a 2에 재적용된다.
(q i, p i)상의 부분 모듈(partial moduli)은 다음의 3 종류로 분류될 수 있다.
1. 기본 모듈러스(Base modulus)(q 0): 각 동형 곱을 수행할 때마다 q i의 수가 1식 줄어들고, 회로 깊이가 1씩 줄어들며, 이 모듈은 마지막 남은 모듈러스이다.
2. 리스케일 모듈러스(rescale modulus)(q 1, where 1 ≤i≤ l): 리스케일 모듈러의 수는 회로의 깊이를 나타낸다. 일반적으로 부트 스크랩을 최대한 자주 사용하지 않도록 이 숫자를 크게 만드는 것이 유리하다.
3. 모드업 모듈러스(p i, where 1 ≤i≤ k) : 동형 곱 동안 발생한 오류의 크기를 줄이는데 사용된다.
이하에서는 RNS-HEAAN의 부트 스트래핑을 위한 매개변수를 설명한다.
동형 암호 스킴은 에러를 사용하여 메시지를 암호화한다. 그러나 동형 암호문에 대한 연산이 수행될 때마다 내부의 에러는 증가하게 되며, 특히, 동형 곱을 수행할 때마다 내부의 에러는 급속히 커진다. 더욱이, 에러의 크기가 일정 수준을 초과하는 경우, 복호시 올바른 메시지를 얻을 수 없게 된다. 여기서 일정 수준(또는 임계 값)에 도달하기 전의 동형 곱의 수를 회로 깊이(circuit depth)라고 지칭한다.
에러 및 회로 깊이를 재설정하는 부트 스트래핑을 수행하면 동형 암호문은 동형 연산을 무제한으로 수행할 수 있게 된다. 그러나 부트 스트래핑은 매우 느린 속도로 수행되기 때문에, 실용적인 연산은 아니다. 따라서, 부트 스트래핑의 속도를 증가시킬 필요가 있으며, 다음과 같은 두 방식으로 속도 향상하는 방법을 고려할 수 있다. 첫째는 부트 스트래핑의 처리 속도를 가속하는 방법과 둘째는 부트 스트래핑 간의 간격(예를 들어, 회로 깊이)을 증가시키는 방법이다. 이하에서는 두 번째 방법에 대해서 먼저, 설명한다.
일반적인 부트 스트래핑은 15-20의 회로 깊이를 소모한다. 부트 스트래핑이 수행되면 초기 깊이에서 부트 스트래핑에 필요한 회로 깊이가 빠지게 된다. 실용적인 설계를 위하여 부트 스트래핑 이후의 회로 깊이가 20-25가 되도록, 초기 회로 깊이는 대략 40으로 설정되어야 한다. 이하에서는 이러한 초기 회로 깊이를 갖기 위한 본 개시의 파라미터를 표 1를 참조하여 설명한다.
λ dnum N l+1 k logQ logP logPQ logq 0 logq i logp i
RNS-HEAAN 1 73 1 2 15 11 12 611 660 1271 62 55 55
RNS-HEAAN2 108 4 2 16 24 6 1090 273 1363 62 45 -
RNS-HEAAN 3 105 7 2 16 28 - 1270 182 1452 62 45 -
HEAX set-A 128.1 - 2 12 2 - - - 109 - - -
HEAX set-B 128.5 - 2 13 4 - - - 218 - - -
HEAX set-C 128.1 - 2 14 8 - - - 438 - - -
Our SET-A 129.8 2 2 17 36 16 1882 992 2874 62 52 62
our SET-B 127.3 3 2 17 42 12 2194 744 2938 62 52 62
표 1을 참조하면, 기존의 기술은 대략 80의 보안 파라미터(λ)가 널리 사용되고 있음을 확인할 수 있다. 그러나 개인 데이터에 대한 관련 연구가 다양해 지고 있다는 점에서, 보안 파라미터는 128까지 증가할 필요가 있다. 구체적으로, 표 1을 참조하면, 기존의 RNS-HEAAN 스킴에서의 보안 파라미터는 128 보안을 만족하지 않음을 확인할 수 있다. 기존의 HEAX 스킴은 128 보안을 만족하나 해당 스킴은 부트 스트래핑을 고려하지 않기 때문에 동형 곱을 8회만 허용한다.한편, 본 개시의 파라미터 중 기존과 가장 차이가 있는 파라미터는 평가 키의 수와 dnum이다. 두 번째 행을 참조하면, logP의 크기와 logQ의 크기가 유사하게 설정됨을 확인할 수 있다. 그러나 초기 회로 깊이를 대략 40으로 증가시키기 위해서는 logQ는 커져야 하나, 보안을 위해 logPQ의 크기에 제한이 있다. 이 점을 해결하기 위하여, dnum을 증가시켜 암호문을 분해할 수 있다. 그 결과 logQ는 LogP×dnum으로 설정된다. 즉, dnum이 증가하면 평가키를 저장할 메모리 크기가 증가하게 되므로, 내부 메모리에 평가 키를 저장할 수 없게 된다. 또한, NTT는 dnum 배수만큼 수행되어야 하여, 큰 지연을 유발하게 된다. 따라서, 본 개시에서는 초기 회로 깊이의 증가와 평가키의 증가를 최적화할 수 있는 dnum 값을 2 또는 3으로 선택하여 사용하였다.
또한, 본 개시에서는 복호화할 때 메시지의 정밀도를 보존하기 위하여, 기준 모듈러스(log q 0)를 62로 설정하였으며, 리스케일 모듈러스(log qi)는 다음의 두 가지 기준을 충족시키기 위하여 52로 설정하였다. 첫 번째 기준은 RNS-HEAAN의 근사 계산을 수행할 수 있을 만큼 충분히 크고, 두 번째 기준은 많은 경량 소수를 충분히 찾을 수 있을 정도의 조건이다. 이러한 소수를 사용함으로써, 동형 곱을 비트 시프트와 덧셈으로 치환함으로써 모드곱(modMult)의 속도를 증가시킬 수 있다.
모드업 모듈러스(log p i)의 크기를 결정할 때, 작은 한계가 있다. 그러나 모드업 모듈러스의 곱은 특정값보다 커야 한다는 점이다. 즉, 각 모드업 모듈러스는 작아야 하며, 모드업 모듈러스의 수는 증가되어야 한다. 그리고 기본 모듈러스를 위한 62-bit 모듈러 연산자를 이미 보유하기 때문에, 모드업 모듈러스의 크기는 62로 선택 사용하였다.
기본/리스케일 모듈러스 및 모드업 모듈러스에 사용되는 소수 정보는 도 5 및 도 6에 도시하였다.
도 5는 본 개시의 일 실시 예에 따른 제1 소수 세트의 예를 도시한 도면이다.
도 5를 참조하면, 42개의 소수가 표시되며, 42개의 소수 각각은 최대 61 지수승 내에서 2의 지수승들의 조합으로 표현된다. 여기서 첫 번째 소수(i=0)가 기본 모듈러스에서 사용되는 소수로 최대 62비트 크기를 가지며, 1보다 크가 l보다 작은 소수들이 리스케일 모듈러스에 사용되는 소수이다. i >1보다 큰 경우에 소수들은 모두 최대 2 52보다 작은 크기를 가짐을 확인할 수 있다. 이와 같이 본 개시에서는 2의 지수승들의 조합으로 표현 가능한 소수를 이용하는바, 해당 소수의 곱셈을 시프트 연산 및 가산/감산 연산만으로 수행할 수 있다.
한편, 상술한 소수에 대한 정보 저장시에는 소수 값 자체를 저장하지 않고, 상술한 소수를 구성하는 거듭제곱에 대한 정보만을 저장할 수 있다. i = 0인 소수에 대해서 51, 0이 +1 값이고, 26이 -1 값을 갖는 다는 정보를 소수 정보로서 저장할 수 있다. 이와 같이 소수 정보를 저장함으로써 2 61 비트보다 작은 비트로 소수 값을 저장할 수 있다. 상술한 표현 방식은 일예이고, 상술한 방식과 다른 방식으로도 소수 값 정보를 저장할 수도 있다. 특히, 본원은 3개 내지 5개의 거듭제곱만으로 구성되는 소수를 이용하는바, 소수 정보의 저장에 작은 리소스만이 요구된다.
도 6은 본 개시의 일 실시 예에 따른 제2 소수 세트의 예를 도시한 도면이다.
도 6을 참조하면, 16개의 소수가 표시되며, 16개 소수 각각은 최대 61 지수승 내의 2의 지수승들의 조합으로 표현된다. 이와 같이 본 개시에서는 2의 지수승들의 조합으로 표현 가능한 소수를 이용하는바, 모드업 연산 시에 해당 소수의 곱셈을 시프트 연산 및 가산/감산 연산만으로 수행할 수 있다.
도 5 및 도 6에서는 소수 값만 표시하였지만, 즉, 해당 소수에 대한 스케일된 값(즉, 역수)을 표시하지 않았지만, 해당 값과의 곱을 통하여 1을 산출할 수 있는 2의 지수승으로 표현되는 값(즉, 역수)이 존재한다. 이와 같은 소수 및 이에 대한 역수는 5 이하의 해밍 가중치를 가지는바, 이를 이용하여 공간적으로 효율적인 하드웨어 설계가 가능하게 된다.
다시 표 1로 돌아가서, 본 개시에서는 2 17의 값의 N 매개변수를 사용하였다. 이와 같이 N 매개변수가 기존보다 증가하였기 때문에, NTT의 실행 시간 및 INTT의 실행 시간이 증가할 수 있다. 따라서, 이하에서는 N 매개변수의 증대에도 불구하고 기존보다 빠른 NTT 및 INTT 연산 속도를 갖기 위한 하드웨어 시스템 설계 방식을 설명한다.
앞서 설명한 바와 같이 NTT를 수행함에 있어서 제곱근이 필요로 한다. 빠른 연산을 위해서는 모든 제곱근을 저장하여 이용할 수 있다. 그러나 이러한 접근 방식은 메모리 필요 공간을 N 및 (l+1)·k 와 같이 선형적으로 증가시키는 문제가 있다.
즉, N 및/또는 (l+1)·k가 매우 커지는 경우, 모든 소수(또는 거듭제곱근)을 내부 메모리에 저장할 수 없게 될 수 있다. 특히 FPGA 내의 내부 메모리는 일반적인 경우와 달리 제한된 공간을 갖는다는점에서, FPGA가 허용하는 내부 메모리 크기 내에서 필요한 소수 정보를 저장하는 방법이 요구된다. 예를 들어, 표 1의 SET-B을 INTT에 사용하는 경우, 모든 제곱근의 저장에 총 400MB(
Figure PCTKR2021003088-appb-img-000023
62b*17+52b*41)*2 17)의 내부 메모리가 요구된다.
따라서, 모든 소수 정보(또는 모든 제곱근 정보)를 저장하여 이용하지 않고, 일부 소수 정보(또는 일부 제곱근 정보)만 저장해 놓고, 연산 과정에서 해당 정보로 필요한 소수 정보(또는 제곱근 정보)를 산출하여 이용할 수 있는 방법이 요구된다. 이하에서는 이와 같은 동작을 위한 구체적인 구성 및 방법을 설명한다. 본 개시에 따른 방식은 계산 및 저장을 균형되게 한다. 또한, 이와 같은 수정이 계산량을 비대칭적으로 증가시키지 않는다. 예를 들어, 변경된 알고리즘을 이용하더라도 계산 비용은 여전히 기존과 동일한 O(NlogN)이다. 반대로, 저장 공간은 o(N) 비트에서 O(logN) 비트로 절감되는 효과가 있다.
이하에서는 도 7을 참조하여 상술한 방법을 자세히 설명한다.
도 7은 본 개시의 제2 실시 예에 따른 INTT 알고리즘을 설명하기 위한 도면이다. 도 7에서도 도 4와 동일하게 설명의 단순화를 위하여 리스케일 단계가 생략되었지만, 실제 구현시에는 리스케일 단계가 추가될 수 있다.
도 7을 참조하면, 고정된 프리미티브 (2N) th 제곱근(Ψ)의 (-2 i) th 거듭제곱의 리스트를 취하며, 이를
Figure PCTKR2021003088-appb-img-000024
로 지칭한다. 보다 구체적으로,
Figure PCTKR2021003088-appb-img-000025
Figure PCTKR2021003088-appb-img-000026
를 포함한다. 도 7의 BitReverse(k, log h)는 k의 비트 값을 비트 전환하여 log h 비트 정수로 사용하는 것이다.
도 4에 도시된 알고리즘 1과의 차이는 다음과 같다. i) 입력의 크기를 줄이기 위하여,
Figure PCTKR2021003088-appb-img-000027
대신에
Figure PCTKR2021003088-appb-img-000028
를 사용한다는 점, ii)기저장된 제곱근을 취하는 대신에 도 7의 line 7의 비트 전환 처리를 수행한다는 점, iii) 모든 제곱근을 미리 계산하지 않고, 필요한 제곱근을 생성 및 업데이트로 이용한다는 점이다.
한편, INTT 스테이지 별로 다른 제곱근이 요구되며, 본 개시는 각 스테이지에 필요한 제곱근을 병렬로 생성한다. 이와 같은 동작에 대해서는 이하에서 설명한다.
진행 방향이 다르며, INTT의 경우 스케일링 단계가 추가된다는 점을 제외하고는, NTT와 INTT는 거의 동일한 시스템 설계를 갖는다. 이러한 점에서, NTT와 INTT는 동일한 회로를 사용할 수 있으며, 이하에서는 INTT의 구현예만을 설명한다.
도 8은 본 개시의 제1 실시 예에 따른 BU의 구성을 도시한 도면이다. 구체적으로 도 8은 INTT용 radix-2BU 이다.
도 8을 참조하면, BU(800)는 모듈러 감산기(810), 모듈러 가산기(820), 모듈러 곱셈기(830)를 포함할 수 있다. 그리고 A, B는 입력 샘플을 나타내며, A' 및 B'는 출력 샘플을 나타내며, W는 제곱근 정보를 나타낸다.
모듈러 감산기(810)는 A, B를 입력받고, 두 입력 샘플의 모듈러 감산 연산 결과를 모듈러 곱셈기에 출력할 수 있다.
모듈러 가산기(820)는 A, B를 입력받고, 두 입력 샘플의 모듈러 덧셈 연산 결과를 A'로 출력할 수 있다.
이러한 모듈러 감산기(810) 및 모듈러 가산기(820)는 일반적인 감산기 및 가산기의 시스템 설계와 동일하며, 해당 감산기 또는 가산기의 연산 결과는 2 사이클의 지연후 출력된다.
모듈러 곱셈기(830)는 모듈러 감산기(810)의 출력 및 W를 입력받고, 이에 대한 모듈러 곱셈 연산을 출력한다. 여기서 모듈러 곱셈기(830)는 경량 모듈러를 갖는 완전 파이프라인된 시스템 설계를 이용할 수 있다. 이러한 모듈러 곱셈기의 구체적인 구성은 도 3과 관련하여 앞서 설명하였는바 중복 설명은 생략한다.
본 개시에 우리의 모듈러의 최대 해밍 가중치 및 스케일된 인버스 값이 기존보다 하나 더 크다는 점에서, 본 개시에서 이용하는 모듈러 곱셈기(830)의 연산 결과의 출력은 기존보다 한 사이클이 더 요구되어 21 사이클의 지연후 출력된다. 여기서 지연 사이클은 일 예이며, 적용하는 하드웨어 환경 및 구현 알고리즘에 따라 지연 사이클은 상술한 값과 상이할 수 있다.
한편, 상술한 BU가 NTT 연산에 이용되는 경우, 제곱근 정보 대신에 소수 정보가 모듈러 곱셈기에 제공될 수 있으며, 모듈러 곱셈기의 연산 결과가 모듈러 감산기 또는 모듈러 가산기에 적용될 수 있다.
이하에서는 상술한 BU 동작을 동작 타이밍 도를 참조하여 자세히 설명한다.
도 9는 도 8의 BU의 동작 타이밍을 설명하기 위한 도면이다.
도 9를 참조하면, 제1 출력 값(A')은 두 입력 값(A, B)이 입력된 이후 2 사이클 뒤에 출력되며, 제2 출력 값(B')은 제1 출력 값(A')이 모듈러 곱셈기(830)에 입력된 이후 21 사이클 뒤에 출력됨을 확인할 수 있다.
한편, 본 개시에 따른 BU는 완전한 파이프라인으로 설계되어 있는바, 2개의 입력 샘플이 사이클마다 연속적으로 입력되고, 출력도 일정 지연 이후에 매 사이클마다 출력됨을 확인할 수 있다.
한편, 여러 개의 BU가 직렬로 연결되어 있는 경우, 출력 샘플은 다음 BU의 입력 샘플이 될 수 있다.
이하에서는 복수의 BU를 그룹화한 경우를 설명한다.
FPGA 상에서 INTT의 속도를 향상시키기 위해서, 동시에 복수의 BU를 사용할 필요가 있다. 그러나 각 BU는 고가의 모듈러 연산자가 포함되기 때문에, N이 매우 클때, N/2*logN 개의 BU를 채용하기 어렵다.
따라서, 합리적인 수의 BU를 사용할 필요가 있으며, 이하에서는 합리적인 BU 배치 방법을 설명한다. 첫 번째 방법은 복수의 BU를 동일한 스테이지에 병렬로 배치하는 것이고, 두 번째는 각 스테이지 별로 단일 BU(또는 몇 개의 BU)가 배치되고 복수의 BU가 직렬로 배치하는 것이다.
첫 번째 방법은 직관적이며 중간 데이터의 순서가 단순하다. 그러나 BU가 병렬 배치됨에 따라 짧은 시간 동안 높은 입출력 및 메모리 밴드폭이 요구된다. 따라서, 본 개시에서는 두 번째 방법을 이용하는 예를 설명한다. 하지만, 높은 입출력 및 메모리 밴드폭을 해결할 수 있는 환경이라면 첫 번째 방법을 이용할 수도 있다.
도 10은 도 7의 알고리즘으로 BU를 동작하는 경우의 동작 타이밍을 설명하기 위한 도면이다. 구체적으로, 도 10은 N이 32일 때 복수의 BU를 직렬 배치한 경우의 동작 타이밍을 도시한다.
도 10을 참조하면, 스테이지 순서는 첫 번째 행에 나타내며, 각 스테이지의 첫 번째 열 및 두 번째 열에는 입력되는 샘플의 인덱스가 표시된다.
각 스테이지의 세번째 열에 표시된 제곱근은 지수가 표시되며, 이는 고정된 단위로 증가하며, 업데이트 상수로 지칭된다. 스테이지가 증가함에 따라 업데이트 상수는 지수적으로 증가함을 확인할 수 있다.
그리고 제1 스테이지와 제2 스테이지를 비교하여 보면, 첫 번째 스테이지의 출력이 두 번째 스테이지에 입력되는 첫 번째 경우를 화살표로 표시하였다.
이와 같이 각 스테이지는 종속성을 가지므로, 지연이 누적된다. 따라서, 이러한 지연을 해결하기 위하여, 각 스테이지 별로 BU가 추가 배치할 수 있다. 구체적으로, DSP 슬라이스의 수는 룩업 테이블 및 플립플롭에 제한을 받기 때문에, 사용 가능한 DSP 슬라이스의 총 수에 기초하여, 각 스테이지에 대한 BU의 수(이하, c)를 결정할 수 있다. 그런 다음 각 스테이지에 대한 입력 샘플 시퀀스를 c로 나누고, 나눠진 부분 시퀀스를 각 BU에 입력할 수 있다.
도 11은 복수의 BU를 병렬화한 경우의 동작 타이밍을 설명하기 위한 도면이다.
도 11을 참조하면, 도시된 예에서의 c는 4이고, ci는 i 번째 BU 코어를 의미한다. 스테이지 1의 0, 2, 4, 5를 갖는 입력 샘플은 C1, C3, C2, C4 각각의 modAdd에서 처리되고, 따라서 스테이지 2의 C5, C5는 2 사이클 지연하여 시작된다. 한편, modSub및 modMult는 1, 3, 5, 7로 표시된 입력 샘플이 적용되어 2 단계의 C7, C8은 23 사이클 지연 후에 시작된다. 이후의 스테이지 3의 BU 코어는 동일한 방식으로 동작할 수 있다.
우리는 상술한 바와 같이 큰 N값을 갖는 것을 목적으로 하기 때문에, 스테이지 1 내지 3에서의 누적 지연은 무시할 정도이고, 상술한 처리량은 8 samples/cycles이다.
한편, 제4 스테이지의 BU 코어는 8의 인덱스 차이를 갖는 입력 샘플을 수신하지만, 각 입력 샘플은 N/(2*2*4) (N이 2 17인 경우) 사이클 후에 계산될 수 있다. 따라서, 순서를 변경하기 위한 리오더링 버퍼(reordering buffer)가 요구된다. 두개의 리오더링 버퍼 사이에 BU 코어는 BU 그룹(BGU)을 포함할 수 있다. 단일 GBU 내의 스테이지 수 및 전체 INTT 설계 내의 GBU 수는 1+logc, [logN/(1+logc)]로 계산될 수 있다.
도 12는 본 개시의 일 실시 예에 따른 GBU의 구성을 도시한 도면이다. 구체적으로, 도 12는 상술한 c가 4인 경우의 GBU 구성을 도시한 도면이다. 본 예에서는 c가 4인 경우를 설명하였지만, 구현시에는 다름 c 값을 갖도록 GBU를 구성할 수도 있다.
도 12를 참조하면, 하나의 GBU(1200)는 12개의 BU를 포함한다. 구체적으로, GBU는 3개의 스테이지로 구성되며, 각 스테이지는 4개의 BU 구성될 수 있다. 이와 같은 3*4 형태의 배치는 예시에 불과하며, 구현시에는 설계 파라미터에 따라 다른 스테이지 개수 및 스테이지별로 다른 BU의 개수를 갖도록 배치할 수 있다.
각 BU의 모듈러 곱셈 연산(ModMults)의 출력은 굵은 선으로 표시되어 있다. GBU는 매 사이클마다 8개의 입력 샘플과 12개의 제곱근을 입력받는다. 한 사이클의 지연 후에 8개의 샘플이 생성되며, RB에 매사이클마다 전달될 수 있다.
처리량을 더욱 향상시키기 위하여, 추가적인 병렬화 동작을 이용할 수 있다. 이에 대해서는 도 13을 참조하여 설명한다.
도 13은 표 1의 SET B로 INTT를 설계한 경우의 동작 타이밍을 설명하기 위한 도면이다.
도 13을 참조하면, RNS-HEAAN의 동형 곱에서 기본 모듈러스, 리스케일 모듈러스는 INTT에서만 사용되며, 도 5와 같은 42 모듈러스가 이용될 수 있다. 다항식에 대한 INTT를 계산하는데, 각 파이프 시간은 대략 16K 사이클(약 16K*(5+42))이 요구된다.
이하에서는 리오더링 버퍼에 대해서 도 14를 참조하여 설명한다.
도 14는 본 개시의 일 실시 예에 따른 RB의 구성을 도시한 도면이다.
도 14를 참조하면, i 번째 RB는 i번째 GBU에서 생성된 출력 샘플을 저장하고, i+1번째 GBU에 리오더링된 샘플을 전달할 수 있다.
앞선 도 11, 12는 제1 GBU 사이클에서 8개 샘플이 생성될 수 있다. 리오더링을 수행하는 경우, 이들 샘플은 각 RB 내의 버퍼에 저장될 수 있다. 그리고 스테이지 4의 4개의 BU 코어 각각은 8개 샘플을 8 값이 차이나는 인덱스를 갖는 샘플을 읽어올 수 있다. 예를 들어, 0, 8, ..., 48, 56으로 인덱스된 샘플을 제1사이클에서 읽어올 수 있다.
만약, BU 코어에서의 생성된 샘플을 해당 샘플을 생성한 BU 코어에서 이용하기 위하여 BRAM에 저장한다면 대역폭이 큰 BRAM이 이용되어야 한다. 이는 BRAM의 사용 효율을 저감시키는 것이 된다. 따라서, 각 BU 코어로부터 출력 샘플 시퀀스는 8개의 별도의 BRAM 버퍼에 쓰일 수 있다. 여기서 BRAM은 FPGA에서 내부 캐시(internal Cache)로 저장 기능을 수행하며 일반적인 DDR 방식보다 빠른 읽기/쓰기 속도를 갖는다.
도시하지 않았지만, 읽기/쓰기를 동시에 수행할 수 있는 이중 버퍼링 기술(double buffering technique)이 이용될 수 있다. 따라서, 128(=2*8*8) 62-bit *2K 크기의 BRAM 버퍼가 각 RB에 포함될 수 있다.
제4 스테이지 내의 8개의 BU 코어에 전달할 때, 8개 샘플은 도 14에 도시된 바와 같이 수평적으로 샘플을 읽어올 수 있다. 다음 RB는 동일한 버퍼에서 수직으로 8 i-1 샘플을 동일한 버퍼에서 수직방향으로 읽고, 다음으로 수평적으로 다음 버퍼에 전달할 수 있다.
이하에서는 본 개시의 일 실시 예에 따른 소수 생성기의 동작을 설명한다.
도 15는 본 개시의 일 실시 예에 따른 소수 생성기의 구성을 도시한 도면이다. 이하에서는 설명을 용이하기 위하여 소수를 생성한다고 표현하였지만, 해당 소수에 대응되는 제곱근을 생성하는 경우(즉, INTT 동작시)에도 상술한 소수 생성기가 이용될 수 있다. 즉, 소수 생성기는 소수를 생성하는 것뿐만 아니라, 해당 소수에 대응되는 제곱근을 생성할 수도 있다. 이러한 경우, 소수 생성기는 제곱근 생성기로 지칭될 수도 있다.
참고적으로, 도 15는 N이 2 17 및 c가 4인 경우의 소수 생성기의 예를 도시하였으나, 구현시에는 다른 N 및 다른 c 값을 지원할 수 있도록 소수 생성기의 구성은 변경될 수 있다.
도 15를 참조하면, 소수 생성기(1500)는 O(logN)인 기저 제곱근(또는 기저 소수)으로부터 모든 제곱근(또는 모든 소수)을 생성할 수 있다. 각 GBU는 12개의 제곱근이 요구된다. 구체적으로, C5와 C7, C6과 C9, C9 내지 C12는 각각 동일한 제곱근을 사용하기 때문에 소수 생성기는 7개의 제곱근을 생성할 수 있다. 각 제곱근은 W C1, W C2, W C3, W C4, W C5&7, W C6&8, W C9-12로 나타내었다.
7개의 제곱근은 제곱근의 그룹(W Gi)을 포함하며, i번째 GBU로 전달될 수 있다. 동시에 이들은 RUG 내의 모듈러스 연산(ModMULTS)에 제공할 수 있으며, 해당 제곱근 생성 이후에는 다음 사이클의 연산에 필요한 제곱근(또는 소수)을 생성할 수 있다. 구체적으로, 소수 생성기(1500)는 현재 사이클에서 생성한 제곱근과 기저 제곱근 정보(또는 기저 소수 정보)를 이용하여 다음 사이클에서 이용할 제곱근 정보(또는 소수 정보)를 생성할 수 있다.
도 16은 본 개시의 일 실시 예에 따른 내부 메모리에 저장되는 데이터 예를 설명하기 위한 도면이다.
도 16을 참조하면, 각 다른 해칭은 다른 모듈에 사용되는 기저 제곱근을 나타낸다. 상술한 바와 같이 각 LUG에는 7개의 기저 제곱근이 필요하다. 그러나 ModMult RUG의 하드웨어 시스템 설계를 변화시켜 21 사이클 지연이 발생할 수 있다.
(i) 지연 중에 ROM에 저장된 제곱근이 ModMults의 입력 피 연산자로 사용되어 저장할 제곱근의 수를 증가시키고, 지연 후 ModMults에 의해 생성된 제곱근이 입력 피 연산자로 사용된다. (ii) 지연 후에, 제곱근은 ModMults에서 생성되며, 입력 연산에 사용될 수 있다. 따라서, 제1 GBU에 대한 제곱근은 매 사이클마다 변경되기 때문에, 21개의 기저 제곱근이 요구된다. 한편, 제2 GBU에 대한 제곱근은 8 사이클마다 변경되기 때문에, 3개의 기저 제곱근이 저장될 수 있다. 마지막으로 제3 GBU, 제4 GBU, 제5 GBU, 제6 GBU는 매 64 사이클마다 변경되기 때문에 하나의 기저 제곱근만이 요구된다. 제1 GBU에 대한 21개 기저 제곱근은 직접 ModMULTS에 전달될 수 있다.
한편, BRAM 대역폭을 최소화하기 위하여, 다른 GBU에 대한 기저 제곱근은 R1으로 표시된 레지스터에 저장되며, 다음 파이프라인 동안 다음 모듈러스에서 이용될 수 있다. 유사하게 업데이트 상수는 롬(또는 FPGA 내의 내부 메모리)으로부터 읽어지며 R2로 표시된 레지스터에 저장될 수 있다. BU는 7개 기저 제곱근을 동시에 수신하기 때문에, 기저 제곱근은 각각 7개 ROM(또는 내부 메모리, 내부 레지스터, 내부 버퍼 등)에 저장될 수 있다. 기본적으로 모드업 및 기저 모듈러스를 위한 기저 제곱근은 62 비트 ROM에 저장되고, 스케일 모듈러스를 위한 기저 제곱근은 52 비트 ROM에 저장될 수 있다.
그러나 q 1~q 5에 대한 기저 제곱근은 BRAM의 활용성을 증가시키기 위하여 62 비트 ROM에 저장될 수도 있다. 한편, 표 1의 Set-A에 대해서는 다른 구성이 사용될 수 있다. 구체적으로, p 1~p 16, q 0, q 1은 62 비트 롬에 저장되고, q 2~q 35는 52 비트 롬에 저장될 수도 있다.
한편, 본 개시의 부트 스트래핑 파라미터 세트는 50 모듈러스 이상 및 스케일링 인버스 값을 갖는다. 이들 값은 MT(Modulus Table)에 저장되고, 파이프라인 타임에 대응되는 쌍이 제1 GBU 및 RUG에 대한 선택 신호에 따라 선택될 수 있다. 이러한 쌍은 레지스터에서 지연되고, 다음 GBU 및 RUG에 제공될 수 있다.
도 17은 본 개시의 일 실시 예에 따른 프로세서 구조를 설명하기 위한 도면이다.
도 17에서는 c 값이 4인 경우의 예를 도시하였지만, 구현시에는 다른 c 값을 갖는 형태로도 구현할 수 있다. 구체적으로, 높은 c는 높은 처리율, 짧은 지연 및 적은 BRAM을 유발하지만 많은 DSP 슬라이스가 요구된다.
본 개시에 따른 INTT를 수행하는 하드웨어 시스템(1700)은 내부 메모리(1710), 6개의 GBU(1720) 및 5개의 RB(1740) 및 6개의 RGU(1730) 및 하나의 MT(1750)로 구성될 수 있다. 특히 INTT 스테이지는 6개의 GBU만 사용하므로 마지막 스테이지는 스케일링을 위해 사용될 수 있다. 구체적으로, 마지막 스테이지 내의 BU는 2개의 ModMults로 대체되고, 스케일링 상수가 제곱근 대신에 ModMults에 입력될 수 있다.
이하에서는 본 개시에 따른 동형 연산의 성능을 설명한다.
목표 플랫폼은 1800 DSP 슬라이스, 132.9 Mbit BRAMs, 1M LUTs, 2M FFs이다. 입력 샘플이 iNTT 설계에 연속적으로 투입되고, I/O 인터페이스를 통한 데이터 전송 시간은 파이프라인 스케줄링에 의하여 숨겨졌다고 가정한다.
Design Chen Roy Ozturk Proposed
Device xc6slx100 xczu9eg xc7vc690t xcvu190
No. of samples 2 11 2 12 2 15 2 17
No. of moduli 1 6 41 ~42
Max. bit-width 58 30 32 62
fmax (MHz) 210 200 250 200
kLUT 6 55 219 365
kFF 19 22 91 335
DSP 64 182 768 1332
BRAM (KB) 113 1746 869 10163
Gbps 4.43 1.45 20.60 88.65
Mbps/DSP 69.20 7.94 26.82 66.55
Kbps/LUT 703.59 26.01 93.98 242.68
표 2는 제안된 iNTT 설계와 기존의 방식을 비교한다. 표 2를 참조하면 두 번째 행은 Xilinx TM FPGA 장치를 나타낸다. 기존에는 다항식 곱셈과 같은 더 큰 함수를 위해 설계되었지만, INTT 및 다른 기능에 동일한 회로를 재사용하기 때문에 이 평가를 위해 채용되었다. 표 2를 참조하면, Chen에서 FPGA에서 BU가 2개만 배치되므로 설계에서 가장 낮은 리소스를 사용하며 4개 설계중 두 번째로 낮은 처리량을 보여준다. 이러한 점에서 RNS 기반 동형 암호 체계에서는 사용할 수 없다. Roy는 표에서 가장 낮은 처리량을 보여주지만 FPGA에 더 많은 코어 프로세서를 배치함으로써 처리량을 더욱 향상시킬 수 있다.
또한, 본 개시에 따른 정규화된 처리량은 기존 방식들의 처리량보다 2-3배 더 큼을 확인할 수 있다. 이러한 결과는 본 개시에 따른 하드웨어 설계 방식이 높은 수준의 병렬화를 사용하기 때문에 발생한 것이다.
표 2의 FPGA 리소스 내역을 참조하면, 본 개시에 일 실시예 따른 방법은 BRAM을 제외한 6개의 GBU가 대부분의 리소스를 차지함을 확인할 수 있다. 구체적으로 LUT의 50%, DSP 슬라이스의 68%를 사용합니다. BRAM의 경우 5개의 RB가 10MB를 사용하며 이는 전체 설계에서 대부분이다. 사용 가능한 리소스에 따라 트레이드오프를 선택할 수 있는 DSP 슬라이스를 사용하는 BU 수를 늘리면 이 크기를 줄일 수 있다.
Parameter w/o our method w/ our method Improvement
Set-A 44.91MB 64.76KB 99.86%
Set-B 45.91MB 70.29KB 99.85%
표 3 은 소수 정보 모두를 저장하여 이용하지 않고, 사이클마다 산출하여 사용하는 경우의 내부 메모리 크기 개선을 나타낸다. 첫 번째 열은 본 개시에서 이용한 매개 변수를 나타내며, 두 번째 열과 세 번째 열은 각각 기존 방법과 제안된 방법에서의 저장하는 제곱근 정보를 저장하는 메모리 크기를 보여준다. 이와 같이 본 개시에 따른 방법을 이용하는 경우, 메모리의 크기를 99% 절감할 수 있음을 확인할 수 있다. FPGA 구현은 하드웨어 가속 효과를 확인하기 위하여, iNTT 소프트웨어 구현과 FPGA 로 구현한 경우를 비교한다.
Software Impl. FPGA impl.
Set-A 387ms 3.28ms
Set-B 446ms 3.76ms
표 4를 참조하면, 본 개시에 알고리즘을 소프트웨어적으로 구현한 경우와 FPGA 구현한 경우의 실행 시간을 나타낸다. 표 4의 두 번째 행과 세번째 행은 매개변수 세트 A와 세트 B를 사용할 경우의 결과를 나타낸다. 주파수가 200MHz일 때, 세트 A와 세트 B에 대한 FPGA 구현의 실행 시간은 각각 3.23ms와 3.76ms로 소프트웨어로 구현된 경우보다 115배 빠름을 확인할 수 있다. 한편, 상술한 다양한 실시 예에 따른 암호문 처리 방법은 각 단계들을 수행하기 위한 프로그램 코드 형태로 구현되어, 기록 매체에 저장되고 배포될 수도 있다. 이 경우, 기록 매체가 탑재된 장치는 상술한 암호화 또는 암호문 처리 등의 동작들을 수행할 수 있다. 이러한 기록 매체는, ROM, RAM, 메모리 칩, 메모리 카드, 외장형 하드, 하드, CD, DVD, 자기 디스크 또는 자기 테이프 등과 같은 다양한 유형의 컴퓨터 판독 가능 매체가 될 수 있다.
이상 첨부 도면을 참고하여 본 개시에 대해서 설명하였지만 본 개시의 권리범위는 후술하는 특허청구범위에 의해 결정되며 전술한 실시 예 및/또는 도면에 제한되는 것으로 해석되어서는 안 된다. 그리고 특허청구범위에 기재된 개시의, 당업자에게 자명한 개량, 변경 및 수정도 본 개시의 권리범위에 포함된다는 점이 명백하게 이해되어야 한다.

Claims (15)

  1. 연산 장치에 있어서,
    적어도 하나의 인스트럭션(instruction)을 저장하는 메모리; 및
    상기 적어도 하나의 인스트럭션을 실행하는 프로세서;를 포함하고,
    상기 프로세서는,
    상기 적어도 하나의 인스트럭션을 실행함으로써,
    기결정된 기저 소수 정보를 저장하고, 상기 기저장된 기저 소수 정보를 비트 반전 처리하여 상기 기저 소수 정보와 다른 제1 소수 정보를 생성하고, 상기 생성된 제1 소수 정보를 이용하여 상기 복수의 암호문에 대한 모듈 연산을 수행하는 연산 장치.
  2. 제1항에 있어서,
    상기 기저 소수 정보 및 상기 제1 소수 정보는,
    서로 다른 지수로 구성된 3개, 4개 또는 5개의 2의 지수승들의 감가산 값인 암호문 연산 장치.
  3. 제1항에 있어서,
    상기 프로세서는,
    상기 기저 소수 정보를 저장하는 내부 메모리;
    서로 다른 기설정된 동형 연산을 수행하는 복수의 연산기를 포함하는 BU를 복수개 포함하는 GBU;
    상기 내부 메모리로부터 기저 소수 정보를 읽어 오고, 상기 기저 소수 정보를 비트 반전하여 상기 복수의 BU 각각에 필요한 소수 정보를 생성하여 복수개의 BU 각각에 제공하는 소수 생성기;를 포함하는 연산 장치.
  4. 제3항에 있어서,
    상기 소수 생성기는,
    상기 기저 소수 정보의 k번째 비트를 log h번째 비트 정수로 비트 값 전환하여 소수 정보를 생성하는 연산 장치.
  5. 제3항에 있어서,
    상기 소수 생성기는,
    상기 기저 소수 정보를 이용하여 제1 사이클에 필요한 제1 소수 정보를 생성하고, 상기 생성된 제1 소수 정보와 상기 기저 소수 정보를 이용하여 제2 사이클에 필요한 제2 소수 정보를 생성하는 연산 장치.
  6. 제3항에 있어서,
    상기 프로세서는,
    상기 GBU를 복수개 포함하며,
    상기 복수개의 GBU는 직렬 배치되며,
    상기 프로세서는,
    상기 하나의 GBU의 출력 값을 저장하고, 저장 순서와 다른 순서로 저장된 출력값을 다른 GBU에 제공하는 리오더링 버퍼(RB)를 더 포함하는 연산 장치.
  7. 제3항에 있어서,
    상기 GBU는,
    복수의 스테이지를 구성하며, 상기 복수의 스테이지 각각은 복수의 BU가 병렬 배치되는 연산 장치.
  8. 제3항에 있어서,
    상기 하나의 GBU 내의 복수의 BU 중 적어도 두개는 동일한 소수 정보를 이용하여 동형 연산을 수행하는 연산 장치.
  9. 제3항에 있어서,
    상기 BU 각각은,
    두개의 동형 암호문을 입력받아 그 차이값을 출력하는 모듈러스 감산기;
    두개의 동형 암호문을 입력받아 그 합산 값을 출력하는 모듈러스 가산기; 및
    상기 모듈러스 감산기의 출력 값과 소수 정보를 이용하여 모듈러 곱셈 연산을 수행하는 모듈러스 곱셈기;를 포함하는 연산 장치.
  10. 제9항에 있어서,
    상기 모듈러스 곱셈기는,
    상기 소수 정보를 구성하는 복수의 2의 지수승 각각의 지수에 기초하여 개별적인 시프트 연산을 수행하고, 시프트 연산 결과들을 가산 연산 또는 감산 연산하여 모듈러 곱셈 연산을 수행하는 연산 장치.
  11. 제1항에 있어서,
    상기 프로세서는,
    FPGA(Field Programmable Gate Array)인 연산 장치.
  12. 복수의 암호문에 대한 모듈 연산 명령을 입력받는 단계;
    2의 지수승들의 조합으로 표현되는 소수 정보를 이용하여 상기 복수의 암호문에 대한 모듈 연산을 수행하는 단계; 및
    상기 연산 결과를 출력하는 단계;를 포함하고,
    상기 모듈 연산을 수행하는 단계는,
    기저 소수 정보를 저장하고, 상기 기저 소수 정보를 비트 반전 처리하여 상기 기저 소수 정보와 다른 제1 소수 정보를 생성하고, 상기 생성된 제1 소수 정보를 이용하여 상기 복수의 암호문에 대한 모듈 연산을 수행하는 암호문 연산 방법.
  13. 제12항에 있어서,
    상기 기저 소수 정보 및 상기 제1 소수 정보는,
    서로 다른 지수로 구성된 3개, 4개 또는 5개의 2의 지수승들의 감가산 값인 암호문 연산 방법.
  14. 제12항에 있어서,
    상기 모듈 연산을 수행하는 단계는,
    상기 기저 소수 정보의 k번째 비트를 log h번째 비트 정수로 비트 값 전환하여 제1 소수 정보를 생성하는 암호문 연산 방법.
  15. 제12항에 있어서,
    상기 모듈 연산을 수행하는 단계는,
    상기 기저 소수 정보를 이용하여 제1 사이클에 필요한 제1 소수 정보를 생성하고, 상기 생성된 제1 소수 정보와 상기 기저 소수 정보를 이용하여 제2 사이클에 필요한 제2 소수 정보를 생성하는 암호문 연산 방법.
PCT/KR2021/003088 2020-03-12 2021-03-12 모듈러 곱셈 연산을 수행하는 연산 장치 및 방법 WO2021182908A1 (ko)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/905,693 US20230145760A1 (en) 2020-03-12 2021-03-12 Method and device for calculating modular product

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
US202062988598P 2020-03-12 2020-03-12
US62/988,598 2020-03-12
KR10-2021-0032033 2021-03-11
KR1020210032033A KR102498133B1 (ko) 2020-03-12 2021-03-11 모듈러 곱셈 연산을 수행하는 연산 장치 및 방법

Publications (1)

Publication Number Publication Date
WO2021182908A1 true WO2021182908A1 (ko) 2021-09-16

Family

ID=77671801

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/KR2021/003088 WO2021182908A1 (ko) 2020-03-12 2021-03-12 모듈러 곱셈 연산을 수행하는 연산 장치 및 방법

Country Status (2)

Country Link
US (1) US20230145760A1 (ko)
WO (1) WO2021182908A1 (ko)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140355758A1 (en) * 2011-12-15 2014-12-04 Inside Secure Method of generating prime numbers proven suitable for chip cards
WO2019022665A2 (en) * 2017-07-28 2019-01-31 Agency For Science, Technology And Research MULTIPLICATION METHODS, NON-TRANSIENT COMPUTER-READABLE MEDIA, AND MULTIPLICATION DEVICES
US20190312728A1 (en) * 2018-04-09 2019-10-10 Infineon Technologies Ag Method and processing device for performing a lattice-based cryptographic operation
KR20190138815A (ko) * 2017-04-11 2019-12-16 더 가버닝 카운슬 오브 더 유니버시티 오브 토론토 동형 암호화에 의한 보안 계산 가속화를 위한 동형 처리 유닛(hpu)

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140355758A1 (en) * 2011-12-15 2014-12-04 Inside Secure Method of generating prime numbers proven suitable for chip cards
KR20190138815A (ko) * 2017-04-11 2019-12-16 더 가버닝 카운슬 오브 더 유니버시티 오브 토론토 동형 암호화에 의한 보안 계산 가속화를 위한 동형 처리 유닛(hpu)
WO2019022665A2 (en) * 2017-07-28 2019-01-31 Agency For Science, Technology And Research MULTIPLICATION METHODS, NON-TRANSIENT COMPUTER-READABLE MEDIA, AND MULTIPLICATION DEVICES
US20190312728A1 (en) * 2018-04-09 2019-10-10 Infineon Technologies Ag Method and processing device for performing a lattice-based cryptographic operation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
ALEJANDRO HEVIA;GREGORY NEVEN: "Progress in Cryptology LATINCRYPT 2012", vol. 7533, 7 October 2012, SPRINGER BERLIN HEIDELBERG, Berlin, Heidelberg, ISBN: 978-3-642-33480-1, article THOMAS PÖPPELMANN;TIM GÜNEYSU: "Towards Efficient Arithmetic for Lattice-Based Cryptography on Reconfigurable Hardware", pages: 139 - 158, XP047014963 *

Also Published As

Publication number Publication date
US20230145760A1 (en) 2023-05-11

Similar Documents

Publication Publication Date Title
WO2020235797A1 (en) Apparatus for processing modular multiply operation and methods thereof
WO2019117694A1 (ko) 동형 암호화를 수행하는 단말 장치와 그 암호문을 처리하는 서버 장치 및 그 방법들
WO2020145503A1 (en) Apparatus for processing approximately encrypted messages and methods thereof
WO2020117015A1 (ko) 다변수 패킹을 이용하는 연산 장치 및 방법
WO2018199443A1 (en) Apparatus and method for performing operation being secure against side channel attack
EP3909193A1 (en) Apparatus for processing approximately encrypted messages and methods thereof
WO2020145759A1 (ko) 근사 계산에 대한 계산 검증
WO2014035146A2 (ko) 환 동형 사상을 이용한 동형 암호화 방법과 복호화 방법 및 이를 이용한 장치
WO2017222140A1 (ko) Cnn 기반 인루프 필터를 포함하는 부호화 방법과 장치 및 복호화 방법과 장치
WO2018090823A1 (zh) 一种系统分区关键数据的保护方法及系统、终端
WO2020166879A1 (en) Apparatus for performing threshold design on secret key and method thereof
WO2020116807A1 (ko) 암호문에 대한 비다항식 연산을 수행하는 장치 및 방법
WO2016036048A1 (en) Method and device for data encrypting
WO2017028597A1 (zh) 一种虚拟资源的数据处理方法及装置
WO2017071330A1 (zh) 数据的加密和解密方法及加密和解密装置
WO2019143026A1 (ko) 특징맵 압축을 이용한 이미지 처리 방법 및 장치
WO2020246848A1 (ko) 근사 암호화된 암호문에 대한 정렬 장치 및 방법
WO2017071352A1 (zh) 密码的推送方法、推送系统及终端设备
WO2019143027A1 (ko) 이미지 파이프라인 처리 방법 및 장치
WO2019143024A1 (ko) 라인 단위 연산을 이용한 초해상화 방법 및 장치
WO2016159518A1 (ko) 비선형 데이터의 평균 계산 장치
WO2018093203A1 (ko) 공개키를 이용하여 암호화하는 연산 장치 및 그 암호화 방법
WO2023282359A1 (ko) 공간 복잡도를 고려한 동형 암호화 또는 복호화 방법
WO2021182908A1 (ko) 모듈러 곱셈 연산을 수행하는 연산 장치 및 방법
WO2018076871A1 (zh) 联系人信息的同步方法、装置、介质、电子设备及系统

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: 21767377

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21767377

Country of ref document: EP

Kind code of ref document: A1