Multi-party security computing method based on secret sharing and related equipment

Through pre-calculation and 1-out-of-2shared OT protocol, the problem of increasing data transmission and calculation amount in batch multi-party secure calculations is solved, and the computing performance is improved.

CN119011135APending Publication Date: 2024-11-22ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411029776.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-11-22

AI Technical Summary

Technical Problem

In multi-party security computing scenarios, performing multiple multi-party security computing in batches increases the amount of data transmission and calculation, resulting in performance degradation.

Method used

By precalculating two possible expected calculation results corresponding to 1 bit data, and using the 1-out-of-2shared OT protocol, both parties can obtain secret fragments of the actual calculation results corresponding to the true value of each input data, The safe calculation parameters are transmitted only once in the online stage.

Benefits of technology

It greatly reduces the amount of data transmission and calculation volume, and improves the computing performance of batch multi-party secure computing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119011135A_ABST
    Figure CN119011135A_ABST
Patent Text Reader

Abstract

The invention provides a multi-party security computing method based on secret sharing and related equipment. The multi-party security computing method is applied to first computing equipment participating in multi-party security computing. The first computing device holds N pieces of first input data, and the value of the first input data is 0 or 1; the second computing device holds second input data, a first computing result and a second computing result, wherein the first computing result and the second computing result respectively correspond to the value of 0 or 1 of the first input data. The method comprises the following steps: acquiring N random numbers and N random values; acquiring a security calculation parameter which is sent by the second calculation equipment and is calculated based on the first calculation result and the second calculation result; if the value of the jth first input data is 0, calculating a first secret fragment in a multi-party security calculation result of the jth first input data based on the jth random value; and if the value of the jth first input data is 1, calculating a first secret fragment in the multi-party security calculation result of the jth first input data based on the jth random value and the security calculation parameter.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of secure computing technology, and in particular, to a multi-party secure computing method based on secret sharing and related equipment. Background Art

[0002] Secret sharing (SS), or secret sharing, is a common security protocol in secure multi-party computing (SMPC). In the process of secure multi-party computing, in order not to disclose the data and calculation results of each party, the calculation is usually kept in a shared state. Secret sharing splits the secret information (such as the data of each party and the calculation results) in an appropriate way and assigns each split part to different participants for management, so that each participant cannot recover the secret information alone, and only multiple participants can recover the secret information by working together.

[0003] However, in some possible scenarios, it is often necessary to perform multiple multi-party secure computations in batches, which inevitably increases the amount of data transmission and computation in the computation process. Therefore, how to ensure the performance of batch multi-party secure computation is an urgent problem to be solved. Summary of the invention

[0004] In view of this, one or more embodiments of the present specification provide a multi-party secure computing method based on secret sharing and related devices.

[0005] In a first aspect, the present specification provides a multi-party secure computing method based on secret sharing, which is applied to a first computing device participating in a multi-party secure computing; the first computing device holds N first input data corresponding to the multi-party secure computing, the first input data is 1-bit data with a value of 0 or 1, and N is an integer greater than 1; a second computing device participating in the multi-party secure computing holds second input data corresponding to the multi-party secure computing and an expected computing result; wherein the expected computing result includes a first computing result calculated with the second input data when the value of the first input data is 0, and a second computing result calculated with the second input data when the value of the first input data is 1;

[0006] The method comprises:

[0007] Obtaining N random numbers, and N random values ​​corresponding to the array subscripts indicated by the N random numbers, randomly selected from N arrays consisting of N groups of random values ​​obtained from the second computing device; wherein each group of random values ​​in the N groups of random values ​​includes a first random value and a second random value, and each of the N random numbers has a value of 0 or 1;

[0008] Acquire a security computing parameter corresponding to the multi-party secure computing that is calculated based on the first computing result and the second computing result and sent by the second computing device;

[0009] When the value of the j-th first input data among the N first input data is 0, based on the j-th random value among the N random values, the ciphertext data corresponding to the first calculation result is calculated, and the ciphertext data is used as the first secret shard in the multi-party security calculation result of the j-th first input data; or, when the value of the j-th first input data is 1, based on the j-th random value and the security calculation parameter, the ciphertext data corresponding to the second calculation result is calculated, and the ciphertext data is used as the first secret shard in the multi-party security calculation result of the j-th first input data;

[0010] Among them, the j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​in the N groups of random values, corresponding to the array subscript indicated by the j-th random number among the N random numbers; j is an integer greater than or equal to 0 and less than N.

[0011] In a second aspect, the present specification provides a multi-party secure computing method, which is applied to a second computing device participating in the multi-party secure computing; the first computing device participating in the multi-party secure computing holds N first input data corresponding to the multi-party secure computing, the first input data is 1-bit data with a value of 0 or 1, and N is an integer greater than 1; the second computing device holds second input data corresponding to the multi-party secure computing and an expected computing result; wherein the expected computing result includes a first computing result calculated with the second input data when the value of the first input data is 0, and a second computing result calculated with the second input data when the value of the first input data is 1;

[0012] The method comprises:

[0013] Obtaining N groups of random values, each group of random values ​​in the N groups of random values ​​includes a first random value and a second random value;

[0014] Calculate a security calculation parameter corresponding to the multi-party security calculation based on the first calculation result and the second calculation result, and send the security calculation parameter to the first computing device, so that when the value of the jth first input data among the N first input data held by the first computing device is 0, the first computing device calculates the ciphertext data corresponding to the first calculation result based on the jth random value among the N random values ​​obtained, and uses the ciphertext data as the first secret shard in the multi-party security calculation result of the jth first input data; or, when the value of the jth first input data is 1, calculate the ciphertext data corresponding to the second calculation result based on the jth random value and the security calculation parameter, and use the ciphertext data as the first secret shard in the multi-party security calculation result of the jth first input data;

[0015] Among them, the j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​in the N groups of random values, corresponding to the array subscript indicated by the j-th random number among the N random numbers obtained by the first computing device; j is an integer greater than or equal to 0 and less than N.

[0016] In a third aspect, the present specification provides a multi-party secure computing apparatus based on secret sharing, which is applied to a first computing device participating in a multi-party secure computing; the first computing device holds N first input data corresponding to the multi-party secure computing, the first input data is 1-bit data with a value of 0 or 1, and N is an integer greater than 1; a second computing device participating in the multi-party secure computing holds second input data corresponding to the multi-party secure computing and an expected computing result; wherein the expected computing result includes a first computing result calculated with the second input data when the value of the first input data is 0, and a second computing result calculated with the second input data when the value of the first input data is 1;

[0017] The device comprises:

[0018] A first acquisition unit is used to acquire N random numbers, and N random values ​​randomly selected from N arrays consisting of N groups of random values ​​acquired by the second computing device and corresponding to the array subscripts indicated by the N random numbers; wherein each group of random values ​​in the N groups of random values ​​includes a first random value and a second random value, and each of the N random numbers has a value of 0 or 1;

[0019] A second acquisition unit is configured to acquire a security computing parameter corresponding to the multi-party secure computing and calculated based on the first computing result and the second computing result and sent by the second computing device; and

[0020] a computing unit, configured to, when the value of the j-th first input data among the N first input data is 0, calculate the ciphertext data corresponding to the first computing result based on the j-th random value among the N random values, and use the ciphertext data as the first secret shard in the multi-party security computing result of the j-th first input data; or, when the value of the j-th first input data is 1, calculate the ciphertext data corresponding to the second computing result based on the j-th random value and the security computing parameter, and use the ciphertext data as the first secret shard in the multi-party security computing result of the j-th first input data;

[0021] Among them, the j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​in the N groups of random values, corresponding to the array subscript indicated by the j-th random number among the N random numbers; j is an integer greater than or equal to 0 and less than N.

[0022] In a fourth aspect, the present specification provides a multi-party secure computing apparatus based on secret sharing, which is applied to a second computing device participating in the multi-party secure computing; the first computing device participating in the multi-party secure computing holds N first input data corresponding to the multi-party secure computing, the first input data is 1-bit data with a value of 0 or 1, and N is an integer greater than 1; the second computing device holds second input data corresponding to the multi-party secure computing and an expected computing result; wherein the expected computing result includes a first computing result calculated with the second input data when the value of the first input data is 0, and a second computing result calculated with the second input data when the value of the first input data is 1;

[0023] The device comprises:

[0024] An acquisition unit, configured to acquire N groups of random values, each group of random values ​​in the N groups of random values ​​comprising a first random value and a second random value;

[0025] a sending unit, configured to calculate a security calculation parameter corresponding to the multi-party security calculation based on the first calculation result and the second calculation result, and send the security calculation parameter to the first computing device, so that when the value of the j-th first input data among the N first input data held by the first computing device is 0, the first computing device calculates the ciphertext data corresponding to the first calculation result based on the j-th random value among the N random values ​​obtained, and uses the ciphertext data as the first secret shard in the multi-party security calculation result of the j-th first input data; or, when the value of the j-th first input data is 1, the first computing device calculates the ciphertext data corresponding to the second calculation result based on the j-th random value and the security calculation parameter, and uses the ciphertext data as the first secret shard in the multi-party security calculation result of the j-th first input data;

[0026] Among them, the j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​in the N groups of random values, corresponding to the array subscript indicated by the j-th random number among the N random numbers obtained by the first computing device; j is an integer greater than or equal to 0 and less than N.

[0027] Accordingly, this specification also provides a computing device, comprising: a memory and a processor; the memory stores a computer program / instruction that can be executed by the processor; when the processor executes the computer program / instruction, it executes the multi-party secure computing method based on secret sharing described in the first aspect or the second aspect above.

[0028] Accordingly, the present specification also provides a computer-readable storage medium having a computer program / instruction stored thereon. When the computer program / instruction is executed by a processor, the multi-party secure computing method based on secret sharing as described in the first aspect or the second aspect above is executed.

[0029] Accordingly, the present specification also provides a computer program product, which includes a computer program / instructions. When the computer program / instructions are executed by a processor, the multi-party secure computing method based on secret sharing as described in the first aspect or the second aspect above is performed.

