Oblivious transfer method and apparatus

By maintaining global queues and local queues in oblivious transfer, allocating local queues for each computing task, and utilizing deterministic random number generation options and selections, the problem of parallel processing in existing technologies is solved, and more efficient computing efficiency is achieved.

CN114546621BActive Publication Date: 2025-09-26ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210182216.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-02-25
Publication Date
2025-09-26
Estimated Expiration
2042-02-25

AI Technical Summary

Technical Problem

The oblivious transfer in the existing technology cannot meet the requirements of parallel processing, resulting in low operating efficiency.

Method used

The first party maintains a global queue and multiple local queues, allocates a dedicated local queue for each computing task, and sequentially takes out OT tuples when the local queue is not empty and sends them to the second party for calculation. A deterministic random number generator is used to generate options and selections to achieve parallel processing.

Benefits of technology

The operating efficiency of oblivious transfer is improved, allowing multiple computing tasks to be executed in parallel, ensuring that the first and second parties take out the corresponding OT tuples in the same order, thereby improving computing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114546621B_ABST
    Figure CN114546621B_ABST
Patent Text Reader

Abstract

The embodiments of this specification provide an oblivious transfer method and apparatus. Executed by a first party, wherein the first party maintains a global queue for storing obliviously transferred OT tuples, and multiple local queues maintained by taking OT tuples from the global queue; the method includes: for a first computing task, the first process of the first party obtains the first queue index of the first local queue allocated to the first computing task in the multiple local queues; when the first local queue is not empty, sequentially taking out OT tuples from the first local queue, and sending the first queue index to the second party, so that the second party sequentially takes out OT tuples from the local queue corresponding to the first queue index maintained locally, and performs oblivious transfer-based calculations with the second party using the OT tuples taken out by each party. It can meet the requirements of parallel processing, thereby improving operating efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] One or more embodiments of the present specification relate to the field of computers, and more particularly, to methods and apparatuses for oblivious transmission. Background Art

[0002] Multi-party secure computation, also known as secure multi-party computation, involves multiple parties working together to compute the result of a function without revealing the input data of each party involved. The result is then made public to one or more of the parties involved. The input data of each party is often private data.

[0003] Oblivious transfer (OT) is the basis of multi-party secure computation. Typically, the sender provides several options, and the receiver provides a choice. After OT is completed, the receiver obtains the option he needs without knowing the content of other options, and the sender does not know which option the receiver has chosen.

[0004] In the prior art, oblivious transfer cannot meet the requirements of parallel processing, resulting in low operating efficiency. Summary of the Invention

[0005] One or more embodiments of this specification describe an oblivious transmission method and apparatus that can meet the requirements of parallel processing, thereby improving operating efficiency.

[0006] In a first aspect, an oblivious transmission method is provided, which is performed by a first party, wherein the first party maintains a global queue for storing obliviously transmitted (OT) tuples, and a plurality of local queues maintained by taking OT tuples from the global queue; the method comprising:

[0007] For a first computing task, the first process of the first party obtains a first queue index of a first local queue allocated to the first computing task from among the multiple local queues;

[0008] When the first local queue is not empty, OT tuples are sequentially taken out from the first local queue, and the first queue index is sent to the second party, so that the second party sequentially takes out OT tuples from the local queue corresponding to the first queue index maintained locally, and performs oblivious transmission-based calculations with the second party using the OT tuples respectively taken out.

[0009] In a possible implementation, the OT tuple retrieved by the first party includes several randomly generated options, and the OT tuple retrieved by the second party includes a randomly generated selection and a target option among the several options corresponding to the selection.

[0010] Furthermore, the plurality of options or the selection is generated based on a deterministic random bit generator (DRBG) context.

[0011] In one possible implementation, the method further includes:

[0012] For a second computing task, a second process of the first party executed in parallel with the first process obtains a second queue index of a second local queue allocated to the second computing task from among the multiple local queues;

[0013] When the second local queue is not empty, OT tuples are sequentially taken out from the second local queue, and the second queue index is sent to the second party, so that the second party sequentially takes out OT tuples from the local queue corresponding to the second queue index maintained locally, and performs oblivious transfer-based calculations with the second party using the respective taken out OT tuples; the second local queue is different from the first local queue.

[0014] In a possible implementation, the first process of the first party obtains the first queue index in the following manner:

[0015] Determine whether the idle queue index sequence is empty;

[0016] If it is determined that the idle queue index sequence is not empty, taking an idle queue index from the idle queue index sequence and using it as the first queue index;

