원시데이터 수집 시스템
선정목록으로

CRGC: A Practical Framework for Constructing Reusable Garbled Circuits

관련 산업용 섬유 · (9) 타이어코드

기본 정보

저자
  1. Christopher Harth-Kitzerow — Department of Informatics, Technical University of Munich, Garching, Germany, --- Select a Country ---
  2. Georg Carle — Department of Informatics, Technical University of Munich, Garching, Germany, --- Select a Country ---
  3. Fan Fei — Faculty of Electrical Engineering and Computer Science, Leibniz University Hannover, Hannover, Germany, --- Select a Country ---
  4. André Luckow — Group IT, The BMW Group, Munich, Germany, --- Select a Country ---
  5. Johannes Klepsch — Group IT, The BMW Group, Munich, Germany, --- Select a Country ---
DOI
10.5220/0011145300003283
저널
–
발행년도
2022
발행기관
–
피인용수
1
라이선스
cc-by-nc-nd
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.5220/0011145300003283
토픽
Advancements in Photolithography Techniques
OpenAlex ID
W4285413145

평가 내용

관련도
관련
사업분야
산업용 섬유 · (9) 타이어코드
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '산업용 섬유 > 타이어코드' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

초록이 없습니다.

본문 55,681자

본문 펼치기
## CRGC ### _A Practical Framework for Constructing Reusable Garbled Circuits_ Christopher Harth-Kitzerow <sup>1</sup> *, Georg Carle <sup>1</sup>, Fan Fei <sup>2</sup>, Andre Luckow <sup>3</sup> and Johannes Klepsch <sup>3</sup> 1 _Technical University of Munich,_ 2 _Leibniz University Hannover,_ 3 _BMW Group_ _[*christopher.harth-kitzerow@tum.de](mailto:christopher.harth-kitzerow@tum.de)_ Keywords: Secure Multiparty Computation, Garbled Circuits, Privacy Enhancing Technologies. Abstract: In this work, we introduce two schemes to construct reusable garbled circuits (RGCs) in the semi-honest setting. Our completely reusable garbled circuit (CRGC) scheme allows the generator (party _A_ ) to construct and send an obfuscated boolean circuit along with an encoded input to the evaluator (party _B_ ). In contrast to Yao’s Garbled Circuit protocol, _B_ can securely evaluate the same CRGC with an arbitrary number of inputs. As a tradeoff, CRGCs predictably leak some input bits of _A_ to _B_ . We also propose a partially reusable garbled circuit (PRGC) scheme that divides a circuit into reusable and non-reusable sections. PRGCs do not leak input bits of _A_ . We benchmark our CRGC implementation against the state-of-the-art garbled circuit libraries EMP SH2PC and TinyGarble2. Using our framework, evaluating a CRGC is up to twenty times faster, albeit with weaker privacy guarantees, than evaluating an equivalent garbled circuit constructed by the two existing libraries. Our open-source library can convert any C++ function to a CRGC at approx. 80 million gates per second and repeatedly evaluate a CRGC at approx. 350 million gates per second. Additionally, a compressed CRGC is approx. 75% smaller in file size than the unobfuscated boolean circuit. ### 1 INTRODUCTION Secure Multiparty Computation enables parties to execute functions on obliviously shared inputs without revealing them (Lindell, 2020). Yao’s Garbled Circuits protocol (Yao, 1982; Yao, 1986) is a popular Secure Multiparty Computation protocol for realizing semi-honest two-party computation. Following the protocol, a circuit generator _A_ sends its encoded inputs and the encrypted and permuted gate output tables of a boolean circuit to a circuit evaluator _B_ . _B_ can obtain only one encoded input per circuit through Oblivious Transfer. Thus, each time _B_ wants to obtain an output from a different input, it needs to request another garbled circuit. Garbled circuits get large in file size. Our Reusable Garbled Circuit (RGC) schemes allow _B_ to re-use a garbled circuit for multiple evaluations with different evaluator inputs. They significantly reduce communication overhead compared to sending a new garbled circuit for each evaluation. RGCs enable party _A_ to send obfuscated data to an untrusted party _B_ while ensuring that sent data remains secret and can only be used for its intended purpose implemented by the circuit. _B_ can evaluate an RGC with an arbitrary number of inputs without revealing _A_ ’s input. Existing RGC schemes usually rely on cryptographic primitives that are too complex for realworld use cases. Our key idea instead is to utilize information-theoretic techniques to obfuscate the wire labels that _A_ sends to _B_ in a way that hinders _B_ from learning _A_ ’s secret inputs. With this approach, _B_ can repeatedly evaluate the same obfuscated circuit with arbitrary inputs. Only when _A_ <sup>_′_</sup> _s_ input changes it needs to construct a new RGC. While constructing an RGC can take longer than constructing a garbled circuit, it pays off over time due to faster evaluation speed. Not all gates in a circuit can be obfuscated without leaking input bits. Thus, _A_ has two options: 1. It obfuscates only those gates with our techniques that do not leak information. It then groups the remaining unobfuscated gates into _n_ non-reusable sub-circuits and prepares _n_ Yao’s Garbled Circuit protocols. With this approach, we obtain reusable and non-reusable sections in a circuit. We call the resulting circuit a partially reusable garbled circuit (PRGC). 2. It obfuscates all gates with our techniques and tolerates a certain number of leaked input bits. We call the resulting circuit a completely reusable garbled circuit (CRGC). Our CRGC scheme essentially transforms a boolean circuit _C_ that computes a functionality _f_ ( _a,_ _b_ ) into a boolean circuit _C_ <sup>_′_</sup> and obfuscated input _a_ <sup>_′_</sup> such that _C_ <sup>_′_</sup> ( _a_ <sup>_′_</sup> _,_ _b_ ) = _C_ ( _a,_ _b_ ) for a specific input _a_ and any arbitrary input _b_ . Evaluating _C_ <sup>_′_</sup> is as efficient as evaluating _C_ . Given _C_ <sup>_′_</sup>, _C_, and _a_ <sup>_′_</sup> it is difficult to infer input bits of _a_ even with repeated evaluations. Our PRGC scheme divides a CRGC _C_ <sup>_′_</sup> into reusable sub-circuits (sections) and non-reusable sections. Reusable sections do not leak inputs of _a_ . Non-reusable sections contain gates that may leak input bits of _a_ . Thus, _A_ and _B_ engage in a Yao’s Garbled Circuit protocol for each non-reusable section in _C_ <sup>_′_</sup> for each repeated evaluation. As a result, our PRGC scheme guarantees the same level of input privacy as Yao’s Garbled Circuit protocol. Our framework compiles any user-defined C++ program and a set of inputs into a CRGC and a set of encoded inputs. _A_ can send these compressed over the network to _B_ . _B_ can use our implementation to evaluate the CRGC with an arbitrary number of inputs. We tested several programs such as linear search, set intersection, and data analysis but also elementary operations such as addition and multiplication. Our benchmarks show that an Amazon M5ZN instance can construct CRGCs at approx. 80 million gates per second and evaluate them at approx. 350 million gates per second. The construction is only necessary once per input of party A. EMP SH2PC (Wang et al., 2016) and TinyGarble2 (Hussain et al., 2020) can evaluate the same programs at up to 55 million gates per second but without leaking any input bits to _B_ . ### 2 OUR APPROACH In this section, we show how _A_ can construct a CRGC and a PRGC. Any boolean circuit _C_ and generator input _a_ can be converted into an RGC _C_ <sup>_′_</sup> and an obfuscated input _a_ <sup>_′_</sup> using three different kinds of obfuscation techniques: Bit Flipping, obfuscating fixed gates, and obfuscating intermediary gates. After applying our obfuscation techniques, _C_ <sup>_′_</sup> is tied to a single _a_ <sup>_′_</sup>, meaning that _∃a∀b_ : _C_ <sup>_′_</sup> ( _a_ <sup>_′_</sup> _,_ _b_ ) = _C_ ( _a,_ _b_ ) but for inputs not equal to _a_ <sup>_′_</sup> the output equality of _C_ and _C_ <sup>_′_</sup> is not ensured. We call _XNOR_ and _XOR_ gates _balanced_ _gates_, and all other gates _imbalanced_ _gates_ . We refer to a gate as a _passive gate_ if modifying its truth table does not alter the circuit’s output. A gate provides _indis-_ _tinguishability_ _obfuscation_ if _B_ has an advantage of 0 to distinguish between a gate’s truth table entry resulting from a generator’s input of 0 and 1. In our PRGC protocol, only truth tables of gates that provide indistinguishability obfuscation and final output gates are contained in the reusable section. _A_ uses Yao’s Garbled Circuit protocol to ensure that the remaining gates also do not leak any input bits of _a_ . In our CRGC protocol, _A_ instead also sends these remaining gates to _B_ without additional obfuscation, thus tolerating a predictable number of leaked input bits. 2.1 Bit Flipping Bit Flipping refers to applying a one-time pad _r_ over the input bits of _a_ and all wires in the circuit _C_ to obtain _C_ <sup>_′_</sup> and _a_ <sup>_′_</sup> . Only inputs from _B_ and final output wires do not get flipped. Whenever, a wire _w_ is flipped by _r_, _A_ needs to modify the truth table of _w_ ’s child gates to recover the integrity of _C_ <sup>_′_</sup> . For instance, if the left input wire of a gate _g_ with functionality _f_ ( _u,_ _v_ ) is flipped, _A_ can modify _g_ <sup>_′_</sup> _s_ truth table to _f_ ( _¬u,_ _v_ ) to ensure that _C_ <sup>_′_</sup> ( _a_ <sup>_′_</sup> _,_ _b_ ) = _C_ ( _a,_ _b_ ). Since an RGC should be dependent on one fixed _a_ with a bitlength _l_, truth table entries that contain _¬ai_ ( _i < l_ ) can be modified arbitrarily while maintaining the integrity of _C_ <sup>_′_</sup> . Algorithm 1 realizes Bit Flipping. Since a one-time pad is only secure for a single input, _A_ has to construct a new RGC if _a_ changes. However, _B_ can use _C_ <sup>_′_</sup> and _a_ <sup>_′_</sup> for multiple of its own inputs _b_ . With Bit Flipping, all balanced gates ( _XOR,_ _XNOR_ ) in _C_ <sup>_′_</sup> achieve indistinguishability obfuscation. <u>Algorithm 1</u> <u>Bit Flipping</u> 1: for each generator input _a_ [ _i_ ] do 2: _a_ <sup>_′_</sup> [ _i_ ] _←_ _generateRandomBit_ () 3: _flipped_ [ _i_ ] _←_ _a_ <sup>_′_</sup> [ _i_ ] == _a_ [ _i_ ] 4: for each gate _g_ do 5: _recoverIntegrity_ ( _g_ ) 6: _flipped_ [ _g_ ] _←_ _generateRandomBit_ () 7: if _flipped_ [ _g_ ] == _true_ & _g̸ ∈_ Output then 8: _flipTruthTable_ ( _g_ ) 2.1.1 Examples Figure 1 illustrates the achieved indistinguishability of randomly flipping balanced gates. Note that truth tables shown in Figure 1a and 1b are identical, even though their generator inputs _u_ differ. Figure 1c, 1d show the other two identical truth tables constructed from different inputs and flips. Since _B_ can obtain two identical truth tables from a generator’s value of 0 and 1, it cannot infer _u_ from inspecting the truth table of a potentially flipped balanced gate. Bit Flipping does not lead to an indistinguishability obfuscation for imbalanced gates. All four combinations of randomly flipping the generator’s input w XOR <u>u</u> v _<u>u</u>_ <u>v</u> <u>w</u> <u>0</u> <u>0</u> <u>1</u> <u>0</u> <u>1</u> <u>0</u> <u>1</u> <u>0</u> <u>0</u> <u>1</u> <u>1</u> <u>1</u> <u>w</u> XOR u v <u>u</u> <u>v</u> _<u>w</u>_ <u>0</u> <u>0</u> <u>1</u> <u>0</u> <u>1</u> <u>0</u> <u>1</u> <u>0</u> <u>0</u> <u>1</u> <u>1</u> <u>1</u> (a) _XOR_ gate, left parent flipped. (b) _XOR_ gate, output flipped. w XOR u v <u>u</u> <u>v</u> <u>w</u> <u>0</u> <u>0</u> <u>0</u> <u>0</u> <u>1</u> <u>1</u> <u>1</u> <u>0</u> <u>1</u> <u>1</u> <u>1</u> <u>0</u> <u>w</u> XOR <u>u</u> v _<u>u</u>_ <u>v</u> _<u>w</u>_ <u>0</u> <u>0</u> <u>0</u> <u>0</u> <u>1</u> <u>1</u> <u>1</u> <u>0</u> <u>1</u> <u>1</u> <u>1</u> <u>0</u> (c) _XOR_ gate, not flipped. (d) _XOR_ gate, left parent & output flipped. Figure 1: Flipping balanced gates yields indistinguishable truth tables. _u_ and the output wire _w_ yield distinct truth tables. Thus, even though _a_ <sup>_′_</sup> _i_ <sup>is</sup> <sup>obfuscated</sup> <sup>by</sup> <sup>_ri_</sup> <sup>,</sup> <sup>_B_</sup> <sup>can</sup> <sup>in-</sup> fer _ai_ by inspecting any imbalanced gate with functionality _f_ ( _a_ <sup>_′_</sup> _i_ <sup>_,_</sup> <sup>_b_</sup> <sup>_j_</sup> <sup>).</sup> <sup>Our following two techniques also</sup> obfuscate imbalanced gates. 2.2 Obfuscating Fixed Gates We define fixed gates as gates that always return the same value given the generator input _a_ . For instance, an _AND_ gate that takes a generator input of 0 is a fixed gate. The problem with an imbalanced gate on level 1 is that _B_ can immediately infer _A_ <sup>_′_</sup> _s_ input by observing if its output changes when changing _B_ <sup>_′_</sup> _s_ input bit. _A_ can effectively obfuscate those gates by flipping one of the output values in the truth table and adjusting child gates accordingly. This way, a fixed imbalanced gate at level 1 is indistinguishable from an unfixed one. When obfuscating a fixed gate, we break the gate’s integrity, i.e., we might return a value of 1 even though its correct value is 0. The integrity of _C_ <sup>_′_</sup> has to be recovered to yield the correct output. Algorithm 2 identifies all fixed gates and ensures that modifying fixed gates maintains the correctness of _C_ <sup>_′_</sup> . 2.2.1 Examples - Obfuscating Fixed Gates Figure 2 illustrates the following examples. Consider an _AND_ gate _g_ at level 1 in _C_ that depends on one input _u_ of _A_ and one input _v_ of _B_ . Suppose _A_ ’s input is 1 (Figure 2a). In this case, the relevant output entries for _g_ are 1 _|_ 0 _|_ 0 and 1 _|_ 1 _|_ 1 (left input _|_ right input _|_ output). _A_ can modify the other two entries arbitrarily as they depend on a different generator input. Thus, _A_ can obfuscate _g_ to an _XNOR_ gate by assigning the unused truth table entries to 0 _|_ 0 _|_ 1 and 0 _|_ 1 _|_ 0. Suppose _A_ ’s input is 0 (Figure 2b). In this case, _g_ is a fixed gate since the two relevant entries in its <u>Algorithm 2</u> <u>Identify fixed gates</u> 1: for each generator input _a_ [ _i_ ] do 2: _fixedValue_ [ _i_ ] _←_ _a_ [ _i_ ] 3: _isFixed_ [ _i_ ] _←_ _true_ 4: for each gate _g_ do 5: _l ←_ _g.leftParent_ 6: _r ←_ _g.rightParent_ 7: _T_ _←_ _g.truthTable_ 8: _vl_ _←_ _fixedValue_ [ _l_ ] 9: _vr ←_ _fixedValue_ [ _r_ ] 10: if _isFixed_ [ _l_ ] & _isFixed_ [ _r_ ] then 11: _fixedValue_ [ _g_ ] _←_ _T_ [ _vl_ ][ _vr_ ] 12: _isFixed_ [ _g_ ] _←_ _true_ 13: else 14: if _isFixed_ [ _l_ ] & _T_ [ _vl_ ][0] == _T_ [ _vl_ ][1] then 15: _fixedValue_ [ _g_ ] _←_ _T_ [ _vl_ ][0] 16: _isFixed_ [ _g_ ] _←_ _true_ 17: if _isFixed_ [ _r_ ] & _T_ [0][ _vr_ ] == _T_ [1][ _vr_ ] then 18: _fixedValue_ [ _g_ ] _←_ _T_ [0][ _vr_ ] 19: _isFixed_ [ _g_ ] _←_ _true_ 20: if ! _isFixed_ [ _g_ ] then 21: _recoverIntegrity_ ( _g_ ) truth table 0 _|_ 0 _|_ 0 and 0 _|_ 1 _|_ 0 both return a 0 independent of _B_ ’s input. The fixed output immediately reveals _u_ to _B_ if it knows the gate type. _A_ obfuscates a fixed gate by choosing one of these entries at random and flipping its output wire. For instance, _A_ can change the entry 0 _|_ 0 _|_ 0 to 0 _|_ 0 _|_ 1. This way, we again created a truth table indistinguishable from _XNOR_ . We showed before that _A_ can apply Bit Flipping to a balanced gate like _XNOR_ to achieve indistinguishability obfuscation. Again, truth tables shown in Figure 2a and 2b are identical, even though their generator inputs _u_ differ. w AND u = 1 v <u>u</u> <u>v</u> <u>w</u> <u>0</u> <u>0</u> <u>1</u> <sup><u>†</u></sup> <u>0</u> <u>1</u> <u>0</u> <sup><u>†</u></sup> <u>1</u> <u>0</u> <u>0</u> <u>1</u> <u>1</u> <u>1</u> <u>u</u> <u>v</u> <u>w</u> <u>0</u> <u>0</u> <u>1</u> <sup>_<u>⋆</u>_</sup> <u>0</u> <u>1</u> <u>0</u> <u>1</u> <u>0</u> <u>0</u> <sup><u>†</u></sup> <u>1</u> <u>1</u> <u>1</u> <sup><u>†</u></sup> w AND u = 0 v (a) Unfixed _AND_ gate, obfuscated. (b) Fixed _AND_ gate, obfuscated. Figure 2: Obfuscated imbalanced gates on level 1. †These entries do not depend on the generator’s input and can be re-assigned arbitrarily. _⋆_ One relevant entry in a fixed gate gets flipped. y AND w (0) x <u>w</u> <u>x</u> <u>y</u> <u>0</u> <u>0</u> <u>0</u> <u>0</u> <u>1</u> <u>0</u> <u>1</u> <u>0</u> <u>0</u> <u>1</u> <u>1</u> <u>0</u> <sup><u>†</u></sup> y XOR w (0) x <u>w</u> <u>x</u> <u>y</u> <u>0</u> <u>0</u> <u>0</u> <u>0</u> <u>1</u> <u>1</u> <u>1</u> <u>0</u> <u>0</u> <sup><u>†</u></sup> <u>1</u> <u>1</u> <u>1</u> <sup><u>†</u></sup> (a) Child _AND_ gate. <sup>_⋆_</sup> (b) Child _XOR_ gate. Figure 3: Gates with a fixed left parent. †Left parent’s true value is 0. Truth table gets recovered accordingly. _⋆_ Adjusting the truth table transformed the child gate into a fixed gate. This gate gets obfuscated in the next iteration of algorithm 2. 2.2.2 Examples - Modifying Child Gates Figure 3a shows an _AND_ gate _g_ with a fixed obfuscated _AND_ gate as its left parent. _A_ can recover _g_ ’s integrity by changing the entry 1 _|_ 1 _|_ 1 to 1 _|_ 1 _|_ 0. _A_ just transformed _g_ into a fixed gate that always returns 0. Thus, _A_ can apply our obfuscation technique to this gate as well. Figure 3b shows an _XOR_ gate with a fixed obfuscated _AND_ gate as its left parent. _A_ can recover its integrity by changing the entries 1 _|_ 0 _|_ 1 and 1 _|_ 1 _|_ 0 to 1 _|_ 0 _|_ 0 and 1 _|_ 1 _|_ 1. Notice that the resulting truth table is not a balanced gate. Thus, it does not provide indistinguishability obfuscation. 2.3 Obfuscating Intermediary Gates Some gates _gi_ do not affect the circuit’s output as all paths from _gi_ to a final output gate _go_ include at least one fixed gate _g_ _f_ . We call these gates between the first level of the circuit and the dependant fixed gates _intermediary gates_ . If _A_ modifies an intermediary gate _gi_, each fixed gate’s output wire may change its value due to changing the truth table of a gate it depends on. However, we know that changing an obfuscated fixed gate’s value does not change the final output of _C_ <sup>_′_</sup> . By definition we also know that no final output gate _go_ directly depends on _gi_ without a fixed gate _g_ _f_ between _gi_ and _go_ . Thus, arbitrary modifications of intermediary gates do not break the integrity of _C_ <sup>_′_</sup> . Due to this property, fixed and intermediary gates are passive gates. _A_ can modify each passive gate’s truth table to be indistinguishable from its active version. At the end of Algorithm 3, all gates where _obfuscatable_ [ _g_ ] has not been set to _false_ are passive gates. Our protocol re-generates each gate on level 1 to a random balanced gate and all other passive and balanced gates to provide indistinguishability obfuscation. <u>Algorithm 3</u> <u>Identify passive gates</u> 1: for each final output gate _go_ do 2: _queue.push_ ( _go_ ) _▷_ output gates are non-intermediary 3: while ! queue.empty() do 4: _g ←_ _queue.pop_ () 5: _obfuscatable_ [ _g_ ] _←_ _false_ 6: for each parent _p_ of _g_ do 7: if ! _isFixed_ [p] & ! _pushed_ [ _p_ ] then 8: _pushed_ [ _p_ ] _←_ _true_ 9: _queue.push_ ( _p_ ) _▷_ non-intermediary gates get pushed 2.3.1 Example Figure 4 illustrates a section of a circuit with two fixed gates. Note that all paths from the unfixed gates in the section end up as an input wire of a fixed gate. Thus, all four unfixed gates in this section are intermediary gates. Modifying their truth tables may change the output of one of the fixed gates. However, this modification will not affect the output of the circuit. _fixed_ _fixed_ Figure 4: Section of a circuit containing four intermediary gates. <sup>_⋆_</sup> _⋆_ Properties hold for every gate type. 2.4 Constructing a CRGC The whole process of constructing a CRGC can be summarized as follows: 1. Obtain _C_ <sup>_′_</sup> and _a_ <sup>_′_</sup> by applying Bit Flipping to _a_ and all gates in _C_ using algorithm 1. 2. Identify all fixed gates and modify all children of fixed gates in _C_ <sup>_′_</sup> using algorithm 2. 3. Identify all intermediary gates in _C_ <sup>_′_</sup> using algorithm 3. 4. Obfuscate all imbalanced, fixed, and intermediary gates on level 1 randomly to _XOR/XNOR_ . Obfuscate all passive gates in _C_ <sup>_′_</sup> beyond level 1 to achieve indistinguishability obfuscation. After these steps, an evaluator that receives _C_ <sup>_′_</sup> and _a_ <sup>_′_</sup> can evaluate _C_ <sup>_′_</sup> any number of times with varying inputs _b_ . For all gates _gn_ that do not provide indistinguishability obfuscation, _B_ has an advantage _>_ 0 to infer the true wire labels of _gn_ ’s parents. Thus, some of these gates may leak input bits of _A_ . _A_ can predict the leakage of a CRGC before constructing it and decide whether to send the CRGC that leaks some input bits or to construct a PRGC instead. PRGCs do not leak generator inputs. In the appendix, we show how _A_ can predict input leakage of a constructed CRGC and achieve n-party computations from our CRGC scheme. We also give a step-by-step example of applying our obfuscation techniques to a circuit. 2.5 Constructing a PRGC After applying the three described obfuscation techniques, there is a subset of gates left in _C_ <sup>_′_</sup> that do not provide indistinguishability obfuscation, i.e. _B_ might be able to infer input bits of _a_ when inspecting those gates. Our PRGC scheme prevents _B_ from inferring inputs when inspecting these gates by introducing _non-reusable sections_ . 2.5.1 Non-reusable Sections Each gate that does not provide indistinguishability obfuscation has to be contained in a non-reusable section. At the start of a non-reusable section _s_ of _C_ <sup>_′_</sup>, _A_ and _B_ engage in Oblivious Transfer (OT) for each input wire on the first level of _s_ to let _B_ obtain keys to be used in a Yao’s Garbled Circuit protocol. A nonreusable section ends if each final output gate of the non-reusable section provides indistinguishability obfuscation. _A_ needs to apply a new Bit Flipping to each of these output gates to hinder _B_ from inferring inputs by evaluating the circuit multiple times. With this approach, _A_ and _B_ have to engage in a Yao’s Garbled Circuit protocol for each non-reusable section. With the output bits obtained from Yao’s Garbled Circuit protocol, _B_ continues evaluating the circuit. By ”refreshing” Bit Flipping at the end of a nonreusable section, all balanced gates again provide indistinguishability obfuscation. To ensure correctness, both parties need to engage in OT for each final output gate of _C_ <sup>_′_</sup> to let _A_ reverse Bit Flipping applied in the non-reusable sections. Note that a simpler protocol could consist of evaluating each gate that does not provide indistinguishability obfuscation by an OT with a bit flipped result. However, if a nonreusable section spans multiple levels in the circuit, using Yao’s Garbled Circuit protocol is more efficient. Figure 5 illustrates a circuit with a non-reusable section. Inputs _ai_ mark _A_ ’s inputs, inputs _bi_ mark _B_ ’s inputs. Observe that both _AND_ gates cannot be fixed gates and reveal _A_ ’s input even if obfuscated by our techniques. The final _XOR_ gate marks the end of the non-reusable section by providing indistinguishability obfuscation. _A_ only sends the gates in the reusable section (first level) to _B_ . By assigning the two _AND_ gates and the final _XOR_ gate to a non-reusable section, _B_ has to stop evaluating the PRGC after the first level. For each input wire of each _AND_ gate, it has to receive an input key via OT and obtain a Yao’s Garbled Circuit from _A_ containing the remaining three gates. For each repeated evaluation of the circuit with different inputs _b_, it can reuse the gates on the first level of the circuit. PRGCs provide input privacy without leakage. A security proof of PRGCs can be found in the appendix. There, we also cover how to achieve indistinguishability obfuscation for passive gates in the reusable section. In high latency environments, it might be favorable to split _C_ <sup>_′_</sup> into only one reusable and one non-reusable section. This way, a PRGC can be evaluated in constant communication rounds where one batch of OTs is processed in parallel. a0 b0 a1 b1 a2 b2 a3 b3 _XOR_ _XOR_ _XOR_ _XOR_ Non-reusable Section _AND_ _AND_ _XOR_ Figure 5: A circuit containing a non-reusable section. ### 3 BENCHMARKS [Our open-source library is available on GitHub.](https://github.com/chart21/CRGC) With our library, _A_ can construct a CRGC from any userdefined C++ function, compress it, predict leaked input bits, and send it over the network to _B_ . _B_ can evaluate the CRGC and store it on its hard drive for future use. For compiling a C++ function to a boolean circuit, we mainly rely on modules provided by EMP. We tested our implementation on two AWS M5ZN metal instances with 24 cores, 48 threads, and 192GB of RAM connected via 100 Gbit/s network connections to the internet in a WAN setting. _A_ can construct a CRGC at a speed of up to 85 million gates per second, perform leakage prediction with up to 115 million gates per second and evaluate a circuit with up to 395 million gates per second. For comparison, we also implemented our test programs with EMP SH2PC and TinyGarble2. Since EMP SH2PC and TinyGarble2 implement a regular garbled circuit protocol, an evaluation must always be performed together with circuit construction. In all tests, EMP performs better than TinyGarble2 and achieves a speed of up to 55 million gates per second. Thus, after only a few evaluations, our CRGC library outperforms both libraries. All CRGCs we constructed leak at most two input bits to _B_ . We use the [Turbo](https://github.com/powturbo/TurboPFor-Integer-Compression) Pfor integer compression algorithm (Lemire et al., 2014) before sending a CRGC over a network or storing it locally. As a result, a CRGC is approx. 75% smaller in file size than the original uncompressed boolean circuit. 3.1 Basic Circuits Table 1 shows the results of applying our protocol to elementary circuits. _|C|_ shows the number of gates in a circuit. _Inputs leaked_ refers to the number of generator inputs a CRGC leaks. All tested basic circuits can be evaluated in under 1ms by our library. Table 1: Evaluation time for basic circuits. Circuit _|C|_ Inputs Evaluation leaked time ( _µ_ s) 64-bit Adder 376 1/64 2 64-bit Subtract 439 1/64 2 64-bit Multiplier 13675 2/64 36 AES-256(k,m) 50666 0/256 94 SHA256 135073 0/512 205 SHA512 349617 0/1024 551 3.2 Large Circuits We also tested more complex circuits that implement three real-world use cases: Finding an element in an unsorted list (query), identifying the maximum element in a specific coordinate range of a 2D array, and finding the intersect of two datasets. The resulting circuits have up to 1.9 billion gates and leak at most one input bit to _B_ . These larger circuits demonstrate that our library is practical for real problems. Our programs may serve as references for other functionalities. Table 2 shows that our library can process a dataset containing millions of entries in just a few seconds for simple functionalities. For complex functions such as the demonstrated set intersection, it can process a few thousand elements per second. These results may serve as a rough estimation of whether CRGCs can cope with a certain problem size. Figure 6 shows the results of benchmarking our framework against EMP SH2PC and TinyGarble2. Recall that _A_ has to perform leakage prediction only once per circuit, independent of its inputs. It has to generate a CRGC once per unique generator input _a_ . _B_ has to evaluate a CRGC once per changing evaluator input _b_ . Thus, we measured all three tasks independently. The bars with different shades of colors show additional costs that might occur along with a CRGC component: After _A_ constructs a CRGC, it needs to send it to _B_ over the network (brown bar). If _B_ does not store the circuit in memory after evaluating it, it needs to import the circuit from the hard drive again before performing an additional evaluation (green bar). Our benchmark shows that our library can consistently evaluate different circuits at approx. 350 million gates per second. Constructing a CRGC and sending it to _B_ is sometimes slower than performing a regular garbled circuit protocol with EMP once. However, evaluating a CRGC is 5-20 times faster than performing a garbled circuit protocol using EMP. In all tests, using our library compared to EMP and TinyGarble2 pays off after less than three evaluations. Figure 6: Performance Comparison of EMP SH2PC, TinyGarble2, and CRGC Components. Table 2: Evaluation time for large circuits. Evaluation time (Elements/s) Functionality _|C|_ Elements CRGC EMP SH2PC TinyGarble2 Query 9,100,000 140,000 6,086,956 281,690 1,924 Max in 2D Range 123,815,518 148,996 396,265 48,094 11,860 Set Intersection 1,910,780,159 40,000 7,362 1,163 1,027 Note that beyond our implementation, a generator can always construct a PRGC with only one reusable and non-reusable section. Since evaluating a CRGC is faster than evaluating a regular garbled circuit, it follows that for most circuits _C_, we can construct a PRGC that can be evaluated faster than performing Yao’s Garbled Circuit protocol with _C_ . ### 4 RELATED WORK Reusable garbled circuits have been gaining popularity in the Secure Multiparty Computation community during the last decade. (Saleem et al., 2018) summarizes and discusses recent advancements in garbled circuits. The authors state that one important future step is constructing a reusable garbled circuit scheme with low computational complexity. In contrast to our approach, existing proposals tried to build CRGCs without leakage that do not scale well. To achieve practicability, we propose a trade-off between the extent of reusability and performance (PRGC), or between security and performance (CRGC). (Goldwasser et al., 2013) proposed the first reusable garbled circuit scheme that is based on functional encryption. Functional encryption allows a user to generate secret keys that enable a key holder to learn a specific function output of encrypted data but learn nothing about the data (Boneh et al., 2011). However, their scheme relies on fully homomorphic encryption and other computationally expensive techniques to achieve functional encryption. Since then, there have been optimizations to the computational complexity of reusable garbled circuits that also rely on fully homomorphic- or attribute-based encryption (Boneh et al., 2014). As both prior mentioned schemes for reusable garbled circuits combine multiple complex cryptographic primitives, it is difficult to assess their efficiency. According to (Wang et al., 2017) both so lutions are not practical. Thus, (Wang et al., 2017) constructed a reusable garbled circuit scheme with a trade-off between security and privacy. Their solution does not contain any benchmarks or implementations. (Gorbunov et al., 2015) proposed a step towards reusable garbled circuits by encrypting each garbled value with a seed. For each wire and each gate, a different encryption key is used. The evaluator obtains an encoded seed in the beginning to evaluate the circuit. However, their scheme does not achieve input privacy. Due to the lack of an existing reusable garbled circuit implementation, we compare our library with the alternative of constructing a new Yao’s Garbled Circuit for each evaluation with a state-of-the-art framework. Multiple libraries have been proposed that implement Yao’s Garbled Circuit protocol with various optimizations such as _Free_ _XOR_ (Kolesnikov and Schneider, 2008). Libraries that offer state-ofthe-art performance and rich functionalities are TinyGarble2 (Hussain et al., 2020), Obliv-C (Zahur and Evans, 2015), ABY (Demmler et al., 2015), and EMP SH2PC (Wang et al., 2016). Since (Hussain et al., 2020) demonstrated that TinyGarble2 outperforms Obliv-C and ABY, we chose EMP and TinyGarble2 as our benchmark. ### 5 CONCLUSION In this work, we proposed obfuscation-based techniques for constructing completely reusable garbled circuits (CRGCs) and partially reusable garbled circuits (PRGCs). We showed that our CRGC library can evaluate constructed circuits up to 20 times faster than current state-of-the-art garbled circuit libraries. CRGCs come with predictable input leakage. While we were not able to not infer multiple input bits from our test circuits, certain functionalities or more sophisticated analyses may do so. In this case, the generator and evaluator can engage in our hybrid PRGC protocol to only use a CRGC for evaluating the sections of the underlying circuit that do not pose input leakage. The remaining sub-circuits can be evaluated by Yao’s Garbled Circuit protocol. Future work may introduce techniques to increase the number of gates in the reusable section or find more efficient ways to construct RGCs for n-party computation. ### REFERENCES Boneh, D., Gentry, C., Gorbunov, S., Halevi, S., Niko laenko, V., Segev, G., Vaikuntanathan, V., and Vinayagamurthy, D. (2014). Fully key-homomorphic encryption, arithmetic circuit abe and compact garbled circuits. In _Annual International Conference on_ _the_ _Theory_ _and_ _Applications_ _of_ _Cryptographic_ _Tech-_ _niques_, pages 533–556. Springer. Boneh, D., Sahai, A., and Waters, B. (2011). Functional encryption: Definitions and challenges. In _Theory_ _of_ _Cryptography Conference_, pages 253–273. Springer. Demmler, D., Schneider, T., and Zohner, M. (2015). Aby a framework for efficient mixed-protocol secure twoparty computation. In _NDSS_ . Goldwasser, S., Kalai, Y., Popa, R. A., Vaikuntanathan, V., and Zeldovich, N. (2013). Reusable garbled circuits and succinct functional encryption. In _Proceedings of_ _the_ _forty-fifth_ _annual_ _ACM_ _symposium_ _on_ _Theory_ _of_ _computing_, pages 555–564. Gorbunov, S., Vaikuntanathan, V., and Wee, H. (2015). Attribute-based encryption for circuits. _Journal of the_ _ACM (JACM)_, 62(6):1–33. Hussain, S., Li, B., Koushanfar, F., and Cammarota, R. (2020). Tinygarble2: Smart, efficient, and scalable yao’s garble circuit. In _Proceedings_ _of_ _the_ _2020_ _Workshop_ _on_ _Privacy-Preserving_ _Machine_ _Learning_ _in Practice_, pages 65–67. Kolesnikov, V. and Schneider, T. (2008). Improved garbled circuit: Free xor gates and applications. In _Interna-_ _tional Colloquium on Automata, Languages, and Pro-_ _gramming_, pages 486–498. Springer. Lemire, D., Boytsov, L., and Kurz, N. (2014). Simd com pression and the intersection of sorted integers. _Soft-_ _ware:_ _Practice and Experience_, 46. Lindell, Y. (2017). How to simulate it–a tutorial on the sim ulation proof technique. _Tutorials on the Foundations_ _of Cryptography_, pages 277–346. Lindell, Y. (2020). Secure multiparty computation (mpc). _IACR Cryptol. ePrint Arch._, 2020:300. Lindell, Y. and Pinkas, B. (2009). A proof of security of yao’s protocol for two-party computation. _Journal of_ _cryptology_, 22(2):161–188. Saleem, A., Khan, A., Shahid, F., Alam, M. M., and Khan, M. K. (2018). Recent advancements in garbled computing: how far have we come towards achieving secure, efficient and reusable garbled circuits. _Journal_ _of Network and Computer Applications_, 108:1–19. Wang, X., Malozemoff, A. J., and Katz, J. (2016). Emp toolkit: Efficient multiparty computation toolkit. Wang, X. A., Xhafa, F., Ma, J., Cao, Y., and Tang, D. (2017). Reusable garbled gates for new fully homomorphic encryption service. _International_ _journal_ _of_ _web and grid services_, 13(1):25–48. Yao, A. C. (1982). Protocols for secure computations. In _23rd_ _annual_ _symposium_ _on_ _foundations_ _of_ _computer_ _science (sfcs 1982)_, pages 160–164. IEEE. Yao, A. C. (1986). How to generate and exchange secrets. In _27th Annual Symposium on Foundations of Computer_ _Science (sfcs 1986)_, pages 162–167. Zahur, S. and Evans, D. (2015). Obliv-c: A language for extensible data-oblivious computation. _IACR Cryptol._ _ePrint Arch._, 2015:1153. ### APPENDIX Security Proof of PRGCs To prove _input_ _privacy_ of a one-time protocol π against semi-honest adversaries one can use the following two simulation proofs (Lindell, 2017): _{S_ 1(1 <sup>_n_</sup> _,_ _x, f_ 1( _x,_ _y_ )) _}x,y∈{_ 0 _,_ 1 _}∗_ ; _n∈_ N (1) π1 <sup>(</sup> <sup>_x,_</sup> <sup>_y,_</sup> <sup>_n_</sup> <sup>)</sup> <sup>_}_</sup> _x,y∈{_ 0 _,_ 1 _}_ <sup>_∗_</sup> ; _n∈_ N _≡{c_ _view_ π1 _{S_ 2(1 <sup>_n_</sup> _,_ _y, f_ 2( _x,_ _y_ )) _}x,y∈{_ 0 _,_ 1 _}∗_ ; _n∈_ N (2) π2 <sup>(</sup> <sup>_x,_</sup> <sup>_y,_</sup> <sup>_n_</sup> <sup>)</sup> <sup>_}_</sup> _x,y∈{_ 0 _,_ 1 _}_ <sup>_∗_</sup> ; _n∈_ N holding for all wires under said conditions. We split up the proof into four Lemmas. Proofing Lemma 1-3 shows that the reusable sections of a PRGC provide input privacy. Proofing Lemma 4 shows that nonreusable sections of a PRGC provide input privacy. In combination, we prove that PRGCs provide input privacy for any circuit _C_ . Lemma 1 The position _p_ of an entry _vk_ in the truth table _Tg_ does not leak _vi_ under the security assumptions of _G_ . _Proof:_ In the unmodified truth table of _g_, _B_ can infer the following from _p_ : _p ∈{_ 0 _,_ 1 _}_ = _⇒_ _vi_ = 0 (4) _p ∈{_ 2 _,_ 3 _}_ = _⇒_ _vi_ = 1 (5) After Bit Flipping _B_ can infer the following from _p_ : _p ∈{_ 0 _,_ 1 _}_ = _⇒_ _vi ⊕_ _bi_ = 0 (6) _p ∈{_ 2 _,_ 3 _}_ = _⇒_ _vi ⊕_ _bi_ = 1 (7) Since _B_ does not hold _bi_, it cannot infer _vi_ from its position _p_ in the truth table without breaking the security assumptions of _G_ . Lemma 2 A balanced gate _g_ in the reusable section does not leak _vi_ under the security assumptions of _G_ . _Proof:_ The following equation holds if _g_ is an _XOR_ gate: _≡{c_ _view_ π2 Simulating _A_ ’s view is trivial as it does not interact with _B_ when constructing reusable sections. Simulating _B_ ’s view is possible by constructing a PRGC with a random generator input. Using the knowledge of _f_ 2( _x,_ _y_ ), the simulator can modify the Oblivious Transfers required to obtain the final output bits by always returning the correct output, independent of _B_ <sup>_′_</sup> _s_ choice bit. Thus, we only need to show if, in _B_ ’s view, a PRGC based on a random generator input is indistinguishable from a PRGC based on the actual generator input. Claim _A PRGC computing an arbitrary functionality_ _f_ ( _a,_ _b_ ) _expressed by a circuit C for a fixed input a and_ _an unfixed input b provides input privacy_ . Without loss of generality, assume _C_ only consists of balanced gates ( _XOR,_ _XNOR_ ) and the following imbalanced gates: _AND,_ _NAND,_ _OR,_ _NOR_ . Assume _G_ is a PRG that can sample a uniformly random _b_ from _U_ = _{_ 0 _,_ 1 _}_ . Assume that _B_ knows every gate _g_ in _C_ . For each value _vw_ at wire _w_ in _C_, _A_ samples a _bw_ from _U_ and sets _v_ <sup>_′_</sup> _w_ <sup>=</sup> <sup>_vw_</sup> <sup>_⊕_</sup> <sup>_bw_</sup> <sup>.</sup> <sup>Each</sup> <sup>wire</sup> <sup>label</sup> <sup>_v_</sup> _w_ <sup>_′_</sup> is now obfuscated by a one time pad. _B_ receives _bw_ only for its own input bit wires. Let _g_ be a gate in _C_ with functionality _f_ ( _vi,_ _v_ _j_ ) = _vk,_ _i, j,_ _k < |w|_ . Let _B_ receive only the last column of the truth table _Tg_ from _A_ that contains all four combinations for _f_ ( _v_ <sup>_′_</sup> _i_ <sup>_,_</sup> <sup>_v′_</sup> _j_ <sup>) =</sup> _v_ <sup>_′_</sup> _k_ <sup>.</sup> <sup>Table</sup> <sup>3</sup> <sup>shows</sup> <sup>a</sup> <sup>truth</sup> <sup>table</sup> <sup>after</sup> <sup>Bit</sup> <sup>Flipping.</sup> <sup>_p_</sup> refers to the position in the of the last column’s entry in the truth table. _B_ knows up to one input wire _vc,_ _bc_ ( _c ∈{i, j}_ ) of _g_ in advance (let _c_ = _j_ ). If all wires satisfy the following equation, then any two PRGCs based on different generator inputs follow the same distribution of wire labels and are thus indistinguishable from _B_ ’s perspective. _PR_ [ _vi_ = 0] = <sup>_c_</sup> _PR_ [ _vi_ = 1] = <sup>_c_</sup> <sup><u>1</u></sup> (3) 2 <sup>_._</sup> Thus, we reduce the proof that a PRGC provides input privacy against a semi-honest evaluator to equation 3 The following equation holds if _g_ is an _XNOR_ gate: _vk ⊕_ _bk_ = _¬_ ( _vi ⊕_ _bi ⊕_ _v_ _j ⊕_ _b_ _j_ ) (9) Since B does not hold any values of _{vi ⊕_ _bi,_ _vk ⊕_ _bk}_, _B_ cannot distinguish between the entries in _Tg_ where _vi_ = 1, _vi_ = 0, _vk_ = 0, _vk_ = 1. Thus, _B_ cannot infer _vk_ and _vi_ when inspecting the truth table _Tg_ of balanced gate _g_ without breaking the security assumption of _G_ . Lemma 3 An imbalanced gates _g_ in the reusable section does not leak _vi_ under the security assumptions of _G_ . _Proof:_ The following equation holds if _g_ is an _AND_ gate: _vk ⊕_ _bk_ = _vi ⊕_ _bi ∧_ _v_ _j ⊕_ _b_ _j_ (10) With a certain probability _q_, _A_ replaces _g_ by a _NOR_ gate: _vk ⊕_ _bk_ = _¬_ ( _vi ⊕_ _bi ∨_ _v_ _j ⊕_ _b_ _j_ ) (11) _v_ <sup>_′_</sup> <sup>_′_</sup> _k_ <sup>=</sup> <sup>_v_</sup> _i_ <sup>_′_</sup> _j_ = _vk ⊕_ _bk_ = _vi ⊕_ _bi ⊕_ _v j ⊕_ _b_ _j_ _i_ <sup>_′_</sup> <sup>_⊕_</sup> <sup>_v′_</sup> (8) <sup>_′_</sup> _w_ <sup>=</sup> <sup>_vw_</sup> <sup>_⊕_</sup> <sup>_bw_</sup> <sup>.</sup> <sup>Each</sup> <sup>wire</sup> <sup>label</sup> <sup>_v′_</sup> <sup>_′_</sup> _i_ <sup>_,_</sup> <sup>_v′_</sup> Table 3: Flipped gate with arbitrary functionality, denoted by _⋆_ . _p_ _v_ <sup>_<u>′</u>_</sup> _<u>i</u>_ <sup>_<u>′</u>_</sup> _<u>i</u>_ _v_ <sup>_<u>′</u>_</sup> _<u>j</u>_ _v_ <sup>_<u>′</u>_</sup> _<u>k</u>_ _<u>i</u>_ _<u>j</u>_ _<u>k</u>_ <u>2</u> _<u>bi</u>_ <u>+</u> _<u>b</u>_ _<u>j</u>_ <u>0</u> _<u>⊕</u>_ _<u>bi</u>_ <u>0</u> _<u>⊕</u>_ _<u>b</u>_ _<u>j</u>_ <u>[(0</u> _<u>⊕</u>_ _<u>bi</u>_ <u>)</u> _<u>⋆</u>_ <u>(0</u> _<u>⊕</u>_ _<u>b</u>_ _<u>j</u>_ <u>)]</u> _<u>⊕</u>_ _<u>bk</u>_ <u>2</u> _<u>bi</u>_ <u>+</u> <u>1</u> _<u>−</u>_ _<u>b</u>_ _<u>j</u>_ <u>0</u> _<u>⊕</u>_ _<u>bi</u>_ <u>1</u> _<u>⊕</u>_ _<u>b</u>_ _<u>j</u>_ <u>[(0</u> _<u>⊕</u>_ _<u>bi</u>_ <u>)</u> _<u>⋆</u>_ <u>(1</u> _<u>⊕</u>_ _<u>b</u>_ _<u>j</u>_ <u>)]</u> _<u>⊕</u>_ _<u>bk</u>_ <u>2</u> _<u>−</u>_ <u>2</u> _<u>bi</u>_ <u>+</u> _<u>b</u>_ _<u>j</u>_ <u>1</u> _<u>⊕</u>_ _<u>bi</u>_ <u>0</u> _<u>⊕</u>_ _<u>b</u>_ _<u>j</u>_ <u>[(1</u> _<u>⊕</u>_ _<u>bi</u>_ <u>)</u> _<u>⋆</u>_ <u>(0</u> _<u>⊕</u>_ _<u>b</u>_ _<u>j</u>_ <u>)]</u> _<u>⊕</u>_ _<u>bk</u>_ <u>2</u> _<u>−</u>_ <u>2</u> _<u>bi</u>_ <u>+</u> <u>1</u> _<u>−</u>_ _<u>b</u>_ _<u>j</u>_ <u>1</u> _<u>⊕</u>_ _<u>bi</u>_ <u>1</u> _<u>⊕</u>_ _<u>b</u>_ _<u>j</u>_ <u>[(1</u> _<u>⊕</u>_ _<u>bi</u>_ <u>)</u> _<u>⋆</u>_ <u>(1</u> _<u>⊕</u>_ _<u>b</u>_ _<u>j</u>_ <u>)]</u> _<u>⊕</u>_ _<u>bk</u>_ Only _vi_ = 1 can lead to the unique output of an _AND_ gate ( _vk_ = 1). Only _vi_ = 0 can lead to the unique output of a _NOR_ gate ( _vk_ = 1). By inspecting the truth table of this term _B_ finds identical values of _v_ <sup>_′_</sup> _k_ <sup>for</sup> three cases. In the other case it can infer that _vi_ produces the unique output of _g_ . However, if it cannot distinguish if _A_ replaced _g_ before Bit Flipping it cannot infer the value of _vi_ . Thus _A_ <sup>_′_</sup> _s_ goal is to replace _g_ with a probability _q_ such that from _B_ <sup>_′_</sup> _s_ perspective _Pr_ [ _g ∈_ _NOR_ ] = _Pr_ [ _g ∈_ _AND_ ]. Replacing _g_ does not maintain the integrity of _C_ <sup>_′_</sup> . Thus, _A_ can only replace _g_ if it is a passive gate. Let _s_ be the set of possible input combinations for _a_ where _g_ is a passive gate. _A_ and _B_ can calculate _p_ = _Pr_ [ _g ∈{_ passive gates _}_ ] = <sup>_<u>|s|</u>_</sup> 2 <sup>_|a|_</sup> <sup>.</sup> <sup>_A_</sup> <sup>sets the proba-</sup> bility to replace _g_ to: _pq_ = (1 _−_ _p_ )+(1 _−_ _q_ ) _p_ _⇔_ 2 _q_ = <sup><u>1</u></sup> <sup>_<u>−</u>_</sup> <sup>_<u>p</u>_</sup> + 1 _p_ (12) circuit _s_ according to Yao’s Garbled Circuit protocol. Yao’s Garbled Circuit protocol was proven to be secure before (Lindell and Pinkas, 2009). Each final output gate of _s_ is either also a final output gate of _C_ or meets the conditions of a gate contained in the reusable section. In the former case, there is no difference to Yao’s Garbled Circuit protocol. In the latter case, equation 3 holds as proven in lemma 1-3 . If _A_ does not need to learn the output of the computation, a PRGC is secure against a malicious _B_ when utilizing a compatible OT protocol. Enabling n-party Computation with CRGCs Our CRGC protocol can be easily extended to enable n-party computation. The following steps are neccessary for 3-PC: 1. A sends _C_ <sup>_′_</sup> and _a_ <sup>_′_</sup> to party B. 2. Party B further obfuscates _C_ <sup>_′_</sup> and its inputs _b_ and sends _C_ <sup>_′′_</sup>, _a_ <sup>_′_</sup>, and _b_ <sup>_′_</sup> to party C. 3. Party C can evaluate _C_ <sup>_′′_</sup> with _a_ <sup>_′_</sup>, _b_ <sup>_′_</sup>, and arbitrary inputs _c_ . If party C wants to evaluate _C_ <sup>_′′_</sup> with different inputs of B, the parties have to repeat steps 2-3. For different inputs of party A, they have to repeat all steps. Thus, the order of parties receiving and further obfuscating a CRGC is relevant. We can generalize this observation for n-party computation. If any party wants to evaluate the circuit with a different input of a party at position _i_ in the receiving order, all parties at position _p_ with _i ≤_ _p ≤_ _n_ _−_ 1 need to repeat obfuscation. _⇔_ _q_ = <sup><u>1</u></sup> 2 _p_ If _q ≤_ 1, _A_ replaces _g_ with probability _q_ to achieve: _Pr_ [ _g ∈_ _NOR_ ] = <sup>_c_</sup> _Pr_ [ _g ∈_ _AND_ ] = <sup>_c_</sup> <sup><u>1</u></sup> 2 <sup>_._</sup> (13) If _q >_ 1, _A_ must not add _g_ to the reusable section of _C_ <sup>_′_</sup> . With the same procedure, A can securely obfuscate _NOR_ gates ( _AND_ gates as replacement), _NAND_ gates ( _OR_ gates as replacement), and _OR_ gates ( _NAND_ gates as replacement). After replacing (or not replacing) _g_, A applies Bit Flipping to _g_ . By proofing Lemma 1-3, we showed that a reusable section containing only the balanced gates of _C_ and imbalanced gates that meet the conditions above satisfies equation 3. All other gates of _C_ <sup>_′_</sup> are contained in a non-reusable section. Lemma 4 A gate _g_ in the non-reusable section does not leak _vi_ under the security assumptions of Yao’s Garbled Circuit protocol. _Proof:_ For each gate _g_ in the first level of a nonreusable section _s_, _B_ holds both input wires _v_ <sup>_′_</sup> _i_ <sup>,</sup> <sup>_v′_</sup> _j_ <sup>.</sup> By engaging in two Oblivious Transfers per gate with _A_, _B_ obtains two input keys per gate. _A_ garbles the Predicting Leakage of a CRGC To predict leaked input bits of a CRGC, we have to take the evaluator’s perspective when it receives _C_ <sup>_′_</sup> and _a_ <sup>_′_</sup> from _A_ . By default, _B_ does not know whether a gate in _C_ <sup>_′_</sup> is obfuscated or flipped except for a final output gate (that is never obfuscated nor flipped). However, if it knows _C_ ’s exact construction, it can identify gates that are not passive or balanced with certainty. These gates do not provide indistinguishability obfuscation and may reveal input bits of _A_ . Potentially Fixed Gates First, we introduce the concept of _potentially_ _fixed_ _gates_ . From _B_ ’s perspective, any imbalanced gate on level 1 is a potentially fixed gate. As we showed before, we achieved indistinguishability obfuscation for all gates on level 1. However, in deeper levels of _C_, _B_ may identify gates that _A_ could not have obfuscated. To identify potentially fixed gates, _B_ can use the following ruleset. It can consider all generator inputs as potentially fixed and all evaluator inputs as not potentially fixed. A balanced gate that has at least one not potentially fixed parent is not potentially fixed itself. This property holds because evaluating a balanced gate such as _XOR_ with one fixed and one unfixed bit always returns two different output bits. An imbalanced gate instead is only not potentially fixed if both parents are not potentially fixed. This property holds because evaluating an imbalanced gate such as _AND_ with at least one fixed bit may always return the same output bit. _B_ can iterate through the whole circuit with this ruleset to identify all not potentially fixed gates. Algorithm 4 applies this ruleset to a CRGC. Potentially Intermediary Gates Recall that intermediary gates and fixed gates provide indistinguishability obfuscation. Thus, _B_ also needs to identify all _potentially intermediary gates_ . If it assumes all potentially fixed gates to be fixed gates, it can identify intermediary gates by algorithm 3. As the set of fixed gates is a subset of all potentially fixed gates, _B_ can identify all potentially intermediary gates this way. Potentially Revealing Gates Recall that Bit Flipping provides indistinguishability obfuscation only for balanced gates. Thus, _B_ can identify the true values of both parents of a gate with certainty if the gate is not balanced and not potentially passive. However, identifying such a gate does <u>Algorithm 4</u> <u>Identify potentially fixed gates.</u> 1: for each generator input _a_ <sup>_′_</sup> _i_ <sup>do</sup> 2: _pf_ [ _a_ <sup>_′_</sup> _i_ <sup>]</sup> <sup>_←_</sup> <sup>_true_</sup> _▷_ _pf_ �= potentially fixed 3: for each evaluator input _bi_ do 4: _pf_ [ _bi_ ] _←_ _false_ 5: for each gate _g_ do 6: switch type(g) do 7: case _type_ ( _g_ ) _∈_ _imbalancedGates_ 8: _pf_ [ _g_ ] = _pf_ [ _l_ ] _∨_ _pf_ [ _r_ ] 9: case _type_ ( _g_ ) _∈{XOR,_ _XNOR}_ 10: _pf_ [ _g_ ] = _pf_ [ _l_ ] _∧_ _pf_ [ _r_ ] 11: case _type_ ( _g_ ) _∈{{_ 0 _,_ 0 _,_ 1 _,_ 1 _}_, _{_ 1 _,_ 1 _,_ 0 _,_ 0 _}}_ 12: _pf_ [ _g_ ] = _pf_ [ _l_ ] 13: case _type_ ( _g_ ) _∈{{_ 0 _,_ 1 _,_ 0 _,_ 1 _}_, _{_ 1 _,_ 0 _,_ 1 _,_ 0 _}}_ 14: _pf_ [ _g_ ] = _pf_ [ _r_ ] 15: case _Default_ _▷_ _{_ 0 _,_ 0 _,_ 0 _,_ 0 _}_ or _{_ 1 _,_ 1 _,_ 1 _,_ 1 _}_ 16: _pf_ [ _g_ ] = _true_ not yield input leakage yet. Thus, we call those gates _potentially revealing gates_ . Suppose there is a potentially revealing gate on level 1. Since a potentially revealing gate, _gpr_ always reveals the true value of its parents to _B_ (if it knows _C_ ), a potentially revealing gate on level 1 would leak its input bits. However, each revealing gate is located at a deeper level of _C_ <sup>_′_</sup> . Therefore, its leakage does not always reveal an input bit of _A_ . Consider a potentially revealing gate _gpr_ . _B_ can only infer a generator input bit _a_ <sup>_′_</sup> _i_ <sup>if</sup> <sup>there</sup> <sup>is</sup> <sup>at</sup> <sup>most</sup> one balanced gate on the path of _gpr_ to _a_ <sup>_′_</sup> _i_ <sup>since it does</sup> not know whether a balanced gate’s input wires are flipped. This approach is utilized by our library to predict the number of inputs leaked in a CRGC. However, _B_ could combine the knowledge of multiple potentially revealing gates by setting up a system of boolean equations from each input bit to each revealed value. Calculating solutions to this system of equations may require an exhaustive search and is infeasible for large circuits. Thus, we do not provide an implementation for this approach. This means, however, that our implemented leakage prediction only serves as a lower bound. We also do not exclude the possibility that there are more ways to infer input bits from potentially revealing gates. In case a CRGC leaks multiple input bits, _A_ can construct a PRGC instead. Alternative threat models than discussed here may assume that _B_ does not know _C_ ’s construction. In this case, passive gates can be re-generated completely at random instead of providing indistinguishably obfuscation. This is the default setting of our library. Example - Constructing a CRGC Figure 7 illustrates an exemplary section _s_ of a circuit and shows the key modifications when using our three obfuscation techniques. Figure 7a shows the plain circuit and its inputs. For simplicity, we use only _AND_ and _XOR_ gates to cover one type of balanced and one type of imbalanced gates. In the example, the left parent of each gate on level 1 is always _A_ ’s input, and the right parent is always _B_ ’s input. Since useful realworld circuits are too large to illustrate in an example, we assume that the shown sequence of gates is only a section of a bigger circuit. Bit Flipping Figure 7b illustrates how each gate and input bit is modified when Bit Flipping is applied. At first, _A_ generates obfuscated inputs. The suffix (!) next to a wire value indicates that the obfuscated input is the flipped version of the original input. Bit Flipping first recovers the integrity of each gate if one of its parents got flipped. Afterward, with a probability of <sup><u>1</u></sup> 2 <sup>, the output</sup> wire of each gate gets flipped as well. In the figure, the four values inside each gate show the output entries of the sorted truth table after the recovery step. Two columns inside a gate indicate that the gate also got flipped afterward. In this case, the values on the left show the truth table after recovering the gate’s integrity, while the values on the right show the truth table after the output wire got flipped. Notice that the _XOR_ gate with evaluator input bit _b_ ( _XOR_ 1) provides indistinguishability obfuscation since _B_ cannot distinguish _XOR_ 1’s truth table from the one where _A_ <sup>_′_</sup> _s_ input is 0 and _XOR_ 1 is flipped. Obfuscating Fixed Gates Figure 7c illustrates how fixed gates and their parents get modified after Bit Flipping is applied. The four most left values inside each gate show the truth table of each gate after Bit Flipping. _obf/o_ indicates that a gate is fixed and shows the truth table after obfuscating it. Recall that all gates on level 1 of the circuit get obfuscated to a gate indistinguishable from _XOR_ / _XNOR_ . _L1_ indicates that an unfixed imbalanced gate gets obfuscated into a balanced gate. _rec/r_ indicates that the child _gc_ of a fixed gate gets modified to recover the circuit’s integrity. If this modification leads to _gc_ being fixed, it gets obfuscated afterward (indicated by _o_ ). Notice that after applying this obfuscation technique to all gates on level 1, each gate’s truth table is indistinguishable from either _XOR_ or _XNOR_ . Observe that after recovering a gate’s integrity, each truth table gets modified to be independent of its obfuscated parent. After recovery, any modification to the obfuscated gate does not change the output of its children. All fixed gates get modified to provide indistinguishability obfuscation. Obfuscating Intermediary Gates Figure 7d illustrates how intermediary gates get modified after obfuscating fixed gates. Recall that each gate _g_ where each path from _g_ to a final output gate _go_ contains a fixed gate _g_ _f_ is an intermediary gate. _A_ can modify these gates to achieve indistinguishability obfuscation without breaking the circuit’s integrity. The four most left values inside each gate show the truth table of each gate after obfuscating fixed gates. _obf_ indicates that this intermediary gate gets obfuscated. Since the final gate of _s_ in this example is an obfuscated fixed gate, all other gates are intermediary gates. Thus, _A_ can obfuscate all gates to provide indistinguishability obfuscation. After applying our obfuscation techniques to the whole circuit, _A_ can send _C_ <sup>_′_</sup> and _a_ <sup>_′_</sup> to _B_ . ! 0 1 1 0 ! 0 1 0 0 0 1 obf 1 0 0 1 obf 1 0 1 0 0 1 1 0 obf 0 1 1 0 obf 0 1 0 1 0 0 1 0 0 1 1 0 1 1 0 1 1 0 0 0 1 0 ! 0 1 0 0 0 1 1 0 0 a 1 b 0 c 0 d 1 e 0 f _AND_ _XOR_ _XOR_ _AND_ _AND_ _XOR_ 1 0 0 1 _XOR_ _AND_ _AND_ 0 0 0 1 _AND_ 1 1 0 1 1(!) a 1 b 1(!) c 1(!) d 1 e 0 f 1 a 1 b 1 c 1 d 1 e 0 f ! 0 1 1 1 ! 0 0 1 0 1 0 0 1 (a) Section of a circuit. 1 0 ! 1 0 1 1 0 0 ! 1 0 1 1 0 1 0 0 1 ! (b) Bit Flipping. 0 1 0 0 1 0 1 1 obf 0 0 1 0 0 1 1 0 1 0 1 1 0 0 0 1 obf 0 1 1 0 0 1 1 0 rec 1 1 0 1 obf 1 a 1 b 1 c 1 d 1 e 0 f 1 0 1 1 1 1 1 0 1 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 0 1 0 0 1 0 0 1 0 1 1 1 0 0 r 0 - 0 0 1 0 0 1 0 1 1 1 0 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 0 0 0 r 0 0 0 1 0 1 1 0 1 obf 0 0 _AND_ 1 0 r 1 - 1 1 1 1 1 0 0 L1 0 1 1 0 0 1 1 1 obf 0 1 (c) Obfuscating fixed gates. (d) Obfuscating intermediary gates. Figure 7: Constructing a CRGC. Codebase: [https://github.com/chart21/CRGC](https://github.com/chart21/CRGC)

