myl7/fss 1.1.0
Function secret sharing (FSS) primitives including distributed point/comparison function (DPF/DCF)
Loading...
Searching...
No Matches
fss::cuckoo_hash::Compact< Prp, In, kappa > Struct Template Reference

Compact Cuckoo hashing (Algorithm 4 from the paper). More...

Public Member Functions

int Run (std::span< const In > as, int m, int4 sigma, __uint128_t n, int b_size, int ch_retry, std::span< std::pair< int, int > > table)
 Run Cuckoo hashing to place elements into a table.
 

Public Attributes

Prp prp
 

Detailed Description

template<typename Prp, typename In, int kappa = 3>
requires Permutable<Prp>
struct fss::cuckoo_hash::Compact< Prp, In, kappa >

Compact Cuckoo hashing (Algorithm 4 from the paper).

Inserts elements into m buckets using kappa hash functions via Cuckoo hashing with random walk eviction.

Template Parameters
PrpPRP type satisfying Permutable.
InInput domain type (unsigned integer up to __uint128_t).

Member Function Documentation

◆ Run()

template<typename Prp , typename In , int kappa = 3>
int fss::cuckoo_hash::Compact< Prp, In, kappa >::Run ( std::span< const In >  as,
int  m,
int4  sigma,
__uint128_t  n,
int  b_size,
int  ch_retry,
std::span< std::pair< int, int > >  table 
)
inline

Run Cuckoo hashing to place elements into a table.

Each table entry stores (index_into_as, hash_fn_k), or (-1, -1) if empty.

Parameters
asInput elements.
mNumber of buckets.
sigmaPRP seed.
nDomain size (N = 2^{in_bits}).
b_sizeBucket size B.
ch_retryMax eviction attempts before failure.
tablePre-allocated span of size m. Filled on success.
Returns
0 on success, 1 on failure (too many evictions).

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