Secret data processing method and device
By performing transformation, analog conversion and restoration operations on data shards, the problem of data type conversion in the prior art is solved, and efficient data processing is achieved.
Patent Information
- Application Number
- CN202210814416.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-12
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-07-12
AI Technical Summary
In the prior art, the data type conversion of intermediate calculation results has a large amount of communication and calculation amount and takes a long time during the secure multi-party calculation process.
By performing transformation operations, analog conversion operations and restore operations on data slices based on secret parameters, the data is converted from the t1 power space of modulo 2 to the t2 power space of modulo 2, reducing the calculation amount and communication amount.
It shortens the time-consuming of data type conversion and improves computing efficiency.
Smart Images

Figure CN115134079B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of computer technology, and in particular to a method for processing secret data. Background Art
[0002] Secure multi-party computation refers to the calculation of the result of a function by multiple parties, and the calculation result is made public to one or more parties without revealing the input data of the parties to the function. In the process of secure multi-party computation, calculations can be performed on secret data. The input data, intermediate calculation results, and final calculation results in the calculation process are all held by each party in the form of data shards, and the holder of the intermediate calculation results performs data type conversion on the intermediate calculation results. In the prior art, when converting the data type of the intermediate calculation results, the communication volume and calculation amount are large and the time consumption is long. Therefore, a secret data processing method is urgently needed to solve the above problems. Summary of the invention
[0003] In view of this, an embodiment of this specification provides a secret data processing method. One or more embodiments of this specification also relate to a secret data processing device, a computing device, a computer-readable storage medium and a computer program to solve the technical defects existing in the prior art.
[0004] According to a first aspect of an embodiment of this specification, a secret data processing method is provided, wherein the secret data includes a first data slice and a second data slice, wherein a first party holds the first data slice, and a second party holds the second data slice, and the secret data, the first data slice, and the second data slice all belong to a t1-power space modulo 2, including:
[0005] Performing a transformation operation based on the secret parameter and the first data slice, and obtaining a third data slice corresponding to the first data slice according to the transformation operation result; performing a modular conversion operation on the third data slice and a fourth data slice corresponding to the second data slice according to a preset operation rule, to obtain a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice;
[0006] Based on the secret parameter, the first target bit value and the second target bit value are restored, and the target secret data corresponding to the secret data is obtained according to the restoration operation result, wherein the shards of the target secret data belong to the t2 power space modulo 2, t1 and t2 are both positive integers, and t2>t1>2.
[0007] According to a second aspect of an embodiment of this specification, a secret data processing device is provided, wherein the secret data includes a first data slice and a second data slice, wherein a first party holds the first data slice, and a second party holds the second data slice, and the secret data, the first data slice, and the second data slice all belong to a t1-power space modulo 2; the device includes:
[0008] a transformation operation module, configured to perform a transformation operation based on a secret parameter and the first data slice, and obtain a third data slice corresponding to the first data slice according to a transformation operation result;
[0009] an analog conversion operation module, configured to perform an analog conversion operation on the third data slice and a fourth data slice corresponding to the second data slice according to a preset operation rule, to obtain a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice;
[0010] The restoration operation module is configured to perform a restoration operation based on the secret parameter, the first target bit value and the second target bit value, and obtain the target secret data corresponding to the secret data according to the restoration operation result, wherein the sharding of the target secret data belongs to the t2 power space modulo 2, t1 and t2 are both positive integers, and t2>t1>2.
[0011] According to a third aspect of an embodiment of this specification, a computing device is provided, including:
[0012] Memory and processor;
[0013] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above-mentioned secret data processing method are implemented.
[0014] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned secret data processing method are implemented.
[0015] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned secret data processing method.
[0016] In one embodiment of the present specification, secret data includes a first data slice and a second data slice, a first party holds the first data slice, a second party holds the second data slice, and the secret data, the first data slice and the second data slice all belong to the t1-power space of modulo 2; a transformation operation is performed based on the secret parameter and the first data slice, and a third data slice corresponding to the first data slice is obtained according to the transformation operation result; a modulo conversion operation is performed on the third data slice and the fourth data slice corresponding to the second data slice according to a preset operation rule, and a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice are obtained; a restoration operation is performed based on the secret parameter, the first target bit value and the second target bit value, and a target secret data corresponding to the secret data is obtained according to the restoration operation result, and the slice of the target secret data belongs to the t2-power space of modulo 2, t1 and t2 are positive integers, and t2>t1>2. The amount of calculation and the amount of communication are reduced, and the time consumption of data type conversion is shortened. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] Figure 1 is a flow chart of a secret data processing method provided by one embodiment of this specification;
[0018] Figure 2 is a schematic diagram of a secret data processing method provided by an embodiment of this specification;
[0019] Figure 3 is a flow chart of a second secret data processing method provided by an embodiment of this specification;
[0020] Figure 4 is a flow chart of a third secret data processing method provided by an embodiment of this specification;
[0021] Figure 5 It is a structural diagram of a secret data processing device provided by an embodiment of this specification;
[0022] Figure 6 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0023] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0024] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0025] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0026] First, the terms involved in one or more embodiments of this specification are explained.
[0027] Secret sharing, also known as secret splitting or secret sharing, is a process of splitting a secret into multiple pieces and giving them to different people for safekeeping. Each party's input data is split into pieces and the pieces are exchanged with each other; each party performs conversion operations on multiple local pieces and obtains a new piece; each party merges all the new pieces to obtain the result of the operation.
[0028] Secure Multi-Party Computation (SMC) is mainly aimed at the problem of how to securely calculate an agreed function without a trusted third party. SMC is the cryptographic basis for many applications such as electronic elections, threshold signatures, and electronic auctions.
[0029] A computing task usually involves changes in the plaintext space. For example, the calculation starts with the int8 type (8-bit integer), and then the intermediate calculation result of the int8 type is converted to the int16 type (16-bit integer) for calculation. In order to support the secure calculation of such tasks, it is necessary to implement modular expansion: convert the modulo 2 8 Slices of space converted modulo 2 16Spatial sharding. For example, we start with the int64 type (64-bit integer) for calculation, and then shift the intermediate calculation result of the int64 type right by 20 bits (that is, the lowest 20 bits are discarded and the result is placed in the lower 44 bits). In order to support the safe calculation of such tasks, we need to implement the modulo 2 64 The fragmentation of the space discards the lowest 20 bits and converts to modulo 2 44 The space is divided into slices, and then the module is expanded: the module 2 44 Slices of space converted modulo 2 64 Spatial sharding.
[0030] In this specification, a secret data processing method is provided. This specification also relates to a secret data processing device, a computing device, a computer-readable storage medium and a computer program, which are described in detail one by one in the following embodiments.
[0031] See also Figure 1 , Figure 1 A flowchart of a secret data processing method provided according to an embodiment of the present specification is shown, wherein the secret data includes a first data slice and a second data slice, wherein a first party holds the first data slice, and a second party holds the second data slice, and the secret data, the first data slice and the second data slice all belong to the t1 power space modulo 2, and specifically includes the following steps.
[0032] Step 102: Perform a transformation operation based on the secret parameter and the first data slice, and obtain a third data slice corresponding to the first data slice according to the transformation operation result.
[0033] Specifically, secret data includes private data and non-private data, where private data refers to the intermediate calculation results obtained by calculating the input data in a multi-party secure computing scenario. Secret data can be split into multiple data slices, and the data slices can be data of multiple data types, where the data types include int8, int16, int64 and other data types. The first data slice and the second data slice are both data slices obtained based on the secret data, where the first data slice is held by the first party and the second data slice is held by the second party. Secret parameters refer to parameter values calculated by a pre-set calculation formula; transformation operations refer to summation or difference operations performed on the secret parameters and the first data slice.
[0034] Based on this, the secret data is split to obtain a first data slice and a second data slice, the first data slice is held by the first party, and the second data slice is held by the second party. The secret data, the first data slice, and the second data slice all belong to the t1 power space modulo 2. The first party holding the first data slice performs a transformation operation on the secret parameter and the first data slice to obtain a third data slice corresponding to the first data slice. The transformation operation includes a summation or difference operation on the secret parameter and the first data slice, and the operation result is the third data slice.
[0035] For example, in a secret sharing scenario, a secure calculation is performed on the secret data d, and the secret data d is split into two secret data slices, which are respectively handed over to the first party and the second party. That is, each party holds a secret data slice corresponding to the secret data d. The first party holds the secret data slice d 0 , the second party holds the secret data shard d 1 The secret data slice corresponding to either party is transformed with the secret parameter to obtain the transformation result. If the party participating in the transformation operation is the first party holding the secret data slice d 0 , the transformation result is the secret data fragment d 0 The corresponding secret data shard d' 0 .
[0036] Furthermore, the secret parameter can be calculated based on the moduli space to which the secret data belongs, and the specific implementation is as follows:
[0037] According to the moduli space to which the secret data belongs, a secret parameter corresponding to the secret data is determined, wherein the secret parameter is a positive number.
[0038] Specifically, the modulo space refers to the data type corresponding to the secret data, such as the t1-power space of modulo 2. When t1 is equal to 4, the decimal secret data can be converted into four-bit binary data.
[0039] Based on this, after determining the modulus space to which the secret data belongs, the secret parameter can be calculated based on the t1 power of the determined modulus space 2. The secret parameter needs to be less than 2 to the t1-1 power minus the value corresponding to the secret data, and the value corresponding to the secret data needs to be greater than the negative secret parameter. Preferably, the secret parameter can be obtained by calculating 2 to the t1-2 power. The value of the secret parameter is a positive number, and it is necessary to make 2 to the t1-1 power greater than the value corresponding to the third data fragment, and greater than or equal to zero. The secret parameter is known to either party.
[0040] Continuing with the above example, when the moduli space to which the secret data d belongs is determined, preferably, the secret parameter u is equal to 2 raised to the power of t1-2, and the secret parameter u is a positive number.
[0041] In summary, the secret parameter corresponding to the secret data is determined according to the moduli space to which the secret data belongs, thereby ensuring that the third data slice is a positive number or a negative number, so as to facilitate the subsequent modulo conversion operation based on the third data slice.
[0042] Further, when obtaining the third data slice corresponding to the first data slice according to the transformation operation result, the transformation operation result may be modulo-ed to obtain the third data slice, which is specifically implemented as follows:
[0043] The transformation operation result is modulo 2 raised to the power of t1 to obtain a third data slice corresponding to the first data slice.
[0044] Based on this, a transformation operation is performed based on the secret parameter and the first data shard to obtain a transformation operation result, and then the transformation operation result is modulo 2 raised to the t1th power to obtain the third data shard corresponding to the first data shard.
[0045] Using the above example, the secret data is sharded into d' 0 The calculation method can be that the first party holds the secret data shard d 0 Add / subtract the secret parameter u, and take the calculation result modulo 2 raised to the power of t1 to obtain the third data shard corresponding to the first data shard, that is, the secret data shard d 0 The corresponding secret data shard d' 0 .
[0046] In summary, the third data slice is obtained by taking the modulus of 2 raised to the power of t1 based on the transformation operation result, so as to facilitate the subsequent modulus conversion operation based on the third data slice.
[0047] Step 104: Perform analog conversion operation on the third data slice and the fourth data slice corresponding to the second data slice according to preset operation rules to obtain a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice.
[0048] Specifically, the preset operation rules include logical operations on the third data slice and the fourth data slice, that is, AND operations and OR operations, and calculations of bit values corresponding to the third data slice and the fourth data slice, respectively. Correspondingly, the modular conversion operation refers to a modular expansion operation on the third data slice and the fourth data slice, that is, converting the t1 power space of the modulo 2 to which the third data slice and the fourth data slice belong to into the t2 power space of the modulo 2. In this embodiment, the modular conversion operation is a modular conversion operation from the t1 power space of the modulo 2 to the t2 power space of the modulo 2. The first target bit value refers to the third data slice in binary form obtained by base conversion of the third data slice in decimal form, and correspondingly, the second target bit value refers to the fourth data slice in binary form obtained by base conversion of the fourth data slice in decimal form.
[0049] Based on this, an analog conversion operation is performed on the third data slice according to the preset operation rules to obtain the first target bit value corresponding to the third data slice, and an analog conversion operation is performed on the fourth data slice corresponding to the second data slice according to the preset operation rules to obtain the second target bit value corresponding to the fourth data slice, wherein the first target bit value and the second target bit value are the bit values after analog expansion.
[0050] Further, after obtaining the third data slice and the fourth data slice, the third data slice and the fourth data slice can be subjected to analog conversion operation, which is specifically implemented as follows:
[0051] Determine a fourth data slice corresponding to the second data slice; determine a first bit value of the t1-1th bit of the third data slice; determine a second bit value of the t1-1th bit of the fourth data slice; perform a security logic operation on the first bit value and the second bit value to obtain a first intermediate calculation result; and calculate a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice according to the first intermediate calculation result.
[0052] Specifically, the first bit value refers to the bit value corresponding to the t1-1th bit of the third data slice, and the second bit value refers to the bit value corresponding to the t1-1th bit of the fourth data slice; logical operations include logical operations such as AND operations and OR operations, and correspondingly, secure logical operations refer to secret operations based on MPC, and do not directly use plain text for calculations; the first intermediate calculation result refers to the calculation result obtained after performing secure logical operations on the first bit value and the second bit value, and the first intermediate calculation result is a non-zero or one value; the first target bit value refers to the bit value corresponding to the third data slice, and the first target bit value is an eight-bit binary number; correspondingly, the second target bit value refers to the bit value corresponding to the fourth data slice, and the second target bit value is an eight-bit binary number.
[0053] Based on this, after determining the second data slice, determine the corresponding fourth data slice according to the second data slice, determine the corresponding t1-bit binary value according to the third data slice, and determine the bit value of the t1-1th bit in the t1-bit binary value corresponding to the third data slice. Determine the corresponding t1-bit binary value according to the fourth data slice, and determine the bit value of the t1-1th bit in the t1-bit binary value corresponding to the fourth data slice. Perform a security logic operation on the bit value of the t1-1th bit in the t1-bit binary value corresponding to the third data slice, and the bit value of the t1-1th bit in the t1-bit binary value corresponding to the fourth data slice, to obtain a first intermediate calculation result. Calculate the first target bit value corresponding to the third data slice and the second target bit value corresponding to the fourth data slice according to the first intermediate calculation result.
[0054] Using the above example, determine the second data shard d 1 The corresponding fourth data fragment d' 1 , where the second data fragment d 1 The algebraic value of the fourth data slice d' 1 The algebraic value of is equal to the secret data shard d' 0 When t1 is 4, the third data slice and the fourth data slice in algebraic value form are converted into a four-bit binary expression form to determine the third data slice d' respectively. 0 and the fourth data fragment d' 1 The third data fragment d' 0 and the fourth data fragment d' 1 The third data fragment d' is calculated based on the first intermediate calculation result. 0 The corresponding first target bit value and the fourth data fragment d' 1 The corresponding second target bit value.
[0055] To summarize, by performing a security logic operation on the bit value of the t1-1th bit in the t1-bit binary value corresponding to the third data slice and the bit value of the t1-1th bit in the t1-bit binary value corresponding to the fourth data slice, the first intermediate calculation result is obtained, and the calculation of the first target bit value corresponding to the third data slice and the second target bit value corresponding to the fourth data slice is realized, thereby reducing the computational amount of binary value calculation.
[0056] Further, after the first intermediate result is calculated, the first target bit value and the second target bit value can be calculated according to the first intermediate calculation result, which is specifically implemented as follows:
[0057] Determine a second intermediate calculation result based on the first intermediate calculation result; determine a first intermediate bit value corresponding to the third data slice and a second intermediate bit value corresponding to the fourth data slice based on the second intermediate calculation result; concatenate the first intermediate bit value with the third data slice to obtain a first target bit value, and concatenate the second intermediate bit value with the fourth data slice to obtain a second target bit value, wherein the first target bit value and the second target bit value belong to the t2 power space modulo 2.
[0058] Specifically, the second intermediate calculation result refers to the calculation result obtained by calculating the first intermediate calculation result, and the second intermediate calculation result is obtained by multiplying the first intermediate calculation result by negative one; the first intermediate bit value refers to the bit value obtained by calculating the second intermediate calculation result in binary form; correspondingly, the second intermediate bit value refers to the bit value obtained by calculating the second intermediate calculation result in binary form. The calculation of the first intermediate bit value and the second intermediate bit value can be performed using MPC technologies such as secret sharing, obfuscated circuits, and oblivious transmission.
[0059] Figure 2 is a schematic diagram of a secret data processing method provided by an embodiment of this specification, such as Figure 2 As shown, one implementation of oblivious transmission is as follows: a trusted third party generates a first set of random numbers r based on the second intermediate result i i And the second set of 4 bits of random number r 0 , r 1 , a trusted third party will i Send to the first party, r 0 , r 1 The trusted third party can be a third-party platform that provides services or a receiver of the calculation results, and is used to initiate the calculation task and obtain the calculation results of the joint calculation of the first party and the second party. The first party receives the data and the first intermediate calculation result x[t1] 0 The second party performs a calculation based on the received data and the first intermediate calculation result x[t1] of the second party. 1 Perform calculations and generate random y 1 , random y 1 That is, the second intermediate bit value is calculated by the second party as the intermediate result c 0 and c 1 , where c 0 The calculation method is 0 and x[t1] 1 XOR operation, multiply by -1, and then subtract y 1 and r e , correspondingly, c1 is calculated by 1 and x[t1] 1 XOR operation, multiply by -1, and then subtract y 1 and r 1-e , the second party will c 0 and c 1 Sent to the first party, the first party based on c 0 and c 1 Calculate the first intermediate bit value y 0 ,y 0 =c i +r i The first target bit value refers to the bit value obtained by concatenating the first intermediate bit value in binary form and the bit value corresponding to the third data slice; the second target bit value refers to the bit value obtained by concatenating the second intermediate bit value in binary form and the bit value corresponding to the fourth data slice.
[0060] Based on this, a multiplication operation is performed on the first intermediate calculation result, and the first intermediate calculation result is multiplied by negative one to obtain a second intermediate calculation result. According to the second intermediate calculation result, the first intermediate bit value corresponding to the third data slice and the second intermediate bit value corresponding to the fourth data slice are determined; the first intermediate bit value and the third data slice in binary form are spliced to obtain the first target bit value, and the second intermediate bit value and the fourth data slice in binary form are spliced to obtain the second target bit value. At this time, the first target bit value and the second target bit value obtained both belong to the t2 power space of modulo 2.
[0061] Continuing with the above example, the first intermediate calculation result is multiplied by negative one to obtain the second intermediate calculation result. The first intermediate bit value and the second intermediate bit value are determined based on the second intermediate calculation result, wherein the sum of the first intermediate bit value and the second intermediate bit value is equal to 15, which is expressed as 1111 in binary. That is, the first intermediate calculation result is 1, and the second intermediate calculation result is -1, and the corresponding first intermediate bit value can be 1010, and the second intermediate bit value can be 0101. The first intermediate bit value is concatenated with the third data slice 0111 in four-bit binary form to obtain the first target bit value 10100111; the second intermediate bit value is concatenated with the fourth data slice 1011 in four-bit binary form to obtain the second target bit value 01011011. The first target bit value 10100111 and the second target bit value 01011011 are both eight-bit binary expressions, that is, they belong to the t2 power space modulo 2.
[0062] In summary, the conversion of the moduli space is achieved by concatenating the first intermediate bit value and the third data slice to obtain the first target bit value, and concatenating the second intermediate bit value and the fourth data slice to obtain the second target bit value.
[0063] Step 106: Based on the secret parameter, the first target bit value and the second target bit value are restored, and the target secret data corresponding to the secret data is obtained according to the restoration operation result, wherein the slices of the target secret data belong to the t2 power space modulo 2, t1 and t2 are both positive integers, and t2>t1>2.
[0064] Specifically, the restoration operation refers to the calculation method corresponding to the transformation operation, which is the inverse operation of the transformation operation; the restoration operation result refers to the operation result obtained after performing the restoration operation on the first target bit value and the second target bit value; the target secret data refers to the secret data obtained after performing modulus expansion on the secret data. When the secret data is of type int8, the obtained target secret data is of type int16.
[0065] Based on this, when the first target bit value and the second target bit value are obtained, the first target bit value and the second target bit value are restored based on the secret parameter to obtain the restoration operation result corresponding to the first target bit value and the restoration operation result corresponding to the second target bit value respectively. The restoration operation result corresponding to the first target bit value is added to the restoration operation result corresponding to the second target bit value to obtain the target secret data corresponding to the secret data.
[0066] Furthermore, after performing a restoration operation on the secret parameter, the first target bit value and the second target bit value and obtaining a restoration operation result, the target secret data corresponding to the secret data can be determined according to the restoration operation result, which is specifically implemented as follows:
[0067] Determine the first target data corresponding to the first target bit value and the second target data corresponding to the second target bit value according to the restoration operation result; add the first target data to the second target data to obtain the target secret data corresponding to the secret data, wherein the slices of the target secret data belong to the t2 power space modulo 2, and the secret data value is equal to the target secret data value.
[0068] Specifically, the first target data refers to binary data obtained by performing a restoration operation on the first target bit value, and correspondingly, the second target data refers to binary data obtained by performing a restoration operation on the second target bit value, and the target secret data refers to secret data obtained by performing a modulo expansion on the secret data, wherein the shards of the secret data belong to the t1 power space modulo 2, and the shards of the target secret data belong to the t2 power space modulo 2.
[0069] Based on this, based on the secret parameter, the first target bit value and the second target bit value are restored to obtain the restoration result, and the first target data corresponding to the first target bit value and the second target data corresponding to the second target bit value are determined according to the restoration result. The first target data and the second target data are summed, and the calculated data is the target secret data corresponding to the secret data. The sharding of the target secret data belongs to the t2 power space modulo 2. The target secret data in binary expression is converted into decimal expression, and the target secret data value is equal to the secret data value.
[0070] Using the above example, based on the secret parameter u, the first target bit value 10100111 and the second target bit value 01011011 are restored, that is, the difference or sum of the secret parameter u and the first target bit value 10100111 is calculated to obtain the first target data corresponding to the first target bit value. The second target bit value 01011011 is the second target data. The first target data and the second target data are summed to obtain the target secret data corresponding to the secret data.
[0071] To summarize, by performing restoration operations on the secret parameters, the first target bit value and the second target bit value, the first target data and the second target data are determined, and then the target secret data is calculated, thereby realizing the conversion of the secret data in the t1 power space of modulo 2 to the secret data in the t2 power space of modulo 2, thereby achieving modular expansion while reducing the amount of calculation and communication.
[0072] Corresponding to the above embodiment, this specification also provides a second secret data processing method, such as Figure 3 As shown, Figure 3 A flowchart of a second secret data processing method provided by an embodiment of the present specification is shown, wherein the secret data includes a first data slice and a second data slice, wherein the first party holds the first data slice, and the second party holds the second data slice, and the secret data, the first data slice and the second data slice all belong to the t1 power space modulo 2, and specifically includes the following steps:
[0073] Step 302: Perform a sum operation based on the secret parameter and the first data shard to obtain a sum operation result, and take the sum operation result modulo 2 raised to the power of t1 to obtain a third data shard corresponding to the first data shard.
[0074] Specifically, the sum operation refers to an addition operation performed on the secret parameter and the first data slice, and the secret parameter is added to the first data slice, and the calculation result obtained is the sum operation result.
[0075] Based on this, a sum operation is performed on the first data shard based on the secret parameter, that is, the secret parameter is added to the first data shard to obtain a sum operation result, and then the sum operation result is modulo 2 raised to the power of t1 to obtain a third data shard corresponding to the first data shard.
[0076] For example, Table 1 is a parameter table provided in this embodiment, which is used to represent d, d 0 d 1 The various expressions corresponding to the parameter values and the moduli space to which the parameter values belong. In the case of t1=4, t2=8, and secret data d=-2, the two data fragments d of the secret data d 0 and d 1 Need to satisfy d = d 0 +d 1 Modulo 2 raised to the power of t1. Therefore, the two data shards d 0 It can be 3, d 1 It can be 11. Preferably, the secret parameter u is equal to 2 raised to the power of t1-2. It should be noted that the secret parameter u is a positive number, and the value of the secret parameter u needs to make 2 t1 -1-u>d>=-u. d'=d+u=2, d' is a non-negative number. The holders of the two data shards respectively 0 , data shard d 1 Perform secure computing. Hold data shard d 0 The first party divides the data into d 0 Add it to the secret parameter u, and then take the result of the addition modulo 2 raised to the power of t1 to obtain the third data fragment d' 0 .
[0077] Step 304: determine the fourth data slice corresponding to the second data slice; determine the first bit value of the t1-1th bit of the third data slice; determine the second bit value of the t1-1th bit of the fourth data slice.
[0078] Step 306: Perform a security OR operation on the first bit value and the second bit value to obtain a first intermediate calculation result; calculate the first target bit value corresponding to the third data slice and the second target bit value corresponding to the fourth data slice according to the first intermediate calculation result.
[0079] Specifically, the OR operation refers to a calculation method in logical operation, and the operation rules of the OR operation are: 0|0=0; 0|1=1; 1|0=1; 1|1=1, and the data involved in the operation are OR-operated according to binary bits. Correspondingly, the secure OR operation refers to a secret OR operation performed on the first bit value and the second bit value based on MPC.
[0080] Based on this, determine the fourth data slice corresponding to the second data slice. Convert the third data slice and the fourth data slice into binary form respectively, determine the first bit value of the t1-1th bit of the third data slice in binary form, and the second bit value of the t1-1th bit of the fourth data slice in binary form. Perform a secure OR operation on the first bit value and the second bit value to obtain a first intermediate calculation result, and calculate the first target bit value corresponding to the third data slice and the second target bit value corresponding to the fourth data slice according to the first intermediate calculation result.
[0081] Using the above example, data shard d 1 That is the fourth data fragment d' 1 , that is, d' 0 =7, d' 1 =11. 0 and d' 1 Converted to binary form, d' 0 The binary representation is 0111, d' 1 The binary representation of is 1011. d' 0 The bit value of the t1-1th bit is 0, d' 1 The bit value of the t1-1th bit is 1, for d' 0 The bit value of the t1-1th bit, and d' 1 The bit value of the t1-1th bit is securely ORed, and the result of the operation is 1, which is the first intermediate calculation result. The second intermediate calculation result y is obtained by multiplying the first intermediate calculation result by -1. 0 The corresponding intermediate calculation result y' 0 =1010, and the fourth data fragment d' 1 The corresponding intermediate calculation result y' 1 = 0101. The third data in binary form is divided into pieces d' 0 and the intermediate calculation result y' 0 Perform splicing to obtain the first target bit value e' 0 , e' 0 =10100111; the fourth data in binary form is fragmented into d' 1 and the intermediate calculation result y' 1 Perform concatenation to obtain the second target bit value e' 1 , e' 1 =01011011. Then the first target bit value e' 0 and the second target bit value e' 1 Add, and take the result modulo 2 raised to the power of t2, that is, e' 0 +e' 1 %2 8=100000010%2 8 =00000010, 00000010 has the same value as the binary representation of d' 0010.
[0082] Step 308: Perform a difference operation based on the first target bit value and the secret parameter to obtain the first target data corresponding to the first data slice; determine the second target data corresponding to the second target bit value; add the first target data to the second target data to obtain the target secret data corresponding to the secret data.
[0083] Specifically, the difference operation refers to a subtraction operation performed on the secret parameter and the first target bit value, with the first target bit value being used as the minuend and the secret parameter being used as the subtrahend to calculate and obtain the first target data.
[0084] Based on this, a difference operation is performed based on the calculated first target bit value and the secret parameter to obtain the first target data corresponding to the first data slice. The second target data corresponding to the second target bit value is determined according to the second target bit value. The first target data in binary form is added to the second target data bit by bit to obtain the target secret data corresponding to the secret data.
[0085] Using the above example, the first target data e 0 Equal to the first target bit value e' 0 Subtract the secret parameter u and then take the modulus of 2 to the power of t2 to get 10100011, the second target data e 1 Equal to the second target bit value e' 1 Equal to 01011011. The target secret data e is equal to the first target data e 0 With the second target data e 1 Add, that is, e = e 0 +e 1 =11111110. The decimal expression of the target secret data e is -2, which is equal to the value of the secret data d. Table 1 is as follows:
[0086] parameter Decimal Binary Belong to the moduli space d -2 1110 t1 d’ 2 0010 t1 u 4 0100 / <![CDATA[d 0 ]]> 3 0011 t1 <![CDATA[d 1 ]]> 11 1011 t1 <![CDATA[d’ 0 ]]> 7 0111 t1 <![CDATA[d’ 1 ]]> 11 1011 t1 <![CDATA[e’ 0 ]]> 167 10100111 t2 <![CDATA[e’ 1 ]]> 91 01011011 t2 <![CDATA[e 0 ]]> 163 10100011 t2 <![CDATA[e 1 ]]> 91 01011011 t2 e -2 / 254 11111110 t2
[0087] Table 1
[0088] To summarize, the secret data includes a first data slice and a second data slice, the first party holds the first data slice, the second party holds the second data slice, and the secret data, the first data slice and the second data slice all belong to the t1 power space modulo 2; a summation operation is performed based on the secret parameter and the first data slice, and a third data slice corresponding to the first data slice is obtained according to the summation operation result; a modulo conversion operation is performed on the third data slice and the fourth data slice corresponding to the second data slice according to a preset operation rule to obtain a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice; a difference operation is performed based on the secret parameter, the first target bit value and the second target bit value, and the target secret data corresponding to the secret data is obtained according to the difference operation result, and the slice of the target secret data belongs to the t2 power space modulo 2, which reduces the amount of calculation and communication and shortens the time consumption of data type conversion.
[0089] It should be noted that the technical solution of the second secret data processing method provided in this embodiment belongs to the same concept as the technical solution of the above-mentioned secret data processing method. For the details not described in detail in the technical solution of the second secret data processing method, please refer to the description of the technical solution of the above-mentioned secret data processing method.
[0090] Corresponding to the above embodiment, this specification also provides a second secret data processing method, such as Figure 4 As shown, Figure 4 A flowchart of a third secret data processing method provided by an embodiment of the present specification is shown, wherein the secret data includes a first data slice and a second data slice, wherein the first party holds the first data slice, and the second party holds the second data slice, and the secret data, the first data slice and the second data slice all belong to the t1 power space modulo 2, and specifically includes the following steps.
[0091] Step 402: Perform a difference operation based on the secret parameter and the first data shard to obtain a difference operation result, and take the difference operation result modulo 2 raised to the power of t1 to obtain a third data shard corresponding to the first data shard.
[0092] Specifically, the difference operation refers to a subtraction operation performed on the secret parameter and the first data slice, with the first data slice being used as the minuend and the secret parameter being used as the subtrahend, and the calculation result obtained is the difference operation result.
[0093] Based on this, a sum operation is performed based on the first target bit value and the secret parameter to obtain the first target data corresponding to the first data slice; the second target data corresponding to the second target bit value is determined; the first target data and the second target data are added to obtain the target secret data corresponding to the secret data.
[0094] For example, when t1=4, t2=8, and secret data d=-2, the two data fragments d of secret data d 0 and d 1 Need to satisfy d = d 0 +d 1 Modulo 2 raised to the power of t1. Therefore, the two data shards d 0 It can be 11, d 1 It can be 3. Preferably, the secret parameter u is equal to 2 raised to the power of t1-2. It should be noted that the secret parameter u is a positive number, and the value of the secret parameter u needs to satisfy u>d>=u-2 t1-1 d'=du=-6, d' is a negative number. The holders of the two data shards respectively 0 , data shard d 1 Perform secure computing. Hold data shard d 0 The first party divides the data into d 0 Subtract the secret parameter u, and then take the result of the subtraction modulo 2 raised to the power of t1 to obtain the third data fragment d' 0 .
[0095] Step 404: determine the fourth data slice corresponding to the second data slice; determine the first bit value of the t1-1th bit of the third data slice; determine the second bit value of the t1-1th bit of the fourth data slice.
[0096] Step 406: Perform a security AND operation on the first bit value and the second bit value to obtain a first intermediate calculation result; calculate the first target bit value corresponding to the third data slice and the second target bit value corresponding to the fourth data slice according to the first intermediate calculation result.
[0097] Specifically, AND operation refers to a calculation method in logical operation, and the operation rules of AND operation are: 0&0=0; 0&1=0; 1&0=0; 1&1=1, and the data involved in the operation are ANDed according to binary bits. Correspondingly, secure AND operation refers to a secret AND operation performed on the first bit value and the second bit value based on MPC.
[0098] Based on this, a difference operation is performed on the first data slice based on the secret parameter, that is, the secret parameter is added to the first data slice to obtain a summation result, and then the summation result is modulo 2 raised to the power of t1 to obtain the third data slice corresponding to the first data slice, and the fourth data slice corresponding to the second data slice is determined. The third data slice and the fourth data slice are respectively converted into binary form, and the first bit value of the t1-1th bit of the third data slice in binary form and the second bit value of the t1-1th bit of the fourth data slice in binary form are determined. A secure AND operation is performed on the first bit value and the second bit value to obtain a first intermediate calculation result, and the first target bit value corresponding to the third data slice and the second target bit value corresponding to the fourth data slice are respectively calculated according to the first intermediate calculation result.
[0099] Using the above example, data shard d 1 That is the fourth data fragment d' 1 , that is, d' 0 =7, d' 1 =3. 0 and d' 1 Converted to binary form, d' 0 The binary representation is 0111, d' 1 The binary representation of is 0011. d' 0 The bit value of the t1-1th bit is 0, d' 1 The bit value of the t1-1th bit is 0, for d' 0 The bit value of the t1-1th bit, and d' 1 The bit value of the t1-1th bit is securely ANDed, and the result is 0. The result is the first intermediate calculation result. The second intermediate calculation result y is obtained by multiplying the first intermediate calculation result by -1. 0 The corresponding intermediate calculation result y' 0 =1000, and the fourth data fragment d' 1 The corresponding intermediate calculation result y' 1 = 1000. The third data in binary form is divided into pieces d' 0 and the intermediate calculation result y' 0 Perform splicing to obtain the first target bit value e' 0 , e' 0 =10000111; the fourth data in binary form is fragmented into d' 1 and the intermediate calculation result y' 1 Perform concatenation to obtain the second target bit value e' 1 , e' 1 =10000011. Then set a target bit value e' 0 and the second target bit value e' 1Add, and take the result modulo 2 raised to the power of t2, that is, e' 0 +e' 1 %2 8 =100001010%2 8 =00001010, 00001010 has the same value as the binary representation of d', 1010.
[0100] Step 408: Perform a sum operation based on the first target bit value and the secret parameter to obtain the first target data corresponding to the first data slice; determine the second target data corresponding to the second target bit value; add the first target data to the second target data to obtain the target secret data corresponding to the secret data.
[0101] Specifically, the sum operation refers to an addition operation on the secret parameter and the first target bit value. The secret parameter is added to the first data slice, and the calculation result obtained is the first target data corresponding to the first data slice.
[0102] Based on this, the first target data corresponding to the first data slice is obtained by performing a sum operation based on the calculated first target bit value and the secret parameter. The second target data corresponding to the second target bit value is determined according to the second target bit value. The first target data in binary form is added to the second target data bit by bit to obtain the target secret data corresponding to the secret data.
[0103] Using the above example, the first target data e 0 Equal to the first target bit value e' 0 Add the secret parameter u and then take the modulus of 2 to the power of t2 to equal 10001011, the second target data e 1 Equal to the second target bit value e' 1 Equal to 10000011. The target secret data e is equal to the first target data e 0 With the second target data e 1 Add, that is, e = e 0 +e 1 = 00001110. The decimal expression of the target secret data e is -2, which is equal to the value of the secret data d.
[0104] To summarize, the secret data includes a first data slice and a second data slice, the first party holds the first data slice, the second party holds the second data slice, and the secret data, the first data slice and the second data slice all belong to the t1 power space modulo 2; a summation operation is performed based on the secret parameter and the first data slice, and a third data slice corresponding to the first data slice is obtained according to the difference operation result; a modulo conversion operation is performed on the third data slice and the fourth data slice corresponding to the second data slice according to a preset operation rule to obtain a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice; a difference operation is performed based on the secret parameter, the first target bit value and the second target bit value, and the target secret data corresponding to the secret data is obtained according to the summation operation result, and the slice of the target secret data belongs to the t2 power space modulo 2, which reduces the amount of calculation and communication and shortens the time consumption of data type conversion.
[0105] It should be noted that the technical solution of the third secret data processing method provided in this embodiment belongs to the same concept as the technical solution of the above-mentioned secret data processing method. For the details not described in detail in the technical solution of the third secret data processing method, please refer to the description of the technical solution of the above-mentioned secret data processing method.
[0106] Corresponding to the above method embodiment, this specification also provides a secret data processing device embodiment, Figure 5 FIG. 1 is a schematic diagram showing the structure of a secret data processing device provided by an embodiment of the present specification. Figure 5 As shown, the secret data includes a first data slice and a second data slice, wherein the first party holds the first data slice, the second party holds the second data slice, and the secret data, the first data slice and the second data slice all belong to the t1 power space of modulo 2; the device includes:
[0107] A transformation operation module 502 is configured to perform a transformation operation based on the secret parameter and the first data slice, and obtain a third data slice corresponding to the first data slice according to the transformation operation result;
[0108] The analog conversion operation module 504 is configured to perform an analog conversion operation on the third data slice and the fourth data slice corresponding to the second data slice according to a preset operation rule to obtain a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice;
[0109] The restoration operation module 506 is configured to perform a restoration operation based on the secret parameter, the first target bit value and the second target bit value, and obtain the target secret data corresponding to the secret data according to the restoration operation result, wherein the sharding of the target secret data belongs to the t2 power space modulo 2, t1 and t2 are both positive integers, and t2>t1>2.
[0110] In an optional embodiment, the analog conversion operation module 504 is further configured to:
[0111] The modular conversion operation is a modular conversion operation from the t1-power space of modular 2 to the t2-power space of modular 2.
[0112] In an optional embodiment, the transformation operation module 502 is further configured to:
[0113] The secret parameter is obtained by the following operation: determining the secret parameter corresponding to the secret data according to the modulus space to which the secret data belongs, wherein the secret parameter is a positive number.
[0114] In an optional embodiment, the transformation operation module 502 is further configured to:
[0115] The transformation operation result is modulo 2 raised to the power of t1 to obtain a third data slice corresponding to the first data slice.
[0116] In an optional embodiment, the analog conversion operation module 504 is further configured to:
[0117] Determine a fourth data slice corresponding to the second data slice; determine a first bit value of the t1-1th bit of the third data slice; determine a second bit value of the t1-1th bit of the fourth data slice; perform a security logic operation on the first bit value and the second bit value to obtain a first intermediate calculation result; and calculate a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice according to the first intermediate calculation result.
[0118] In an optional embodiment, the analog conversion operation module 504 is further configured to:
[0119] Determine a second intermediate calculation result based on the first intermediate calculation result; determine a first intermediate bit value corresponding to the third data slice and a second intermediate bit value corresponding to the fourth data slice based on the second intermediate calculation result; concatenate the first intermediate bit value with the third data slice to obtain a first target bit value, and concatenate the second intermediate bit value with the fourth data slice to obtain a second target bit value, wherein the first target bit value and the second target bit value belong to the t2 power space modulo 2.
[0120] In an optional embodiment, the restoration operation module 506 is further configured to:
[0121] Determine the first target data corresponding to the first target bit value and the second target data corresponding to the second target bit value according to the restoration operation result; add the first target data to the second target data to obtain the target secret data corresponding to the secret data, wherein the slices of the target secret data belong to the t2 power space modulo 2, and the secret data value is equal to the target secret data value.
[0122] In an optional embodiment, the transformation operation module 502 is further configured to:
[0123] A summation operation is performed based on the secret parameter and the first data slice to obtain a summation result, and the summation result is modulo 2 raised to the t1th power to obtain a third data slice corresponding to the first data slice; accordingly, the modulus conversion operation includes: determining the fourth data slice corresponding to the second data slice; determining the first bit value of the t1-1th bit of the third data slice; determining the second bit value of the t1-1th bit of the fourth data slice; performing a security OR operation on the first bit value and the second bit value to obtain a first intermediate calculation result; according to the first intermediate calculation result, respectively calculating the first target bit value corresponding to the third data slice and the second target bit value corresponding to the fourth data slice; accordingly, the restoration operation includes: performing a difference operation based on the first target bit value and the secret parameter to obtain the first target data corresponding to the first data slice; determining the second target data corresponding to the second target bit value; adding the first target data to the second target data to obtain the target secret data corresponding to the secret data.
[0124] In an optional embodiment, the transformation operation module 502 is further configured to:
[0125] A difference operation is performed based on the secret parameter and the first data slice to obtain a difference operation result, and the difference operation result is taken modulo 2 raised to the t1th power to obtain a third data slice corresponding to the first data slice; accordingly, the modulus conversion operation includes: determining the fourth data slice corresponding to the second data slice; determining the first bit value of the t1-1th bit of the third data slice; determining the second bit value of the t1-1th bit of the fourth data slice; performing a security AND operation on the first bit value and the second bit value to obtain a first intermediate calculation result; according to the first intermediate calculation result, respectively calculating the first target bit value corresponding to the third data slice and the second target bit value corresponding to the fourth data slice; accordingly, the restoration operation includes: performing a summation operation based on the first target bit value and the secret parameter to obtain the first target data corresponding to the first data slice; determining the second target data corresponding to the second target bit value; adding the first target data to the second target data to obtain the target secret data corresponding to the secret data.
[0126] In summary, the secret data processing device provided in this specification, the secret data includes a first data slice and a second data slice, the first party holds the first data slice, the second party holds the second data slice, the secret data, the first data slice and the second data slice all belong to the t1-power space of modulo 2; based on the secret parameter and the first data slice, a transformation operation is performed, and the third data slice corresponding to the first data slice is obtained according to the transformation operation result; according to the preset operation rule, the third data slice and the fourth data slice corresponding to the second data slice are subjected to a modular conversion operation to obtain a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice; based on the secret parameter, the first target bit value and the second target bit value, a restoration operation is performed, and the target secret data corresponding to the secret data is obtained according to the restoration operation result, and the slice of the target secret data belongs to the t2-power space of modulo 2, t1 and t2 are positive integers, and t2>t1>2. The amount of calculation and the amount of communication are reduced, and the time consumption of data type conversion is shortened.
[0127] The above is a schematic scheme of a secret data processing device of this embodiment. It should be noted that the technical scheme of the secret data processing device and the technical scheme of the secret data processing method described above are of the same concept, and the details not described in detail in the technical scheme of the secret data processing device can be referred to the description of the technical scheme of the secret data processing method described above.
[0128] Figure 6The block diagram of a computing device 600 according to an embodiment of the present specification is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and the database 650 is used to store data.
[0129] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 640 may include one or more of any type of network interface (e.g., a network interface card (NIC)) whether wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a World Wide Interoperability for Microwave Access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0130] In one embodiment of the present specification, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 6 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0131] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 600 may also be a mobile or stationary server.
[0132] The processor 620 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the above-mentioned secret data processing method.
[0133] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned secret data processing method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above-mentioned secret data processing method.
[0134] An embodiment of the present specification also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned secret data processing method.
[0135] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned secret data processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned secret data processing method.
[0136] An embodiment of the present specification also provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned secret data processing method.
[0137] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the above-mentioned secret data processing method belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be referred to the description of the technical scheme of the above-mentioned secret data processing method.
[0138] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0139] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0140] It should be noted that, for the convenience of description, the aforementioned method embodiments are all described as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0141] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0142] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A method for processing secret data, wherein the secret data includes a first data slice and a second data slice, in, A first party holds the first data shard, a second party holds the second data shard, the secret data, the first data shard, and the second data shard all belong to a t1-power space modulo 2, and the method comprises: Performing a transformation operation based on a secret parameter and the first data slice, and obtaining a third data slice corresponding to the first data slice according to the transformation operation result, wherein the secret parameter is obtained by calculation according to the modulus space to which the secret data belongs; Performing a modular conversion operation on the third data slice and the fourth data slice corresponding to the second data slice according to a preset operation rule to obtain a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice, including: determining the fourth data slice corresponding to the second data slice, the first bit value of the t1-1th bit of the third data slice, and the second bit value of the t1-1th bit of the fourth data slice; performing a security logic operation on the first bit value and the second bit value to obtain a first intermediate calculation result; and respectively calculating the first target bit value corresponding to the third data slice and the second target bit value corresponding to the fourth data slice according to the first intermediate calculation result; Based on the secret parameter, the first target bit value and the second target bit value are restored, and the target secret data corresponding to the secret data is obtained according to the restoration operation result, wherein the shards of the target secret data belong to the t2 power space modulo 2, t1 and t2 are both positive integers, and t2>t1>2.
2. The method according to claim 1, in, The modular conversion operation is a modular conversion operation from the t1 power space of modular 2 to the t2 power space of modular 2.
3. The method according to claim 1, in, The secret parameter is obtained by the following operation: According to the moduli space to which the secret data belongs, a secret parameter corresponding to the secret data is determined, wherein the secret parameter is a positive number.
4. The method according to claim 1, obtaining a third data slice corresponding to the first data slice according to the transformation operation result, include: The transformation operation result is modulo 2 raised to the power of t1 to obtain a third data slice corresponding to the first data slice.
5. The method according to claim 1, wherein the first target bit value corresponding to the third data slice and the second target bit value corresponding to the fourth data slice are calculated respectively according to the first intermediate calculation result, include: Determine a second intermediate calculation result according to the first intermediate calculation result; Determine a first intermediate bit value corresponding to the third data slice and a second intermediate bit value corresponding to the fourth data slice according to the second intermediate calculation result; The first intermediate bit value and the third data slice are concatenated to obtain a first target bit value, and the second intermediate bit value and the fourth data slice are concatenated to obtain a second target bit value, wherein the first target bit value and the second target bit value belong to the t2 power space modulo 2.
6. The method according to claim 1, wherein the target secret data corresponding to the secret data is obtained according to the restoration operation result. include: Determine, according to the restoration operation result, first target data corresponding to the first target bit value and second target data corresponding to the second target bit value; The first target data is added to the second target data to obtain target secret data corresponding to the secret data, wherein the slices of the target secret data belong to the t2 power space modulo 2, and the secret data value is equal to the target secret data value.
7. The method according to claim 1, wherein the transformation operation is: include: Perform a sum operation based on the secret parameter and the first data shard to obtain a sum operation result, and perform a modulo operation on the sum operation result with respect to 2 raised to the power of t1 to obtain a third data shard corresponding to the first data shard; Correspondingly, the analog conversion operation includes: determining a fourth data slice corresponding to the second data slice; determining a first bit value of the t1-1th bit of the third data slice; determining a second bit value of the t1-1th bit of the fourth data slice; performing a secure OR operation on the first bit value and the second bit value to obtain a first intermediate calculation result; and respectively calculating a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice according to the first intermediate calculation result; Correspondingly, the restoration operation includes: performing a difference operation based on the first target bit value and the secret parameter to obtain the first target data corresponding to the first data slice; determining the second target data corresponding to the second target bit value; adding the first target data to the second target data to obtain the target secret data corresponding to the secret data.
8. The method according to claim 1, wherein the transformation operation is: include: Perform a difference operation based on the secret parameter and the first data shard to obtain a difference operation result, and perform a modulo operation on the difference operation result with respect to 2 raised to the power of t1 to obtain a third data shard corresponding to the first data shard; Correspondingly, the analog conversion operation includes: determining a fourth data slice corresponding to the second data slice; determining a first bit value of the t1-1th bit of the third data slice; determining a second bit value of the t1-1th bit of the fourth data slice; performing a security AND operation on the first bit value and the second bit value to obtain a first intermediate calculation result; and respectively calculating a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice according to the first intermediate calculation result; Correspondingly, the restoration operation includes: performing a sum operation based on the first target bit value and the secret parameter to obtain the first target data corresponding to the first data slice; determining the second target data corresponding to the second target bit value; adding the first target data to the second target data to obtain the target secret data corresponding to the secret data.
9. A secret data processing device, wherein the secret data includes a first data slice and a second data slice, in, A first party holds the first data slice, a second party holds the second data slice, the secret data, the first data slice and the second data slice all belong to a t1-power space modulo 2; the device comprises: a transformation operation module, configured to perform a transformation operation based on a secret parameter and the first data slice, and obtain a third data slice corresponding to the first data slice according to a transformation operation result, wherein the secret parameter is obtained by calculation according to a modulus space to which the secret data belongs; The analog conversion operation module is configured to perform analog conversion operation on the third data slice and the fourth data slice corresponding to the second data slice according to a preset operation rule to obtain a first target bit value corresponding to the third data slice and a second target bit value corresponding to the fourth data slice, including: determining the fourth data slice corresponding to the second data slice, the first bit value of the t1-1th bit of the third data slice, and the second bit value of the t1-1th bit of the fourth data slice; performing a security logic operation on the first bit value and the second bit value to obtain a first intermediate calculation result; and respectively calculating the first target bit value corresponding to the third data slice and the second target bit value corresponding to the fourth data slice according to the first intermediate calculation result; The restoration operation module is configured to perform a restoration operation based on the secret parameter, the first target bit value and the second target bit value, and obtain the target secret data corresponding to the secret data according to the restoration operation result, wherein the sharding of the target secret data belongs to the t2 power space modulo 2, t1 and t2 are both positive integers, and t2>t1>2.
10. A computing device, include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the secret data processing method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the secret data processing method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method and device for carrying out security operation on multi-party private data
CN111523144A
Secure mode conversion method and device for privacy numerical value
CN114611150A
Homomorphic evaluation including key switching, modulus switching, and dynamic noise management
US20130216044A1