섹션 본문 71문단 · 36,712자

(제목 없음)

1In this work, we introduce two schemes to construct reusable garbled circuits (RGCs) in the semi-honest setting. Our completely reusable garbled circuit (CRGC) scheme allows the generator (party A) to construct and send an obfuscated boolean circuit along with an encoded input to the evaluator (party B). In contrast to Yao's Garbled Circuit protocol, B can securely evaluate the same CRGC with an arbitrary number of inputs. As a tradeoff, CRGCs predictably leak some input bits of A to B. We also propose a partially reusable garbled circuit (PRGC) scheme that divides a circuit into reusable and non-reusable sections. PRGCs do not leak input bits of A. We benchmark our CRGC implementation against the state-of-the-art garbled circuit libraries EMP SH2PC and TinyGarble2. Using our framework, evaluating a CRGC is up to twenty times faster, albeit with weaker privacy guarantees, than evaluating an equivalent garbled circuit constructed by the two existing libraries. Our open-source library can convert any C++ function to a CRGC at approx. 80 million gates per second and repeatedly evaluate a CRGC at approx. 350 million gates per second. Additionally, a compressed CRGC is approx. 75% smaller in file size than the unobfuscated boolean circuit.

INTRODUCTION

2Secure Multiparty Computation enables parties to execute functions on obliviously shared inputs without revealing them (Lindell, 2020). Yao's Garbled Circuits protocol (Yao, 1982;Yao, 1986) is a popular Secure Multiparty Computation protocol for realizing semi-honest two-party computation. Following the protocol, a circuit generator A sends its encoded inputs and the encrypted and permuted gate output tables of a boolean circuit to a circuit evaluator B. B can obtain only one encoded input per circuit through Oblivious Transfer. Thus, each time B wants to obtain an output from a different input, it needs to request another garbled circuit. Garbled circuits get large in file size. Our Reusable Garbled Circuit (RGC) schemes allow B to re-use a garbled circuit for multiple evaluations with different evaluator inputs. They significantly reduce communication overhead compared to sending a new garbled circuit for each evaluation. RGCs enable party A to send obfuscated data to an untrusted party B while ensuring that sent data remains secret and can only be used for its intended purpose implemented by the circuit. B can evaluate an RGC with an arbitrary number of inputs without revealing A's input.

