myl7/fss 1.1.0
Function secret sharing (FSS) primitives including distributed point/comparison function (DPF/DCF)
Loading...
Searching...
No Matches
fss::Vdmpf< in_bits, max_points, bucket_bits, Group, Prg, XorHash, Hash, Prp, In, kappa, ch_lambda > Class Template Reference

2-party VDMPF scheme. More...

Classes

struct  BucketKey
 Per-bucket key containing the inner VDPF key data. More...
 
struct  Key
 VDMPF key for one party. More...
 

Public Types

using InnerVdpf = Vdpf< bucket_bits, Group, Prg, XorHash, Hash, uint >
 

Public Member Functions

int Gen (Key &k0, Key &k1, int4 sigma, cuda::std::span< const cuda::std::array< int4, 2 >, m > s0s, std::span< const In > as, std::span< const int4 > b_bufs, int t, int ch_retry=1000)
 Key generation method.
 
void BatchEval (bool b, const Key &key, std::span< const In > xs, std::span< int4 > ys, cuda::std::array< int4, 4 > &pi)
 Batch verifiable evaluation method.
 

Static Public Member Functions

static bool Verify (cuda::std::span< const int4, 4 > pi0, cuda::std::span< const int4, 4 > pi1)
 Verification method.
 

Public Attributes

Prg prg
 
XorHash xor_hash
 
Hash hash
 
Prp prp
 

Static Public Attributes

static constexpr int m = cuckoo_hash::ChBucket(max_points, ch_lambda)
 
static constexpr __uint128_t n = __uint128_t(1) << in_bits
 
static constexpr int b_size
 

Detailed Description

template<int in_bits, int max_points, int bucket_bits, typename Group, typename Prg, typename XorHash, typename Hash, typename Prp, typename In = uint, int kappa = 3, int ch_lambda = 80>
requires ((std::is_unsigned_v<In> || std::is_same_v<In, __uint128_t>) && in_bits <= sizeof(In) * 8 && Groupable<Group> && Prgable<Prg, 2> && XorHashable<XorHash> && Hashable<Hash> && Permutable<Prp>)
class fss::Vdmpf< in_bits, max_points, bucket_bits, Group, Prg, XorHash, Hash, Prp, In, kappa, ch_lambda >

2-party VDMPF scheme.

Template Parameters
in_bitsInput domain bit size.
max_pointsMaximum number of point functions. Must be >= 30. Sizes arrays at compile time.
bucket_bitsBit size of the inner VDPF domain (per bucket).
GroupType for the output domain. See Groupable.
PrgSee Prgable.
XorHashSee XorHashable. Paper's \(H\): maps \((x, s)\) to \(4\lambda\) bits.
HashSee Hashable. Paper's \(H'\): maps \(4\lambda\) bits to \(2\lambda\) bits.
PrpSee Permutable. Used for Cuckoo hashing.
InType for the input domain. From uint8_t to __uint128_t.
kappaNumber of Cuckoo hash functions. 3 is good enough for all practical use cases (Lemma 5 and Remark 1 of the paper).
ch_lambdaCuckoo-hashing security parameter in bits. Controls the failure probability of Cuckoo hashing: inserting t elements fails with probability at most \(2^{-\text{ch\_lambda}}\).

Member Function Documentation

◆ BatchEval()

template<int in_bits, int max_points, int bucket_bits, typename Group , typename Prg , typename XorHash , typename Hash , typename Prp , typename In = uint, int kappa = 3, int ch_lambda = 80>
void fss::Vdmpf< in_bits, max_points, bucket_bits, Group, Prg, XorHash, Hash, Prp, In, kappa, ch_lambda >::BatchEval ( bool  b,
const Key key,
std::span< const In >  xs,
std::span< int4 >  ys,
cuda::std::array< int4, 4 > &  pi 
)
inline

Batch verifiable evaluation method.

Evaluates the VDMPF key on a batch of input points and produces output shares and a proof.

Parameters
bParty index. False for 0 and true for 1.
keyThis party's key.
xsInput points to evaluate.
ysOutput shares (pre-allocated, size >= xs.size()). Will be zero-initialized.
piProof output.

◆ Gen()

template<int in_bits, int max_points, int bucket_bits, typename Group , typename Prg , typename XorHash , typename Hash , typename Prp , typename In = uint, int kappa = 3, int ch_lambda = 80>
int fss::Vdmpf< in_bits, max_points, bucket_bits, Group, Prg, XorHash, Hash, Prp, In, kappa, ch_lambda >::Gen ( Key k0,
Key k1,
int4  sigma,
cuda::std::span< const cuda::std::array< int4, 2 >, m >  s0s,
std::span< const In >  as,
std::span< const int4 >  b_bufs,
int  t,
int  ch_retry = 1000 
)
inline

Key generation method.

Parameters
k0Key output for party 0.
k1Key output for party 1.
sigmaPRP seed. Users can randomly sample it.
s0sm pairs of initial seeds for inner VDPFs. Users can randomly sample them.
asAlpha values of t point functions.
b_bufsCorresponding beta values. Will be clamped.
tActual number of points (<= max_points).
ch_retryMax Cuckoo hash eviction attempts.
Returns
0 on success, 1 on failure (Cuckoo hash or inner VDPF Gen failed).

◆ Verify()

template<int in_bits, int max_points, int bucket_bits, typename Group , typename Prg , typename XorHash , typename Hash , typename Prp , typename In = uint, int kappa = 3, int ch_lambda = 80>
static bool fss::Vdmpf< in_bits, max_points, bucket_bits, Group, Prg, XorHash, Hash, Prp, In, kappa, ch_lambda >::Verify ( cuda::std::span< const int4, 4 >  pi0,
cuda::std::span< const int4, 4 >  pi1 
)
inlinestatic

Verification method.

Returns
True if proofs match (Accept), false otherwise (Reject).

Member Data Documentation

◆ b_size

template<int in_bits, int max_points, int bucket_bits, typename Group , typename Prg , typename XorHash , typename Hash , typename Prp , typename In = uint, int kappa = 3, int ch_lambda = 80>
constexpr int fss::Vdmpf< in_bits, max_points, bucket_bits, Group, Prg, XorHash, Hash, Prp, In, kappa, ch_lambda >::b_size
staticconstexpr
Initial value:
=
static_cast<int>((static_cast<__uint128_t>(n) * kappa + m - 1) / m)

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