[0030] In summary, the present application takes into account that in some batch multi-party secure computing scenarios, the multiple data (for example, N first input data) held by one of the parties that may participate in the multi-party secure computing are all 1 bit, with a value of 0 or 1, while the data held by the other party is a fixed integer scalar (for example, the second input data), that is, the purpose of the batch multi-party secure computing is to perform secure computing on multiple bits with the integer scalar respectively, and finally realize the secure computing of a bit vector and an integer scalar. Based on this, the present application takes into account that each first input data has only two possible values ​​of 0 and 1. Therefore, two possible expected computing results corresponding to the value of 0 or 1 (that is, the first computing result and the second computing result) can be calculated in advance, and then through the OT protocol, the two parties can obtain the secret shards of the actual computing results corresponding to the true value of each first input data. In addition, based on the calculation method provided by the present application, the secure computing parameters for multi-party secure computing only need to be transmitted once in the online stage, which greatly reduces the amount of data transmission and calculation, and improves the computing performance of batch multi-party secure computing. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 It is a schematic diagram of an alternative sharing inadvertent transmission provided by an exemplary embodiment;

[0032] Figure 2 is a schematic diagram of a system architecture provided by an exemplary embodiment;

[0033] Figure 3 It is a flowchart of a multi-party secure computing method based on secret sharing provided by an exemplary embodiment;

[0034] Figure 4 It is a schematic diagram of a calculation process of batch two-choice sharing and oblivious transmission provided by an exemplary embodiment;

[0035] Figure 5a It is a schematic diagram of another calculation process of batch two-choice sharing oblivious transmission provided by an exemplary embodiment;

[0036] Figure 5b It is a schematic diagram of a calculation process of another batch two-choice sharing oblivious transmission provided by an exemplary embodiment;

[0037] Figure 6 It is a flowchart of another multi-party secure computing method based on secret sharing provided by an exemplary embodiment;

[0038] Figure 7 It is a structural schematic diagram of a multi-party secure computing device based on secret sharing provided by an exemplary embodiment;

[0039] Figure 8It is a structural schematic diagram of another multi-party secure computing device based on secret sharing provided by an exemplary embodiment;

[0040] Fig. 9 It is a structural diagram of a computing device provided by an exemplary embodiment. DETAILED DESCRIPTION

[0041] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of this specification. Instead, they are merely examples of devices and methods consistent with some aspects of one or more embodiments of this specification as detailed in the appended claims.

[0042] It should be noted that: in other embodiments, the steps of the corresponding method are not necessarily performed in the order shown and described in this specification. In some other embodiments, the steps included in the method may be more or less than those described in this specification. In addition, a single step described in this specification may be decomposed into multiple steps for description in other embodiments; and multiple steps described in this specification may be combined into a single step for description in other embodiments.

[0043] In addition, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0044] First, some terms in this specification are explained to facilitate understanding by those skilled in the art.

[0045] (1) Secret sharing, also known as secret sharing or secret splitting, is a cryptographic technology that was originally used to manage secret information. The basic principle is to split secret information into multiple shares in an appropriate manner and give the multiple shares to different people for safekeeping. Only when more than a threshold number of people merge their shares can the secret be restored, while less than the threshold number of shares cannot restore any information of the secret. The threshold number is usually the same as the number of participants in multi-party secure computing. When secret sharing is applied to multi-party secure computing, the share conversion technology is used. First, the input data of each party is split into multiple shares and the shares are exchanged with each other; then, each party performs conversion operations on the local multiple shares and each obtains a new secret share (i.e., the share of the calculation result); finally, all parties merge all the new secret shares to obtain the complete calculation result.

[0046] (2) Oblivious Transfer (OT) protocol is a secure computing protocol executed by two parties. It allows one party (sender) to transmit one or more data in a set of data to another party (receiver). During the transmission process, the sender does not know which data in the set of data is transmitted (or the sender does not know which data the receiver obtains). In addition, the receiver cannot obtain other unselected data except the data selected by itself, thereby achieving secure transmission of information while maintaining the privacy of both parties. For example, the sender holds N secret input data, namely x[0], x[1], ..., x[N-1], where N is an integer greater than 1; the receiver holds a secret choice p, where p is an integer greater than or equal to 0 and less than or equal to N-1. The result of the oblivious transfer protocol is that the receiver obtains the pth input data x[p] among the N input data, while the other input data of the sender are always kept confidential, and the sender cannot know the receiver's p, that is, cannot know the specific data obtained by the receiver. Exemplarily, the above-mentioned N secret input data can be the personal information of N users, such as identity information or credit evaluation, etc., which is not specifically limited in this specification.

[0047] Among them, shared oblivious transfer (shared OT protocol) is a transformation based on the OT protocol. The final execution result of the sharedOT protocol (or the output of the shared OT protocol) can be that the sender and the receiver each obtain a slice of c=x[p]. For example, the receiver obtains slice c0 and the sender obtains slice c1, and the sender cannot know the receiver's p.

[0048] Among them, the Random Oblivious Transfer (Random OT) protocol is a secure computing protocol executed by both parties. Executing Random OT allows the sender of the protocol to obtain N random data, and the receiver obtains a random choice and the random data corresponding to the choice. Random OT can be a tool for implementing other secure computing protocols.

[0049] In an illustrated embodiment, a 1-out-of-2 shared OT can be constructed based on random OT, wherein the 1-out-of-2 OT protocol means that the sender holds two data and the receiver can choose to obtain one of them, while the sender is unaware of the choice. For example, see Figure 1 , Figure 1 FIG. 1 is a schematic diagram of an exemplary embodiment of a two-choice sharing oblivious transmission. Figure 1 As shown, the receiver holds a 1-bit choice p, that is, the value of p is equal to 0 or 1, and the sender holds two t bits of input data, namely x[0] and x[1], where t is an integer greater than or equal to 1.

[0050] like Figure 1 As shown, in the offline phase, the sender and the receiver run the random OT protocol, the sender obtains the random values ​​r0 and r1 generated by running the random OT protocol, and the receiver obtains the random number i and the corresponding random value r generated by running the random OT protocol. i The random values ​​r0 and r1 can be 128-bit or 256-bit random data, which is not specifically limited in this specification. The random number i is 1-bit random data, that is, the value of i is equal to 0 or 1; correspondingly, the random value r i It can be a random value corresponding to the array subscript indicated by the random number i, randomly selected from an array composed of random values ​​r0 and random values ​​r1 as array elements. In one illustrated embodiment, the value of the random number i can be determined as the value of the array subscript, that is, the random number i is used as the array subscript. Among them, the array subscript is used to represent the array element at the corresponding position in the array. For example, the array subscript is 0, which can represent the first array element in the array, and the array subscript is 1, which can represent the second array element in the array, and so on. It will not be elaborated here. For example, if the random number i=0, the array subscript is 0, and accordingly, the random value r obtained by the receiver is i is the first random value in the array consisting of random values ​​r0 and r1 as array elements, that is, r0; if the random number i = 1, the array subscript is 1, and accordingly, the random value r obtained by the receiver is iIt is the second random value in the array consisting of random value r0 and random value r1 as array elements, that is, r1.

[0051] like Figure 1 As shown, in the online stage, the receiver calculates the XOR result e=i XOR p, and sends the calculated XOR result e to the sender, where XOR is an exclusive OR calculation, which can also be expressed as ⊕, that is, e=i⊕p; the sender calculates f=h(r0)+h(r1)-x[0]+x[1], and sends the calculated f to the receiver.

[0052] Wherein, h() is a hash function, which is used to output a random value of t bits after a certain operation on the input random value (such as r0 and r1), that is, to output a random value of the same length as x[0] and x[1]. For example, if the length of r0 and r1 is 64 bits or 256 bits, and the length of x[0] and x[1] is 128 bits, then based on the hash function, the 128-bit hash values ​​h(r0) and h(r1) corresponding to the random values ​​r0 and r1 can be calculated, and then, based on the hash values ​​h(r0) and h(r1), the above f can be further calculated in combination with x[0] and x[1]. It should be understood that if the length of the random value originally input is consistent with the length of x[0] and x[1] (for example, the lengths of r0 and r1 are all 128 bits as are the lengths of x[0] and x[1]), the hash function may also output the random value originally input directly without performing any operation, i.e., h(r0)=r0, h(r1)=r1. In an illustrated embodiment, the hash function h() may be a pseudo-random number generating function; or, in an illustrated embodiment, if the lengths of r0 and r1 are greater than t bits, the hash function h() may also be a simple function for directly intercepting t bits from r0 and r1 to obtain h(r0) and h(r1), etc. This specification does not specifically limit this.

[0053] Furthermore, if Figure 1 As shown, after the sender obtains the XOR result e calculated by the receiver and the receiver obtains f calculated by the sender, both parties can calculate the secret fragment of c=x[p] based on the obtained data.

[0054] For example, Figure 1 As shown, the receiver can determine the value of p it holds. If p = 0, then calculate c0 = h(r i ); if p = 1, then calculate c0 = fh (r i ), where c0 is a secret slice of c=x[p].

[0055] For example, Figure 1As shown, the sender can calculate c1 = x[0]-h(r e ), where r e It can be a random value randomly selected from an array consisting of random values ​​r0 and random values ​​r1 as array elements and corresponding to the array index indicated by the XOR result e, where c1 is another secret fragment of c = x[p]. For example, if the XOR result e = 0, the array index is 0, and accordingly, the random value r obtained by the sender is e is the first random value in the array consisting of random values ​​r0 and r1 as array elements, that is, r0; if the XOR result e=1, the array subscript is 1, and accordingly, the random value r obtained by the sender e It is the second random value in the array consisting of random value r0 and random value r1 as array elements, that is, r1.

[0056] In summary, compared to the ordinary 1-out-of-2OT protocol, which only allows the receiver to directly choose from the two data x[0] and x[1] held by the sender to obtain x[p] corresponding to the choice p held by it, the 1-out-of 2shared OT protocol allows both parties to obtain a secret slice of x[p] corresponding to the choice p held by the receiver. Only by merging the secret slices held by both parties can x[p] be restored, that is, the true value of x[p] can be obtained, thereby further improving the security of information transmission.