3Existing RGC schemes usually rely on cryptographic primitives that are too complex for realworld use cases. Our key idea instead is to utilize information-theoretic techniques to obfuscate the wire labels that A sends to B in a way that hinders B from learning A's secret inputs. With this approach, B can repeatedly evaluate the same obfuscated circuit with arbitrary inputs. Only when A s input changes it needs to construct a new RGC. While constructing an RGC can take longer than constructing a garbled circuit, it pays off over time due to faster evaluation speed. Not all gates in a circuit can be obfuscated without leaking input bits. Thus, A has two options:

41. It obfuscates only those gates with our techniques that do not leak information. It then groups the remaining unobfuscated gates into n non-reusable sub-circuits and prepares n Yao's Garbled Circuit protocols. With this approach, we obtain reusable and non-reusable sections in a circuit. We call the resulting circuit a partially reusable garbled circuit (PRGC).

52. It obfuscates all gates with our techniques and tolerates a certain number of leaked input bits. We call the resulting circuit a completely reusable garbled circuit (CRGC).

6Our CRGC scheme essentially transforms a boolean circuit C that computes a functionality f (a, b) into a boolean circuit C and obfuscated input a such that C (a , b) = C(a, b) for a specific input a and any arbitrary input b. Evaluating C is as efficient as evaluating C. Given C , C, and a it is difficult to infer input bits of a even with repeated evaluations. Our PRGC scheme divides a CRGC C into reusable sub-circuits (sections) and non-reusable sections. Reusable sections do not leak inputs of a. Non-reusable sections contain gates that may leak input bits of a. Thus, A and B engage in a Yao's Garbled Circuit protocol for each non-reusable section in C for each repeated evaluation. As a result, our PRGC scheme guarantees the same level of input privacy as Yao's Garbled Circuit protocol.

