Optimizing MPC for robust and scalable integer and floating-point arithmetic
Liisi Kerik* Peeter Laud* Jaak Randmets*†
* Cybernetica AS † University of Tartu, Institute of Computer Science
January 30, 2016
Optimizing MPC for robust and scalable integer and floating-point - - PowerPoint PPT Presentation
Optimizing MPC for robust and scalable integer and floating-point arithmetic Liisi Kerik * Peeter Laud * Jaak Randmets * * Cybernetica AS University of Tartu, Institute of Computer Science January 30, 2016 Introduction Secure
Liisi Kerik* Peeter Laud* Jaak Randmets*†
* Cybernetica AS † University of Tartu, Institute of Computer Science
January 30, 2016
education and income records.
robust.
1/15
2/15
v = (v1 + v2 + v3) mod N .
wi = ui + vi mod N .
this representation.
3/15
x = (−1)s · f · 2e
number with 0 bits before radix point.
IEEE float).
4/15
i=1) multiplies point-wise.
5/15
polynomials: sqrt, sin, exp, ln, erf.
additions are expensive due to private shifts. Fixed-point polynomials can be computed much faster.
64-bit fixed-point number:
6/15
Relative errors of inverse and square root Old New inv32 1.3 · 10−4 2.69 · 10−9 inv64 1.3 · 10−8 7.10 · 10−19 sqrt32 5.1 · 10−6 4.92 · 10−9 sqrt64 4.1 · 10−11 1.30 · 10−15
7/15
be of any size.)
then instead of interpolating f(x) in range [2−nk, 2−n(k + 1)) we interpolate f(2−n(x + k)) in range [0, 1). Smaller coefficients and better precision.
Gets rid of denormalized results and overflows.
(extend, multiply, cut), we extend the argument sufficiently in the beginning and later only perform multiplications and cuts.
the terms, we add the terms and then cut.
8/15
Data: x (0 bits before, n bits after radix point) Result: { xi}k
i=1 (n′ + n bits before, n bits after radix point) 1 if k = 0 then 2
return {}
3 else 4
l ← ⌈log2 k⌉
5
x1 ← Extend( x, n′ + (l + 1)n)
6
for i ← 0 to l − 1 do
7
{ xj}2i+1
j=2i+1 ← MultArr(
x2i, { xj}2i
j=1) 8
for j ← 1 to 2i+1 do in parallel
9
xj ← Cut( xj, n)
10
return { xi}k
i=1
9/15
Data: x (0 bits before, n bits after radix point), { ci}k
i=0
(n′ + n bits before, n bits after radix point, highest n bits empty) Result: Sum({ ci · xi}k
i=0) (0 bits before, n bits after radix
point)
1 {
xi}k
i=1 ← PowArr(
x, k, n, n′)
2
z0 ← Share( c0)
3 for i ← 1 to k do in parallel 4
ci · xi
5 for i ← 0 to k do in parallel 6
i ← Trunc(
zi, n′)
7 return Cut(Sum({
z′
i}k i=0), n)
10/15
sin (π/2 − x) = sin (π/2 + x).
11/15
f ∈ [0.5, 1) ⇒ log4 f + 1 ∈ [0.5, 1).
different polynomials.)
addition.
12/15
Algorithm 1: Resharing protocol. Data: Shared values u ∈ R Result: Shared value w ∈ R such that u = w.
1 All parties Pi perform the following: 2
r ← R
3
Send r to Pp(i)
4
Receive r′ from Pn(i)
5
wi ← ui + (r − r′)
6 return w
inputs and outputs
14/15
it to some other party.
15/15
Algorithm 2: Multiplication protocol. Data: Shared values u, v ∈ R Result: Shared value w ∈ R such that u · v = w.
1 u ← Reshare(u) 2 v ← Reshare(v) 3 All parties Pi perform the following: 4
Send ui and vi to Pn(i)
5
Receive up(i) and vp(i) from Pp(i)
6
wi ← ui · vi + up(i) · vi + ui · vp(i)
7 w ← Reshare(w) 8 return w
16/15
1 2 3 ×2 ×3 ×2 ×3 ×2 ×3
17/15
1 2 3 ×2 ×3 ×2 ×3 ×2 ×3
17/15
Algorithm 3: Symmetric multiplication protocol. Data: Shared values u, v ∈ R Result: Shared value w ∈ R such that u · v = w.
1 u ← Reshare(u) 2 v ← Reshare(v) 3 All parties Pi perform the following: 4
Send ui to Pn(i) and vi to Pp(i)
5
Receive up(i) from Pp(i) and vn(i) from Pn(i)
6
wi ← ui · vi + up(i) · vi + up(i) · vn(i)
7 w ← Reshare(w) 8 return w
18/15
1 2 3
19/15
up to 1000 repeats.
20/15