[0057] In one illustrated embodiment, Figure 1 All addition and subtraction operators in the calculation formulas shown are replaced by the bitwise XOR operator ⊕, so that the receiver and the sender can obtain the XOR slice of x[p]. That is, the two secret slices c0 and c1 satisfy: c0⊕c1=x[p]. For example, the sender can calculate f=h(r0)⊕h(r1)⊕x[0]⊕x[1], and calculate c1=x[0]⊕h(r e ); if p = 1, the receiver can calculate c0 = f⊕h(r i ).

[0058] It should be noted that Figure 1 The calculation formula shown in is only one possible way to implement the 1-out-of 2shared OT protocol. In some possible implementations, the same calculation effect can be achieved by slightly deforming or transforming these calculation formulas. This specification does not make specific limitations on this.

[0059] Furthermore, in an illustrated embodiment, multi-party secure computation based on secret sharing can be implemented based on the above-mentioned 1-out-of-2shared OT protocol. Exemplarily, the receiver holds 1-bit input data a, that is, the value of a is equal to 0 or 1, and the sender holds input data b of any length. The purpose of multi-party secure computation is that both parties obtain a secret slice of the calculation result c=g(a,b). Among them, the function g can be a function for performing any possible operation, such as XOR operation, addition operation, subtraction operation or multiplication operation, etc., and this specification does not make specific limitations on this.

[0060] Considering that the input data a has only two possible values, 0 or 1, the sender can first calculate the expected calculation result x[j]=g(j,b) based on these two possible values, 0 or 1, where the value of j is equal to 0 or 1, that is, the expected calculation results include: x[0]=g(0,b), x[1]=g(1,b). In other words, Figure 1 The x[0] shown can be the expected calculation result calculated by the sender based on the value 0 and the input data b when the sender assumes that the value of the input data a is 0; x[1] can be the expected calculation result calculated by the sender based on the value 1 and the input data b when the sender assumes that the value of the input data a is 1.

[0061] Furthermore, the receiver and the sender perform the above Figure 1 The 1-out-of 2shared OT protocol shown can ultimately enable both parties to obtain a secret shard of the actual calculation result c=g(a, b) corresponding to the true value of the input data a, thereby realizing multi-party secure computing based on secret sharing.

[0062] In an illustrated embodiment, the input data a and b may be private data of both parties, or a fragment of secret data, which is not specifically limited in this specification. In an illustrated embodiment, the input data a and b may be single private data / fragment, wherein the input data b may also be a combination of multiple private data / fragments, etc., which is not specifically limited in this specification.

[0063] It should be noted that in some possible computing scenarios, both parties often need to execute multiple 1-out-of-2shared OT protocols to complete batch multi-party secure computing tasks, which greatly increases the amount of data transmission and computing, and reduces the overall computing performance.

[0064] Based on this, this specification provides a technical solution, which mainly constructs a batch 1-out-of-2 shared OT protocol to reduce the amount of data transmission and calculation in batch computing scenarios and improve computing performance.

[0065] In implementation, the present application can be applied to a first computing device participating in a multi-party secure computation. The first computing device holds N first input data corresponding to the multi-party secure computation, each first input data is a 1-bit data with a value of 0 or 1, and N is an integer greater than 1. The second computing device participating in the multi-party secure computation holds the second input data corresponding to the multi-party secure computation and the expected computation result. Among them, the expected computation result may include the first computation result calculated with the second input data when the value of the first input data is 0, and the second computation result calculated with the second input data when the value of the first input data is 1. In an illustrated embodiment, the first computing device may first obtain N random numbers, and N random values ​​corresponding to the array subscript indicated by the N random numbers randomly selected from the N arrays consisting of the N groups of random values ​​obtained from the second computing device; wherein each group of random values ​​in the N groups of random values ​​includes a first random value and a second random value, and the value of each random number in the N random numbers is 0 or 1. Further, the first computing device may obtain the security computing parameters corresponding to the current multi-party secure computing calculated based on the first computing result and the second computing result and sent by the second computing device. In addition, the first computing device may also determine the value of the j-th first input data. If the value of the j-th first input data is 0, the ciphertext data corresponding to the first computing result may be calculated based on the j-th random value among the N random values, and the ciphertext data may be used as the first secret shard in the multi-party secure computing result of the j-th first input data; if the value of the j-th first input data is 1, the ciphertext data corresponding to the second computing result may be calculated based on the j-th random value and the security computing parameters, and the ciphertext data may be used as the first secret shard in the multi-party secure computing result of the j-th first input data. The j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​among the N groups of random values ​​and corresponding to the array subscript indicated by the j-th random number among the N random numbers; j is an integer greater than or equal to 0 and less than N.

[0066] In the above technical scheme, the present application takes into account that in some batch multi-party secure computing scenarios, multiple data (e.g., N first input data) held by one of the parties that may participate in the multi-party secure computing are all 1 bit, with a value of 0 or 1, while the data held by the other party is a fixed integer scalar (e.g., second input data), that is, the purpose of the batch multi-party secure computing is to perform secure computing on multiple bits with the integer scalar, and finally realize the secure computing of a bit vector and an integer scalar. Based on this, the present application takes into account that each first input data has only two possible values ​​of 0 and 1, so two possible expected computing results (i.e., the first computing result and the second computing result) corresponding to the value of 0 or 1 can be pre-calculated, and then through the 1-out-of-2shared OT protocol, the two parties can obtain the secret shards of the actual computing results corresponding to the true value of each first input data. Moreover, based on the calculation method provided by the present application, the secure computing parameters for multi-party secure computing only need to be transmitted once in the online stage, which greatly reduces the amount of data transmission and calculation, and improves the computing performance of batch multi-party secure computing.

[0067] See also Figure 2 , Figure 2 FIG. 1 is a schematic diagram of a system architecture provided by an exemplary embodiment. Figure 2 As shown, one or more embodiments provided in this specification may be Figure 2 The present invention is specifically implemented in the system architecture shown or a similar system architecture.

[0068] like Figure 2 As shown, the system may include a computing device 100 and a computing device 200 participating in multi-party secure computing, wherein the computing device 100 may be a computing device corresponding to a receiver in an OT protocol, and the computing device 200 may be a computing device corresponding to a sender in an OT protocol. In an illustrated embodiment, a communication connection may be established between the computing device 100 and the computing device 200 in any possible manner, and this specification does not specifically limit this.

[0069] In an illustrated embodiment, the computing device 100 may hold N first input data corresponding to the batch multi-party secure computation, where N is an integer greater than 1. Each first input data is 1 bit, and its value is 0 or 1. Exemplarily, the N first input data may be recorded as a[0], a[1], a[2], ..., a[N-1], respectively, where the jth first input data among the N first input data may be recorded as a[j], where j is an integer greater than or equal to 0 and less than or equal to N-1.

[0070] In an illustrated embodiment, the computing device 200 corresponding to the sender of the protocol may hold second input data (e.g., b) corresponding to the batch multi-party secure computation. The second input data may be t bits, where t is an integer greater than or equal to 1, i.e., the second input data may be data of any length, such as an integer scalar, which is not specifically limited in this specification.

[0071] In an illustrated embodiment, computing device 100 and computing device 200 may also hold an objective function corresponding to a multi-party secure computation. The batch multi-party secure computation in the present application may be used to use each of the N first input data and the second input data as input data of the objective function, and to calculate the multi-party secure computation result of each of the first input data and the second input data based on secret sharing. Exemplarily, after computing device 100 and computing device 200 perform batch multi-party secure computation, both parties may obtain secret slices of the objective function calculation result of each of the first input data and the second input data, respectively. Only when both parties merge their respective obtained secret slices can they restore the actual value of the calculation result. For the specific calculation process, please refer to the following Figure 3-Figure 5b The description of the corresponding embodiment will not be elaborated here. Exemplarily, the calculation result of the j-th first input data a[j] and the second input data (for example, b) can be recorded as g(a[j], b). The objective function g can be a function for performing any possible operation, such as an XOR operation, an addition operation, a subtraction operation or a multiplication operation, etc., and this specification does not specifically limit this.

[0072] As described above, it can be understood that, in the case where each first input data is 1 bit and the second input data is a fixed integer scalar, the purpose of batch multi-party secure computation in this application is to perform secure computations on multiple bits and the integer scalar respectively, and finally realize secure computations on a bit vector and an integer scalar. Exemplarily, the multiplication of a bit vector and an integer scalar can be realized, and further, the multiplication of a bit matrix and an integer vector (composed of the multiplication of multiple bit vectors and integer scalars), the multiplication of a bit matrix and an integer matrix (composed of the multiplication of multiple bit vectors and integer scalars), and so on can be realized, and this specification does not make specific limitations on this.

[0073] Accordingly, in an illustrated embodiment, the batch multi-party secure computing in the present application can be applied to machine learning scenarios, such as the training of the Gradient Boosting Decision Tree (GBDT). For example, the computing device 100 as the receiver can hold a model to be trained, and the computing device 200 as the sender can hold data related to the model training. The receiver needs to use the data held by the sender during the model training process, but hopes to keep the data actually used confidential. Therefore, during the training process, both parties may need to execute the shared OT protocol in batches to achieve batch multi-party secure computing, thereby completing a large number of computing tasks that can be included in the model training, etc. This specification does not make specific limitations on this.

[0074] In one illustrated embodiment, computing device 100 and computing device 200 may be a laptop computer, a desktop computer, a server, a server cluster consisting of multiple servers, or a cloud computing service center, etc. having the above-mentioned functions, and this specification does not make any specific limitations on this.

[0075] See also Figure 3 , Figure 3 This is a flowchart of a multi-party secure computing method based on secret sharing provided by an exemplary embodiment. This method can be applied to Figure 2 The system architecture shown in FIG. 1 can be specifically applied to the computing device 100 corresponding to the receiving party of the protocol in the system architecture. Figure 3 As shown, the multi-party secure computing method based on secret sharing may specifically include the following steps S301 to S304.

