A ciphertext computing engine and privacy protection device

By introducing virtual base classes and interface mechanisms into the ciphertext calculation engine, developers are allowed to flexibly specify function implementation methods, which solves the problem of complex and difficult-to-use interfaces of the ciphertext calculation engine, improves development efficiency and versatility, and adapts to various privacy protections. product demand.

CN115080014BActive Publication Date: 2024-09-17HUAKONG TSINGJIAO INFORMATION SCI BEIJING LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210881624.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-26
Publication Date
2024-09-17
Estimated Expiration
2042-07-26

AI Technical Summary

Technical Problem

The interface of the existing ciphertext calculation engine is complex and difficult to use, which makes developers inefficient and difficult to debug when packaging it into privacy protection products, and it is unable to flexibly adapt to various practical application scenarios.

Method used

Designed a ciphertext calculation engine, including multiple functional modules. Through virtual base classes and interfaces, developers are allowed to specify the implementation of functions, including calculation, communication and storage modules. The implementation of modules can be flexibly specified through inheritance and instantiation functions. .

Benefits of technology

It provides a more user-friendly functional interface, allowing developers to flexibly specify function implementation methods according to actual application scenarios, improving development efficiency and versatility, and making the ciphertext calculation engine easier to package and optimize in privacy protection products.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115080014B
    Figure CN115080014B
Patent Text Reader

Abstract

The present application discloses a ciphertext computing engine and a privacy protection device, which relate to the fields of multi-party secure computing technology and privacy computing technology. The ciphertext computing engine includes: multiple functional modules, at least one of which has a functional interface for external invocation, which can specify the functional implementation of the functional module when called; the functional interface includes a virtual base class, which contains functions for implementing functions; when the functional interface is called, it inherits the virtual base class and instantiates the contained functions to specify the functional implementation of the functional module. The ciphertext computing engine can provide a more user-friendly functional interface to the outside world, which is conducive to developers packaging the ciphertext computing engine into privacy protection products.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of multi-party secure computing technology and privacy computing technology, and in particular to a ciphertext computing engine and a privacy protection device. Background Art

[0002] In the field of privacy computing technology, the ciphertext computing engine is the underlying ciphertext computing module that performs privacy protection functions. Multiple participants calculate and transmit ciphertext data to each other, thereby jointly calculating the output results of the privacy protection task. The computing protocols used by the ciphertext computing engine include but are not limited to multi-party secure computing (MPC) protocols, such as secret sharing, oblivious transmission, and obfuscated circuits. The characteristic of the ciphertext computing engine is that a large number of ciphertext data may need to be transmitted multiple times between multiple participants, and each participant needs to use external storage (such as hard disk storage) to avoid insufficient memory when calculating a large amount of ciphertext data locally.

[0003] In the research and development and deployment of most privacy protection products, the development of the underlying ciphertext computing engine and the work of packaging the ciphertext computing engine into the privacy protection product are generally separated and completed by different developers. This is because the development of the ciphertext computing engine requires a certain theoretical foundation in cryptography and privacy computing, and the cost of asking developers of privacy protection products to learn these theories before developing them is very high, which is not in line with the reality.

[0004] Although developers hope that the development of the underlying ciphertext computing engine and the work of packaging the ciphertext computing engine can be decoupled as much as possible, so that both sides can perform their respective duties and efficiently develop practical privacy protection products together, it is not easy to implement in reality.

[0005] At present, for the development of privacy protection products, the ciphertext calculation engine can choose to use open source libraries and call them in actual scenarios by encapsulating the interface of the open source library. The ciphertext calculation engine generally requires multiple participating nodes to calculate and transmit a large amount of ciphertext data to each other. For example, in the simplest oblivious transfer (OT) protocol, the sender and the receiver need to transmit data back and forth at least three times. The communication module of the open source library is generally already specified in the library. If the easy-to-use open source library interface is directly encapsulated, such as directly calling the OT function, then at least three internal communications will use the communication method specified by the open source library.

[0006] However, in actual application scenarios, privacy protection products need to have flexible communication methods to adapt to the various hardware and software requirements of the participating nodes. It is very likely that the communication method specified by the open source library cannot be applied in the actual application scenario, so the developers of the packaging engine need to go deep into the open source library to modify the communication part coupled with the ciphertext calculation, or dig out the interface of pure ciphertext calculation and link it to its own communication module for use. However, no matter which method is used, it not only requires developers to have a certain theoretical foundation in cryptography and privacy computing, but also has low development efficiency and is difficult to debug.

