tation x = (condition)? a : b means that x is assigned
the value a when condition = true and b otherwise.
Logical values f alse,true and bit values 0, 1 are
encoded as 0
F
and 1
F
, respectively. F can be either
Z
q
or a small binary field F
2
m
. This encoding allows
efficient secure evaluation of Boolean functions using
secure arithmetic in F (Catrina and de Hoogh, 2010a).
We denote JaK ∧JbK = JaKJbK = Ja∧bK (AND) , JaK ∨
JbK = JaK + JbK −JaKJbK = Ja ∨bK (OR) and JaK ⊕
JbK = JaK + JbK −2JaKJbK = Ja ⊕bK (XOR).
Signed integer types are defined as Z
hki
= {¯x ∈
Z | ¯x ∈ [−2
k−1
,2
k−1
−1]}. They are encoded in Z
q
by the function fld : Z
hki
7→ Z
q
, fld( ¯x) = ¯x mod q, for
a prime q > 2
k+κ
, where κ is the security parameter
(similar to two’s complement encoding). This method
enables efficient secure integer arithmetic using se-
cure arithmetic in Z
q
: for any ¯x
1
, ¯x
2
∈ Z
hki
and ∈
{+,−, ·}, we have ¯x
1
¯x
2
= fld
−1
(fld( ¯x
1
) fld( ¯x
2
));
also, if ¯x
2
| ¯x
1
then ¯x
1
/ ¯x
2
= fld
−1
(fld( ¯x
1
) ·fld( ¯x
2
)
−1
).
Signed fixed-point types are sets of rational num-
bers defined as Q
FX
hk, f i
= {˜x ∈ Q| ˜x = ¯x2
−f
, ¯x ∈ Z
hki
},
for f < k. They are obtained by sampling at 2
−f
in-
tervals the range of real numbers [−2
k−f −1
,2
k−f −1
−
2
−f
]. The value 2
−f
is the resolution of the fixed-
point type. Q
FX
hk, f i
is mapped to Z
hki
by the function
int : Q
FX
hk, f i
7→ Z
hki
, ¯x = int
f
( ˜x) = ˜x2
f
and encoded in
Z
q
as described above. Secure multiplication and di-
vision of fixed-point numbers require q > 2
2k+κ
.
Floating-point numbers ˆx ∈ Q
FL
hl,gi
are tuples
h¯v, ¯p,s,zi, where ¯v ∈ [2
`−1
,2
`
−1] ∪{0} is the un-
signed, normalized significand, ¯p ∈ Z
hgi
is the signed
exponent, s = ( ˆx < 0)? 1 : 0, and z = ( ˆx = 0)? 1 : 0.
The value of the number is ˆx = (1−2s)· ¯v ·2
¯p
. If ˆx = 0
then z = 1, ¯v = 0, and ¯p = −2
g−1
. This encoding of
ˆx = 0 simplifies secure addition with minimal nega-
tive effects on other operations. The integer signifi-
cand and exponent are encoded as described above.
The parameters k, f , ` and g are not secret. The
protocols work for any setting of these parameters that
satisfies the type definitions. The applications usually
need k ∈[32,128], k = 2 f , ` ∈ [24,64] and g ∈[8,15],
depending on range and accuracy requirements.
The floating-point protocols are constructed using
a subset of the building blocks introduced in (Cat-
rina and de Hoogh, 2010a; Catrina and Saxena, 2010),
enhanced by optimizations added in (Catrina, 2018).
All building blocks rely on the secure computation
model described above for their own security and se-
cure composition. We summarize in the following
their functionality and the optimizations
1
. Table 2
lists their online and precomputation complexity.
1
Further details are available in the Appendix.
Multiplication and Inner Product. Standard mul-
tiplication of Shamir-shared field elements requires an
interaction. However, this interaction can be avoided
in some cases. Denote JxK
u,i
the share of x owned by
P
i
, for a random polynomial of degree u; the default
value of the degree is t. The multiplication proto-
col computes JcK ← JaKJbK as follows (Cramer et al.,
2015): for all i ∈ [1, n], P
i
locally computes JaK
i
JbK
i
;
the result is JcK
2t,i
, a share of c for a non-random poly-
nomial of degree 2t (product of the polynomials used
to share a and b); then, P
i
shares the value JcK
2t,i
by
sending to the others JJcK
2t,i
K
j
, for j ∈ [1, n], j 6= i; fi-
nally, P
i
computes its own share JcK
i
from the received
shares, by Lagrange interpolation.
A first optimization applies to multiplications fol-
lowed by additive hiding: d ← Reveal(JaKJbK + JrK).
With standard protocols, this computation needs 2
rounds. We can avoid the first round by locally ran-
domizing the share products: for all i ∈ [1,n], party i
computes JcK
2t,i
←JaK
i
JbK
i
+ J0K
2t,i
, where J0K
2t,i
are
pseudo-random shares of 0 generated with PRZS(2t)
(Cramer et al., 2005). We denote JaK ∗JbK this local
operation. The computation can now be completed
with a single interaction: d ← RevealD(JaK ∗JbK +
JrK), where RevealD is the secret reconstruction pro-
tocol for polynomials of degree 2t.
This situation occurs very often. In particular,
many of the protocols discussed below use additive
hiding of the input. We add variants of these protocols
for input shared with a random polynomial of degree
2t, and distinguish them by the suffix ’D’. The differ-
ence is that they use RevealD instead of Reveal.
Another optimization is used to compute the in-
ner product of two vectors, JcK ←
∑
m
k=1
Ja
k
KJb
k
K, in
the protocol InnerProd: the parties locally compute
the inner product of their own shares and re-share the
result. Thus, InnerProd needs a single interaction (in-
stead of m interactions). If InnerProd is followed by
additive hiding of its output, we can also use the pre-
vious optimization. We call InnerProdD a variant that
locally computes JcK
2t,i
←
∑
m
k=1
Ja
k
K
i
Jb
k
K
i
+ J0K
2t,i
.
Multiplication and Division by 2
m
. The floating-
point arithmetic protocols are built using a small set
of related protocols that efficiently compute
¯
b = ¯a ·2
m
and ¯c ≈ ¯a/2
m
, for secret ¯a,
¯
b, ¯c ∈ Z
hki
and public or
secret integer m ∈[0,k −1].
If m is public we compute ¯a ·2
m
without interac-
tion. To compute ¯a/2
m
, we use the protocols Div2m
and Div2mP, introduced in (Catrina and de Hoogh,
2010a; Catrina and Saxena, 2010). Div2m rounds
to −∞ and Div2mP rounds probabilistically to the
nearest integer. We denote their outputs b¯a/2
m
c
and b¯a/2
m
e, respectively. Div2mP computes ¯c =
Efficient Secure Floating-point Arithmetic using Shamir Secret Sharing
51