[0017] If it is determined that the idle queue index sequence is empty, an idle queue index is randomly generated as the first queue index.

[0018] Furthermore, after the second party and the second party perform calculation based on oblivious transfer using the OT tuples respectively retrieved, the method further includes:

[0019] Put the first queue index into the idle queue index sequence.

[0020] Furthermore, the method further comprises:

[0021] Periodically scanning the idle queue index sequence;

[0022] When it is determined that there is an idle queue index in the idle queue index sequence that has not been taken out for a long time, the OT tuple in the local queue corresponding to the idle queue index is put back into the global queue, and the second party is notified to put the OT tuple in the local queue corresponding to the idle queue index back into its locally maintained global queue.

[0023] In one possible implementation, the method further includes:

[0024] When the first local queue is empty, notify the second party to lock the global queue maintained locally, and after confirming that the second party has locked successfully, lock the global queue, and after confirming that the global queue has been locked successfully, sequentially take out several OT tuples from the global queue to generate the first local queue, and notify the second party to sequentially take out several OT tuples from the global queue maintained locally to generate a local queue corresponding to the first queue index.

[0025] Furthermore, before sequentially taking out a plurality of OT tuples from the global queue to generate the first local queue, the method further includes:

[0026] Determine whether the number of OT tuples contained in the global queue is greater than or equal to a preset threshold;

[0027] If it is determined that the number of OT tuples is less than the preset threshold, a period of time is waited until the number of OT tuples included in the global queue is expanded to be greater than or equal to the preset threshold.

[0028] Furthermore, the method further comprises:

[0029] The third process of the first party periodically detects the number of OT tuples contained in the global queue;

[0030] If it is found that the number of OT tuples is less than the preset threshold, the global queue is expanded to a first number, and the second party is notified to expand its locally maintained global queue to the first number.

[0031] According to a second aspect, an oblivious transmission apparatus is provided, the apparatus being disposed on a first party, wherein the first party maintains a global queue for storing obliviously transmitted (OT) tuples, and a plurality of local queues maintained by extracting OT tuples from the global queue; the apparatus comprising:

[0032] a first obtaining unit, configured to obtain, for a first computing task, by a first process of the first party, a first queue index of a first local queue allocated to the first computing task among the multiple local queues;

[0033] The first computing unit is configured to sequentially retrieve OT tuples from the first local queue when the first local queue is not empty, and send the first queue index obtained by the first obtaining unit to the second party, so that the second party sequentially retrieves OT tuples from the local queue corresponding to the first queue index maintained locally, and performs oblivious transfer-based calculations with the second party using the OT tuples respectively retrieved.

[0034] According to a third aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed in a computer, the computer is caused to execute the method according to the first aspect.

[0035] In a fourth aspect, a computing device is provided, comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method of the first aspect is implemented.

[0036] Through the method and apparatus provided in the embodiments of this specification, the first party not only maintains a global queue for storing obliviously transmitted OT tuples, but also maintains multiple local queues maintained by taking OT tuples from the global queue; when a first computing task needs to be executed, first, for the first computing task, the first process of the first party obtains the first queue index of the first local queue allocated to the first computing task in the multiple local queues; then, if the first local queue is not empty, the OT tuples are sequentially taken out from the first local queue, and the first queue index is sent to the second party, so that the second party sequentially takes out the OT tuples from the local queue corresponding to the first queue index maintained locally, and performs oblivious transmission-based calculations with the second party using the OT tuples taken out. As can be seen from the above, in the embodiments of this specification, since each computing task is allocated its own local queue and the first queue index is sent to the second party, multiple computing tasks can be executed in parallel, so that when multiple processes simultaneously obtain OT tuples, the first party and the second party can take out the corresponding OT tuples in the same order, thereby improving operating efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0038] Figure 1 A schematic diagram of an implementation scenario of an embodiment disclosed in this specification;

[0039] Figure 2 This is a schematic diagram of an implementation scenario of another embodiment disclosed in this specification;

[0040] Figure 3 A flow chart of an oblivious transmission method according to an embodiment is shown;

[0041] Figure 4 A schematic diagram illustrating an allocation method of local queues according to one embodiment is shown;

[0042] Figure 5 A schematic block diagram of an oblivious transmission apparatus according to an embodiment is shown. DETAILED DESCRIPTION

[0043] The solution provided in this specification is described below in conjunction with the accompanying drawings.