7Our framework compiles any user-defined C++ program and a set of inputs into a CRGC and a set of encoded inputs. A can send these compressed over the network to B. B can use our implementation to evaluate the CRGC with an arbitrary number of inputs. We tested several programs such as linear search, set intersection, and data analysis but also elementary operations such as addition and multiplication. Our benchmarks show that an Amazon M5ZN instance can construct CRGCs at approx. 80 million gates per second and evaluate them at approx. 350 million gates per second. The construction is only necessary once per input of party A. EMP SH2PC (Wang et al., 2016) and TinyGarble2 (Hussain et al., 2020) can evaluate the same programs at up to 55 million gates per second but without leaking any input bits to B.

OUR APPROACH

8In this section, we show how A can construct a CRGC and a PRGC. Any boolean circuit C and generator input a can be converted into an RGC C and an obfuscated input a using three different kinds of obfuscation techniques: Bit Flipping, obfuscating fixed gates, and obfuscating intermediary gates. After applying our obfuscation techniques, C is tied to a single a , meaning that ∃a∀b : C (a , b) = C(a, b) but for inputs not equal to a the output equality of C and C is not ensured.

9We call XNOR and XOR gates balanced gates, and all other gates imbalanced gates. We refer to a gate as a passive gate if modifying its truth table does not alter the circuit's output. A gate provides indistinguishability obfuscation if B has an advantage of 0 to distinguish between a gate's truth table entry resulting from a generator's input of 0 and 1. In our PRGC protocol, only truth tables of gates that provide indistinguishability obfuscation and final output gates are contained in the reusable section. A uses Yao's Garbled Circuit protocol to ensure that the remaining gates also do not leak any input bits of a. In our CRGC protocol, A instead also sends these remaining gates to B without additional obfuscation, thus tolerating a predictable number of leaked input bits.