[0007] In addition to using an open source ciphertext calculation engine, a dedicated ciphertext calculation engine can also be used, that is, each functional module is customized to adapt to a specific application scenario. However, since the implementation method of each functional module is fixed and single, there is also the problem that it cannot be applied to various other actual application scenarios.

[0008] In another way of developing privacy protection products, the ciphertext calculation engine can also strip off some functional modules, such as the communication module, and only include the interface for ciphertext calculation. After the developer of the packaging engine calls a calculation interface, the output ciphertext data obtained is sent to the participating node using the communication module that he or she flexibly specifies. This solution completely decouples calculation and communication, that is, the ciphertext calculation engine only performs ciphertext calculation, and the developer of the packaging engine can flexibly call these interfaces in various privacy protection products.

[0009] Although this solution seems very easy to use, it is not practical in privacy protection products that integrate multi-party secure computing (MPC). This is because the MPC protocol often has many rounds of communication. For example, the OT protocol requires at least 3 rounds of communication, so the developers of the packaging engine need to be familiar with the protocol process in order to correctly call the interface in sequence to complete the calculation and transmission of the protocol. It is easy to make mistakes when calling the interface of more complex MPC protocols. In other words, after the ciphertext computing engine is stripped of the communication module, the form of the interface will become more complicated, which is not easy for the developers of the packaging engine to call, and requires a certain threshold and workload.

[0010] In addition, stripping communications will also make it difficult to optimize the underlying ciphertext computing engine, because the optimization of the MPC protocol often requires comprehensive consideration of computing and transmission, which are coupled. At the same time, optimization for memory usage cannot be specified by the developers of the packaging engine. For example, if external memory optimization is used, that is, part of the data is stored and read in external storage devices such as hard disks, then the storage location and reading and writing methods of the intermediate files cannot be flexibly specified in the development of privacy protection products.

[0011] In summary, the interfaces provided by current ciphertext computing engines are complex and difficult to use, which makes it difficult for developers to package ciphertext computing engines into privacy protection products. Summary of the invention

[0012] The embodiments of the present application provide a ciphertext calculation engine and a privacy protection device to solve the problem in the prior art that the interface provided by the ciphertext calculation engine to the outside is complex and difficult to use, which is not conducive to developers packaging the ciphertext calculation engine into a privacy protection product.

[0013] The embodiment of the present application provides a ciphertext calculation engine, including: a plurality of functional modules, wherein at least one functional module has a functional interface for external invocation, and when the functional interface is called, a functional implementation mode of the functional module can be specified;

[0014] The functional interface includes a virtual base class, and the virtual base class includes functions for implementing functions;

[0015] When the functional interface is called, it inherits the virtual base class and instantiates the included functions to specify the functional implementation method of the functional module.

[0016] Furthermore, the multiple functional modules include a computing module and a communication module connected to each other, and a storage module connected to the computing module.

[0017] Further, the communication module has a communication interface, the communication interface includes a Channel class, the Channel class is a virtual base class, and the Channel class includes a sending function with a data sending function and a receiving function with a data receiving function;

[0018] When the communication interface is called, it inherits the Channel class and instantiates the sending function and the receiving function to specify the communication mode of the communication module.

[0019] Further, the computing module has a data input interface, the data input interface includes a DataReader class, the DataReader class is a virtual base class, the DataReader class includes a data reading function for reading data into a memory and a reading position offset function for implementing an offset of a reading position;

[0020] When the data input interface is called, it inherits the DataReader class and instantiates the data reading function and the reading position offset function to specify the data reading method of the calculation module.

[0021] Further, the computing module has a data output interface, the data output interface includes a DataWriter class, a virtual base class of the DataWriter class, and the DataWriter class includes a data writing function for writing the data to be output into a specified storage location;

[0022] When the data output interface is called, it inherits the DataWriter class and instantiates the data writing function to specify the data output mode of the computing module.

[0023] Further, the storage module has an external storage management interface and a data external storage interface;

[0024] The external storage management interface includes an ExternalStorage class, which is a virtual base class and is used to implement management of external storage objects;

[0025] The data external storage interface includes a StorageObject class, which is a virtual base class and is used to implement external storage of data using an external storage object.

[0026] Furthermore, the ExternalStorage class includes a generation function, an opening function, a closing function and a deletion function;

[0027] The generation function is used to generate an external storage object;

[0028] The open function is used to open the external storage object;

[0029] The close function is used to close the external storage object;

