Privacy calculation method, system and device, storage medium and program product
By using the digital secret sharing algorithm in privacy calculations to truncate and encrypt the results of fixed-point decimal multiplication operations, the problem of low efficiency of fixed-point decimal multiplication operations in the prior art is solved, and more efficient communication and calculation efficiency is achieved.
Patent Information
- Application Number
- CN202411137033.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-12-06
- Estimated Expiration
- 2044-08-16
AI Technical Summary
The existing privacy computing solutions have inefficient performance problems, especially in fixed-point decimal multiplication operations, where the overhead brought by communication has a great impact on computing efficiency.
The first and second values are split into parts held by each participant through the digital secret sharing algorithm, and truncation and encryption are performed after multiplication operation, reducing the data length of communication transmission, thereby improving communication efficiency and privacy Computational efficiency.
It effectively reduces the amount of communication transmission and improves the efficiency of privacy calculations, so that participants can more efficiently transmit and process data when performing fixed-point decimal multiplication operations for privacy protection.
Smart Images

Figure CN119089494A_ABST
Abstract
Description
Technical Field
[0001] One or more embodiments of this specification relate to the field of privacy and security technology, and in particular, to a privacy computing method, system, electronic device, computer-readable storage medium, and computer program product. Background Art
[0002] With the rapid development of the internet, data subjects are accumulating increasing amounts of data, hoping to enrich their own data value from multiple dimensions by combining it with the data of other data subjects. However, unlike conventional objects, data is easily copied and transferred. To protect data privacy, technologies such as secure multi-party computation, differential privacy, and homomorphic encryption are often employed. These technologies allow multiple participants to perform private computing while protecting their data from being leaked. However, current private computing solutions still suffer from performance issues, and the efficiency of private computing needs to be improved. Summary of the Invention
[0003] In view of this, one or more embodiments of this specification provide a privacy computing method, system, electronic device, computer-readable storage medium, and computer program product.
[0004] To achieve the above objectives, one or more embodiments of this specification provide the following technical solutions:
[0005] According to a first aspect of one or more embodiments of this specification, a privacy-preserving computing method is provided for performing a fixed-point decimal multiplication operation based on privacy protection on a first value and a second value; the first value is split into a first part held by a first participant participating in the privacy protection and a second part held by a second participant participating in the privacy protection based on a digital secret sharing algorithm; the second value is split into a third part held by the first participant and a fourth part held by the second participant based on the digital secret sharing algorithm; the data length of the first value and the second value is a first data length;
[0006] The method is applied to an electronic device corresponding to a first participant, and the method includes:
[0007] Performing a multiplication operation based on the first portion of the first value held by the first party and the third portion of the second value to obtain a first fragment of the multiplication result of the first value and the second value;
[0008] truncating a decimal portion of a first slice of the multiplication result based on a preset decimal point position in the fixed-point decimal multiplication operation;
[0009] Encrypting the first fragment of the truncated multiplication result using the digital secret sharing algorithm to obtain a first encrypted result; the data length of the first encrypted result is less than the first data length;
[0010] Sending the first encryption result to the second participant, and receiving a second encryption result sent by the second participant obtained after performing a fixed-point decimal multiplication operation; the data length of the second encryption result is less than the first data length;
[0011] Combination processing is performed based on the first encryption result and the second encryption result to obtain a portion of the fixed-point decimal multiplication operation result held by the first participant as indicated by the digital secret sharing algorithm.
[0012] According to a second aspect of an embodiment of this specification, a privacy-preserving computing system is provided, comprising an electronic device corresponding to a first participant and an electronic device corresponding to a second participant; wherein the privacy-preserving computing system is configured to perform a fixed-point decimal multiplication operation based on privacy protection on a first value and a second value; the first value is split, based on a digital secret sharing algorithm, into a first part held by the first participant participating in the privacy protection and a second part held by the second participant participating in the privacy protection; the second value is split, based on the digital secret sharing algorithm, into a third part held by the first participant and a fourth part held by the second participant; and the data length of the first value and the second value is a first data length.
[0013] The electronic device corresponding to the first participant is used to perform a multiplication operation based on the first part of the first value and the third part of the second value held by the first participant to obtain a first slice of the multiplication result of the first value and the second value; truncate the decimal part of the first slice of the multiplication result based on a preset decimal point position in the fixed-point decimal multiplication operation; encrypt the truncated first slice of the multiplication result using the digital secret sharing algorithm to obtain a first encrypted result; the data length of the first encrypted result is less than the first data length; and send the first encrypted result to the second participant;
[0014] The electronic device corresponding to the second participant is used to perform a multiplication operation based on the second part of the first value and the fourth part of the second value held by the second participant to obtain a second slice of the multiplication result of the first value and the second value; truncate the decimal part of the second slice of the multiplication result based on a preset decimal point position in the fixed-point decimal multiplication operation; encrypt the second slice of the multiplication result after truncation using the digital secret sharing algorithm to obtain a second encrypted result; the data length of the second encrypted result is less than the first data length; and send the second encrypted result to the first participant;
[0015] The electronic device corresponding to the first party is further configured to receive a second encryption result sent by the second party, and perform combined processing based on the first encryption result and the second encryption result to obtain a portion of the fixed-point decimal multiplication result held by the first party as indicated by the digital secret sharing algorithm;
[0016] The electronic device corresponding to the second participant is also used to receive the first encryption result sent by the first participant, and perform combined processing based on the first encryption result and the second encryption result to obtain another part of the fixed-point decimal multiplication operation result held by the second participant as indicated by the digital secret sharing algorithm.
[0017] According to a third aspect of the embodiments of this specification, there is provided an electronic device, including:
[0018] processor;
[0019] a memory for storing processor-executable instructions;
[0020] Wherein, when the processor executes the executable instructions, it is used to implement the method described in the first aspect.
[0021] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the steps of any of the above methods are implemented.
[0022] According to a fifth aspect of the embodiments of this specification, a computer program product is provided, comprising a computer program, which implements the steps of any of the above methods when executed by a processor.
[0023] The technical solutions provided by the embodiments of this specification may have the following beneficial effects:
[0024] In an embodiment of the present specification, in the process of performing a fixed-point decimal multiplication operation based on privacy protection on a first value and a second value, the first participant performs truncation processing after obtaining the first slice of the multiplication result of the first value and the second value, and does not perform a padding operation after the truncation processing, so that the first encryption result transmitted during the communication process is smaller than the first data length. Similarly, the second encryption result obtained and needed to be transmitted by the second participant based on a similar method is also smaller than the first data length, thereby effectively reducing the communication transmission volume, which is conducive to improving communication efficiency and privacy computing efficiency.
[0025] It should be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] Figure 1 This is a structural diagram of a privacy computing system provided by an exemplary embodiment.
[0027] Figure 2 is a timing diagram between a first participant and a second participant provided by an exemplary embodiment.
[0028] Figure 3 is another sequence diagram between a first participating method and a second participating party provided by an exemplary embodiment.
[0029] Figure 4 This is a convolutional layer and activation layer structure in a neural network model provided by an exemplary embodiment.
[0030] Figure 5 This is a flowchart of a privacy computing method provided by an exemplary embodiment.
[0031] Figure 6 It is a structural diagram of an electronic device provided by an exemplary embodiment. DETAILED DESCRIPTION
[0032] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The implementations described in the following exemplary embodiments are not intended to represent all implementations consistent with one or more embodiments of this specification. Rather, they are merely examples of apparatuses and methods consistent with certain aspects of one or more embodiments of this specification, as detailed in the appended claims.
[0033] 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 method may include more or fewer steps than those described in this specification. In addition, a single step described in this specification may be broken down 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.
[0034] It should be noted that 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 manual 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 relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0035] Here is an explanation of the technical terms involved in this manual:
[0036] 1. Secure multi-party computation (MPC): This allows participants to perform computations without exposing private inputs, without a trusted third party. While ensuring the privacy and data security of each participant, multiple parties jointly compute a function or perform a computational task, and each party only obtains its own relevant computational results and no other information.
[0037] 2. Secret sharing: This involves splitting a secret into multiple fragments, with each participant holding a portion. This prevents one or a small number of participants from recovering the shared secret value. Only when a sufficient number of fragments are combined can the original secret information be recovered.
[0038] For example, for arithmetic secret sharing algorithms, there are two sharing schemes:
[0039] (1) [·]-sharing, for a secret value v, the participant P i Hold v i Satisfy v1+v2+…+v n =v;0<i≤n,n≥2.
[0040] (2) <·>-sharing, for a secret value v, publish Δ v =v+δ v , and δ v Use [·]-sharing; that is, n parties jointly hold Δv , and each participant holds a separate δ vi ,;0<i≤n,n≥2.
[0041] Boolean secret sharing algorithms are similar to arithmetic secret sharing algorithms, but differ in that they use logical operations, and the secret value can only be 0 or 1. Specifically, the exclusive OR operation in a Boolean circuit is equivalent to addition in an arithmetic circuit, and the AND operation in a Boolean circuit is equivalent to multiplication in an arithmetic circuit. Digital circuits are used to perform arithmetic operations, such as addition and multiplication, and can convert linear functions into digital circuits for calculation. Boolean circuits, on the other hand, use logical operations such as AND, OR, and NOT, and can convert nonlinear functions into Boolean circuits for calculation.
[0042] To protect data privacy, technologies such as secure multi-party computation, differential privacy, and homomorphic encryption are often employed. These allow multiple parties to perform private computations while protecting their data from being leaked. For example, in secure multi-party computation using secret sharing with fixed-point decimals, multiplication operations require some communication to complete the encrypted data multiplication, and the communication overhead significantly impacts computational efficiency.
[0043] Fixed-point fractional multiplication involves the multiplication of two fixed-point numbers. Unlike floating-point operations, the decimal point position of fixed-point operations is fixed. Fixed-point fractional numbers are usually represented as integers. For example, an 8-bit fixed-point fractional number may actually represent an integer in the range of -128 to 127. Before the multiplication operation, it is necessary to determine the number of bits of the fixed-point numbers involved in the operation and whether they are signed or unsigned numbers. The multiplication operation is performed according to the conventional integer multiplication, but the result needs to be adjusted according to the format of the fixed-point numbers. In the multiplication result, the decimal point position is usually fixed. For example, a 16-bit fixed-point fractional multiplication result may require the decimal point to be moved to the left or right to fit the 16-bit format.
[0044] In the process of implementing the embodiments of this specification, the inventors found that, for example, when two 64-bit fixed-point decimals (for example, the data length of the decimal part is 16 bits) are multiplied, the decimal part of the multiplication result is 32 bits. In this case, the decimal part of the multiplication result needs to be truncated to keep the data length of the decimal part of the multiplication result at 16 bits, and then padded according to the sign bit (i.e., sign extension) so that the multiplication result is 64 bits. During the encryption calculation process, the multiplication operation requires a certain amount of communication to complete the multiplication operation of the encrypted data. In this process, 64-bit data is usually transmitted. This 64-bit data may be padded data, which includes some meaningless data. Therefore, the following optimization is considered, that is, when performing multiplication communication, meaningless data content is not transmitted, thereby reducing the communication volume and improving the efficiency of privacy computing.
[0045] See also Figure 1 An embodiment of this specification provides a privacy computing system, which includes an electronic device 10 corresponding to a first participant (hereinafter referred to as "first participant 10") and an electronic device 20 corresponding to a second participant (hereinafter referred to as "second participant 20"); wherein the first participant 10 and the second participant 20 can achieve communication between the two based on relevant privacy protection technologies (such as oblivious transfer protocol, differential privacy or homomorphic encryption, etc.).
[0046] The electronic device 10 corresponding to the first participant and the electronic device 20 corresponding to the second participant can be devices with computing functions, including but not limited to independent physical servers, server clusters composed of multiple physical servers, cloud servers, personal computers, laptops, cellular phones, camera phones, smart phones, personal digital assistants, media players, navigation devices, email sending and receiving devices, game consoles, tablet computers, wearable devices or a combination of any of these devices.
[0047] The privacy computing system is at least used to perform a fixed-point decimal multiplication operation based on privacy protection on a first value and a second value. The first value is split into a first part held by a first participant participating in privacy protection and a second part held by a second participant participating in privacy protection based on a digital secret sharing algorithm; the second value is split into a third part held by the first participant and a fourth part held by the second participant based on the digital secret sharing algorithm; the data length of the first value and the second value is a first data length, and the data length of the decimal part of the first value and the second value is a second data length, and the second data length is less than the first data length.
[0048] See also Figure 2In the timing diagram shown, the first participant 10 performs a multiplication operation based on the first part of the first numerical value held by the first participant 10 and the third part of the second numerical value to obtain a first slice of the multiplication result of the first numerical value and the second numerical value (201); then, based on a preset decimal point position in the fixed-point decimal multiplication operation, the decimal part of the first slice of the multiplication result is truncated (202); the first slice of the truncated multiplication result is encrypted using a digital secret sharing algorithm to obtain a first encrypted result (203); wherein the data length of the first slice of the truncated multiplication result and the first encrypted result are both less than the first data length; and the first encrypted result is sent to the second participant 20 (204). This embodiment realizes the transmission of only meaningful data after truncation, without maintaining the data length of the first encrypted result equal to the first data length, thereby reducing communication volume and improving communication efficiency and privacy computing efficiency.
[0049] The electronic device corresponding to the second participant 20 is used to perform a multiplication operation based on the second part of the first numerical value and the fourth part of the second numerical value held by the second participant 20 to obtain a second slice (205) of the multiplication result of the first numerical value and the second numerical value; the decimal part of the second slice of the multiplication result is truncated based on the preset decimal point position in the fixed-point decimal multiplication operation (206); the second slice of the multiplication result after truncation is encrypted using a digital secret sharing algorithm to obtain a second encrypted result (207); wherein the data length of the second slice of the multiplication result after truncation and the second encrypted result is less than the first data length; and the second encrypted result is sent to the first participant 10 (208). In this embodiment, only the meaningful data after truncation is transmitted, and there is no need to keep the data length of the second encrypted result equal to the first data length, which is conducive to reducing communication volume and improving communication efficiency and privacy computing efficiency.
[0050] The electronic device corresponding to the first participant 10 is also used to receive the second encryption result sent by the second participant 20, and perform combined processing based on the first encryption result and the second encryption result to obtain a part of the fixed-point decimal multiplication operation result held by the first participant 10 indicated by the digital secret sharing algorithm (209).
[0051] The electronic device corresponding to the second participant 20 is also used to receive the first encryption result sent by the first participant 10, and perform combined processing based on the first encryption result and the second encryption result to obtain another part (210) of the fixed-point decimal multiplication operation result held by the second participant 20 as indicated by the digital secret sharing algorithm.
[0052] Among them, one part of the fixed-point decimal multiplication result held by the first participant 10 and the other part of the fixed-point decimal multiplication result held by the second participant 20 are both valid data representing the fixed-point decimal multiplication result. If the fixed-point decimal multiplication operation is to be continued, the two can be sign-extended (i.e., filled) according to actual needs. This embodiment does not impose any restrictions on this.
[0053] In this embodiment, when performing fixed-point decimal multiplication operations based on privacy protection in accordance with the above-mentioned method, no padding operation is performed after truncation, so that the data length of the first encryption result and the second encryption result transmitted during the communication process is less than the first data length, thereby effectively reducing the communication transmission volume, which is conducive to improving communication efficiency and privacy computing efficiency.
[0054] Exemplarily, the digital secret sharing algorithm is described using the above-mentioned <·>-sharing as an example:
[0055] The first part of the first value includes a first digital secret slice held solely by the first party 10, the second part of the first value includes a second digital secret slice held solely by the second party 20, and the first part and the second part of the first value both also include a first common value held jointly by the first party 10 and the second party 20.
[0056] The third part of the second value includes a third digital secret slice held solely by the first party 10, the fourth part of the second value includes a fourth digital secret slice held solely by the second party 20, and the third part and the fourth part of the second value also include a second common value held jointly by the first party 10 and the second party 20.
[0057] The first party 10 and the second party 20 can obtain the first multiplication slice held by the first party 10 and the second multiplication slice held by the second party 20 based on a preset multiplication triplet generation protocol (setupMULT protocol) without disclosing the first digital secret slice, the second digital secret slice, the third digital secret slice, and the fourth digital secret slice; the first multiplication slice is a part of the product of the first combination result and the second combination result; the second multiplication slice is another part of the product of the first combination result and the second combination result; the first combination result is the result of combining the first digital secret slice and the second digital secret slice, and the second combination result is the result of combining the third digital secret slice and the fourth digital secret slice.
[0058] After obtaining the first multiplication slice, the first party 10 may perform a multiplication operation based on the first portion of the first numerical value, the third portion of the second numerical value, and the first multiplication slice held by the first party 10. For example, the first party 10 may obtain a first product of the first public value, the second public value, and the first multiplication coefficient, a second product of the first public value and the third digital secret slice, and a third product of the second public value and the first digital secret slice; and subtract the second product and the third product from the sum of the first product and the first multiplication slice to obtain a first slice of the multiplication result of the first numerical value and the second numerical value.
[0059] Similarly, after obtaining the second digital slice, the second party 20 may perform a multiplication operation based on the second portion of the first numerical value, the fourth portion of the second numerical value, and the second digital slice held by the second party 20. For example, the second party 20 may obtain a fourth product of the first public value, the second public value, and the second multiplication coefficient, a fifth product of the first public value and the fourth digital secret slice, and a sixth product of the second public value and the second digital secret slice; and subtract the fifth and sixth products from the sum of the fourth product and the second digital slice to obtain a second slice of the multiplication result of the first and second numerical values.
[0060] After obtaining the first slice of the multiplication result of the first value and the second value, the first participant 10 may truncate the decimal part of the first slice of the multiplication result based on a preset decimal point position in the fixed-point decimal multiplication operation.
[0061] Similarly, after obtaining the second slice of the multiplication result of the first value and the second value, the second participant 20 can truncate the decimal part of the second slice of the multiplication result based on the preset decimal point position in the fixed-point decimal multiplication operation.
[0062] The data length of the decimal part of the first value and the second value is the second data length, and the second data length is less than the first data length. Before truncation, the data length of the decimal part of the first slice of the multiplication result and the second slice of the multiplication result is the sum of the data lengths of the decimal part of the first value and the second value, that is, twice the second data length. According to the fixed-point decimal multiplication operation rules, the first slice of the multiplication result and the second slice of the multiplication result can be arithmetic right shifted to achieve truncation, so that the data length of the decimal part of the first slice after truncation and the second slice after truncation is the second data length.
[0063] Next, the first participant 10 can determine the third data length based on the difference between the first data length and the second data length, and randomly generate a fifth digital secret fragment within the data range of the third data length; based on the sum of the first fragment of the truncated multiplication result and the fifth digital secret fragment, obtain the first encryption result and send it to the second participant 20; wherein, the data length of the first fragment of the truncated multiplication result and the first encryption result are both the third data length, reducing the amount of data transmission.
[0064] Similarly, the second party 20 can determine the third data length based on the difference between the first data length and the second data length, and randomly generate a sixth digital secret fragment within the data range of the third data length; based on the sum of the second fragment of the truncated multiplication result and the sixth digital secret fragment, obtain the second encryption result and send it to the first party 10; wherein, the data length of the second fragment of the truncated multiplication result and the second encryption result are both the third data length, reducing the amount of data transmission.
[0065] After receiving the second encryption result, first party 10 may obtain, based on the first encryption result and the second encryption result, a portion of the fixed-point decimal multiplication result held by first party 10 as indicated by the digital secret sharing algorithm; wherein the portion of the fixed-point decimal multiplication result held by first party 10 includes the third public value and the fifth digital secret fragment. The third public value is the sum of the first encryption result and the second encryption result.
[0066] Similarly, after receiving the first encryption result, the second party 20 can obtain another portion of the fixed-point decimal multiplication result held by the second party 20 as indicated by the digital secret sharing algorithm based on the first encryption result and the second encryption result. The other portion of the fixed-point decimal multiplication result held by the second party 20 includes the third public value and the sixth secret fragment, and the third public value is the sum of the first encryption result and the second encryption result.
[0067] For example, assuming the first value <x>={Δ x ,[δ x ] i } and the second value <y>={Δ y ,[δ y ] i }, where i∈{0,1}, P0 represents the first participant 10, P1 represents the second participant 20, Δ x represents the first common value, [δ x ]0 represents the first digital secret fragment, [δ x ]1 represents the second digital secret fragment, Δ y represents the second common value, [δ y ]0 represents the third digital secret fragment, [δ y ]1 represents the fourth digital secret fragment.
[0068] To calculate z = x·y, output the shared value <z>={Δ z ,[δ z ] i }. Among them, Δ z Represents the third common value in the result of fixed-point fractional multiplication, [δ z ]0 represents the fifth digital secret shard held by the first party 10, [δ z ]1 represents the sixth digital secret fragment held by the second participant 20.
[0069] Participants calculate the shared value in the form of: Δ z =z+δ z =(Δ x -δ x )(Δ y -δ y )+δ z =Δ x Δ y -Δ x δ y -Δ y δ x +δ x δ y +δ z δ x Indicates [δ x ]0 and [δ x ]1 combination result, δ y Indicates [δ y ]0 and [δ y ]1 combination result, δ z Indicates [δ z ]0 and [δ z ]1 combination result. Since the δ value should not be made public, it is necessary to calculate δ first. xy =δ x δ y [·]-sharing, that is, [δ xy ] i , then we can calculate Δ z [·]-sharing, that is, [Δ z ] i .
[0070] Phase 1:
[0071] (1) For i∈{0,1}, P i Generate a random [δ z ] i ; [δ z ]0 represents the fifth digital secret fragment, [δ z ]1 represents the sixth digital secret fragment.
[0072] (2) By using the setupMULT protocol input [δ x ] and [δ y ]Generate [δ xy ] i ; [δ xy ]0 represents the first multiplication slice, [δ xy ]1 represents the second multiplied slice.
[0073] Phase 2:
[0074] (1) For i∈{0,1}, P i Calculate the following and send it to P 1-i :[Δ z ] i =i·Δ xy -Δ x [δ y ] i -Δ y [δ x ] i +[δ xy ] i +[δ z ] i ; Among them, the first multiplication coefficient i corresponding to the first participant P0 is 0, the second multiplication coefficient i corresponding to the second participant P1 is 1, Δ xy Represents the product between the first common value and the second common value.
[0075] (2) Each participant calculates Δ z =[Δ z ]0+[Δ z ]1;[Δ z ]0 represents the first encryption result, [Δ z ]1 represents the second encryption result.
[0076] Assume that the data length of the first and second values is l bits, use fixed-point decimals, and the length of the decimal part is l' bits, with [x] l-l′ For example, [x] l-l′ The superscript ll′ in [x] indicates the data length of [x]. The superscripts of other data have similar meanings. A "truncation" operation is defined, using To represent the defined "truncation" operation, the input is l bits of data, and the output is reduced to ll' bits: [x l ,l′]=(xl>>l′) l-l′ , so that the truncated output actually becomes 11′ bits, containing only valid information. Then the fixed-point decimal multiplication operation based on privacy protection can be expressed as follows:
[0077] Phase 1:
[0078] (1) For i∈{0,1}, P i Generate random in is a ring of 11′-digit integers. That is, the first participant 10 randomly generates [δ z ]0, the second participant 20 randomly generates [δ z ]1.
[0079] (2) By using the setupMULT protocol, based on [δ x ] l and [δ y ] l Generate [δ xy ] l , so that the first participant 10 obtains [δ xy ]0, the second participant 20 obtains [δ xy ]1. Generated [δ xy ]0 and [δ xy ]1 data length is 1 bit.
[0080] Phase 2:
[0081] (1) For i∈{0,1}, P i Calculate the following and send it to P 1-i : in, Indicates that after calculating one of the fragments of the multiplication result of the first value and the second value (e.g., the first participant P0 obtains the first fragment, and the second participant P1 obtains the second fragment), the decimal part is truncated to obtain a fragment of the multiplication result with a data length of 11′ bits;
[0082] (2) Each participant Ring Computing
[0083] In this embodiment, since the actual transmission [Δ z ] i There are only 11′ bits of valid data in the transmission. If the invalid data is excluded during transmission, only the valid 11′ bits will be transmitted. In this way, the communication volume is improved. The reduction can reduce the communication overhead.
[0084] Among them, the setupMULT protocol is used in the preprocessing stage to generate [δ xy ] l When [δ xy ] l-l′ In this way, in the second stage, there is no need to truncate this part and the calculation can be performed directly, which is also beneficial to reduce the amount of data transmission and calculation.
[0085] In some embodiments, the privacy-preserving computing methods provided in the embodiments of this specification are further configured to, after performing a privacy-preserving fixed-point decimal multiplication operation on a first value and a second value, perform a privacy-preserving nonlinear operation on the result of the fixed-point decimal multiplication. Nonlinear operations cannot be performed directly under secret sharing, and therefore can be performed by converting them into Boolean circuits for bitwise calculation.
[0086] See also Figure 3 As shown in the timing diagram, after obtaining a portion of the fixed-point decimal multiplication result, the first party 10 can convert the portion of the fixed-point decimal multiplication result held by the first party 10 from digital secret sharing to Boolean secret sharing to obtain a first Boolean secret fragment (301); then, using a Boolean circuit indicated by a nonlinear operation, perform a nonlinear operation on the first Boolean secret fragment to obtain one of the fragments of the nonlinear operation result (302).
[0087] Similarly, after obtaining the other part of the fixed-point decimal multiplication result, the second party 20 can convert the other part of the fixed-point decimal multiplication result held by the second party 20 from digital secret sharing to Boolean secret sharing to obtain a second Boolean secret slice (303); then use the Boolean circuit indicated by the nonlinear operation to perform a nonlinear operation on the second Boolean secret slice to obtain another slice of the nonlinear operation result (304).
[0088] The process of first participant 10 obtaining the first Boolean secret fragment and the process of second participant 20 obtaining the second Boolean secret fragment require the two parties to communicate and transmit relevant data. The following is an exemplary illustration of the conversion process from digital secret sharing to Boolean secret sharing:
[0089] The first party 10 may perform a conversion operation on a portion of the result of the fixed-point decimal multiplication operation held by the first party 10 to obtain a first intermediate result; wherein the portion of the result of the fixed-point decimal multiplication operation held by the first party 10 includes a third public value jointly held by the first party 10 and the second party 20 and a fifth digital secret slice held solely by the first party 10. In the process of obtaining the first intermediate result, the first party 10 may determine a first conversion coefficient corresponding to the first party 10; and then determine the first intermediate result as the difference between the product of the third public value and the first conversion coefficient and the fifth digital secret slice.
[0090] The second party 20 may perform a conversion operation on another part of the result of the fixed-point decimal multiplication operation to obtain a second intermediate result; wherein the other part of the result of the fixed-point decimal multiplication operation held by the second party 20 includes a third public value jointly held by the first party 10 and the second party 20 and a sixth digital secret slice held solely by the second party 20. In the process of obtaining the second intermediate result, the second party 20 may determine a second conversion coefficient corresponding to the second party 20; and then determine the product of the third public value and the second conversion coefficient and the difference between the sixth digital secret slice as the second intermediate result.
[0091] For example, there is a digital sharing <v> A ={Δ v ,[δ v ] i }, for i∈{0,1}, P i Local Computing i =(1-i)·Δ v -[δ v ] i ; Wherein, the first conversion coefficient i corresponding to the first participant 10 is 0, and the second conversion coefficient i corresponding to the second participant 20 is 1; wherein v0 represents the first intermediate result, v1 represents the second intermediate result, Δ v represents the third common value, [δ v ]0 represents the fifth secret fragment, [δ v ]1 represents the sixth secret fragment.
[0092] After obtaining the first intermediate result, the first participant 10 can use the Boolean secret sharing algorithm to split the first intermediate result into a first intermediate fragment and a second intermediate fragment, and transmit the second intermediate fragment to the second participant 20. The first intermediate fragment is held solely by the first participant 10 and is not disclosed to the outside world, thereby achieving privacy protection.
[0093] Similarly, after obtaining the second intermediate result, the second participant 20 can use the Boolean secret sharing algorithm to split the second intermediate result into a third intermediate fragment and a fourth intermediate fragment, and transmit the third intermediate fragment to the first participant 10, while the fourth intermediate fragment is held solely by the second participant 20 and not disclosed to the outside, thereby achieving privacy protection.
[0094] After receiving the third intermediate slice, the first participant 10 may use a full adder to perform a Boolean addition operation on the first intermediate slice and the third intermediate slice to obtain a first Boolean secret slice.
[0095] Similarly, after receiving the second intermediate fragment, the second party 20 can use a full adder to perform a Boolean addition operation on the second intermediate fragment and the fourth intermediate fragment to obtain a second Boolean secret fragment. The specific process of performing the Boolean addition operation using a full adder can be found in the description of the related art and will not be repeated here.
[0096] For example, assume that the data length of the first value and the second value is 1 bit, and the length of the decimal part is 1′ bit.
[0097] In the first stage, P1 generates the second intermediate result according to the above formula The second intermediate result is split into the third and fourth intermediate fragments using the Boolean secret sharing algorithm, and the third intermediate fragment is transmitted and shared to P0. The data lengths of the two fragments of the multiplication result are both 11′, so the data lengths of the first and second intermediate results obtained by the conversion operation according to the above formula are also 11′, and the Boolean shared data is also reduced. The total amount of data transferred is reduced The communication volume is effectively reduced in the process of converting from digital secret sharing to Boolean secret sharing.
[0098] In the second stage: P0 calculates the first intermediate result according to the above formula The first intermediate result is split into the first intermediate fragment and the second intermediate fragment using the Boolean secret sharing algorithm, and the second intermediate fragment is transmitted to P1. Then P0 processes the first intermediate fragment and the third intermediate fragment locally using a full adder to generate the first Boolean secret fragment. Similarly, P1 processes the second intermediate fragment and the fourth intermediate fragment using a full adder to generate the second Boolean secret fragment. Obviously, the communication volume is reduced.
[0099] The following is an example of the nonlinear operation process:
[0100] For example, nonlinear operations include calculating the ReLU function. The ReLU function is expressed as f(x) = max(0, x). In a Boolean circuit, it is expressed as f(x) = INV(sign(x)) & x, where INV is the inversion circuit and sign is the sign circuit. The value of the ReLU function can be calculated through the Boolean circuit, and x represents either the first Boolean secret slice or the second Boolean secret slice.
[0101] Exemplarily, the first party 10 can use a sign circuit in a Boolean circuit to obtain the sign bit of the first Boolean secret slice; use a negation circuit in the Boolean circuit to negate the sign bit of the first Boolean secret slice; and perform the following operations on the first Boolean secret slice bit by bit until all valid bits in the first Boolean secret slice are traversed: use an exclusive-OR circuit in the Boolean circuit to perform an exclusive-OR operation on the negated sign bit and the value of the jth valid bit in the first Boolean secret slice to obtain a nonlinear operation value for the jth valid bit; where j is greater than 0 and less than the data length of the first Boolean secret slice; and finally, based on the nonlinear operation values corresponding to all valid bits in the first Boolean secret slice, obtain a first ReLU function slice. Since the data length of the first Boolean secret slice is the third data length, which is less than the first data length, the number of valid bits in the first Boolean secret slice that need to be traversed is reduced, which in turn reduces the amount of computation, thereby improving computational efficiency.
[0102] Similarly, the second party 20 can use the sign circuit in the Boolean circuit to obtain the sign bit of the second Boolean secret slice; use the negation circuit in the Boolean circuit to negate the sign bit of the second Boolean secret slice; and perform the following operation on the second Boolean secret slice bit by bit until all valid bits in the second Boolean secret slice are traversed: use the exclusive-OR circuit in the Boolean circuit to perform an exclusive-OR operation on the negated sign bit and the value of the jth valid bit in the second Boolean secret slice to obtain a nonlinear operation value for the jth valid bit; where j is greater than 0 and less than the data length of the second Boolean secret slice; and finally, based on the nonlinear operation values corresponding to all valid bits in the second Boolean secret slice, obtain a second ReLU function slice. Since the data length of the second Boolean secret slice is the third data length, which is less than the first data length, the number of valid bits in the second Boolean secret slice that need to be traversed is reduced, which in turn reduces the amount of computation, thereby improving computational efficiency.
[0103] For example, nonlinear operations including calculating a binarization function are used to illustrate: a binarization function f(x) is defined such that a positive number returns 1 and a negative number returns 0 (assuming 0 returns 0). In a Boolean circuit, the form is f(x) = INV(sign(x)), where INV is an inversion circuit and sign is a sign circuit. The value of the binarization function can be calculated through the Boolean circuit, and x represents any one of the first Boolean secret fragment and the second Boolean secret fragment.
[0104] Other activation functions can also be approximated by circuit calculation using similar methods, which will not be described here.
[0105] In some embodiments, the data length of one slice of the nonlinear operation result obtained by the first participant 10 and the data length of another slice of the nonlinear operation result obtained by the second participant 20 are both the third data length and are Boolean shared values. To continue participating in the multiplication operation, it is necessary to convert from Boolean secret sharing to numeric secret sharing and perform sign extension. Sign extension is a concept in computer organization principles that involves expanding a smaller data word length to a larger one while maintaining the original value and sign. During the extension process, the newly added bits copy the highest bit (sign bit) of the original value. This is because signed integers in computers typically use two's complement representation, in which the highest bit is used to indicate the sign, with 0 representing a positive number and 1 representing a negative number. For example, if an 8-bit signed integer is represented in two's complement form as 1111 0101, it represents a negative number. If this number is extended to 16 bits, the sign bit (in this example, 1) must be copied to all newly added bits to ensure that the extended value remains unchanged. Therefore, the extended value will be 1111 1111 1111 0101.
[0106] Exemplarily, after obtaining one of the slices of the nonlinear operation result, the first participant 10 can perform sign extension based on the value on the sign bit in one of the slices of the nonlinear operation result, so that the data length of one of the slices of the nonlinear operation result after sign extension is changed from the third data length to the first data length; then convert one of the slices of the nonlinear operation result after sign extension from Boolean secret sharing to digital secret sharing to obtain a first conversion result, and the first conversion result can continue to participate in the next fixed-point decimal multiplication operation process based on privacy protection.
[0107] Exemplarily, when performing sign extension, the first participant 10 can determine the number of valid bits to be filled in one of the slices of the nonlinear operation result based on the difference between the first data length and the third data length; determine the filling value of the valid bits to be filled according to the numerical value of the sign bit in one of the slices of the nonlinear operation result; and perform sign extension on one of the slices of the nonlinear operation result according to the number of valid bits to be filled and the filling value of the valid bits to be filled.
[0108] Similarly, after obtaining another slice of the nonlinear operation result, the second participant 20 can perform sign extension based on the value on the sign bit in the other slice of the nonlinear operation result, so that the data length of the other slice of the nonlinear operation result after sign extension is changed from the third data length to the first data length; convert the other slice of the nonlinear operation result after sign extension from Boolean secret sharing to digital secret sharing to obtain a second conversion result, and the second conversion result can continue to participate in the next fixed-point decimal multiplication operation process based on privacy protection.
[0109] The process of converting Boolean secret sharing to digital secret sharing is illustrated as follows: First, consider a single-bit Boolean secret sharing value <v>The conversion operation into an arithmetic secret shared value. For a 1-bit value v, the Boolean shared <v> B , remember v a For an arithmetic value in l-bit form, there exists a Boolean secret sharing algorithm expressed as: Represents the exclusive OR operation, which is equivalent to the addition in the digital secret sharing algorithm. v is a fourth common value held by the first participant 10 and the second participant 20, δ v The secret is split into two pieces in a Boolean secret sharing manner and held separately by the first participant 10 and the second participant 20.
[0110] In the first stage, generate [·]-sharing, for example, the first participant 10 holds the seventh secret shard The second participant 20 holds the eighth secret shard
[0111] In the second stage, for i∈{0,1}, P i calculate in, A Boolean value representing one of the valid bits of any slice of the nonlinear operation result, [v a ] i That is, part of the fourth public value; then each participant calculates based on the part it holds and the part it receives <v a > A =<[v a ]0> A +<[v a ]1> A .
[0112] For the Boolean values on all valid bits of any slice of the nonlinear operation result, each Boolean value can be converted in the above manner to obtain the digital values on all valid bits of any slice of the nonlinear operation result.
[0113] The first participant 10 can perform the above calculation process on each valid bit in one slice of the nonlinear operation result after sign extension, thereby obtaining a first conversion result; similarly, the second participant 20 can perform the above calculation process on each valid bit in another slice of the nonlinear operation result after sign extension, thereby obtaining a second conversion result.
[0114] Exemplarily, the privacy computing system of the embodiment of this specification can be applied in a machine learning scenario based on multi-party secure computing. Machine learning based on multi-party secure computing focuses on using machine learning models to train and infer data while protecting user privacy, with the goal of ensuring that the privacy of training data and models is protected. Each participant divides their input secret into multiple shares and randomly distributes these shares to other participants. Each participant uses the secret share allocated to them to perform calculations on their own local computers, and the participants communicate with each other and exchange necessary intermediate calculation results to advance the entire calculation process. Each participant only gets the secret share and cannot know the actual data held by other participants, thereby protecting privacy and security.
[0115] For example, in healthcare scenarios, multiple hospitals may possess medical imaging data from different patients, but privacy regulations prevent them from directly sharing this data. In this case, machine learning methods based on multi-party secure computing can be used to jointly train a model for imaging diagnosis without exposing patient privacy.
[0116] For example, in a financial risk assessment scenario, multiple banks may want to collaborate on developing a risk assessment model but are reluctant to share sensitive customer financial information. Using machine learning methods based on multi-party secure computation, banks can jointly train the risk assessment model while protecting customer data privacy.
[0117] For example, in smart transportation scenarios, traffic management departments in different cities want to collaborate to improve traffic flow and reduce congestion, but they also need to protect the privacy of vehicles and drivers. Leveraging machine learning methods based on multi-party secure computing, cities can jointly analyze vehicle location data, predict traffic flows, and propose optimized transportation solutions.
[0118] For example, in e-commerce scenarios, multiple platforms collaborate to build a personalized recommendation system to enhance the user experience, but they cannot directly share user purchase history and preference data. Using machine learning methods based on multi-party secure computation, platforms can jointly train recommendation models, achieving personalized recommendations while protecting user privacy.
[0119] During the process of the first participant 10 and the second participant 20 performing machine learning based on multi-party secure computing, the above-mentioned fixed-point decimal multiplication operation includes the fixed-point decimal multiplication operation introduced by the convolutional layer in the neural network model indicated by the machine learning; the above-mentioned nonlinear operation includes the activation function calculation introduced by the activation layer in the neural network model indicated by the machine learning.
[0120] See for example Figure 4 For example, a neural network model will be converted into a hybrid circuit containing two types of circuits, requiring conversion between digital circuits and Boolean circuits. In machine learning, convolutional layers and activation layers are used interchangeably, with convolutional layers using digital circuits and activation layers using Boolean circuits. Digital circuits are used to perform arithmetic operations, such as addition and multiplication, and can be used to convert linear functions into digital circuits for calculation. Boolean circuits, on the other hand, process data using logical operations such as AND, OR, and NOT. This allows the nonlinear functions of activation layers in machine learning to be converted into Boolean circuits for calculation.
[0121] With the continuous development of artificial intelligence, machine learning has become one of the most commonly used technologies in many fields. However, machine learning requires large amounts of data for training. In the context of big data, both users and service providers face serious privacy issues. Users worry about their personal information being leaked, while service providers also worry about their model data being stolen. Therefore, protecting data privacy during model training and prediction has become a very important issue.
[0122] Privacy-preserving machine learning uses secure multi-party computing, differential privacy, homomorphic encryption and other technologies to protect the data in machine learning. Consider the scenario of using secure multi-party computing, which allows participants to jointly calculate a function while protecting their own data from being leaked. How to ensure data privacy without sacrificing the performance of machine learning is a question worth exploring. However, the current privacy-preserving machine learning solutions still have great performance problems. Therefore, in the machine learning scenario, the communication optimization of privacy-preserving machine learning can be achieved based on the privacy computing solution mentioned in the embodiment of this specification; when performing vertex decimal multiplication communication in the convolutional layer, meaningless data content is not transmitted, only the truncated meaningful data needs to be sent, and at the same time, when the activation layer uses Boolean circuits for nonlinear operations, the input data only has the truncated retained data, and the output data still maintains the output of the normal number of bits, thereby reducing the amount of communication and computation to improve the efficiency of privacy-preserving machine learning. As Figure 4 As shown, the input data of the convolutional layer is ring, while the output data is in The amount of data that needs to be transmitted and the amount of data for subsequent nonlinear operations are reduced, which is conducive to improving the efficiency of machine learning.
[0123] During the evaluation and optimization process, in the communication phase, all 2l-bit multiplication communication overheads are reduced to 2(ll′) bits, and the communication volume is reduced. In the case of l = 64, l' = 16, the communication volume is reduced by 25%. In the activation layer, the number of AND gates is also reduced, such as ReLU can reduce AND gate operation.
[0124] The output of the optimized fixed-point decimal multiplication in the convolutional layer is The multiplication in the convolutional layer is done on the ring. On the ring, the output of the optimized multiplication can be converted into a Boolean share and the activation function is calculated by the Boolean circuit of the activation layer to obtain (ll′) groups of Boolean shares, which are then padded to l groups of Boolean shares by sign extension and then converted to The fixed-point decimal multiplication operation in the next convolutional layer can then be performed.
[0125] The various technical features in the above embodiments can be combined arbitrarily as long as there is no conflict or contradiction between the combinations of features. However, due to space limitations, they are not described one by one. Therefore, the arbitrary combination of the various technical features in the above embodiments also falls within the scope of disclosure of this specification.
[0126] See also Figure 5 , an embodiment of this specification also provides a privacy computing method for performing a fixed-point decimal multiplication operation based on privacy protection on a first value and a second value; the first value is split into a first part held by a first participant participating in the privacy protection and a second part held by a second participant participating in the privacy protection based on a digital secret sharing algorithm; the second value is split into a third part held by the first participant and a fourth part held by the second participant based on the digital secret sharing algorithm; the data length of the first value and the second value is a first data length. The method is applied to the electronic device corresponding to the first participant, and the method includes:
[0127] In S501, a multiplication operation is performed based on the first part of the first value and the third part of the second value held by the first participant to obtain a first fragment of the multiplication result of the first value and the second value.
[0128] In S502 , a decimal part of a first slice of the multiplication result is truncated based on a preset decimal point position in the fixed-point decimal multiplication operation.
[0129] In S503, the digital secret sharing algorithm is used to encrypt the first fragment of the truncated multiplication result to obtain a first encrypted result; the data length of the first encrypted result is less than the first data length.
[0130] In S504, the first encryption result is sent to the second participant, and a second encryption result obtained after fixed-point decimal multiplication operation is received from the second participant; the data length of the second encryption result is smaller than the first data length.
[0131] In S505, a combination process is performed based on the first encryption result and the second encryption result to obtain a portion of the fixed-point decimal multiplication result held by the first participant as indicated by the digital secret sharing algorithm.
[0132] In one implementation, the fixed-point decimal multiplication operation includes a fixed-point decimal multiplication operation introduced by a convolutional layer in a neural network model indicated by the machine learning during the process of the first and second parties performing machine learning based on multi-party secure computing.
[0133] In one implementation, the first portion of the first value includes a first digital secret slice held solely by the first party, and the second portion of the first value includes a second digital secret slice held solely by the second party;
[0134] a third portion of the second value includes a third digital secret slice held solely by the first party, and a fourth portion of the second value includes a fourth digital secret slice held solely by the second party;
[0135] The performing a multiplication operation based on the first part of the first value held by the first party and the third part of the second value includes:
[0136] Based on a preset multiplication triplet generation protocol, without disclosing the first digital secret slice, the second digital secret slice, the third digital secret slice, and the fourth digital secret slice, a first multiplication slice held by the first party is obtained; the first multiplication slice is a portion of the product of a first combination result and a second combination result; the first combination result is a result of combining the first digital secret slice and the second digital secret slice, and the second combination result is a result of combining the third digital secret slice and the fourth digital secret slice;
[0137] A multiplication operation is performed based on a first portion of the first value held by the first party, a third portion of the second value, and the first product slice.
[0138] In one implementation, the first part and the second part of the first value each further include a first common value held by the first party and the second party;
[0139] The third part and the fourth part of the second value each further include a second common value held by the first party and the second party;
[0140] The performing a multiplication operation based on the first part of the first value held by the first participant, the third part of the second value, and the first product slice includes:
[0141] obtaining a first product between the first public value, the second public value, and a first multiplication coefficient, a second product between the first public value and the third digital secret slice, and a third product between the second public value and the first digital secret slice;
[0142] The second product and the third product are subtracted from the sum of the first product and the first product slice to obtain a first slice of the multiplication result of the first value and the second value.
[0143] In one implementation, the data length of the decimal parts of the first value and the second value is a second data length, and the second data length is smaller than the first data length;
[0144] The encrypting the first slice of the truncated multiplication result by using the digital secret sharing algorithm includes:
[0145] determining a third data length based on a difference between the first data length and the second data length, and randomly generating a fifth digital secret fragment within a data range of the third data length;
[0146] A first encryption result is obtained based on the sum of the first fragment of the multiplication result after truncation and the fifth digital secret fragment; wherein the data length of the first fragment of the multiplication result after truncation and the first encryption result are both the third data length.
[0147] In one implementation, the portion of the fixed-point decimal multiplication result held by the first party indicated by the digital secret sharing algorithm includes a third public value and the fifth secret fragment; wherein the third public value includes the sum of the first encryption result and the second encryption result.
[0148] In one implementation, the privacy computing method is further configured to, after performing a privacy-preserving fixed-point decimal multiplication operation on the first value and the second value, perform a privacy-preserving nonlinear operation on the obtained fixed-point decimal multiplication result;
[0149] The method further comprises:
[0150] converting a portion of the result of the fixed-point decimal multiplication operation held by the first party from a digital secret sharing to a Boolean secret sharing to obtain a first Boolean secret shard;
[0151] A nonlinear operation is performed on the first Boolean secret slice using the Boolean circuit indicated by the nonlinear operation to obtain one slice of the nonlinear operation result.
[0152] In one implementation, the nonlinear operation includes an activation function calculation introduced by an activation layer in a neural network model indicated by machine learning during a process in which the first and second participants perform machine learning based on multi-party secure computing.
[0153] In one implementation, converting a portion of the result of the fixed-point decimal multiplication operation held by the first party from a digital secret sharing to a Boolean secret sharing includes:
[0154] Performing a conversion operation on a portion of the fixed-point decimal multiplication operation result held by the first participant to obtain a first intermediate result;
[0155] Splitting the first intermediate result into a first intermediate fragment and a second intermediate fragment using a Boolean secret sharing algorithm, and transmitting the second intermediate fragment to the second participant;
[0156] receiving a third intermediate fragment transmitted by the second participant; the third intermediate fragment is obtained by the second participant splitting the second intermediate result into the third intermediate fragment and the fourth intermediate fragment based on the Boolean secret sharing algorithm, and the second intermediate result is obtained by the second participant performing a conversion operation on another part of the fixed-point decimal multiplication result held by the second participant;
[0157] A full adder is used to perform a Boolean addition operation on the first intermediate slice and the third intermediate slice to obtain the first Boolean secret slice.
[0158] In one implementation, the portion of the result of the fixed-point decimal multiplication operation held by the first party includes a third public value held jointly by the first party and the second party and a fifth digital secret slice held solely by the first party;
[0159] The converting operation on a portion of the fixed-point decimal multiplication operation result held by the first participant to obtain a first intermediate result includes:
[0160] determining a first conversion coefficient corresponding to the first party;
[0161] The difference between the product of the third public value and the first conversion coefficient and the fifth digital secret fragment is determined as the first intermediate result.
[0162] In one implementation, the nonlinear operation includes calculating a ReLU function;
[0163] The method of performing a nonlinear operation on the first Boolean secret slice using the Boolean circuit with the privacy-preserving nonlinear operation indication to obtain one slice of the nonlinear operation result includes:
[0164] Obtaining a sign bit of the first Boolean secret slice using a sign circuit in the Boolean circuit;
[0165] Inverting the sign bit of the first Boolean secret fragment using an inversion circuit in the Boolean circuit;
[0166] Performing the following operation on the first Boolean secret slice bit by bit until all valid bits in the first Boolean secret slice are traversed: using an exclusive-OR circuit in the Boolean circuit to perform an exclusive-OR operation on the inverted sign bit and the value of the j-th valid bit in the first Boolean secret slice to obtain a nonlinear operation value of the j-th valid bit; where j is greater than 0 and less than the data length of the first Boolean secret slice;
[0167] A first ReLU function slice is obtained based on the nonlinear operation values corresponding to all valid bits in the first Boolean secret slice.
[0168] In one implementation, the data length of the decimal parts of the first value and the second value is a second data length, and the second data length is smaller than the first data length; the data length of one slice of the nonlinear operation result is a third data length, and the third data length is the difference between the first data length and the second data length;
[0169] The method further comprises:
[0170] performing sign extension based on a value of a sign bit in one of the slices of the nonlinear operation result, so that a data length of one of the slices of the nonlinear operation result after the sign extension is changed from the third data length to the first data length;
[0171] One of the slices of the nonlinear operation result after sign extension is converted from Boolean secret sharing to digital secret sharing to obtain a first conversion result, and the first conversion result can continue to participate in the next fixed-point decimal multiplication operation process based on privacy protection.
[0172] The various technical features in the above embodiments can be combined arbitrarily as long as there is no conflict or contradiction between the combinations of features. However, due to space limitations, they are not described one by one. Therefore, the arbitrary combination of the various technical features in the above embodiments also falls within the scope of disclosure of this specification.
[0173] In some embodiments, an embodiment of this specification further provides an electronic device, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor implements any of the above methods by running the executable instructions.
[0174] For example, Figure 6 This is a schematic structural diagram of a device provided by an exemplary embodiment. Figure 6 At the hardware level, the device includes a processor 602, an internal bus 604, a network interface 606, a memory 608, and a non-volatile memory 610. Of course, it may also include hardware required for other scenarios. One or more embodiments of this specification can be implemented based on software, such as the processor 602 reading the corresponding computer program from the non-volatile memory 610 into the memory 608 and then running it. Of course, in addition to software implementation, one or more embodiments of this specification do not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0175] This specification also provides a privacy-preserving computing device for performing a fixed-point decimal multiplication operation based on privacy protection on a first value and a second value; the first value is split, based on a digital secret sharing algorithm, into a first part held by a first participant participating in the privacy protection and a second part held by a second participant participating in the privacy protection; the second value is split, based on the digital secret sharing algorithm, into a third part held by the first participant and a fourth part held by the second participant; the data length of the first value and the second value is a first data length;
[0176] The device is applied to the first participant's corresponding Figure 6 The electronic device shown includes:
[0177] A multiplication operation module is used to perform a multiplication operation based on the first part of the first value held by the first participant and the third part of the second value to obtain a first fragment of the multiplication result of the first value and the second value.
[0178] The truncation module is configured to truncate the decimal part of the first slice of the multiplication result based on a preset decimal point position in the fixed-point decimal multiplication operation.
[0179] An encryption module is used to encrypt the first slice of the truncated multiplication result using the digital secret sharing algorithm to obtain a first encryption result; the data length of the first encryption result is less than the first data length.
[0180] A communication module is used to send the first encryption result to the second participant, and receive a second encryption result sent by the second participant after performing a fixed-point decimal multiplication operation; the data length of the second encryption result is less than the first data length.
[0181] A combination processing module is used to perform combination processing based on the first encryption result and the second encryption result to obtain a part of the fixed-point decimal multiplication operation result held by the first participant as indicated by the digital secret sharing algorithm.
[0182] In some embodiments, the embodiments of this specification further provide a computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of any of the methods described above.
[0183] Exemplarily, computer-readable media include permanent and non-permanent, removable and non-removable media that can implement information storage by any method or technology. Information can be computer-readable instructions, data structures, program modules or other data. 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 disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassettes, disk storage, quantum memory, graphene-based storage media 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 temporary computer-readable media (transitory media), such as modulated data signals and carrier waves.
[0184] In some embodiments, the embodiments of this specification further provide a computer program product, including a computer program, which implements the steps of any of the above methods when executed by a processor.
[0185] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0186] It should be understood that although one or more embodiments of this specification may use the terms first, second, third, etc. to describe various information, such information should not be limited to these terms. These terms are merely used to distinguish information of the same type from one another. For example, without departing from the scope of one or more embodiments of this specification, first information may also be referred to as second information, and similarly, second information may also be referred to as first information. Depending on the context, the term "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining."
[0187] The above description is merely a preferred embodiment of one or more embodiments of this specification and is not intended to limit one or more embodiments of this specification. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of one or more embodiments of this specification shall be included in the scope of protection of one or more embodiments of this specification.< / v> < / v> < / v> < / z> < / y> < / x>
Claims
1. A privacy computing method, for performing a fixed-point decimal multiplication operation based on privacy protection on a first value and a second value; the first value is split into a first part held by a first participant participating in the privacy protection and a second part held by a second participant participating in the privacy protection based on a digital secret sharing algorithm; the second value is split into a third part held by the first participant and a fourth part held by the second participant based on the digital secret sharing algorithm ; The data length of the first value and the second value is a first data length; The method is applied to an electronic device corresponding to the first participant, and the method includes: Performing a multiplication operation based on a first part of the first value held by the first participant and a third part of the second value to obtain a first fragment of a multiplication result of the first value and the second value; truncating a decimal part of a first slice of the multiplication operation result based on a preset decimal point position in the fixed-point decimal multiplication operation; Using the digital secret sharing algorithm, encrypt the first slice of the truncated multiplication result to obtain a first encrypted result; the data length of the first encrypted result is less than the first data length; Sending the first encryption result to the second participant, and receiving a second encryption result sent by the second participant obtained after performing a fixed-point decimal multiplication operation; the data length of the second encryption result is less than the first data length; Combination processing is performed based on the first encryption result and the second encryption result to obtain a portion of the fixed-point decimal multiplication result held by the first participant as indicated by the digital secret sharing algorithm.
2. According to the method of claim 1, the fixed-point decimal multiplication operation includes the fixed-point decimal multiplication operation introduced by the convolutional layer in the neural network model indicated by the machine learning during the process of the first party and the second party performing machine learning based on multi-party secure computing.
3. The method of claim 1, wherein the first portion of the first value comprises a first digital secret fragment held solely by the first party, and the second portion of the first value comprises a second digital secret fragment held solely by the second party; a third portion of the second value includes a third digital secret slice held solely by the first party, and a fourth portion of the second value includes a fourth digital secret slice held solely by the second party; The multiplication operation based on the first part of the first value held by the first participant and the third part of the second value includes: Based on a preset multiplication triplet generation protocol, a first multiplication slice held by the first participant is obtained without disclosing the first digital secret slice, the second digital secret slice, the third digital secret slice and the fourth digital secret slice; the first multiplication slice is a part of the product between the first combination result and the second combination result; the first combination result is a result of combining the first digital secret slice and the second digital secret slice, and the second combination result is a result of combining the third digital secret slice and the fourth digital secret slice; A multiplication operation is performed based on a first portion of the first value held by the first party, a third portion of the second value, and the first product slice.
4. The method according to claim 3, wherein the first part and the second part of the first value each further include a first common value jointly held by the first participant and the second participant; The third part and the fourth part of the second value both further include a second common value jointly held by the first party and the second party; The multiplication operation is performed based on the first part of the first value held by the first participant, the third part of the second value, and the first product slice, include: obtaining a first product between the first public value, the second public value and a first multiplication coefficient, a second product between the first public value and the third digital secret slice, and a third product between the second public value and the first digital secret slice; The second product and the third product are subtracted from the sum of the first product and the first product slice to obtain a first slice of the multiplication result of the first value and the second value.
5. The method according to claim 1, wherein the data length of the decimal part of the first value and the second value is a second data length, and the second data length is smaller than the first data length; The step of using the digital secret sharing algorithm to encrypt the first slice of the truncated multiplication result includes: Determine a third data length based on the difference between the first data length and the second data length, and randomly generate a fifth digital secret fragment within the data range of the third data length; A first encryption result is obtained based on the sum of the first fragment of the multiplication result after truncation and the fifth digital secret fragment; wherein the data length of the first fragment of the multiplication result after truncation and the first encryption result are both the third data length.
6. The method according to claim 5, wherein the portion of the result of the fixed-point decimal multiplication operation held by the first party indicated by the digital secret sharing algorithm comprises a third public value and the fifth secret fragment; in, The third common value includes the sum of the first encryption result and the second encryption result.
7. The method according to claim 1, wherein the privacy computing method is further used to perform a nonlinear operation based on privacy protection on the obtained fixed-point decimal multiplication result after performing a fixed-point decimal multiplication operation based on privacy protection on the first value and the second value; The method also include: Converting a portion of the result of the fixed-point decimal multiplication operation held by the first party from a digital secret sharing to a Boolean secret sharing to obtain a first Boolean secret slice; A nonlinear operation is performed on the first Boolean secret slice using the Boolean circuit indicated by the nonlinear operation to obtain one of the slices of the nonlinear operation result.
8. According to the method of claim 7, the nonlinear operation includes the activation function calculation introduced by the activation layer in the neural network model indicated by the machine learning in the process of the first participant and the second participant performing machine learning based on multi-party secure computing.
9. The method of claim 7, wherein the step of converting a portion of the result of the fixed-point decimal multiplication operation held by the first party from a digital secret sharing to a Boolean secret sharing, include: Performing a conversion operation on a portion of the fixed-point decimal multiplication operation result held by the first participant to obtain a first intermediate result; Splitting the first intermediate result into a first intermediate fragment and a second intermediate fragment using a Boolean secret sharing algorithm, and transmitting the second intermediate fragment to the second participant; receiving a third intermediate fragment transmitted by the second participant; The third intermediate shard is obtained by the second participant splitting the second intermediate result into the third intermediate shard and the fourth intermediate shard based on the Boolean secret sharing algorithm, and the second intermediate result is obtained by the second participant performing a conversion operation on another part of the fixed-point decimal multiplication operation result held by the second participant; A full adder is used to perform a Boolean addition operation on the first intermediate slice and the third intermediate slice to obtain the first Boolean secret slice.
10. The method according to claim 9, wherein the portion of the result of the fixed-point decimal multiplication operation held by the first party comprises a third public value held jointly by the first party and the second party and a fifth digital secret fragment held solely by the first party; The converting operation is performed on a part of the fixed-point decimal multiplication operation result held by the first participant to obtain a first intermediate result, including: determining a first conversion coefficient corresponding to the first party; The difference between the product of the third public value and the first conversion coefficient and the fifth digital secret slice is determined as the first intermediate result.
11. The method according to claim 7 or 8, wherein the nonlinear operation comprises calculating a ReLU function; The Boolean circuit using the privacy-protection-based nonlinear operation indication performs a nonlinear operation on the first Boolean secret slice to obtain one of the slices of the nonlinear operation result. include: Obtaining a sign bit of the first Boolean secret slice using a sign circuit in the Boolean circuit; Using a negation circuit in the Boolean circuit to negate the sign bit of the first Boolean secret slice; Performing the following operation on the first Boolean secret slice bit by bit until all valid bits in the first Boolean secret slice are traversed: using an XOR circuit in the Boolean circuit to perform an XOR operation on the inverted sign bit and the value of the j-th valid bit in the first Boolean secret slice to obtain a nonlinear operation value of the j-th valid bit; wherein j is greater than 0 and less than the data length of the first Boolean secret slice; A first ReLU function slice is obtained based on the nonlinear operation values corresponding to all valid bits in the first Boolean secret slice.
12. The method according to claim 7, wherein the data length of the decimal part of the first value and the second value is a second data length, and the second data length is smaller than the first data length; the data length of one slice of the nonlinear operation result is a third data length, and the third data length is the difference between the first data length and the second data length; The method also include: Performing sign extension based on the value of the sign bit in one of the slices of the nonlinear operation result, so that the data length of one of the slices of the nonlinear operation result after the sign extension is changed from the third data length to the first data length; One of the slices of the nonlinear operation result after sign extension is converted from Boolean secret sharing to digital secret sharing to obtain a first conversion result, and the first conversion result can continue to participate in the next fixed-point decimal multiplication operation process based on privacy protection.
13. A privacy computing system, comprising an electronic device corresponding to a first participant and an electronic device corresponding to a second participant; in, The privacy computing system is used to perform a fixed-point decimal multiplication operation based on privacy protection on a first value and a second value; the first value is split into a first part held by a first participant participating in the privacy protection and a second part held by a second participant participating in the privacy protection based on a digital secret sharing algorithm; the second value is split into a third part held by the first participant and a fourth part held by the second participant based on the digital secret sharing algorithm; the data length of the first value and the second value is a first data length; The electronic device corresponding to the first participant is used to perform a multiplication operation based on the first part of the first value held by the first participant and the third part of the second value to obtain a first slice of the multiplication result of the first value and the second value; truncating a decimal part of a first slice of the multiplication operation result based on a preset decimal point position in the fixed-point decimal multiplication operation; Using the digital secret sharing algorithm, encrypt the first slice of the truncated multiplication result to obtain a first encrypted result; the data length of the first encrypted result is less than the first data length; Sending the first encryption result to the second party; The electronic device corresponding to the second participant is used to perform a multiplication operation based on the second part of the first value and the fourth part of the second value held by the second participant to obtain a second slice of the multiplication operation result of the first value and the second value; and truncate the decimal part of the second slice of the multiplication operation result based on a preset decimal point position in the fixed-point decimal multiplication operation; Using the digital secret sharing algorithm, encrypt the second slice of the truncated multiplication result to obtain a second encrypted result; the data length of the second encrypted result is less than the first data length; Sending the second encryption result to the first party; The electronic device corresponding to the first participant is further used to receive the second encryption result sent by the second participant, and perform combined processing based on the first encryption result and the second encryption result to obtain a part of the fixed-point decimal multiplication operation result held by the first participant indicated by the digital secret sharing algorithm; The electronic device corresponding to the second participant is also used to receive the first encryption result sent by the first participant, and perform combined processing based on the first encryption result and the second encryption result to obtain another part of the fixed-point decimal multiplication operation result held by the second participant as indicated by the digital secret sharing algorithm.
14. An electronic device, include: processor; a memory for storing processor-executable instructions; The processor implements the method according to any one of claims 1 to 12 by running the executable instructions.
15. A computer-readable storage medium having computer instructions stored thereon, which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 12.
16. A computer program product, comprising a computer program, which implements the steps of the method according to any one of claims 1 to 12 when executed by a processor.
Citation Information
Patent Citations
Fixed-point number secure multiplication calculation method based on vector space secret sharing
CN115333726A
Secure multi-party multiplication method and device, equipment, medium and product
CN115982747A
Boolean arithmetic sharing conversion method and device for protecting private data
CN116821961A
Privacy calculation method and system for secure two-square matrix hybrid multiplication and medium
CN117313121A
Secure multi-party computing fusion method and system based on block chain
CN117370927A