[0044] Figure 1 This is a schematic diagram of an implementation scenario of an embodiment disclosed in this specification. This implementation scenario involves oblivious transmission. Figure 1 The goal of oblivious transmission is that the sender provides n options M0...M(n-1), and the receiver provides a choice x, where x is any number from 0...(n-1). After certain operations between the two parties, the receiver obtains option Mx without knowing the content of other options, and the sender does not know which option the receiver has chosen.

[0045] Oblivious transmission is implemented based on cryptography and has multiple implementation methods. The embodiments of this specification are dedicated to proposing solutions to improve the operational efficiency of oblivious transmission.

[0046] Figure 2 This is a schematic diagram of an implementation scenario of another embodiment disclosed in this specification. This implementation scenario involves the processing of oblivious transmission. The processing of an oblivious transmission can be divided into an offline processing process and an online processing process. The intermediate results obtained in the offline processing process can be calculated and cached in advance, while the online processing process relies on the above intermediate results and is generated in real time according to the calculation content. Figure 2 , showing the offline part of the processing process, the first party and the second party correspond to the aforementioned Figure 1 The sender and receiver are shown. Each party holds a deterministic random bit generator (DRBG) context, which is used to generate its own OT queue. The OT queue consists of OT tuples arranged in sequence. For example, OT1 in the figure represents one OT tuple, OT2 represents another OT tuple, and OT3 represents another OT tuple. The OT queues of the two parties are one-to-one corresponding, that is, the OT1 of the first party corresponds to the OT1 of the second party, the OT2 of the first party corresponds to the OT2 of the second party, and the OT3 of the first party corresponds to the OT3 of the second party. The OT tuple of the first party includes several randomly generated options, and the corresponding OT tuple of the second party includes a randomly generated choice and the target option among the several options corresponding to the choice.

[0047] It is understandable that the aforementioned OT queue is the intermediate result obtained during the offline processing. In practice, the OT queue may contain a large number of OT tuples, for example, 100 or 200, etc. The figure only schematically shows three OT tuples. During the online processing, the first party and the second party each sequentially extract OT tuples from the local OT queue for calculation. It is necessary to ensure that both parties extract OT tuples in the same order so that the OT tuples extracted by both parties correspond to each other. Usually, when the first party has multiple processes that sequentially extract OT tuples from the OT queue at the same time, due to network reasons and other reasons, it cannot be guaranteed that the second party can also extract the corresponding OT tuples in the same order, which will lead to incorrect calculation results.

[0048] In the embodiments of this specification, the aforementioned OT queue is regarded as a global queue, and multiple local queues are generated by taking OT tuples from the global queue. For each computing task, its exclusive local queue is allocated, so that OT tuples can be obtained from different local queues in parallel under high concurrency, and it is ensured that the first party and the second party can take out the corresponding OT tuples in the same order, thereby improving the overall operating efficiency.

[0049] It should be noted that the first party and the second party mentioned in the embodiments of this specification can be physically composed of a module, a computing device or a computing cluster.

[0050] Figure 3 FIG. 1 shows a flow chart of an oblivious transmission method according to an embodiment. Figure 3 , this method can be based on Figure 1 or Figure 2 The implementation scenario shown is executed by the first party, wherein the first party maintains a global queue for storing obliviously transmitted OT tuples, and a plurality of local queues maintained by taking out OT tuples from the global queue. It can be understood that the oblivious transmission calculation requires the cooperation of both parties to execute, the first party is the initiator of the computing task, and the second party is the recipient of the computing task. Accordingly, the second party also maintains a global queue for storing obliviously transmitted OT tuples, and a plurality of local queues maintained by taking out OT tuples from the global queue. OT tuples of the same order in the respective global queues of the first party and the second party correspond to each other, and OT tuples of the same order in the local queues of both parties corresponding to the same queue index also correspond to each other. As Figure 3As shown, the oblivious transfer method in this embodiment includes the following steps: Step 31: For a first computing task, the first process of the first party obtains the first queue index of the first local queue allocated to the first computing task from the multiple local queues; Step 32: If the first local queue is not empty, OT tuples are sequentially retrieved from the first local queue and the first queue index is sent to the second party, so that the second party sequentially retrieves OT tuples from the local queue corresponding to the first queue index maintained locally, and performs oblivious transfer-based computation with the second party using the OT tuples retrieved. The specific execution method of each of the above steps is described below.

[0051] First, in step 31, for a first computing task, the first process of the first party obtains a first queue index of a first local queue allocated to the first computing task from among the multiple local queues. It is understood that when multiple computing tasks are executed in parallel, a different local queue is allocated to each computing task.