[0076] Step S301, the first computing device obtains N random numbers, and N random values ​​corresponding to the array subscripts indicated by the N random numbers are randomly selected from N arrays composed of N groups of random values ​​obtained from the second computing device; wherein each group of random values ​​in the N groups of random values ​​includes a first random value and a second random value, and the value of each random number in the N random numbers is 0 or 1; the first computing device holds N first input data corresponding to multi-party security computation, the first input data is 1-bit data with a value of 0 or 1, and N is an integer greater than 1; the second computing device holds second input data corresponding to the multi-party security computation and an expected computation result; wherein the expected computation result includes a first computation result calculated with the second input data when the value of the first input data is 0, and a second computation result calculated with the second input data when the value of the first input data is 1.

[0077] As described above, the first computing device (eg, Figure 2The computing device 100 shown in the figure may hold N first input data, which may be respectively recorded as a[0], a[1], a[2], ..., a[N-1], wherein each first input data is 1 bit, and its value is 0 or 1. The second computing device (e.g. Figure 2 The computing device 200 shown in the figure may hold second input data (e.g., b), and the second input data may be t bits, where t is an integer greater than or equal to 1, i.e., the second input data may be data of any length, such as an integer scalar, and this specification does not specifically limit this.

[0078] In an illustrated embodiment, after the first computing device and the second computing device perform multi-party secure computation based on secret sharing on each first input data and second input data, both parties can respectively obtain secret slices of the computation results of each first input data and second input data. Only when the two parties merge the secret slices they have obtained can they restore the actual value of the computation result.

[0079] It can be understood that although the N first input data held by the first computing device are always kept confidential, that is, the second computing device cannot know the true value of each first input data, but considering that each first input data has only two possible values ​​0 or 1, the second computing device can first calculate the expected calculation result corresponding to each first input data based on these two possible values ​​0 or 1.

[0080] Among them, the expected calculation result may include: assuming that the value of the first input data is 0, the first calculation result calculated by the second computing device based on the value 0 and the second input data (for example, b), the first calculation result can be recorded as x[0], x[0]=g(0, b); and assuming that the value of the first input data is 1, the second calculation result calculated by the second computing device based on the value 1 and the second input data (for example, b), the second calculation result can be recorded as x[1], x[1]=g(1, b).

[0081] Furthermore, as mentioned above Figure 2 As described in the corresponding embodiment, the first computing device and the second computing device can subsequently run the 1-out-of-2 shared OT protocol in this application so that the first computing device and the second computing device can respectively obtain secret shards of the actual calculation results corresponding to the true values ​​of each first input data.

[0082] It should be noted that, compared with the common 1-out-of-2 shared OT protocol, this application constructs a batch 1-out-of-2 shared OT protocol. Figure 4 , Figure 4 FIG. 1 is a schematic diagram of a calculation flow of batch two-choice sharing and oblivious transmission provided by an exemplary embodiment. Figure 4 As shown, Figure 4 In the example, the N first input data held by the first computing device are respectively a[0], a[1], a[2], ..., a[N-1], and the following will be combined with Figure 4 The batch 1-out-of-2 shared OT protocol provided in this application and the method flow for implementing batch multi-party secure computing based on the batch 1-out-of-2 shared OT protocol are explained.

[0083] The batch 1-out-of-2 shared OT protocol may include an offline phase and an online phase.

[0084] like Figure 4 As shown, in the offline stage, the first computing device corresponding to the receiver of the protocol and the second computing device corresponding to the sender of the protocol can respectively obtain batches of random data through the batch random OT protocol for subsequent multi-party secure computing.

[0085] In an illustrated embodiment, the second computing device may obtain N groups of random values ​​generated by a batch random OT protocol, each group of random values ​​may include a first random value and a second random value, that is, a total of N first random values ​​and N second random values. For example, Figure 4 As shown, the N first random values ​​can be recorded as r[0]0, r[1]0, r[2]0, ..., r[N-1]0, and the N second random values ​​can be recorded as r[0]1, r[1]1, r[2]1, ..., r[N-1]1. Correspondingly, the jth group of random values ​​in the N groups of random values ​​may include a first random value r[j]0 and a second random value r[j]1. Each first random value and each second random value may be, for example, 64 bits, 128 bits or 256 bits of random data, etc., which is not specifically limited in this specification.

[0086] In an illustrated embodiment, the first computing device may obtain N random numbers and corresponding N random values ​​generated by a batch random OT protocol. For example, Figure 4 As shown, the N random numbers can be recorded as i[0], i[1], i[2], ..., i[N-1], and the corresponding N random values ​​can be recorded as r[0] i[0] , r[1] i[1] , r[2] i[2] , …, r[N-1] i[N-1]. Each of the N random numbers is 1 bit and has a value of 0 or 1. The N random values ​​may be N random values ​​randomly selected from N arrays consisting of the N groups of random values ​​as array elements and corresponding to the array subscripts indicated by the N random numbers. Exemplarily, the jth random value r[j] among the N random values ​​is i[j] It can be a random value corresponding to the array index indicated by the random number i[j] randomly selected from the jth array composed of the jth group of random values ​​(including the first random value r[j]0 and the second random value r[j]1) as array elements. For details, please refer to the above Figure 1 The description in the corresponding embodiment will not be repeated here. For example, if the jth random number i[j]=0, the jth random value r[j] obtained by the first computing device i[j] That is, r[j]0. If the jth random number i[j]=1, the jth random value r[j] obtained by the first computing device is i[j] That is r[j]1.

[0087] It should be noted that the present application does not specifically limit the specific implementation method for obtaining the above-mentioned batch random data. In an illustrated embodiment, the first computing device and the second computing device can run the random OT protocol multiple times to obtain the output of N random OTs. In an illustrated embodiment, the present application can also obtain the output of N random OTs through any other possible secure computing protocol, for example, by running a silent OT protocol, which can output multiple random OTs at the same time. In an illustrated embodiment, the above-mentioned batch random data can also be generated by a third-party random number server, etc., and this specification does not specifically limit this.

[0088] Furthermore, if Figure 4 As shown, in the offline stage, the second computing device can also calculate s=h(r[0]0)+h(r[0]1), where s can be regarded as a preset association value. Figure 4 As shown, the second computing device can also calculate the auxiliary computing parameter u[j] corresponding to the multi-party secure computing result of the j-th first input data a[j] based on the calculated association value s, the j-th first random value r[j]0 and the j-th second random value r[j]1. For example, Figure 4As shown, u[j] = sh(r[j]0) - h(r[j]1), j = 1, 2, ..., N-1. It should be understood that since s = h(r[0]0) + h(r[0]1), when j = 0, u[j] = 0. The function of the hash function h() is to output a random value of t bits after performing a certain operation on the input random value (e.g., r[j]0 and r[j]1), that is, to output a random value of the same length as x[0] and x[1]. For details, please refer to the above Figure 1 The description in the corresponding embodiment will not be repeated here.

[0089] Furthermore, if Figure 4 As shown, the second computing device can also send all the auxiliary computing parameters calculated in the offline stage, that is, {u[j], j=1, 2, ..., N-1}, to the first computing device, and correspondingly, the first computing device receives {u[j], j=1, 2, ..., N-1}, so that the amount of data transmission in the online stage can be greatly reduced, the response speed in the online stage can be improved, and the computing performance can be improved. It should be understood that through the above calculation formula, u[j] is independent of the input data of both parties, so it can be calculated and transmitted offline.

[0090] Step S302: Obtain security computing parameters corresponding to multi-party secure computing that are calculated based on the first computing result and the second computing result and sent by the second computing device.

[0091] like Figure 4 As shown, in the online phase of the batch 1-out-of-2 shared OT protocol, on the one hand, the first computing device can calculate the XOR result e[j] of the j-th random number i[j] and the j-th first input data a[j], that is, calculate e[j]=i[j]⊕a[j], and send the XOR result e[j] to the second computing device. On the other hand, the second computing device can further calculate the security calculation parameter f[0] corresponding to the multi-party secure calculation based on the associated value s, the first calculation result x[0] and the second calculation result x[0] calculated in advance, and send the security calculation parameter f[0] to the first computing device. Exemplarily, as Figure 2 As shown, f[0]=sx[0]+x[1].

[0092] It should be noted that this specification does not specifically limit the order in which the above two operations are performed. In one embodiment shown, in order to further improve the computing efficiency, the operations performed by the first computing device and the second computing device can be performed simultaneously, that is, while the first computing device calculates the XOR result e[j] and sends the XOR result e[j] to the second computing device, the second computing device can calculate the security computing parameter f[0] and send the security computing parameter f[0] to the first computing device.

[0093] In an illustrated embodiment, the online phase of the batch 1-out-of-2 shared OT protocol can be triggered in response to a multi-party secure computing instruction for any first input data, and this specification does not specifically limit this. Exemplarily, the first computing device can respond to a multi-party secure computing instruction for the j-th first input data a[j], calculate the XOR result e[j], and send the XOR result e[j] to the second computing device. In an illustrated embodiment, the first computing device can also batch calculate the XOR results of all random numbers and the corresponding first input data, that is, {e[j]=i[j]⊕a[j]}, and send all XOR results {e[j]=i[j]⊕a[j]} to the second computing device, and so on, and this specification does not specifically limit this.

[0094] Step S303, when the value of the j-th first input data is 0, based on the j-th random value among the N random values, calculate the ciphertext data corresponding to the first calculation result, and use the ciphertext data as the first secret shard in the multi-party security calculation result of the j-th first input data.

[0095] Furthermore, if Figure 4 As shown, the first computing device can determine the value of the j-th first input data a[j], and calculate the first secret slice (which can be recorded as c[j]0) of the actual calculation result corresponding to the value.

[0096] In an illustrated embodiment, if the value of the j-th first input data a[j] is 0, the actual calculation result corresponding to its value (which can be recorded as x[a[j]]) should be the above-mentioned first calculation result x[0], then the computing device 100 can obtain the j-th random value r[j] among the N random values ​​obtained. i[j] , calculate the ciphertext data corresponding to the first calculation result x[0], and use the ciphertext data as the first secret fragment c[j]0 in the multi-party security calculation result of the j-th first input data a[j].

[0097] It should be noted that this specification does not explain how to use the j-th random value r[j] i[j] The specific implementation method of calculating the first secret fragment c[j]0 in the multi-party security computation result of the j-th first input data a[j] is not particularly limited.

[0098] For example, Figure 4 As shown, the first computing device can generate the jth random value r[j] i[j] The corresponding hash value h(r[j] i[j]) is determined as the ciphertext data corresponding to the first calculation result x[0], and the ciphertext data is used as the first secret fragment c[j]0, that is, c[j]0=h(r[j] i[j] ).

[0099] In an illustrated embodiment, since the first computing device has obtained the jth random value r[j] through the batch random OT protocol in the offline stage, i[j] Therefore, the first computing device can also calculate h(r[j] in advance in the offline stage i[j] ), thereby reducing the amount of computation in the online phase, improving the response speed in the online phase, and further improving the computational efficiency of multi-party secure computing.

[0100] Step S304, when the value of the j-th first input data is 1, based on the j-th random value and the security calculation parameter, calculate the ciphertext data corresponding to the second calculation result, and use the ciphertext data as the first secret shard in the multi-party security calculation result of the j-th first input data; wherein the j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​in the N groups of random values ​​and corresponding to the array subscript indicated by the j-th random number in the N random numbers; j is an integer greater than or equal to 0 and less than N.

[0101] In an illustrated embodiment, if the value of the j-th first input data a[j] is 1, the actual calculation result corresponding to its value (which can be recorded as x[a[j]]) should be the above-mentioned second calculation result x[1], then the first computing device can obtain the j-th random value r[j] based on i[j] and security calculation parameter f[0], calculate the ciphertext data corresponding to the second calculation result x[1], and use the ciphertext data as the first secret fragment c[j]0 in the multi-party security calculation result of the j-th first input data a[j].

[0102] It should be noted that this specification does not explain how to use the j-th random value r[j] i[j] The specific implementation method of calculating the first secret fragment c[j]0 in the multi-party security computation result of the j-th first input data a[j] using the security computation parameter f[0] is not particularly limited.

[0103] For example, Figure 4 As shown, after receiving the secure computing parameter f[0] sent by the second computing device and u[j] transmitted in the offline phase, the first computing device can calculate the intermediate computing result f[j] corresponding to the multi-party secure computing result of the j-th first input data a[j] based on the secure computing parameter f[0] and u[j] transmitted in the offline phase. For example, Figure 2As shown, f[j]=f[0]-u[j]. Further, the first computing device can calculate the random value r[j] based on the intermediate calculation result f[j] and the jth random value r[j] i[j] Calculate the first secret fragment c[j]0. For example, Figure 4 As shown, the first computing device can calculate the intermediate calculation result f[j] and the jth random value r[j] i[j] The hash value h(r[j] i[j] ), and determine the difference as the first secret fragment c[j]0 in the multi-party security computation result of the j-th first input data a[j], that is, c[j]0=f[j]-h(r[j] i[j] ), that is, c[j]0=f[0]-u[j]-h(r[j] i[j] ).

[0104] Correspondingly, such as Figure 4 As shown, after receiving the XOR result e[j] sent by the first computing device, the second computing device can calculate the second secret fragment (which can be recorded as c[j]1) in the multi-party security calculation result of the j-th first input data a[j] based on the XOR result e[j].

[0105] It should be noted that this specification does not specifically limit the specific implementation method of how to calculate the second secret fragment c[j]1 in the multi-party security computation result of the j-th first input data a[j] based on the XOR result e[j].

[0106] For example, Figure 4 As shown, the second computing device can randomly select a random value r[j] corresponding to the array index indicated by the XOR result e[j] from the jth array consisting of the jth group of random values ​​(including the jth first random value r[j]0 and the jth second random value r[j]1) as array elements. e[j] For details, please refer to the above Figure 1 The description in the corresponding embodiment will not be repeated here. Figure 4 As shown, the second computing device can calculate the first computing result x[0] and the random value r[j] e[j] The hash value h(r[j] e[j] ), and determine the difference as the second secret fragment c[j]1 in the multi-party security computation result of the j-th first input data a[j], that is, c[j]1=x[0]-h(r[j] e[j] ).

[0107] At this point, through the batch 1-out-of-2 shared OT protocol provided by the present application, the first computing device calculates the first secret shard c[j]0 in the multi-party security calculation result of the j-th first input data a[j], and the second computing device calculates the second secret shard c[j]1 in the multi-party security calculation result of the j-th first input data a[j], thereby realizing the multi-party security calculation based on secret sharing for the j-th first input data a[j] and the second input data. Only when the two merge the first secret shard c[j]0 and the second secret shard c[j]1 can the actual value of the calculation result c=x[a[j]] be restored.

[0108] In some possible implementations, in addition to the above Figure 4 In addition to the calculation process shown, the present application can also be combined with correlated OT to implement the above-mentioned batch 1-out-of-2 shared OT protocol. The so-called correlated OT means that there is a correlation between the first random value and the second random value contained in each group of random values ​​obtained by the second computing device, for example, r[j]0+r[j]1=s, and the associated value s can be a random value.

[0109] In one illustrated embodiment, see Figure 5a , Figure 5a FIG. 1 is another flow chart of calculation of batch two-choice sharing and oblivious transmission provided by an exemplary embodiment. Figure 5a As shown, the first computing device and the second computing device can be connected to the third-party random number server respectively. In an illustrated embodiment, for performance optimization, part of the random data can be generated by a shared random number seed without transmission.

[0110] Exemplarily, the first computing device and the random number server may share a first random number seed seed0, and the first computing device and the random number server may generate the above-mentioned N random numbers, i[0], i[1], i[2], ..., i[N-1], based on the shared first random number seed seed0.

[0111] Exemplarily, the second computing device and the random number server can share a second random number seed seed1, and the second computing device and the random number server can generate the above-mentioned association value s and N first random values, namely r[0]0, r[1]0, r[2]0,…, r[N-1]0, based on the shared second random number seed seed1.

[0112] Furthermore, the random number server and the second computing device can both calculate corresponding N second random values, i.e., r[0]1, r[1]1, r[2]1, ..., r[N-1]1, based on the generated association value s and the N first random values, thereby forming a complete set of N random values. Exemplarily, the jth second random value r[j]1=sr[j]0.

[0113] Furthermore, the random number server can randomly select N random values ​​corresponding to the array index indicated by the N random numbers from the N arrays composed of N groups of random values, that is, r[0] i[0] , r[1] i[1] , r[2] i[2] , …, r[N-1] i[N-1 In this way, in the offline stage, only N random values ​​need to be transmitted to the first computing device, and there is no need to calculate and transmit the auxiliary computing parameter u[j], which greatly reduces the amount of data transmission in the offline stage and improves the computing performance.

[0114] Furthermore, if Figure 5a As shown, in the online stage, the first computing device calculates e[j]=i[j]⊕a[j], and sends the calculated e[j] to the second computing device. The second computing device calculates f=sx[0]+x[1], and sends the calculated f to the first computing device. Furthermore, the first computing device determines the value of the j-th first input data a[j] it holds. If a[j]=0, the first computing device can calculate the first secret shard c[j]0=r[j] in the multi-party security calculation result of the j-th first input data a[j] based on the obtained j-th random value. i[j] ; If a[j]=1, the first computing device can calculate the first secret fragment c[j]0=fr[j] based on the obtained jth random value and f. i[j] .

[0115] At the same time, Figure 5a As shown, in the online stage, the second computing device can randomly select a random value r[j] corresponding to the array index indicated by the obtained e[j] from the jth array composed of the jth group of random values ​​(including the jth first random value r[j]0 and the jth second random value r[j]1) as array elements. e[j] , and based on the random value r[j] e[j] and the expected first calculation result x[0], calculate the second secret fragment c[j]1=x[0]-r[j] in the multi-party secure calculation result of the j-th first input data a[j] e[j] .

[0116] It should be noted that the association value s generated by the above-mentioned random number server and the length of each random value can be consistent with the length of the first calculation result x[0] and the second calculation result x[1], and also consistent with the length of the secret segment to be calculated. Therefore, the hash function h() is not required. Alternatively, the hash function h() can also be used, but the input value is consistent with the output value. This manual does not make specific limitations on this.

[0117] In one illustrated embodiment, see Figure 5b , Figure 5b FIG. 1 is another flow chart of batch two-choice sharing and oblivious transmission calculation provided by an exemplary embodiment. Figure 5b As shown, the first computing device and the second computing device can run the silent OT protocol and obtain batch random data generated by running the silent OT protocol. However, the first random value and the second random value contained in each group of random values ​​output by the silent OT protocol are often unrelated. In view of this, the present application can correct the second random value in each group of random values ​​so that each group of first random values ​​and second random values ​​are correlated, that is, r[j]0+r[j]1=s.

[0118] For example, Figure 5b As shown, the first computing device obtains N random numbers (i[0], i[1], i[2], ..., i[N-1]) output by the silent OT protocol and the corresponding N random values ​​(r[0] i[0] , r[1] i[1] , r[2] i[2] , …, r[N-1] i[N-1] ); the second computing device obtains N groups of random values ​​output by the silent OT protocol, including N first random values ​​(r[0]0, r[1]0, r[2]0, ..., r[N-1]0) and N second random values ​​(r[0]1, r[1]1, r[2]1, ..., r[N-1]1).

[0119] Furthermore, if Figure 5b As shown, in the offline phase, the second computing device first calculates the correlation value s=r[0]0+r[0]1, and then calculates the auxiliary computing parameter u[j]=sr[j]0-r[j]1, j=1, 2, ..., N-1. Further, the second computing device may update the second random value in each group of random values ​​so that the updated second random value satisfies the correlation with the first random value. For example, Figure 5bAs shown, the second computing device can update the j-th second random value r[j]1 to the addition result of the j-th second random value r[j]1 and the auxiliary calculation parameter u[j], that is, let r[j]1=r[j]1+u[j], so that the updated j-th first random value r[j]0 and the j-th second random value r[j]1 satisfy r[j]0+r[j]1=s.

[0120] like Figure 5b As shown, the second computing device may also send the calculated auxiliary computing parameter u[j] to the first computing device, and correspondingly, the first computing device receives the auxiliary computing parameter u[j]. Figure 5b As shown, the first computing device can determine the value of the j-th random number i[j]. If the j-th random number i[j]=1, the first computing device can update the j-th second random value r[j]1 to the addition result of the j-th second random value r[j]1 and the auxiliary calculation parameter u[j], that is, let r[j]1=r[j]1+u[j], so that the updated j-th first random value r[j]0 and the j-th second random value r[j]1 satisfy r[j]0+r[j]1=s.

[0121] Furthermore, if Figure 5b As shown, in the online stage, the first computing device calculates e[j]=i[j]⊕a[j], and sends the calculated e[j] to the second computing device. The second computing device calculates f=sx[0]+x[1], and sends the calculated f to the first computing device. Furthermore, the first computing device determines the value of the j-th first input data a[j] it holds. If a[j]=0, the first computing device can calculate the first secret shard c[j]0=r[j] in the multi-party security calculation result of the j-th first input data a[j] based on the obtained j-th random value. i[j] ; If a[j]=1, the first computing device can calculate the first secret fragment c[j]0=fr[j] based on the obtained jth random value and f. i[j] .

[0122] At the same time, Figure 5b As shown, in the online stage, the second computing device can randomly select a random value r[j] corresponding to the array index indicated by the obtained e[j] from the jth array composed of the jth group of random values ​​(including the jth first random value r[j]0 and the jth second random value r[j]1) as array elements. e[j] , and based on the random value r[j] e[j] and the expected first calculation result x[0], calculate the second secret fragment c[j]1=x[0]-r[j] in the multi-party secure calculation result of the j-th first input data a[j]e[j] .

[0123] It should be noted that the length of each random value output by the silent OT protocol can be consistent with the length of the first calculation result x[0] and the second calculation result x[1], and also consistent with the length of the secret segment to be calculated. Therefore, the hash function h() is not required. Alternatively, the hash function h() can also be used, but the input value is consistent with the output value. This manual does not make specific limitations on this.

[0124] It should be noted that the above Figure 5a and Figure 5b The calculation process is only for illustrative purposes. Figure 5a and Figure 5b In addition to the method of constructing the related OT shown, the related OT can also be constructed in any other possible way, and this specification does not make any specific limitation on this.

[0125] In addition, in some possible implementations, the above Figure 4-5b The addition and subtraction operations in each calculation formula recorded in can be replaced by a bitwise XOR operation, so that the first computing device and the second computing device can obtain the XOR slice with the actual calculation result c=x[a[j]], that is, the two secret slices c[j]0 and c[j]1 satisfy: c[j]0⊕c[j]1=x[a[j]].

[0126] For example, the calculation formula s=h(r[0]0)+h(r[0]1) can be replaced by s=h(r[0]0)⊕h(r[0]1);

[0127] Exemplarily, the calculation formula u[j]=sh(r[j]0)-h(r[j]1) can be replaced by u[j]=s⊕h(r[j]0)⊕h(r[j]1);

[0128] For example, the calculation formula f[0]=sx[0]+x[1] can be replaced by f[0]=s⊕x[0]⊕x[1], and correspondingly, the calculation formula f=sx[0]+x[1] can be replaced by f=s⊕x[0]⊕x[1];

[0129] Exemplarily, the calculation formula f[j]=f[0]-u[j] can be replaced by f[j]=f[0]⊕u[j];

[0130] For example, the calculation formula is c[j]0=f[j]-h(r[j] i[j] ), can be replaced by c[j]0=f[j]⊕h(r[j] i[j] ), correspondingly, the calculation formula is c[j]0=fr[j] i[j], can be replaced by c[j]0=f⊕r[j] i[j] ;

[0131] For example, the calculation formula is c[j]1=x[0]-h(r[j] e[j] ), can be replaced by c[j]1=x[0]⊕h(r[j] e[j] ), correspondingly, the calculation formula is c[j]1=x[0]-r[j] e[j] , can be replaced by c[j]1=x[0]⊕r[j] e[j] .

[0132] Exemplarily, the calculation formula r[j]0+r[j]1=s can be replaced by r[j]0⊕r[j]1=s.

[0133] Exemplarily, the calculation formula r[j]1=r[j]1+u[j] can be replaced by r[j]1=r[j]1⊕u[j], and so on. This specification does not make any specific limitations on this. It should be understood that the above calculation formula is only a possible way to implement the batch 1-out-of2shared OT protocol in this application. Slightly deforming or transforming these formulas can also achieve the same effect.

[0134] See also Figure 6 , Figure 6 This is a flowchart of a multi-party secure computing method based on secret sharing provided by an exemplary embodiment. This method can be applied to Figure 2 The system architecture shown in FIG. 1 can be specifically applied to the computing device 200 corresponding to the sender of the protocol in the system architecture. Figure 6 As shown, the multi-party secure computing method based on secret sharing may specifically include the following steps S601 to S602.

[0135] Step S601, the second computing device obtains N groups of random values, each group of random values ​​includes a first random value and a second random value; the first computing device holds N first input data corresponding to multi-party security calculations, the first input data is 1-bit data with a value of 0 or 1, and N is an integer greater than 1; the second computing device holds second input data corresponding to the multi-party security calculations and an expected calculation result; wherein the expected calculation result includes a first calculation result calculated with the second input data when the value of the first input data is 0, and a second calculation result calculated with the second input data when the value of the first input data is 1.

[0136] In an embodiment shown, the specific implementation of step S601 can refer to the above Figure 3-Figure 5b The description of the corresponding embodiments will not be repeated here.

[0137] Step S602, calculate the security calculation parameters corresponding to the multi-party security calculation based on the first calculation result and the second calculation result, and send the security calculation parameters to the first computing device, so that when the value of the j-th first input data among the N first input data held by the first computing device is 0, based on the j-th random value among the N random values ​​obtained, calculate the ciphertext data corresponding to the first calculation result, and use the ciphertext data as the first secret shard in the multi-party security calculation result of the j-th first input data; or, when the value of the j-th first input data is 1, calculate the ciphertext data corresponding to the second calculation result based on the j-th random value and the security calculation parameters, and use the ciphertext data as the first secret shard in the multi-party security calculation result of the j-th first input data; wherein the j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​among the N groups of random values, corresponding to the array subscript indicated by the j-th random number among the N random numbers obtained by the first computing device; j is an integer greater than or equal to 0 and less than N.

[0138] In an embodiment shown, the specific implementation of step S602 can refer to the above Figure 3-Figure 5b The description of the corresponding embodiments will not be repeated here.

[0139] Corresponding to the implementation of the above method flow, an embodiment of the present specification also provides a multi-party secure computing apparatus based on secret sharing, which is applied to a first computing device participating in a multi-party secure computing; the first computing device holds N first input data corresponding to the multi-party secure computing, the first input data is 1-bit data with a value of 0 or 1, and N is an integer greater than 1; the second computing device participating in the multi-party secure computing holds second input data corresponding to the multi-party secure computing and an expected computing result; wherein the expected computing result includes a first computing result calculated with the second input data when the first input data has a value of 0, and a second computing result calculated with the second input data when the first input data has a value of 1. Please refer to Figure 7 , Figure 7 FIG. 1 is a schematic diagram of a multi-party secure computing device based on secret sharing provided by an exemplary embodiment. Figure 7 As shown, the device 70 includes:

[0140] A first acquisition unit 701 is used to acquire N random numbers, and N random values ​​randomly selected from N arrays consisting of N groups of random values ​​acquired from the second computing device and corresponding to the array subscripts indicated by the N random numbers; wherein each group of random values ​​in the N groups of random values ​​includes a first random value and a second random value, and each of the N random numbers has a value of 0 or 1;

[0141] A second acquisition unit 702 is used to acquire a security computing parameter corresponding to the multi-party secure computing, which is calculated based on the first computing result and the second computing result and sent by the second computing device;

[0142] The calculation unit 703 is configured to calculate the ciphertext data corresponding to the first calculation result based on the jth random value among the N random values ​​when the value of the jth first input data among the N first input data is 0, and use the ciphertext data as the first secret shard in the multi-party security calculation result of the jth first input data; or, when the value of the jth first input data is 1, calculate the ciphertext data corresponding to the second calculation result based on the jth random value and the security calculation parameter, and use the ciphertext data as the first secret shard in the multi-party security calculation result of the jth first input data;

[0143] Among them, the j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​in the N groups of random values, corresponding to the array subscript indicated by the j-th random number among the N random numbers; j is an integer greater than or equal to 0 and less than N.

[0144] In one illustrated embodiment, the second computing device also holds an objective function corresponding to the multi-party secure computation; the multi-party secure computation is used to use each of the N first input data and the second input data as input data of the objective function, and calculate the multi-party secure computation results of each of the first input data and the second input data based on secret sharing.

[0145] In an illustrated embodiment, the apparatus 70 further includes a sending unit 704, configured to:

[0146] Calculate the XOR result of the j-th random number and the j-th first input data, and send the XOR result to the second computing device, so that the second computing device calculates the second secret shard in the multi-party security calculation result of the j-th first input data based on the XOR result.

[0147] In an illustrated implementation manner, the sending unit 704 is specifically configured to:

[0148] Sending the XOR result to the second computing device, so that the second computing device randomly selects a random value corresponding to the array index indicated by the XOR result from the jth array consisting of the jth first random value and the jth second random value included in the jth array as array elements;

[0149] Calculate the difference / XOR result between the first input data and the random value corresponding to the XOR result, and determine the difference / XOR result as the second secret shard in the multi-party security calculation result of the j-th first input data.

[0150] In an illustrated embodiment, the calculation unit 703 is specifically configured to:

[0151] The j-th random value among the N random values ​​is determined as the ciphertext data corresponding to the first calculation result.

[0152] In an illustrated embodiment, the device 70 further includes a third obtaining unit 705, which is configured to:

[0153] Obtaining an auxiliary computing parameter sent by the second computing device, which is calculated based on the j-th first random value and the j-th second random value included in the j-th array and corresponds to a multi-party secure computing result of the j-th first input data;

[0154] The calculation unit 703 is specifically used for:

[0155] Calculating, according to the auxiliary parameter and the secure calculation parameter, an intermediate calculation result corresponding to a multi-party secure calculation result of the j-th first input data;

[0156] Based on the j-th random value and the intermediate calculation result, ciphertext data corresponding to the second calculation result is calculated.

[0157] In an illustrated embodiment, the calculation unit 703 is specifically configured to:

[0158] Calculate the difference / XOR result between the intermediate calculation result and the j-th random value;

[0159] The difference / XOR result is determined as ciphertext data corresponding to the second calculation result.

[0160] In an illustrated embodiment, the apparatus 70 further includes a random value updating unit 706, configured to:

[0161] Obtaining an auxiliary computing parameter sent by the second computing device, which is calculated based on the j-th first random value and the j-th second random value included in the j-th array and corresponds to a multi-party secure computing result of the j-th first input data;

[0162] Determine the value of the j-th random number. If the value of the j-th random number is 1, update the j-th random value to the sum of the j-th random value and the auxiliary calculation parameter; wherein the j-th second random value is updated by the second calculation device to the sum of the j-th second random value and the auxiliary calculation parameter.

[0163] In an illustrated embodiment, the auxiliary parameter is a parameter calculated by the second computing device based on a preset association value, the j-th first random value, and the j-th second random value; the security calculation parameter is a parameter calculated by the second computing device based on the association value, the first calculation result, and the second calculation result;

[0164] The associated value is the addition result / XOR result of the 0th first random value and the 0th second random value.

[0165] In an illustrated embodiment, the first acquisition unit 701 is specifically configured to:

[0166] Run a random oblivious transfer protocol and obtain N random numbers generated by running the random oblivious transfer protocol, and randomly select N random values ​​corresponding to array indices indicated by the N random numbers from N arrays consisting of N groups of random values ​​generated by running the random transfer protocol on the second computing device.

[0167] In an illustrated embodiment, the addition result / XOR result of the first random value and the second random value included in each of the N groups of random values ​​generated by the oblivious transfer protocol executed by the second computing device are both associated values.

[0168] In an illustrated embodiment, the first computing device and the second computing device are respectively connected to a random number server, the first computing device and the random number server share a first random number seed, and the second computing device and the random number server share a second random number seed;

[0169] Among them, the random number server and the first computing device generate the N random numbers based on the shared first random number seed; the random number server and the second computing device generate an associated value and N first random values ​​based on the shared second random number seed, and calculate the corresponding N second random values ​​according to the associated value and the N first random values ​​to form the N groups of random numbers.

[0170] In an illustrated embodiment, the first acquisition unit 701 is specifically configured to:

[0171] Obtain N random values ​​sent by the random number server, where the N random values ​​are N random values ​​randomly selected by the random number server from N arrays formed by the N groups of random values ​​and corresponding to the array subscripts indicated by the N random numbers.

[0172] Correspondingly, an embodiment of the present specification also provides a multi-party secure computing apparatus based on secret sharing, which is applied to a second computing device participating in the multi-party secure computing; the first computing device participating in the multi-party secure computing holds N first input data corresponding to the multi-party secure computing, the first input data is 1-bit data with a value of 0 or 1, and N is an integer greater than 1; the second computing device holds second input data corresponding to the multi-party secure computing and an expected computing result; wherein the expected computing result includes a first computing result calculated with the second input data when the first input data has a value of 0, and a second computing result calculated with the second input data when the first input data has a value of 1. Please refer to Figure 8 , Figure 8 FIG. 1 is a schematic diagram of a multi-party secure computing device based on secret sharing provided by an exemplary embodiment. Figure 8 As shown, the device 80 includes:

[0173] An acquiring unit 801 is configured to acquire N groups of random values, each group of random values ​​in the N groups of random values ​​comprising a first random value and a second random value;

[0174] The sending unit 802 is configured to calculate a security calculation parameter corresponding to the multi-party security calculation based on the first calculation result and the second calculation result, and send the security calculation parameter to the first computing device, so that when the value of the j-th first input data among the N first input data held by the first computing device is 0, the first computing device calculates the ciphertext data corresponding to the first calculation result based on the j-th random value among the N random values ​​obtained, and uses the ciphertext data as the first secret shard in the multi-party security calculation result of the j-th first input data; or, when the value of the j-th first input data is 1, the first computing device calculates the ciphertext data corresponding to the second calculation result based on the j-th random value and the security calculation parameter, and uses the ciphertext data as the first secret shard in the multi-party security calculation result of the j-th first input data;

[0175] Among them, the j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​in the N groups of random values, corresponding to the array subscript indicated by the j-th random number among the N random numbers obtained by the first computing device; j is an integer greater than or equal to 0 and less than N.

[0176] The implementation process of the functions and effects of each unit in the above-mentioned device 70 and device 80 is specifically described in the above-mentioned embodiment, and will not be repeated here. It should be understood that the above-mentioned device 70 and device 80 can be implemented by software, or by hardware or a combination of software and hardware. Taking software implementation as an example, as a device in a logical sense, it is formed by the CPU of the device where it is located reading the corresponding computer program instructions into the memory and running them. From the hardware level, in addition to the CPU and memory, the device where the above-mentioned device is located usually also includes other hardware such as chips for wireless signal transmission and reception, and / or other hardware such as boards and cards for realizing network communication functions.

[0177] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical modules, that is, they may be located in one place, or they may be distributed on multiple network modules. Some or all of the units or modules may be selected according to actual needs to achieve the purpose of the scheme of this specification. Those of ordinary skill in the art may understand and implement it without creative work.

[0178] The devices, units, and modules described in the above embodiments may be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer, which may be in the form of a personal computer, a laptop computer, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, a game console, a tablet computer, a wearable device, or a combination of any of these devices.

[0179] Corresponding to the above method embodiment, the embodiment of this specification also provides a computing device. Fig. 9 , Fig. 9 It is a structural diagram of a computing device provided by an exemplary embodiment. Fig. 9 The computing device shown may be a computing device participating in multi-party secure computing, for example, Figure 2 The computing device 100 corresponding to the receiver of the OT protocol, or the computing device 200 corresponding to the sender of the OT protocol in the system architecture shown. Fig. 9 As shown, the computing device includes a processor 1001 and a memory 1002, and may further include an input device 1004 (such as a keyboard, etc.) and an output device 1005 (such as a display, etc.). The processor 1001, the memory 1002, the input device 1004, and the output device 1005 may be connected via a bus or other means. Fig. 9As shown, the memory 1002 includes a computer-readable storage medium 1003, which stores a computer program that can be run by the processor 1001. The processor 1001 can be a general-purpose CPU, a microprocessor, or an integrated circuit for controlling the execution of the above method embodiment. When the processor 1001 runs the stored computer program, it can execute the various steps of the multi-party secure computing method based on secret sharing in the embodiment of this specification. For details, please refer to the previous content, which will not be repeated here.

[0180] Corresponding to the above method embodiment, the embodiment of this specification also provides a computer-readable storage medium, on which a computer program is stored, and when these computer programs are executed by a processor, they execute the various steps of the multi-party secure computing method based on secret sharing in the embodiment of this specification. Please refer to the description of the above embodiment for details, which will not be repeated here.

[0181] The above description is only a preferred embodiment of this specification and is not intended to limit this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of this specification should be included in the scope of protection of this specification.

[0182] In a typical configuration, a terminal device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0183] The memory may include non-permanent storage in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0184] Computer readable media include permanent and non-permanent, removable and non-removable media and can store information by any method or technology. The information can be computer readable instructions, data structures, program modules or other data.

[0185] Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer-readable media does not include transitory media such as modulated data signals and carrier waves.

[0186] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity 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, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0187] Those skilled in the art will appreciate that the embodiments of this specification may be provided as methods, systems or computer program products. Therefore, the embodiments of this specification may take the form of complete hardware embodiments, complete software embodiments or embodiments combining software and hardware. Moreover, the embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.