[0030] The delete function is used to delete the external storage object;

[0031] When the external storage management interface is called, it inherits the ExternalStorage class and instantiates the generation function, the opening function, the closing function and the deletion function to specify the management method of the external storage object of the storage module.

[0032] Furthermore, the StorageObject class includes an external storage data reading function, an external storage data writing function and an external storage data addressing function;

[0033] The external storage data reading function is used to read data from the outside using an external storage object;

[0034] The external storage data writing function is used to write data to the outside using the external storage object;

[0035] The external storage data addressing function is used to obtain the external storage address using the external storage object;

[0036] When the data external storage interface is called, it inherits the StorageObject class and instantiates the external storage data reading function, the external storage data writing function and the external storage data addressing function to specify the data external storage mode of the storage module.

[0037] The embodiment of the present application also provides a privacy protection device, including:

[0038] Any of the above mentioned ciphertext calculation engines.

[0039] Further, comprising a plurality of any of the above-mentioned ciphertext calculation engines;

[0040] Multiple ciphertext computing engines are connected through their respective communication modules.

[0041] The beneficial effects of this application include:

[0042] The ciphertext calculation engine provided by the embodiment of the present application includes multiple functional modules, at least one of which has a functional interface for external invocation, and when the functional interface is called, the functional implementation mode of the functional module can be specified; the functional interface includes a virtual base class, and the virtual base class contains functions for implementing functions; when the functional interface is called, the functional implementation mode of the functional module is specified by inheriting the virtual base class and instantiating the contained functions. Using the ciphertext calculation engine, when it is packaged into the development process of a privacy protection product, when it is necessary to call the functional interface of the ciphertext calculation engine, the functional implementation mode of the functional module can be specified by inheriting the virtual base class of the functional interface and instantiating the contained functions, that is, the functional implementation mode of the functional module of the ciphertext calculation engine is not fixed, but can be flexibly specified by the developer of the privacy protection product based on the actual application scenario, and it is a very easy to develop method to specify by inheriting the virtual base class and instantiating the contained functions, that is, the ciphertext calculation engine provides a more convenient functional interface to the outside, which is conducive to developers packaging the ciphertext calculation engine into a privacy protection product.

[0043] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or be understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings:

[0045] Figure 1A schematic diagram of the structure of the ciphertext calculation engine provided in the embodiment of the present application;

[0046] Figure 2 A schematic diagram of the structure of a ciphertext calculation engine provided in another embodiment of the present application;

[0047] Figure 3 A schematic diagram of the structure of a privacy protection device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0048] In order to provide a more user-friendly functional interface and facilitate developers to package the ciphertext calculation engine into a privacy protection product, the embodiment of the present application provides a ciphertext calculation engine and a privacy protection device. The preferred embodiments of the present application are described below in conjunction with the drawings of the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application and are not used to limit the present application. In addition, the embodiments in the present application and the features in the embodiments can be combined with each other if there is no conflict.

[0049] The present application embodiment provides a ciphertext calculation engine, such as Figure 1 As shown, it includes: multiple functional modules, at least one of which has a functional interface for external invocation, and the functional interface can specify the functional implementation method of the functional module when being called;

[0050] The functional interface includes a virtual base class, and the virtual base class includes functions for implementing functions;

[0051] When the functional interface is called, it inherits the virtual base class and instantiates the included functions to specify the functional implementation method of the functional module.

[0052] When the ciphertext calculation engine is used and packaged into the development process of a privacy protection product, when the functional interface of the ciphertext calculation engine needs to be called, the functional implementation method of the functional module can be specified by inheriting the virtual base class of the functional interface and instantiating the contained functions. That is, the functional implementation method of the functional module of the ciphertext calculation engine is not fixed, but can be flexibly specified by the developer of the privacy protection product based on the actual application scenario. In addition, specifying by inheriting the virtual base class and instantiating the contained functions is a very easy-to-develop method. That is, the ciphertext calculation engine provides a more user-friendly functional interface to the outside world, which is conducive to developers packaging the ciphertext calculation engine into a privacy protection product.

[0053] In one embodiment of the present application, Figure 2 As shown, in the above-mentioned ciphertext computing engine, the multiple functional modules may specifically include a computing module and a communication module connected to each other, and a storage module connected to the computing module.

[0054] Among them, the computing module is used to execute the ciphertext computing part of the privacy computing protocol;

[0055] The storage module is used to assist the computing module in performing ciphertext computing. Through external storage, the computing task can be completed when the memory is insufficient.