[0052] In the embodiments of the present specification, in addition to maintaining a global queue and multiple local queues, the first party may also maintain an idle queue index sequence. The idle queue index sequence may include multiple idle queue indexes arranged in sequence. The local queues identified by each idle queue index are not allocated for use. One of them can be selected as the first queue index. After the computing task is completed, the first queue index can be put back into the idle queue index sequence for allocation to other computing tasks.

[0053] Figure 4 FIG. 1 is a schematic diagram showing an allocation method of a local queue according to an embodiment. Figure 4The first party maintains a global queue and local queues A, C, and D. Each local queue is generated by extracting OT tuples from the global queue. Local queue A has a queue index of A, local queue C has a queue index of C, and local queue D has a queue index of D. OT tuples of the same order in the global queues of the first and second parties correspond to each other. For example, OT1 in the first party's global queue corresponds to OT1 in the second party's global queue. OT tuples of the same order in the local queues of the first and second parties corresponding to the same queue index also correspond to each other. For example, OT6 in the first party's local queue A corresponds to OT6 in the second party's local queue A. The idle queue index sequence includes queue index C and queue index D. That is, the local queue C identified by queue index C and the local queue D identified by queue index D are currently unallocated. Therefore, when the first party initiates a computation request, it first extracts an idle queue index, such as queue index C, from the idle queue index sequence. It then sets the local queue C identified by queue index C as the local queue for the current computation and synchronizes it with the second party. Since each request selects a different local queue, it can be operated in parallel.

[0054] In one example, the first process of the first party obtains the first queue index in the following manner:

[0055] Determine whether the idle queue index sequence is empty;

[0056] If it is determined that the idle queue index sequence is not empty, taking an idle queue index from the idle queue index sequence and using it as the first queue index;

[0057] If it is determined that the idle queue index sequence is empty, an idle queue index is randomly generated as the first queue index.

[0058] In this example, the empty idle queue index sequence may correspond to two situations: one is that no local queue has been generated in the initial state, and the other is that at least one local queue currently exists but has been allocated. It is understood that in both cases, an idle queue index can be randomly generated, and the local queue identified by the queue index can be subsequently generated.

[0059] Then, in step 32, if the first local queue is not empty, OT tuples are sequentially retrieved from the first local queue, and the first queue index is sent to the second party, so that the second party sequentially retrieves OT tuples from the local queue corresponding to the first queue index maintained locally, and performs oblivious transfer-based computation with the second party using the retrieved OT tuples. It is understood that the first local queue may be empty because the local queue has not yet been generated in the initial state, or because the OT tuples in the first local queue have been exhausted, requiring OT tuples to be retrieved from the global queue and placed in the first local queue.

[0060] In an example, the OT tuple retrieved by the first party includes several randomly generated options, and the OT tuple retrieved by the second party includes a randomly generated selection and a target option among the several options corresponding to the selection.

[0061] Further, the several options or the selection are generated based on a deterministic random number generator DRBG context.

[0062] In the embodiments of this specification, the process by which the first and second parties each generate their own global queues can be referred to as random OT, meaning that the options and choices of the sender and receiver are randomly generated. When the number of OT tuples in the global queue is insufficient, the two parties can collaborate to generate a new batch of OT tuples using the DRBG context. OT extension (OTe) can be used, a technique that expands a small number of OT tuples into a larger number of OT tuples. These small numbers of OT tuples are called seed OT tuples.

[0063] Furthermore, after the second party and the second party perform calculation based on oblivious transfer using the OT tuples respectively retrieved, the method further includes:

[0064] Put the first queue index into the idle queue index sequence.

[0065] In this example, by putting the queue index of the used local queue into the idle queue index sequence, the local queue can be allocated and used again later, thereby improving the utilization rate of the local queue and avoiding wasting OT tuples that have not been taken out in the local queue.

[0066] In one example, the method further includes:

[0067] When the first local queue is empty, notify the second party to lock the global queue maintained locally, and after confirming that the second party has locked successfully, lock the global queue, and after confirming that the global queue has been locked successfully, sequentially take out several OT tuples from the global queue to generate the first local queue, and notify the second party to sequentially take out several OT tuples from the global queue maintained locally to generate a local queue corresponding to the first queue index.

[0068] In this example, in the case where the number of OT tuples in the first local queue is insufficient, the global queues of the first and second parties are locked, and then a batch of OT tuples are taken out from the global queue and placed in the first local queue. The lock is then released to replenish the OT tuples in the local queues, and the OT tuples replenished by the two parties for the local queues corresponding to the same queue index are corresponding to each other.