Bit Flipping

10Bit Flipping refers to applying a one-time pad r over the input bits of a and all wires in the circuit C to obtain C and a . Only inputs from B and final output wires do not get flipped. Whenever, a wire w is flipped by r, A needs to modify the truth table of w's child gates to recover the integrity of C . For instance, if the left input wire of a gate g with functionality

11Since an RGC should be dependent on one fixed a with a bitlength l, truth table entries that contain ¬a i (i < l) can be modified arbitrarily while maintaining the integrity of C . Algorithm 1 realizes Bit Flipping. Since a one-time pad is only secure for a single input, A has to construct a new RGC if a changes. However, B can use C and a for multiple of its own inputs b. With Bit Flipping, all balanced gates (XOR, XNOR) in C achieve indistinguishability obfuscation. Figure 1 illustrates the achieved indistinguishability of randomly flipping balanced gates. Note that truth tables shown in Figure 1a and 1b are identical, even though their generator inputs u differ. Figure 1c, 1d show the other two identical truth tables constructed from different inputs and flips. Since B can obtain two identical truth tables from a generator's value of 0 and 1, it cannot infer u from inspecting the truth table of a potentially flipped balanced gate.

12Bit Flipping does not lead to an indistinguishability obfuscation for imbalanced gates. All four combinations of randomly flipping the generator's input u and the output wire w yield distinct truth tables. Thus, even though a i is obfuscated by r i , B can infer a i by inspecting any imbalanced gate with functionality f (a i , b j ). Our following two techniques also obfuscate imbalanced gates.