Claims

1. A multi-party secure computing method based on secret sharing, characterized in that: A first computing device used to participate in multi-party secure computing; The first computing device holds N first input data corresponding to the multi-party secure computation, the first input data being 1-bit data having a value of 0 or 1, and N being an integer greater than 1; The second computing device participating in the multi-party secure computation holds second input data and an expected computation result corresponding to the multi-party secure computation; wherein the expected computation result includes a first computation result calculated with the second input data when the value of the first input data is 0, and a second computation result calculated with the second input data when the value of the first input data is 1; The method comprises: Obtaining N random numbers, and N random values ​​corresponding to the array subscripts indicated by the N random numbers, randomly selected from N arrays consisting of N groups of random values ​​obtained from the second computing device; wherein each group of random values ​​in the N groups of random values ​​includes a first random value and a second random value, and each of the N random numbers has a value of 0 or 1; Acquire a security computing parameter corresponding to the multi-party secure computing that is calculated based on the first computing result and the second computing result and sent by the second computing device; When the value of the j-th first input data among the N first input data is 0, based on the j-th random value among the N random values, the ciphertext data corresponding to the first calculation result is calculated, and the ciphertext data is used as the first secret shard in the multi-party security calculation result of the j-th first input data; or, when the value of the j-th first input data is 1, based on the j-th random value and the security calculation parameter, the ciphertext data corresponding to the second calculation result is calculated, and the ciphertext data is used as the first secret shard in the multi-party security calculation result of the j-th first input data; Among them, the j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​in the N groups of random values, corresponding to the array subscript indicated by the j-th random number among the N random numbers; j is an integer greater than or equal to 0 and less than N.