[0069] Furthermore, before sequentially taking out a plurality of OT tuples from the global queue to generate the first local queue, the method further includes:

[0070] Determine whether the number of OT tuples contained in the global queue is greater than or equal to a preset threshold;

[0071] If it is determined that the number of OT tuples is less than the preset threshold, a period of time is waited until the number of OT tuples included in the global queue is expanded to be greater than or equal to the preset threshold.

[0072] Furthermore, the method further comprises:

[0073] The third process of the first party periodically detects the number of OT tuples contained in the global queue;

[0074] If it is found that the number of OT tuples is less than the preset threshold, the global queue is expanded to a first number, and the second party is notified to expand its locally maintained global queue to the first number.

[0075] In this example, the initial global queue can be considered empty. The first party has a separate background thread that periodically checks the number of OT tuples in the global queue. If it finds that the number of OT tuples is less than a certain threshold, it will initiate an OT expansion request to the second party, expanding both parties' global queues to a certain size. The newly added OT tuples can be placed to the right of the global queue. Because this is a single-threaded operation, no locking is required. Throughout the entire processing process, it can be assumed that the number of OT tuples in the global queue is sufficient. If it is not, it is sufficient to wait for the background thread to complete the expansion.

[0076] Furthermore, the method further comprises:

[0077] Periodically scanning the idle queue index sequence;

[0078] When it is determined that there is an idle queue index in the idle queue index sequence that has not been taken out for a long time, the OT tuple in the local queue corresponding to the idle queue index is put back into the global queue, and the second party is notified to put the OT tuple in the local queue corresponding to the idle queue index back into its locally maintained global queue.

[0079] It's understandable that a preset time threshold can be used to measure whether a task has not been retrieved for a long time. Since actual computing requests are uneven, a large number of local queues may be generated during peak hours, consuming database memory. A background thread regularly scans the idle queue index sequence. If a local queue that has not been used for a long time is found, the OT tuples in the local queue are placed back into the global queue for reuse. If the global queue is too large, some OT tuples can be deleted synchronously to reduce memory usage.

[0080] In one example, the method further includes:

[0081] For a second computing task, a second process of the first party executed in parallel with the first process obtains a second queue index of a second local queue allocated to the second computing task from among the multiple local queues;

[0082] When the second local queue is not empty, OT tuples are sequentially taken out from the second local queue, and the second queue index is sent to the second party, so that the second party sequentially takes out OT tuples from the local queue corresponding to the second queue index maintained locally, and performs oblivious transfer-based calculations with the second party using the respective taken out OT tuples; the second local queue is different from the first local queue.

[0083] In this example, when the first process and the second process are executed in parallel, they will not access the global queue at the same time, but will access their respective local queues respectively, and send the queue index to the second party to ensure that the first party and the second party can retrieve the corresponding OT tuples in the same order.

[0084] Through the method provided in the embodiment of this specification, the first party not only maintains a global queue for storing obliviously transmitted OT tuples, but also maintains multiple local queues maintained by taking OT tuples from the global queue; when there is a first computing task to be executed, first, for the first computing task, the first process of the first party obtains the first queue index of the first local queue allocated to the first computing task in the multiple local queues; then, if the first local queue is not empty, the OT tuples are sequentially taken out from the first local queue, and the first queue index is sent to the second party, so that the second party sequentially takes out the OT tuples from the local queue corresponding to the first queue index maintained locally, and performs oblivious transmission-based calculations with the second party using the OT tuples taken out. As can be seen from the above, in the embodiment of this specification, since each computing task is allocated its own local queue and the first queue index is sent to the second party, multiple computing tasks can be executed in parallel, so that when multiple processes obtain OT tuples at the same time, the first party and the second party can take out the corresponding OT tuples in the same order, thereby improving operating efficiency.

[0085] According to another embodiment, an oblivious transmission device is also provided, which is arranged on a first party, wherein the first party maintains a global queue for storing obliviously transmitted OT tuples, and multiple local queues maintained by taking OT tuples out of the global queue, and the device is used to execute the oblivious transmission method provided in the embodiment of this specification. Figure 5 FIG. 5 shows a schematic block diagram of an oblivious transmission apparatus according to an embodiment. Figure 5 As shown, the device 500 includes:

[0086] A first obtaining unit 51 is configured to obtain, for a first computing task, a first process of the first party, a first queue index of a first local queue allocated to the first computing task among the multiple local queues;