Obfuscating Fixed Gates

13We define fixed gates as gates that always return the same value given the generator input a. For instance, an AND gate that takes a generator input of 0 is a fixed gate. The problem with an imbalanced gate on level 1 is that B can immediately infer A s input by observing if its output changes when changing B s input bit. A can effectively obfuscate those gates by flipping one of the output values in the truth table and adjusting child gates accordingly. This way, a fixed imbalanced gate at level 1 is indistinguishable from an unfixed one. When obfuscating a fixed gate, we break the gate's integrity, i.e., we might return a value of 1 even though its correct value is 0. The integrity of C has to be recovered to yield the correct output. Algorithm 2 identifies all fixed gates and ensures that modifying fixed gates maintains the correctness of C . Figure 2 illustrates the following examples. Consider an AND gate g at level 1 in C that depends on one input u of A and one input v of B. Suppose A's input is 1 (Figure 2a). In this case, the relevant output entries for g are 1|0|0 and 1|1|1 (left input|right input|output). A can modify the other two entries arbitrarily as they depend on a different generator input. Thus, A can obfuscate g to an XNOR gate by assigning the unused truth table entries to 0|0|1 and 0|1|0.

Examples -Obfuscating Fixed Gates

14Suppose A's input is 0 ( Figure 2b). In this case, g is a fixed gate since the two relevant entries in its recoverIntegrity(g) truth table 0|0|0 and 0|1|0 both return a 0 independent of B's input. The fixed output immediately reveals u to B if it knows the gate type. A obfuscates a fixed gate by choosing one of these entries at random and flipping its output wire. For instance, A can change the entry 0|0|0 to 0|0|1. This way, we again created a truth table indistinguishable from XNOR. We showed before that A can apply Bit Flipping to a balanced gate like XNOR to achieve indistinguishability obfuscation. Again, truth tables shown in Figure 2a and 2b are identical, even though their generator inputs u differ.