[0056] The communication module is used for data transmission between participating nodes, and can also realize data transmission between different ciphertext calculation engines.

[0057] For the communication module, the following communication interface implementation scheme is proposed in the embodiment of the present application:

[0058] The communication module has a communication interface, which includes a Channel class. The Channel class is a virtual base class. The Channel class includes a sending function with a data sending function and a receiving function with a data receiving function.

[0059] When the communication interface is called, it inherits the Channel class and instantiates the sending function and receiving function to specify the communication mode of the communication module.

[0060] In the embodiment of the present application, the virtual base class Channel class can be implemented in the following manner:

[0061] class Channel {

[0062] public:

[0063] Channel() {}

[0064] virtual ~Channel() {}

[0065] virtual retcode send(const char *buff, size_t len) = 0;

[0066] virtual retcode recv(char *buff, size_t len) = 0;

[0067] };

[0068] The Channel class implements the communication function, where send() is the sending function and recv() is the receiving function, which respectively implements the sending and receiving of data. In the send() function, the parameter buff indicates the memory block where the data to be sent is located, and the parameter len is the size of the data to be sent; in the recv() function, the parameter buff indicates the memory block where the data to be received will be stored, and the parameter len is the size of the data to be received.

[0069] The Channel class is a virtual base class, which only indicates that this base class contains the send function and the recv function, that is, the data sending and receiving functions, but these two interface functions are not specifically implemented. When users (i.e., developers of the packaging engine) use the ciphertext calculation engine, they need to inherit the Channel class with their own communication class, and only need to instantiate the send function and the recv function, that is, they can specify the communication method they want to use in the ciphertext calculation engine.

[0070] After developers inherit the Channel class and instantiate the communication object, they pass the object pointer to the ciphertext computing engine. Then, when the ciphertext computing engine executes a computing task, it will call the communication method specified by the developer. At this point, for the ciphertext computing engine, the data transmission steps are controlled by the developers of the underlying engine, while the data transmission method is specified by the developers of the packaging engine. This ensures that the engine interface is simple and easy to use, and that the engine can adapt to various actual application scenarios, improving versatility.

[0071] For the calculation module, the following implementation scheme of the calculation interface (including data input interface and data output interface) is proposed in the embodiment of the present application:

[0072] The calculation module has a data input interface, which includes a DataReader class. The DataReader class is a virtual base class. The DataReader class includes a data reading function for reading data into a memory and a reading position offset function for realizing an offset of a reading position.

[0073] When the data input interface is called, it inherits the DataReader class and instantiates the data reading function and the reading position offset function to specify the data reading method of the calculation module.

[0074] In the embodiment of the present application, the virtual base class DataReader class can be implemented in the following manner:

[0075] class DataReader {

[0076] public:

[0077] DataReader() {}

[0078] virtual ~DataReader() {}

[0079] virtual retcode read(size_t len, char *buff) = 0;

[0080] virtual retcode seek(size_t offset) = 0;

[0081] };

[0082] The DataReader class is used to input raw data. In the calculation module, raw data needs to be input for ciphertext calculation. The DataReader class can conveniently allow developers to specify the storage location and reading method of raw data. The read function is a data reading function that reads data into a memory block. The seek function is a read position offset function that offsets the read position.

[0083] When developers use the DataReader class, the method is similar to the Channel class of the communication module, that is, they implement their own data reading class to inherit the DataReader class, overload the two interface functions, read function and seek function, so that they can specify the data reading method of the original data in the ciphertext calculation engine.

[0084] The computing module may also have a data output interface, the data output interface includes a DataWriter class, a DataWriter class virtual base class, and the DataWriter class includes a data writing function for writing the to-be-output data into a specified storage location;

[0085] When the data output interface is called, it inherits the DataWriter class and instantiates the data writing function to specify the data output method of the computing module.

[0086] In the embodiment of the present application, the virtual base class DataWriter class can be implemented in the following way:

[0087] class DataWriter {

[0088] public:

[0089] DataWriter() {}

[0090] virtual ~DataWriter() {}

[0091] virtual retcode write(const char *buff, size_t len) = 0;

[0092] };

[0093] The DataWriter class is used to output the calculation results. When you need to obtain the output results of the ciphertext calculation task, you can use the DataWriter class to specify the storage location of the output data, where the write function is a data writing function used to write data.

[0094] When developers use the DataWriter class, the method is similar to the Channel class of the communication module, that is, they implement their own data writing class to inherit the DataWriter class and overload the write interface function. Then, they can specify the data output method of the output data in the ciphertext calculation engine.