[0087] The first calculation unit 52 is used to sequentially take out OT tuples from the first local queue when the first local queue is not empty, and send the first queue index obtained by the first acquisition unit 51 to the second party, so that the second party can sequentially take out OT tuples from the local queue corresponding to the first queue index maintained locally, and perform calculations based on oblivious transmission with the second party using the OT tuples respectively taken out.

[0088] Optionally, as an embodiment, the OT tuple retrieved by the first party includes several randomly generated options, and the OT tuple retrieved by the second party includes a randomly generated selection and a target option among the several options corresponding to the selection.

[0089] Further, the several options or the selection are generated based on a deterministic random number generator DRBG context.

[0090] Optionally, as an embodiment, the device further includes:

[0091] a second obtaining unit, configured to obtain, for a second computing task, a second process of the first party executed in parallel with the first process, a second queue index of a second local queue allocated to the second computing task in the multiple local queues;

[0092] A second computing unit is configured to sequentially retrieve OT tuples from the second local queue when the second local queue is not empty, and to send the second queue index acquired by the second acquisition unit to the second party, so that the second party sequentially retrieves OT tuples from the local queue corresponding to the second queue index maintained locally, and performs oblivious transfer-based calculations with the second party using the respective retrieved OT tuples; the second local queue is different from the first local queue.

[0093] Optionally, as an embodiment, the first process of the first party obtains the first queue index in the following manner:

[0094] Determine whether the idle queue index sequence is empty;

[0095] If it is determined that the idle queue index sequence is not empty, taking an idle queue index from the idle queue index sequence and using it as the first queue index;

[0096] If it is determined that the idle queue index sequence is empty, an idle queue index is randomly generated as the first queue index.

[0097] Furthermore, the device further comprises:

[0098] The first recycling unit is configured to place the first queue index into the idle queue index sequence after the first calculation unit 52 and the second party perform calculation based on oblivious transfer using the OT tuples respectively taken out.

[0099] Furthermore, the device further comprises:

[0100] A scanning unit, configured to periodically scan the idle queue index sequence;

[0101] The second recycling unit is used to put the OT tuple in the local queue corresponding to the idle queue index back to the global queue when the scanning unit determines that there is an idle queue index that has not been taken out for a long time in the idle queue index sequence, and notify the second party to put the OT tuple in the local queue corresponding to the idle queue index back to its locally maintained global queue.

[0102] Optionally, as an embodiment, the device further includes:

[0103] A generating unit is used to notify the second party to lock the global queue maintained locally when the first local queue is empty, and lock the global queue after confirming that the second party has locked the queue successfully, and after confirming that the global queue has been locked successfully, sequentially take out several OT tuples from the global queue to generate the first local queue, and notify the second party to sequentially take out several OT tuples from the global queue maintained locally to generate a local queue corresponding to the first queue index.

[0104] Furthermore, the device further comprises:

[0105] a judging unit, configured to judge whether the number of OT tuples contained in the global queue is greater than or equal to a preset threshold before the generating unit sequentially takes out a plurality of OT tuples from the global queue to generate the first local queue;

[0106] The waiting unit is configured to wait for a period of time until the number of OT tuples included in the global queue expands to be greater than or equal to the preset threshold if the judging unit judges that the number of OT tuples is less than the preset threshold.

[0107] Furthermore, the device further comprises:

[0108] A detection unit, configured for the third process of the first party to periodically detect the number of OT tuples contained in the global queue;

[0109] The expansion unit is configured to expand the global queue to a first number if it is found that the number of OT tuples obtained by the detection unit is less than the preset threshold, and to notify the second party to expand its locally maintained global queue to the first number.

[0110] Through the device provided in the embodiment of this specification, the first party not only maintains a global queue for storing obliviously transmitted OT tuples, but also maintains multiple local queues maintained by taking OT tuples from the global queue; when a first computing task needs to be executed, first, the first obtaining unit 51, for the first computing task, the first process of the first party obtains the first queue index of the first local queue allocated to the first computing task in the multiple local queues; then, if the first local queue is not empty, the first computing unit 52 sequentially takes out OT tuples from the first local queue and sends the first queue index to the second party, so that the second party sequentially takes out OT tuples from the local queue corresponding to the first queue index maintained locally, and performs oblivious transmission-based calculations with the second party using the OT tuples taken out. As can be seen from the above, in the embodiment of this specification, since each computing task is allocated its own local queue and the first queue index is sent to the second party, multiple computing tasks can be executed in parallel, so that when multiple processes simultaneously obtain OT tuples, the first party and the second party can take out the corresponding OT tuples in the same order, thereby improving operating efficiency.

