template<int in_bits, typename Prg, typename In = uint, int par_depth = -1>
requires ((std::is_unsigned_v<In> || std::is_same_v<In, __uint128_t>) && in_bits <= sizeof(In) * 8 &&
Prgable<Prg, 2>)
class fss::GrottoDcf< in_bits, Prg, In, par_depth >
2-party DCF scheme over F2 from standard DPF (Grotto construction).
- Template Parameters
-
| in_bits | Input domain bit size. |
| Prg | See Prgable. Must satisfy Prgable<Prg, 2> (same as DPF). |
| In | Type for the input domain. From uint8_t to __uint128_t. |
| par_depth | -1 is to use ceil(log(num of threads)). Only Preprocess() and EvalAll() use it. |
template<int in_bits, typename Prg , typename In = uint, int par_depth = -1>
Prefix-parity query on the parity segment tree.
Returns party b's share of 1[alpha <= x]. Internally queries endpoint e = x + 1, computing prefix-parity of [0, e).
- Parameters
-
- Returns
- bool share such that share_0 XOR share_1 = 1[alpha <= x].
template<int in_bits, typename Prg , typename In = uint, int par_depth = -1>
| void fss::GrottoDcf< in_bits, Prg, In, par_depth >::EvalAll |
( |
bool |
b, |
|
|
int4 |
s0, |
|
|
const Cw |
cws[], |
|
|
bool |
ys[] |
|
) |
| |
|
inline |
Full domain evaluation.
Computes party b's share of 1[alpha <= x] for all x in [0, N).
Phase 1: O(N) PRG calls to expand the tree. Phase 2b: O(N) prefix-sum (running XOR) over leaf control bits.
- Parameters
-
| b | Party index. |
| s0 | Initial seed of the party. |
| cws | Correction words from Gen(). |
| ys | Pre-allocated output array of size N = 2^in_bits. ys[x] = party b's share of 1[alpha <= x]. |
template<int in_bits, typename Prg , typename In = uint, int par_depth = -1>
Preprocess: expand DPF tree and build parity segment tree.
Phase 1: O(N) PRG calls to expand the tree and extract leaf control bits. Phase 2a: O(N) XOR operations to build the parity segment tree bottom-up.
- Parameters
-
| pt | ParityTree with p pre-allocated to size 2*N-1 where N = 2^in_bits. pt.b must be set to the party index before calling. |
| s0 | Initial seed of the party. |
| cws | Correction words from Gen(). |