[0095] For the storage module, the following interface implementation schemes (including external storage management interface and data external storage interface) are proposed in the embodiments of the present application:

[0096] The storage module has an external storage management interface and a data external storage interface;

[0097] The external storage management interface includes the ExternalStorage class, which is a virtual base class and is used to manage external storage objects.

[0098] The data external storage interface includes the StorageObject class, which is a virtual base class. The StorageObject class is used to implement external storage of data using an external storage object.

[0099] Furthermore, the ExternalStorage class can contain a create function, an open function, a close function, and a delete function;

[0100] Generate function, used to generate external storage objects;

[0101] Open function, used to open external storage objects;

[0102] Close function, used to close the external storage object;

[0103] Delete function, used to delete external storage objects;

[0104] When the external storage management interface is called, it inherits the ExternalStorage class and instantiates the generation function, the opening function, the closing function, and the deletion function to specify the management method of the external storage object of the storage module.

[0105] Furthermore, the StorageObject class may include an external storage data reading function, an external storage data writing function, and an external storage data addressing function;

[0106] External storage data reading function, used to read data from the outside using external storage objects;

[0107] External storage data writing function, used to write data to the external storage object;

[0108] External storage data addressing function, used to obtain the external storage address using the external storage object;

[0109] When the data external storage interface is called, it inherits the StorageObject class and instantiates the external storage data reading function, external storage data writing function and external storage data addressing function to specify the external data storage method of the storage module.

[0110] In the embodiment of the present application, the virtual base class ExternalStorage class can be implemented in the following manner:

[0111] class ExternalStorage {

[0112] public:

[0113] ExternalStorage () {}

[0114] virtual ~ExternalStorage () {}

[0115] virtual std::string new_() = 0;

[0116] virtual StorageObject *open_storage_object(const std::string &id) =0;

[0117] virtual retcode close_storage_object(StorageObject *object) = 0;

[0118] virtual retcode delete_(const std::string &id) = 0;

[0119] };

[0120] In the embodiment of the present application, the virtual base class StorageObject can be implemented in the following manner:

[0121] class StorageObject {

[0122] public:

[0123] StorageObject () {}

[0124] virtual ~StorageObject () {}

[0125] virtual retcode seek(size_t offset) = 0;

[0126] virtual retcode write(const char *c, size_t len) = 0;

[0127] virtual retcode read(size_t len, char *c) = 0;

[0128] };

[0129] The ExternalStorage class and the StorageObject class implement the function of using external storage to assist memory calculation. When setting parameters for ciphertext calculation tasks, developers can set the memory usage limit parameter. In this way, when the ciphertext calculation engine executes ciphertext calculation tasks, it strictly controls the memory usage of the intermediate calculation process. When the memory is insufficient, external storage can be used for auxiliary calculation.

[0130] Among them, the ExternalStorage class implements methods for generating, opening, closing, and deleting external storage objects. The function new_() is a generation function that can generate a string to indicate an external storage object (such as the file storage path and file name of a file); the function open_storage_object() is an opening function that can open an already generated external storage object; the function close_storage_object() is a closing function that can close an already generated external storage object; the function delete_() is a deletion function that can destroy an already generated external storage object, that is, delete the space occupied by the external storage object.

[0131] The StorageObject class implements the reading, writing, and addressing operations of external data based on the generated external storage object. The read function is an external storage data reading function, the write function is an external storage data writing function, and the seek function is an external storage data addressing function. Its function is similar to a combination of the DataReader class and the DataWriter class.

[0132] Developers can instantiate the ExternalStorage class and StorageObject class, and overload all functions contained in these two virtual base classes, so that they can specify the use of external storage in the ciphertext calculation engine, including the management of external storage objects and the external storage of data. Of course, if developers do not care about how to implement and use external storage, they can use the instantiated ExternalStorage class and StorageObject class specified by default in the ciphertext calculation engine.

[0133] Based on the ciphertext computing engine with the above structure provided in the embodiment of the present application, the developer instantiates the communication module and the storage module, establishes communication between the nodes participating in each ciphertext computing task, passes the communication object Channel into the communication module of the ciphertext computing engine to specify the communication method between nodes, passes the external storage object ExternalStorage into the storage module of the ciphertext computing engine to specify the method of using external storage to assist memory calculation, and passes the storage objects DataReader and DataWriter into the calculation module of the ciphertext computing engine to specify the method of inputting data and outputting task calculation results.