[0111] According to another embodiment, there is also provided a computer readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute a combination of Figure 3 The method described.

[0112] According to another embodiment, a computing device is provided, including a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the system realizes the combination of Figure 3 The method described.

[0113] Those skilled in the art will appreciate that, in one or more of the above examples, the functions described herein may be implemented using hardware, software, firmware, or any combination thereof. When implemented using software, these functions may be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium.

[0114] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent replacements, improvements, etc. made on the basis of the technical solution of the present invention should be included in the scope of protection of the present invention.

Claims

1. An oblivious transfer method, performed by a first party, wherein: The first party maintains a global queue for storing obliviously transmitted (OT) tuples, and a plurality of local queues maintained by extracting OT tuples from the global queue; the second party also maintains a global queue for storing OT tuples, and a plurality of local queues maintained by extracting OT tuples from the global queue; OT tuples of the same order in the respective global queues of the first and second parties correspond to each other, and OT tuples of the same order in the respective local queues corresponding to the same queue index of both parties also correspond to each other; the method includes: For a first computing task, the first process of the first party obtains a first queue index of a first local queue allocated to the first computing task from among the multiple local queues; If the first local queue is not empty, sequentially retrieve OT tuples from the first local queue and send the first queue index to the second party, so that the second party sequentially retrieves OT tuples from the local queue corresponding to the first queue index maintained locally, and performs oblivious transfer-based computation with the second party using the retrieved OT tuples. For a second computing task, a second process of the first party executed in parallel with the first process obtains a second queue index of a second local queue allocated to the second computing task from among the multiple local queues; When the second local queue is not empty, OT tuples are sequentially taken out from the second local queue, and the second queue index is sent to the second party, so that the second party sequentially takes out OT tuples from the local queue corresponding to the second queue index maintained locally, and performs oblivious transfer-based calculations with the second party using the respective taken out OT tuples; the second local queue is different from the first local queue.

2. The method according to claim 1, wherein The OT tuple retrieved by the first party includes several randomly generated options, and the OT tuple retrieved by the second party includes a randomly generated selection and a target option among the several options corresponding to the selection.

3. The method according to claim 2, wherein: The number of options or the selection is generated based on a deterministic random number generator DRBG context.

4. The method according to claim 1, wherein The first process of the first party obtains the first queue index in the following manner: Determine whether the idle queue index sequence is empty; If it is determined that the idle queue index sequence is not empty, taking an idle queue index from the idle queue index sequence and using it as the first queue index; If it is determined that the idle queue index sequence is empty, an idle queue index is randomly generated as the first queue index.

5. The method according to claim 4, wherein: After the second party and the second party perform the oblivious transfer-based calculation using the OT tuples respectively retrieved, the method further includes: Put the first queue index into the idle queue index sequence.

6. The method of claim 4, wherein: The method further comprises: Periodically scanning the idle queue index sequence; When it is determined that there is an idle queue index in the idle queue index sequence that has not been taken out for a long time, the OT tuple in the local queue corresponding to the idle queue index is put back into the global queue, and the second party is notified to put the OT tuple in the local queue corresponding to the idle queue index back into its locally maintained global queue.

7. The method of claim 1, wherein: The method further comprises: When the first local queue is empty, notify the second party to lock the global queue maintained locally, and after confirming that the second party has locked successfully, lock the global queue, and after confirming that the global queue has been locked successfully, sequentially take out several OT tuples from the global queue to generate the first local queue, and notify the second party to sequentially take out several OT tuples from the global queue maintained locally to generate a local queue corresponding to the first queue index.

8. The method of claim 7, wherein: Before sequentially taking out a plurality of OT tuples from the global queue to generate the first local queue, the method further includes: Determine whether the number of OT tuples contained in the global queue is greater than or equal to a preset threshold; If it is determined that the number of OT tuples is less than the preset threshold, a period of time is waited until the number of OT tuples included in the global queue is expanded to be greater than or equal to the preset threshold.

9. The method of claim 8, wherein: The method further comprises: The third process of the first party periodically detects the number of OT tuples contained in the global queue; If it is found that the number of OT tuples is less than the preset threshold, the global queue is expanded to a first number, and the second party is notified to expand its locally maintained global queue to the first number.