15Fixed AND gate, obfuscated. Figure 2: Obfuscated imbalanced gates on level 1. † These entries do not depend on the generator's input and can be re-assigned arbitrarily.

16One relevant entry in a fixed gate gets flipped. Adjusting the truth table transformed the child gate into a fixed gate. This gate gets obfuscated in the next iteration of algorithm 2. Figure 3a shows an AND gate g with a fixed obfuscated AND gate as its left parent. A can recover g's integrity by changing the entry 1|1|1 to 1|1|0. A just transformed g into a fixed gate that always returns 0. Thus, A can apply our obfuscation technique to this gate as well. Figure 3b shows an XOR gate with a fixed obfuscated AND gate as its left parent. A can recover its integrity by changing the entries 1|0|1 and 1|1|0 to 1|0|0 and 1|1|1. Notice that the resulting truth table is not a balanced gate. Thus, it does not provide indistinguishability obfuscation.

Obfuscating Intermediary Gates

17Some gates g i do not affect the circuit's output as all paths from g i to a final output gate g o include at least one fixed gate g f . We call these gates between the first level of the circuit and the dependant fixed gates intermediary gates.

18If A modifies an intermediary gate g i , each fixed gate's output wire may change its value due to changing the truth table of a gate it depends on. However, we know that changing an obfuscated fixed gate's value does not change the final output of C . By definition we also know that no final output gate g o directly depends on g i without a fixed gate g f between g i and g o . Thus, arbitrary modifications of intermediary gates do not break the integrity of C . Due to this property, fixed and intermediary gates are passive gates. A can modify each passive gate's truth table to be indistinguishable from its active version. At the end of Algorithm 3, all gates where ob f uscatable [g] has not been set to f alse are passive gates. Our protocol re-generates each gate on level 1 to a random balanced gate and all other passive and balanced gates to provide indistinguishability obfuscation. queue.push(p) non-intermediary gates get pushed 2.3.1 Example Figure 4 illustrates a section of a circuit with two fixed gates. Note that all paths from the unfixed gates in the section end up as an input wire of a fixed gate. Thus, all four unfixed gates in this section are intermediary gates. Modifying their truth tables may change the output of one of the fixed gates. However, this modification will not affect the output of the circuit. Properties hold for every gate type.

Constructing a CRGC

19The whole process of constructing a CRGC can be summarized as follows:

201. Obtain C and a by applying Bit Flipping to a and all gates in C using algorithm 1.

212. Identify all fixed gates and modify all children of fixed gates in C using algorithm 2.

223. Identify all intermediary gates in C using algorithm 3.

234. Obfuscate all imbalanced, fixed, and intermediary gates on level 1 randomly to XOR/XNOR. Obfuscate all passive gates in C beyond level 1 to achieve indistinguishability obfuscation.

24After these steps, an evaluator that receives C and a can evaluate C any number of times with varying inputs b. For all gates g n that do not provide indistinguishability obfuscation, B has an advantage > 0 to infer the true wire labels of g n 's parents. Thus, some of these gates may leak input bits of A. A can predict the leakage of a CRGC before constructing it and decide whether to send the CRGC that leaks some input bits or to construct a PRGC instead. PRGCs do not leak generator inputs. In the appendix, we show how A can predict input leakage of a constructed CRGC and achieve n-party computations from our CRGC scheme. We also give a step-by-step example of applying our obfuscation techniques to a circuit.

Constructing a PRGC

25After applying the three described obfuscation techniques, there is a subset of gates left in C that do not provide indistinguishability obfuscation, i.e. B might be able to infer input bits of a when inspecting those gates. Our PRGC scheme prevents B from inferring inputs when inspecting these gates by introducing non-reusable sections.

Non-reusable Sections

26Each gate that does not provide indistinguishability obfuscation has to be contained in a non-reusable section. At the start of a non-reusable section s of C , A and B engage in Oblivious Transfer (OT) for each input wire on the first level of s to let B obtain keys to be used in a Yao's Garbled Circuit protocol. A nonreusable section ends if each final output gate of the non-reusable section provides indistinguishability obfuscation. A needs to apply a new Bit Flipping to each of these output gates to hinder B from inferring inputs by evaluating the circuit multiple times. With this approach, A and B have to engage in a Yao's Garbled Circuit protocol for each non-reusable section. With the output bits obtained from Yao's Garbled Circuit protocol, B continues evaluating the circuit.

27By "refreshing" Bit Flipping at the end of a nonreusable section, all balanced gates again provide indistinguishability obfuscation. To ensure correctness, both parties need to engage in OT for each final output gate of C to let A reverse Bit Flipping applied in the non-reusable sections. Note that a simpler protocol could consist of evaluating each gate that does not provide indistinguishability obfuscation by an OT with a bit flipped result. However, if a nonreusable section spans multiple levels in the circuit, using Yao's Garbled Circuit protocol is more efficient. Figure 5 illustrates a circuit with a non-reusable section. Inputs a i mark A's inputs, inputs b i mark B's inputs. Observe that both AND gates cannot be fixed gates and reveal A's input even if obfuscated by our techniques. The final XOR gate marks the end of the non-reusable section by providing indistinguishability obfuscation. A only sends the gates in the reusable section (first level) to B. By assigning the two AND gates and the final XOR gate to a non-reusable section, B has to stop evaluating the PRGC after the first level. For each input wire of each AND gate, it has to receive an input key via OT and obtain a Yao's Garbled Circuit from A containing the remaining three gates. For each repeated evaluation of the circuit with different inputs b, it can reuse the gates on the first level of the circuit.

28PRGCs provide input privacy without leakage. A security proof of PRGCs can be found in the appendix. There, we also cover how to achieve indistinguishability obfuscation for passive gates in the reusable section. In high latency environments, it might be favorable to split C into only one reusable and one non-reusable section. This way, a PRGC can be evaluated in constant communication rounds where one batch of OTs is processed in parallel. Non-reusable Section Figure 5: A circuit containing a non-reusable section.

BENCHMARKS

29Our open-source library is available on GitHub. With our library, A can construct a CRGC from any userdefined C++ function, compress it, predict leaked input bits, and send it over the network to B. B can evaluate the CRGC and store it on its hard drive for future use. For compiling a C++ function to a boolean circuit, we mainly rely on modules provided by EMP.

30We tested our implementation on two AWS M5ZN metal instances with 24 cores, 48 threads, and 192GB of RAM connected via 100 Gbit/s network connections to the internet in a WAN setting. A can construct a CRGC at a speed of up to 85 million gates per second, perform leakage prediction with up to 115 million gates per second and evaluate a circuit with up to 395 million gates per second. For comparison, we also implemented our test programs with EMP SH2PC and TinyGarble2. Since EMP SH2PC and TinyGarble2 implement a regular garbled circuit protocol, an evaluation must always be performed together with circuit construction. In all tests, EMP performs better than TinyGarble2 and achieves a speed of up to 55 million gates per second. Thus, after only a few evaluations, our CRGC library outperforms both libraries. All CRGCs we constructed leak at most two input bits to B. We use the Turbo Pfor integer compression algorithm (Lemire et al., 2014) before sending a CRGC over a network or storing it locally. As a result, a CRGC is approx. 75% smaller in file size than the original uncompressed boolean circuit. Table 1 shows the results of applying our protocol to elementary circuits. |C| shows the number of gates in a circuit. Inputs leaked refers to the number of generator inputs a CRGC leaks. All tested basic circuits can be evaluated in under 1ms by our library.

Large Circuits

31We also tested more complex circuits that implement three real-world use cases: Finding an element in an unsorted list (query), identifying the maximum element in a specific coordinate range of a 2D array, and finding the intersect of two datasets. The resulting circuits have up to 1.9 billion gates and leak at most one input bit to B. These larger circuits demonstrate that our library is practical for real problems. Our programs may serve as references for other functionalities. Table 2 shows that our library can process a dataset containing millions of entries in just a few seconds for simple functionalities. For complex functions such as the demonstrated set intersection, it can process a few thousand elements per second. These results may serve as a rough estimation of whether CRGCs can cope with a certain problem size. Figure 6 shows the results of benchmarking our framework against EMP SH2PC and TinyGarble2. Recall that A has to perform leakage prediction only once per circuit, independent of its inputs. It has to generate a CRGC once per unique generator input a. B has to evaluate a CRGC once per changing evaluator input b. Thus, we measured all three tasks independently.

32The bars with different shades of colors show additional costs that might occur along with a CRGC component: After A constructs a CRGC, it needs to send it to B over the network (brown bar). If B does not store the circuit in memory after evaluating it, it needs to import the circuit from the hard drive again before performing an additional evaluation (green bar).

33Our benchmark shows that our library can consistently evaluate different circuits at approx. 350 million gates per second. Constructing a CRGC and sending it to B is sometimes slower than performing a regular garbled circuit protocol with EMP once. However, evaluating a CRGC is 5-20 times faster than performing a garbled circuit protocol using EMP. In all tests, using our library compared to EMP and Tiny-Garble2 pays off after less than three evaluations. Note that beyond our implementation, a generator can always construct a PRGC with only one reusable and non-reusable section. Since evaluating a CRGC is faster than evaluating a regular garbled circuit, it follows that for most circuits C, we can construct a PRGC that can be evaluated faster than performing Yao's Garbled Circuit protocol with C.

RELATED WORK

34Reusable garbled circuits have been gaining popularity in the Secure Multiparty Computation community during the last decade. (Saleem et al., 2018) summarizes and discusses recent advancements in garbled circuits. The authors state that one important future step is constructing a reusable garbled circuit scheme with low computational complexity. In contrast to our approach, existing proposals tried to build CRGCs without leakage that do not scale well. To achieve practicability, we propose a trade-off between the extent of reusability and performance (PRGC), or between security and performance (CRGC). (Goldwasser et al., 2013) proposed the first reusable garbled circuit scheme that is based on functional encryption. Functional encryption allows a user to generate secret keys that enable a key holder to learn a specific function output of encrypted data but learn nothing about the data (Boneh et al., 2011). However, their scheme relies on fully homomorphic encryption and other computationally expensive techniques to achieve functional encryption. Since then, there have been optimizations to the computational complexity of reusable garbled circuits that also rely on fully homomorphic-or attribute-based encryption (Boneh et al., 2014).

35As both prior mentioned schemes for reusable garbled circuits combine multiple complex cryptographic primitives, it is difficult to assess their efficiency. According to (Wang et al., 2017) both so-lutions are not practical. Thus, (Wang et al., 2017) constructed a reusable garbled circuit scheme with a trade-off between security and privacy. Their solution does not contain any benchmarks or implementations. (Gorbunov et al., 2015) proposed a step towards reusable garbled circuits by encrypting each garbled value with a seed. For each wire and each gate, a different encryption key is used. The evaluator obtains an encoded seed in the beginning to evaluate the circuit. However, their scheme does not achieve input privacy.