[0134] In this way, when packaging the ciphertext computing engine, developers only need to focus on the initialization operations of the above functional modules, and they can easily call the ciphertext computing functions supported in the ciphertext computing engine and execute the privacy computing protocol. At the same time, communication and storage can be flexibly implemented, ensuring strong versatility.

[0135] The above-mentioned ciphertext computing engine provided by the embodiment of the present application is adopted, which not only couples the computing module, storage module and communication module in the ciphertext computing engine, so that developers do not need to worry about any implementation of the ciphertext computing protocol, reducing their development costs, but also can flexibly specify the implementation method of the storage module and the communication module, thereby greatly increasing the versatility of the ciphertext computing engine and enabling it to be packaged in privacy protection products for various practical application scenarios.

[0136] Based on the above ciphertext calculation engine, the embodiment of the present application further provides a privacy protection device, including:

[0137] Any of the above ciphertext computation engines.

[0138] Further, such as Figure 3 As shown, the privacy protection device may include a plurality of the above-mentioned ciphertext calculation engines;

[0139] Multiple ciphertext computing engines are connected through their respective communication modules.

[0140] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0141] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0142] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0143] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0144] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A ciphertext calculation engine, characterized in that: include: A plurality of functional modules, at least one of which has a functional interface for external invocation, and the functional interface can specify a function implementation mode of the functional module when being called; The functional interface includes a virtual base class, and the virtual base class includes functions for implementing functions; When the functional interface is called, it inherits the virtual base class and instantiates the included functions to specify the functional implementation method of the functional module.

2. The ciphertext calculation engine according to claim 1, characterized in that: The multiple functional modules include a computing module and a communication module connected to each other, and a storage module connected to the computing module.

3. The ciphertext calculation engine according to claim 2, characterized in that: The communication module has a communication interface, and the communication interface includes a Channel class, and the Channel class is a virtual base class, and the Channel class includes a sending function with a data sending function and a receiving function with a data receiving function; When the communication interface is called, it inherits the Channel class and instantiates the sending function and the receiving function to specify the communication mode of the communication module.

4. The ciphertext calculation engine according to claim 2, characterized in that: The computing module has a data input interface, which includes a DataReader class, which is a virtual base class. The DataReader class includes a data reading function for reading data into a memory and a reading position offset function for offsetting a reading position. When the data input interface is called, it inherits the DataReader class and instantiates the data reading function and the reading position offset function to specify the data reading method of the calculation module.

5. The ciphertext calculation engine according to claim 4, characterized in that: The computing module has a data output interface, and the data output interface includes a DataWriter class, and the DataWriter class is a virtual base class, and the DataWriter class includes a data writing function for writing the data to be output into a specified storage location; When the data output interface is called, it inherits the DataWriter class and instantiates the data writing function to specify the data output mode of the computing module.

6. The ciphertext calculation engine according to claim 2, characterized in that: The storage module has an external storage management interface and a data external storage interface; The external storage management interface includes an ExternalStorage class, which is a virtual base class and is used to implement management of external storage objects; The data external storage interface includes a StorageObject class, which is a virtual base class and is used to implement external storage of data using an external storage object.

7. The ciphertext calculation engine according to claim 6, characterized in that: The ExternalStorage class includes a create function, an open function, a close function, and a delete function; The generation function is used to generate an external storage object; The open function is used to open the external storage object; The close function is used to close the external storage object; The delete function is used to delete the external storage object; When the external storage management interface is called, it inherits the ExternalStorage class and instantiates the generation function, the opening function, the closing function and the deletion function to specify the management method of the external storage object of the storage module.

8. The ciphertext calculation engine according to claim 6, characterized in that: The StorageObject class includes an external storage data reading function, an external storage data writing function and an external storage data addressing function; The external storage data reading function is used to read data from the outside using an external storage object; The external storage data writing function is used to write data to the outside using the external storage object; The external storage data addressing function is used to obtain the external storage address using the external storage object; When the data external storage interface is called, it inherits the StorageObject class and instantiates the external storage data reading function, the external storage data writing function and the external storage data addressing function to specify the data external storage mode of the storage module.

9. A privacy protection device, characterized in that: include: A ciphertext calculation engine as claimed in any one of claims 1 to 8.

10. The privacy protection device according to claim 9, characterized in that: comprising a plurality of ciphertext computing engines as described in any one of claims 2 to 8; The plurality of ciphertext calculation engines are connected to each other through their respective communication modules.