10. An oblivious transmission device, provided at a first party, wherein: The first party maintains a global queue for storing obliviously transmitted (OT) tuples, and a plurality of local queues maintained by extracting OT tuples from the global queue; the second party also maintains a global queue for storing OT tuples, and a plurality of local queues maintained by extracting OT tuples from the global queue; OT tuples of the same order in the respective global queues of the first and second parties correspond to each other, and OT tuples of the same order in the respective local queues corresponding to the same queue index of both parties also correspond to each other; the apparatus comprises: a first obtaining unit, configured to obtain, for a first computing task, by a first process of the first party, a first queue index of a first local queue allocated to the first computing task among the multiple local queues; a first computing unit, configured to, if the first local queue is not empty, sequentially retrieve OT tuples from the first local queue, and send the first queue index obtained by the first obtaining unit to the second party, so that the second party sequentially retrieves OT tuples from the local queue corresponding to the first queue index maintained locally by the second party, and perform oblivious transfer-based computing with the second party using the OT tuples respectively retrieved; a second obtaining unit, configured to obtain, for a second computing task, a second process of the first party executed in parallel with the first process, a second queue index of a second local queue allocated to the second computing task in the multiple local queues; A second computing unit is configured to sequentially retrieve OT tuples from the second local queue when the second local queue is not empty, and to send the second queue index acquired by the second acquisition unit to the second party, so that the second party sequentially retrieves OT tuples from the local queue corresponding to the second queue index maintained locally, and performs oblivious transfer-based calculations with the second party using the respective retrieved OT tuples; the second local queue is different from the first local queue.

11. The device according to claim 10, wherein The OT tuple retrieved by the first party includes several randomly generated options, and the OT tuple retrieved by the second party includes a randomly generated selection and a target option among the several options corresponding to the selection.

12. The device according to claim 11, wherein The number of options or the selection is generated based on a deterministic random number generator DRBG context.

13. The device according to claim 10, wherein The first process of the first party obtains the first queue index in the following manner: Determine whether the idle queue index sequence is empty; If it is determined that the idle queue index sequence is not empty, taking an idle queue index from the idle queue index sequence and using it as the first queue index; If it is determined that the idle queue index sequence is empty, an idle queue index is randomly generated as the first queue index.

14. The apparatus of claim 13, wherein: The device further comprises: The first recycling unit is configured to place the first queue index into the idle queue index sequence after the first calculation unit and the second party perform calculation based on oblivious transfer using the OT tuples taken out by each party.

15. The apparatus of claim 13, wherein: The device further comprises: A scanning unit, configured to periodically scan the idle queue index sequence; The second recycling unit is used to put the OT tuple in the local queue corresponding to the idle queue index back to the global queue when the scanning unit determines that there is an idle queue index that has not been taken out for a long time in the idle queue index sequence, and notify the second party to put the OT tuple in the local queue corresponding to the idle queue index back to its locally maintained global queue.

16. The apparatus of claim 10, wherein: The device further comprises: A generating unit is used to notify the second party to lock the global queue maintained locally when the first local queue is empty, and lock the global queue after confirming that the second party has locked the queue successfully, and after confirming that the global queue has been locked successfully, sequentially take out several OT tuples from the global queue to generate the first local queue, and notify the second party to sequentially take out several OT tuples from the global queue maintained locally to generate a local queue corresponding to the first queue index.

17. The apparatus of claim 16, wherein: The device further comprises: a judging unit, configured to judge whether the number of OT tuples contained in the global queue is greater than or equal to a preset threshold before the generating unit sequentially takes out a plurality of OT tuples from the global queue to generate the first local queue; The waiting unit is configured to wait for a period of time until the number of OT tuples included in the global queue expands to be greater than or equal to the preset threshold if the judging unit judges that the number of OT tuples is less than the preset threshold.

18. The apparatus of claim 17, wherein: The device further comprises: A detection unit, configured for the third process of the first party to periodically detect the number of OT tuples contained in the global queue; The expansion unit is configured to expand the global queue to a first number if it is found that the number of OT tuples obtained by the detection unit is less than the preset threshold, and to notify the second party to expand its locally maintained global queue to the first number.

19. A computer-readable storage medium having a computer program stored thereon, which, when executed in a computer, causes the computer to execute the method according to any one of claims 1 to 9.

20. A computing device comprising a memory and a processor, wherein the memory stores executable code, and when the processor executes the executable code, the method according to any one of claims 1 to 9 is implemented.

Citation Information

Patent Citations

  • Task processing method, compiler, scheduling server and medium

    CN111061485A

  • Task execution method and device

    CN111290842A