myl7/fss 2.0.0
Function secret sharing (FSS) primitives including distributed point/comparison function (DPF/DCF)
Loading...
Searching...
No Matches
HasGen8 Concept Reference

Optional eight-seed batch extension of Prgable. More...

Concept definition

template<typename Prg, int mul>
concept HasGen8 = Prgable<Prg, mul> && requires(Prg prg, cuda::std::span<const int4, 8> seeds) {
{ prg.Gen8(seeds) } -> std::same_as<cuda::std::array<cuda::std::array<int4, mul>, 8>>;
}
Optional eight-seed batch extension of Prgable.
Definition prg.cuh:82
Pseudorandom generator (PRG) interface.
Definition prg.cuh:24

Detailed Description

Optional eight-seed batch extension of Prgable.

Gen8() borrows eight seeds through cuda::std::span<const int4, 8>. Custom PRGs opt in by providing Gen8(seeds). No registration, inheritance, or specialization is required. Full-domain host evaluators use this method when available and otherwise call Gen() eight times.

The result is indexed as [seed_index][output_index]. For every j in [0, 8), Gen8(seeds)[j] must equal Gen(seeds[j]) from the same PRG configuration. This semantic requirement is the implementer's responsibility. Gen8() must be callable on the host for host batch evaluation.

Host-side full-domain evaluation of Dcf and Dpf expands eight seeds per call. It calls Gen8() when the PRG provides it and calls Gen() eight times otherwise. Dmpf takes the same path through its inner Dpf when bucket_bits is at least 6. Point evaluation, key generation, and GPU evaluation never call Gen8().

Gen8() can help when the backend expands eight seeds faster than the generic eight-call fallback does. For the library's Aes128MmoRaw on one x86 host with one thread, Gen8() made Dcf's full-domain evaluation faster. It made no difference to Dpf's that the measurement could separate from its own bias.

Gen8() must return the same blocks as eight calls to Gen() on the same seeds. A backend can test this requirement on the host by comparing Gen8(seeds)[j] with Gen(seeds[j]) for every j in [0, 8), using multiple seed batches. A mismatch can make evaluators that select Gen8() disagree with point evaluation without an error.

Template Parameters
PrgUser-provided or library-provided PRG type.
mulSeed expansion factor, as in Prgable.