36Due to the lack of an existing reusable garbled circuit implementation, we compare our library with the alternative of constructing a new Yao's Garbled Circuit for each evaluation with a state-of-the-art framework. Multiple libraries have been proposed that implement Yao's Garbled Circuit protocol with various optimizations such as Free XOR (Kolesnikov and Schneider, 2008). Libraries that offer state-ofthe-art performance and rich functionalities are Tiny-Garble2 (Hussain et al., 2020), Obliv-C (Zahur and Evans, 2015), ABY (Demmler et al., 2015), and EMP SH2PC (Wang et al., 2016). Since (Hussain et al., 2020) demonstrated that TinyGarble2 outperforms Obliv-C and ABY, we chose EMP and Tiny-Garble2 as our benchmark.

CONCLUSION

37In this work, we proposed obfuscation-based techniques for constructing completely reusable garbled circuits (CRGCs) and partially reusable garbled circuits (PRGCs). We showed that our CRGC library can evaluate constructed circuits up to 20 times faster than current state-of-the-art garbled circuit libraries.

38CRGCs come with predictable input leakage. While we were not able to not infer multiple input bits from our test circuits, certain functionalities or more sophisticated analyses may do so. In this case, the generator and evaluator can engage in our hybrid PRGC protocol to only use a CRGC for evaluating the sections of the underlying circuit that do not pose input leakage. The remaining sub-circuits can be evaluated by Yao's Garbled Circuit protocol. Future work may introduce techniques to increase the number of gates in the reusable section or find more efficient ways to construct RGCs for n-party computation.

APPENDIX Security Proof of PRGCs

39To prove input privacy of a one-time protocol π against semi-honest adversaries one can use the following two simulation proofs (Lindell, 2017):

40Simulating A's view is trivial as it does not interact with B when constructing reusable sections. Simulating B's view is possible by constructing a PRGC with a random generator input. Using the knowledge of f 2 (x, y), the simulator can modify the Oblivious Transfers required to obtain the final output bits by always returning the correct output, independent of B s choice bit. Thus, we only need to show if, in B's view, a PRGC based on a random generator input is indistinguishable from a PRGC based on the actual generator input.

41Claim A PRGC computing an arbitrary functionality f (a, b) expressed by a circuit C for a fixed input a and an unfixed input b provides input privacy.

42Without loss of generality, assume C only consists of balanced gates (XOR, XNOR) and the following imbalanced gates: AND, NAND, OR, NOR. Assume G is a PRG that can sample a uniformly random b from U = {0, 1}. Assume that B knows every gate g in C.

43For each value v w at wire w in C, A samples a b w from U and sets v w = v w ⊕ b w . Each wire label v w is now obfuscated by a one time pad. B receives b w only for its own input bit wires. Let g be a gate in C with functionality f (v i , v j ) = v k , i, j, k < |w|. Let B receive only the last column of the truth table T g from A that contains all four combinations for f (v i , v j ) = v k . Table 3 shows a truth table after Bit Flipping. p refers to the position in the of the last column's entry in the truth table. B knows up to one input wire v c , b c (c ∈ {i, j}) of g in advance (let c = j).

44If all wires satisfy the following equation, then any two PRGCs based on different generator inputs follow the same distribution of wire labels and are thus indistinguishable from B's perspective.

45Thus, we reduce the proof that a PRGC provides input privacy against a semi-honest evaluator to equation 3 holding for all wires under said conditions. We split up the proof into four Lemmas. Proofing Lemma 1-3 shows that the reusable sections of a PRGC provide input privacy. Proofing Lemma 4 shows that nonreusable sections of a PRGC provide input privacy.

46In combination, we prove that PRGCs provide input privacy for any circuit C.

47Lemma 1 The position p of an entry v k in the truth table T g does not leak v i under the security assumptions of G. Proof: In the unmodified truth table of g, B can infer the following from p:

48After Bit Flipping B can infer the following from p:

49Since B does not hold b i , it cannot infer v i from its position p in the truth table without breaking the security assumptions of G.

50Lemma 2 A balanced gate g in the reusable section does not leak v i under the security assumptions of G. Proof: The following equation holds if g is an XOR gate:

51The following equation holds if g is an XNOR gate:

52Thus, B cannot infer v k and v i when inspecting the truth table T g of balanced gate g without breaking the security assumption of G.

53Lemma 3 An imbalanced gates g in the reusable section does not leak v i under the security assumptions of G. Proof: The following equation holds if g is an AND gate:

54(10) With a certain probability q, A replaces g by a NOR gate:

55Only v i = 1 can lead to the unique output of an AND gate (v k = 1). Only v i = 0 can lead to the unique output of a NOR gate (v k = 1). By inspecting the truth table of this term B finds identical values of v k for three cases. In the other case it can infer that v i produces the unique output of g. However, if it cannot distinguish if A replaced g before Bit Flipping it cannot infer the value of v i . Thus A s goal is to replace g with a probability q such that from B s perspective Pr[g ∈ NOR] = Pr[g ∈ AND].

56Replacing g does not maintain the integrity of C . Thus, A can only replace g if it is a passive gate. Let s be the set of possible input combinations for a where g is a passive gate. A and B can calculate p = Pr[g ∈ {passive gates}] = |s| 2 |a| . A sets the probability to replace g to:

57If q ≤ 1, A replaces g with probability q to achieve:

58If q > 1, A must not add g to the reusable section of C . With the same procedure, A can securely obfuscate NOR gates (AND gates as replacement), NAND gates (OR gates as replacement), and OR gates (NAND gates as replacement). After replacing (or not replacing) g, A applies Bit Flipping to g. By proofing Lemma 1-3, we showed that a reusable section containing only the balanced gates of C and imbalanced gates that meet the conditions above satisfies equation 3. All other gates of C are contained in a non-reusable section.

59Lemma 4 A gate g in the non-reusable section does not leak v i under the security assumptions of Yao's Garbled Circuit protocol. Proof: For each gate g in the first level of a nonreusable section s, B holds both input wires v i , v j . By engaging in two Oblivious Transfers per gate with A, B obtains two input keys per gate. A garbles the circuit s according to Yao's Garbled Circuit protocol. Yao's Garbled Circuit protocol was proven to be secure before (Lindell and Pinkas, 2009). Each final output gate of s is either also a final output gate of C or meets the conditions of a gate contained in the reusable section. In the former case, there is no difference to Yao's Garbled Circuit protocol. In the latter case, equation 3 holds as proven in lemma 1-3 .

60If A does not need to learn the output of the computation, a PRGC is secure against a malicious B when utilizing a compatible OT protocol.

Enabling n-party Computation with CRGCs

61Our CRGC protocol can be easily extended to enable n-party computation. The following steps are neccessary for 3-PC: 1. A sends C and a to party B.

622. Party B further obfuscates C and its inputs b and sends C , a , and b to party C.

633. Party C can evaluate C with a , b , and arbitrary inputs c.

64If party C wants to evaluate C with different inputs of B, the parties have to repeat steps 2-3. For different inputs of party A, they have to repeat all steps. Thus, the order of parties receiving and further obfuscating a CRGC is relevant. We can generalize this observation for n-party computation. If any party wants to evaluate the circuit with a different input of a party at position i in the receiving order, all parties at position p with i ≤ p ≤ n − 1 need to repeat obfuscation.

Predicting Leakage of a CRGC

65To predict leaked input bits of a CRGC, we have to take the evaluator's perspective when it receives C and a from A. By default, B does not know whether a gate in C is obfuscated or flipped except for a final output gate (that is never obfuscated nor flipped). However, if it knows C's exact construction, it can identify gates that are not passive or balanced with certainty. These gates do not provide indistinguishability obfuscation and may reveal input bits of A.

Potentially Fixed Gates

66First, we introduce the concept of potentially fixed gates. From B's perspective, any imbalanced gate on level 1 is a potentially fixed gate. As we showed before, we achieved indistinguishability obfuscation for all gates on level 1. However, in deeper levels of C, B may identify gates that A could not have obfuscated.

67To identify potentially fixed gates, B can use the following ruleset. It can consider all generator inputs as potentially fixed and all evaluator inputs as not potentially fixed. A balanced gate that has at least one not potentially fixed parent is not potentially fixed itself. This property holds because evaluating a balanced gate such as XOR with one fixed and one unfixed bit always returns two different output bits. An imbalanced gate instead is only not potentially fixed if both parents are not potentially fixed. This property holds because evaluating an imbalanced gate such as AND with at least one fixed bit may always return the same output bit. B can iterate through the whole circuit with this ruleset to identify all not potentially fixed gates. Algorithm 4 applies this ruleset to a CRGC.

Potentially Intermediary Gates

68Recall that intermediary gates and fixed gates provide indistinguishability obfuscation. Thus, B also needs to identify all potentially intermediary gates. If it assumes all potentially fixed gates to be fixed gates, it can identify intermediary gates by algorithm 3. As the set of fixed gates is a subset of all potentially fixed gates, B can identify all potentially intermediary gates this way. Figure 7 illustrates an exemplary section s of a circuit and shows the key modifications when using our three obfuscation techniques. Figure 7a shows the plain circuit and its inputs. For simplicity, we use only AND and XOR gates to cover one type of balanced and one type of imbalanced gates. In the example, the left parent of each gate on level 1 is always A's input, and the right parent is always B's input. Since useful realworld circuits are too large to illustrate in an example, we assume that the shown sequence of gates is only a section of a bigger circuit. Figure 7b illustrates how each gate and input bit is modified when Bit Flipping is applied. At first, A generates obfuscated inputs. The suffix (!) next to a wire value indicates that the obfuscated input is the flipped version of the original input. Bit Flipping first recovers the integrity of each gate if one of its parents got flipped. Afterward, with a probability of 1 2 , the output wire of each gate gets flipped as well. In the figure, the four values inside each gate show the output entries of the sorted truth table after the recovery step. Two columns inside a gate indicate that the gate also got flipped afterward. In this case, the values on the left show the truth table after recovering the gate's integrity, while the values on the right show the truth table after the output wire got flipped. Notice that the XOR gate with evaluator input bit b (XOR 1 ) provides indistinguishability obfuscation since B cannot distinguish XOR 1 's truth table from the one where A s input is 0 and XOR 1 is flipped.

Obfuscating Fixed Gates

69Figure 7c illustrates how fixed gates and their parents get modified after Bit Flipping is applied. The four most left values inside each gate show the truth table of each gate after Bit Flipping. obf/o indicates that a gate is fixed and shows the truth table after obfuscating it. Recall that all gates on level 1 of the circuit get obfuscated to a gate indistinguishable from XOR/XNOR. L1 indicates that an unfixed imbalanced gate gets obfuscated into a balanced gate. rec/r indicates that the child g c of a fixed gate gets modified to recover the circuit's integrity. If this modification leads to g c being fixed, it gets obfuscated afterward (indicated by o).

70Notice that after applying this obfuscation technique to all gates on level 1, each gate's truth table is indistinguishable from either XOR or XNOR. Observe that after recovering a gate's integrity, each truth table gets modified to be independent of its obfuscated parent. After recovery, any modification to the obfuscated gate does not change the output of its children. All fixed gates get modified to provide indistinguishability obfuscation.

71Obfuscating Intermediary Gates Figure 7d illustrates how intermediary gates get modified after obfuscating fixed gates. Recall that each gate g where each path from g to a final output gate g o contains a fixed gate g f is an intermediary gate. A can modify these gates to achieve indistinguishability obfuscation without breaking the circuit's integrity. The four most left values inside each gate show the truth table of each gate after obfuscating fixed gates.obf indicates that this intermediary gate gets obfuscated. Since the final gate of s in this example is an obfuscated fixed gate, all other gates are intermediary gates. Thus, A can obfuscate all gates to provide indistinguishability obfuscation. After applying our obfuscation techniques to the whole circuit, A can send C and a to B. Codebase: https://github.com/chart21/CRGC

참고문헌

참고문헌 정보가 없습니다.