2. The method according to claim 1, characterized in that The second computing device also holds an objective function corresponding to the multi-party secure computation; the multi-party secure computation is used to use each of the N first input data and the second input data as input data of the objective function, and calculate the multi-party secure computation results of each of the first input data and the second input data based on secret sharing.

3. The method according to claim 1, characterized in that: The method further comprises: Calculate the XOR result of the j-th random number and the j-th first input data, and send the XOR result to the second computing device, so that the second computing device calculates the second secret shard in the multi-party security calculation result of the j-th first input data based on the XOR result.

4. The method according to claim 3, characterized in that The sending the XOR result to the second computing device so that the second computing device calculates the second secret shard in the multi-party secure computing result of the j-th first input data based on the XOR result, comprises: Sending the XOR result to the second computing device, so that the second computing device randomly selects a random value corresponding to the array index indicated by the XOR result from the jth array consisting of the jth first random value and the jth second random value included in the jth array as array elements; Calculate the difference / XOR result between the first input data and the random value corresponding to the XOR result, and determine the difference / XOR result as the second secret shard in the multi-party security calculation result of the j-th first input data.

5. The method according to claim 1, characterized in that The calculating, based on the j-th random value among the N random values, ciphertext data corresponding to the first calculation result includes: The j-th random value among the N random values ​​is determined as the ciphertext data corresponding to the first calculation result.

6. The method according to claim 1, characterized in that The method further comprises: Obtaining an auxiliary computing parameter sent by the second computing device, which is calculated based on the j-th first random value and the j-th second random value included in the j-th array and corresponds to a multi-party secure computing result of the j-th first input data; The calculating, based on the j-th random value and the security calculation parameter, ciphertext data corresponding to the second calculation result includes: Calculating, according to the auxiliary parameter and the secure calculation parameter, an intermediate calculation result corresponding to the multi-party secure calculation result of the j-th first input data; Based on the j-th random value and the intermediate calculation result, ciphertext data corresponding to the second calculation result is calculated.

7. The method according to claim 6, characterized in that The calculating, based on the j-th random value and the intermediate calculation result, ciphertext data corresponding to the second calculation result includes: Calculate the difference / XOR result between the intermediate calculation result and the j-th random value; The difference / XOR result is determined as ciphertext data corresponding to the second calculation result.

8. The method according to claim 1, characterized in that The method further comprises: Obtaining an auxiliary computing parameter sent by the second computing device, which is calculated based on the j-th first random value and the j-th second random value included in the j-th array and corresponds to a multi-party secure computing result of the j-th first input data; Determine the value of the j-th random number. If the value of the j-th random number is 1, update the j-th random value to the sum of the j-th random value and the auxiliary calculation parameter; wherein the j-th second random value is updated by the second calculation device to the sum of the j-th second random value and the auxiliary calculation parameter.

9. The method according to claim 6 or 8, characterized in that: The auxiliary parameter is a parameter calculated by the second computing device based on a preset association value, the j-th first random value, and the j-th second random value; the security calculation parameter is a parameter calculated by the second computing device based on the association value, the first calculation result, and the second calculation result; The associated value is the addition result / XOR result of the 0th first random value and the 0th second random value.

10. The method according to claim 1, characterized in that The obtaining of N random numbers, and randomly selecting N random values ​​corresponding to the array subscripts indicated by the N random numbers from N arrays consisting of N groups of random values ​​obtained from the second computing device, include: Run a random oblivious transfer protocol and obtain N random numbers generated by running the random oblivious transfer protocol, and randomly select N random values ​​corresponding to array indices indicated by the N random numbers from N arrays consisting of N groups of random values ​​generated by running the random transfer protocol on the second computing device.

11. The method according to claim 1, characterized in that: The first computing device and the second computing device are respectively connected to a random number server, the first computing device and the random number server share a first random number seed, and the second computing device and the random number server share a second random number seed; Among them, the random number server and the first computing device generate the N random numbers based on the shared first random number seed; the random number server and the second computing device generate an associated value and N first random values ​​based on the shared second random number seed, and calculate the corresponding N second random values ​​according to the associated value and the N first random values ​​to form the N groups of random values.

12. The method according to claim 11, characterized in that The obtaining of N random values ​​randomly selected from N arrays consisting of N groups of random values ​​obtained from the second computing device and corresponding to the array subscripts indicated by the N random numbers includes: Obtain N random values ​​sent by the random number server, where the N random values ​​are N random values ​​randomly selected by the random number server from N arrays formed by the N groups of random values ​​and corresponding to the array subscripts indicated by the N random numbers.

13. A multi-party secure computing method, characterized in that: A second computing device used to participate in multi-party secure computing; The first computing device participating in the multi-party secure computation holds N first input data corresponding to the multi-party secure computation, where the first input data is 1-bit data with a value of 0 or 1, and N is an integer greater than 1; the second computing device holds second input data corresponding to the multi-party secure computation and an expected computation result; wherein the expected computation result includes a first computation result calculated with the second input data when the value of the first input data is 0, and a second computation result calculated with the second input data when the value of the first input data is 1; The method comprises: Obtaining N groups of random values, each group of random values ​​in the N groups of random values ​​includes a first random value and a second random value; Calculate a security calculation parameter corresponding to the multi-party security calculation based on the first calculation result and the second calculation result, and send the security calculation parameter to the first computing device, so that when the value of the jth first input data among the N first input data held by the first computing device is 0, the first computing device calculates the ciphertext data corresponding to the first calculation result based on the jth random value among the N random values ​​obtained, and uses the ciphertext data as the first secret shard in the multi-party security calculation result of the jth first input data; or, when the value of the jth first input data is 1, calculate the ciphertext data corresponding to the second calculation result based on the jth random value and the security calculation parameter, and use the ciphertext data as the first secret shard in the multi-party security calculation result of the jth first input data; Among them, the j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​in the N groups of random values, corresponding to the array subscript indicated by the j-th random number among the N random numbers obtained by the first computing device; j is an integer greater than or equal to 0 and less than N.

14. A multi-party secure computing device based on secret sharing, characterized in that: A first computing device used to participate in multi-party secure computing; The first computing device holds N first input data corresponding to the multi-party secure computation, the first input data being 1-bit data having a value of 0 or 1, and N being an integer greater than 1; The second computing device participating in the multi-party secure computation holds second input data and an expected computation result corresponding to the multi-party secure computation; wherein the expected computation result includes a first computation result calculated with the second input data when the value of the first input data is 0, and a second computation result calculated with the second input data when the value of the first input data is 1; The device comprises: A first acquisition unit is used to acquire N random numbers, and N random values ​​randomly selected from N arrays consisting of N groups of random values ​​acquired by the second computing device and corresponding to the array subscripts indicated by the N random numbers; wherein each group of random values ​​in the N groups of random values ​​includes a first random value and a second random value, and each of the N random numbers has a value of 0 or 1; A second acquisition unit is configured to acquire a security computing parameter corresponding to the multi-party secure computing and calculated based on the first computing result and the second computing result and sent by the second computing device; and a computing unit, configured to, when the value of the j-th first input data among the N first input data is 0, calculate the ciphertext data corresponding to the first computing result based on the j-th random value among the N random values, and use the ciphertext data as the first secret shard in the multi-party security computing result of the j-th first input data; or, when the value of the j-th first input data is 1, calculate the ciphertext data corresponding to the second computing result based on the j-th random value and the security computing parameter, and use the ciphertext data as the first secret shard in the multi-party security computing result of the j-th first input data; Among them, the j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​in the N groups of random values, corresponding to the array subscript indicated by the j-th random number among the N random numbers; j is an integer greater than or equal to 0 and less than N.

15. A multi-party secure computing device based on secret sharing, characterized in that: A second computing device used to participate in multi-party secure computing; The first computing device participating in the multi-party secure computation holds N first input data corresponding to the multi-party secure computation, where the first input data is 1-bit data with a value of 0 or 1, and N is an integer greater than 1; the second computing device holds second input data corresponding to the multi-party secure computation and an expected computation result; wherein the expected computation result includes a first computation result calculated with the second input data when the value of the first input data is 0, and a second computation result calculated with the second input data when the value of the first input data is 1; The device comprises: An acquisition unit, configured to acquire N groups of random values, each group of random values ​​in the N groups of random values ​​comprising a first random value and a second random value; a sending unit, configured to calculate a security calculation parameter corresponding to the multi-party security calculation based on the first calculation result and the second calculation result, and send the security calculation parameter to the first computing device, so that when the value of the j-th first input data among the N first input data held by the first computing device is 0, the first computing device calculates the ciphertext data corresponding to the first calculation result based on the j-th random value among the N random values ​​obtained, and uses the ciphertext data as the first secret shard in the multi-party security calculation result of the j-th first input data; or, when the value of the j-th first input data is 1, the first computing device calculates the ciphertext data corresponding to the second calculation result based on the j-th random value and the security calculation parameter, and uses the ciphertext data as the first secret shard in the multi-party security calculation result of the j-th first input data; Among them, the j-th random value is a random value randomly selected from the j-th array composed of the j-th group of random values ​​in the N groups of random values, corresponding to the array subscript indicated by the j-th random number among the N random numbers obtained by the first computing device; j is an integer greater than or equal to 0 and less than N.

16. A computing device, characterized in that include: Memory and processor; The memory stores a computer program executable by the processor; When the processor runs the computer program, it executes the method according to any one of claims 1 to 12, or executes the method according to claim 13.

17. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the method according to any one of claims 1 to 12 is implemented, or the method according to claim 13 is executed.

18. A computer program product, characterized in that The computer program product comprises a computer program / instruction, and when the computer program / instruction is executed by a processor, the method according to any one of claims 1 to 12 is implemented, or the method according to claim 13 is executed.