Problem in softspoken_ote
maths644311798 opened this issue · 5 comments
In softspoken_ote.cc, I do not understand the algorithm in inline void XorReduce(uint64_t k, absl::Span<uint128_t> inout)
. How does it work? To be concrete, inout
represent elements in XorReduce
compute
@maths644311798
Please wait, answer @liang-xiaojian is currently in progress
Hi, @maths644311798
Form your comments, I extract three questions as below,
(1) What is
(2) What is the connection between XorReduce
and
(3) How does SoftspokenOte work?
What is
$p$ and$\ell$ in SoftspokenOte
It's better to understand the correlation between subfield VOLE
and COT
.
As described in PCG19 section 2.3, the functionality for subfield VOLE over
Here comes a problem:
- As mentioned in PCG19 footnote 9, the elements of
$\mathbb F_p$ could be embedded into$\mathbb F_q$ , then we could treat$x \cdot \mathbf u$ as the multiplication over$\mathbb F_q$ . - The element over
$\mathbb F_q = \mathbb F_{p^r}$ could be viewed as a vector over$\mathbb F_p^r$ , then$x \cdot \mathbf u$ could be treated as the tensor product over$\mathbb F_q$ . For example,$x \cdot \mathbf u = \mathbf x \otimes \mathbf u \in \mathbb F_p^{r \times \ell}$ . (PCG19 section 2.3)
In other words, subfield VOLE would pass
In the case that
$\forall i \in [k] ,\forall j \in [\ell], w_{i,j} = x_i \cdot u_j + v_{i,j}$ $\forall j \in [\ell], \mathbf w_{\star,j} = \mathbf x \cdot u_j + \mathbf v_{\star,j}$
Supposed that we view COT
, COT
,
Thus, a subfield VOLE
with length COTs
with length
As a result, in SoftspokenOte, COT
.
What is the connection between
XorReduce
and$\sum x \cdot inout[x]$ ?
Obviously,
It can be visualized as a k-depth full binary tree where the leaves are the inout
vectors. Then (k-i)-level
.
Easily, we could perform addition to pairs of elements at each level of the tree and effectively "reduce" the tree (that is how XorReduce
works)
Then, we could learn that inout[1 << i]
is equal to inout[0]
is
how does SoftspokenOte work?
To gain insight into SoftspokenOte
protocol, it is recommended to review the talk delivered by Lawrence Roy in TPMPC2022.
l <= 128
? inout[i]
is a variable of type uint128_t
.
Now the main obstruction of understanding your picture about XorReduce
is the code inout[i + depth] = inout[i + stride];
in line 130.
inout[i]
is a variable of typeuint128_t
OTs
.
In our implementation (INKP or Softspoken), we define kBatchSize = 128
, then set batch_num
as
Thus, XorReduce
or GenSfVole
would process the data in batches with size 128 (uint128_t
).
inout[i + depth] = inout[i + stride]
As described in line 125, stride = static_cast<uint64_t>(1) << (depth - 1);
.
As a result, it would move the element in inout[1<<i]
to inout[i+1]
which means inout[1], ... , inout[k]
are
Thanks, I understand the implementation of softspoken_ote now. :)