myl7/fss 1.1.0
Function secret sharing (FSS) primitives including distributed point/comparison function (DPF/DCF)
Loading...
Searching...
No Matches
fss::GrottoDcf< in_bits, Prg, In, par_depth > Class Template Reference

2-party DCF scheme over F2 from standard DPF (Grotto construction). More...

Classes

struct  ParityTree
 Parity segment tree over leaf control bits. More...
 

Public Types

using Cw = typename DpfType::Cw
 

Public Member Functions

void Gen (Cw cws[], const int4 s0s[2], In a)
 Key generation method.
 
void Preprocess (ParityTree &pt, int4 s0, const Cw cws[])
 Preprocess: expand DPF tree and build parity segment tree.
 
void EvalAll (bool b, int4 s0, const Cw cws[], bool ys[])
 Full domain evaluation.
 

Static Public Member Functions

static bool Eval (const ParityTree &pt, In x)
 Prefix-parity query on the parity segment tree.
 

Public Attributes

Prg prg
 

Detailed Description

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_bitsInput domain bit size.
PrgSee Prgable. Must satisfy Prgable<Prg, 2> (same as DPF).
InType 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.

Member Function Documentation

◆ Eval()

template<int in_bits, typename Prg , typename In = uint, int par_depth = -1>
static bool fss::GrottoDcf< in_bits, Prg, In, par_depth >::Eval ( const ParityTree pt,
In  x 
)
inlinestatic

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
ptParityTree from Preprocess().
xQuery point.
Returns
bool share such that share_0 XOR share_1 = 1[alpha <= x].

◆ EvalAll()

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
bParty index.
s0Initial seed of the party.
cwsCorrection words from Gen().
ysPre-allocated output array of size N = 2^in_bits. ys[x] = party b's share of 1[alpha <= x].

◆ Gen()

template<int in_bits, typename Prg , typename In = uint, int par_depth = -1>
void fss::GrottoDcf< in_bits, Prg, In, par_depth >::Gen ( Cw  cws[],
const int4  s0s[2],
In  a 
)
inline

Key generation method.

Delegates to Dpf::Gen with beta=0.

Parameters
cwsPre-allocated array of Cw. Size must be in_bits + 1.
s0s2 initial seeds. Users can randomly sample them.
aThe secret comparison threshold.

The key for party i consists of cws + s0s[i].

◆ Preprocess()

template<int in_bits, typename Prg , typename In = uint, int par_depth = -1>
void fss::GrottoDcf< in_bits, Prg, In, par_depth >::Preprocess ( ParityTree pt,
int4  s0,
const Cw  cws[] 
)
inline

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
ptParityTree 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.
s0Initial seed of the party.
cwsCorrection words from Gen().

The documentation for this class was generated from the following file: