2-party DCF scheme over F2 from the packed Half-Tree DPF (Grotto construction).
More...
|
| void | Gen (cuda::std::span< int4 > cws, cuda::std::span< const int4, 2 > s0s, In a, size_t stride=1) |
| | Key generation method for split Cws.
|
| bool | Eval (bool b, int4 s0, cuda::std::span< const int4 > cws, In x, size_t stride=1) |
| | Evaluation method for split Cws, see "Evaluation" in the file details.
|
| void | Preprocess (bool b, int4 s0, cuda::std::span< const int4 > cws, int4 blocks[], bool p[], int par_depth=0, size_t stride=1) |
| | Build packed leaves and their parity tree from split Cws.
|
| OwnedPackedParityTree< HalfTreeGrottoDcf > | PreprocessOwned (bool b, int4 s0, cuda::std::span< const int4 > cws, int par_depth=0, size_t stride=1) |
| | Allocate and populate packed leaves and their parity tree from split Cws.
|
| void | EvalAll (bool b, int4 s0, cuda::std::span< const int4 > cws, bool ys[], int par_depth=0, size_t stride=1) |
| | Evaluate all comparison shares from split Cws on the host.
|
template<int frontier_depth = 16, int threads_per_block = 256>
requires (kDepth < sizeof(size_t) * 8) |
| cudaError_t | PreprocessGpu (bool b, int4 s0, cuda::std::span< const int4 > cws, cuda::std::span< int4 > blocks, cuda::std::span< bool > tree, cudaStream_t stream=0, size_t stride=1) const |
| | Build packed leaves and their parity tree on the GPU from split Cws.
|
template<int frontier_depth = 16, int threads_per_block = 256>
requires (in_bits < sizeof(size_t) * 8) |
| cudaError_t | EvalAllGpu (bool b, int4 s0, cuda::std::span< const int4 > cws, cuda::std::span< bool > ys, cudaStream_t stream=0, size_t stride=1) const |
| | Evaluate all comparison shares on the GPU from split Cws.
|
template<int in_bits, typename Hash, typename In = uint>
requires (ValidForInputBits<In, in_bits> &&
CcrHashable<Hash>)
class fss::HalfTreeGrottoDcf< in_bits, Hash, In >
2-party DCF scheme over F2 from the packed Half-Tree DPF (Grotto construction).
- Template Parameters
-
| in_bits | Input domain bit size. Must exceed 7, the levels a 1-bit output block covers. |
| Hash | Unary CCR hash backend. See CcrHashable and PackedHalfTreeDpf. |
| In | Type for the input domain. From uint8_t to __uint128_t. |
Gen() and scalar Eval() are callable from host and device when the backend supports the execution space and all accessed storage is accessible there. Preprocess() and both EvalAll() overloads are host operations. For N = 2^in_bits and B = N/128, preprocessing stores B packed leaf blocks and a parity tree of 2*B-1 bool entries over whole blocks. Tree queries use O(kDepth) XOR operations and no hash calls. Raw scalar Eval() and the leaf-prefix route can give different individual shares. Both parties must use the same route. Raw EvalAll() and preprocessed evaluation use the same leaf-prefix route and give identical shares.
template<int in_bits, typename Hash, typename In>
requires (in_bits < sizeof(size_t) * 8)
template<int frontier_depth, int threads_per_block>
requires (in_bits < sizeof(size_t) * 8)
| cudaError_t fss::HalfTreeGrottoDcf< in_bits, Hash, In >::EvalAllGpu |
( |
bool | b, |
|
|
int4 | s0, |
|
|
cuda::std::span< const int4 > | cws, |
|
|
cuda::std::span< bool > | ys, |
|
|
cudaStream_t | stream = 0, |
|
|
size_t | stride = 1 ) const |
|
inline |
Evaluate all comparison shares on the GPU from split Cws.
Follows the leaf-prefix route, as in the Cw form. Per-party shares are not comparable across routes.
Expands packed blocks, unpacks their bits, and scans their prefix XOR. Layer l is read from cws[l*stride] and the packed-output correction word from cws[kDepth*stride]. The host instance passes its hash value and instance seed to the packed evaluator. Referenced backend resources must already be device-accessible. Packed-block and CUB scan scratch are allocated and released on stream. No backend upload, deep copy, synchronization, or event management occurs.
- Parameters
-
| b | Party index. |
| s0 | This party's seed, passed by value. |
| cws | Device correction words, layer l at index l*stride. |
| ys | Device output of at least 2^in_bits bool entries, in input order. |
| stream | Stream used for evaluation, scanning, and temporary storage. |
| stride | Positive stride between Cw entries. |
- Precondition
- stride > 0 and cws holds at least kDepth*stride+1 elements.
-
Buffers and backend resources remain valid until queued work completes.
- Returns
- The first immediate CUDA failure, including allocation or release. Invalid buffers/counts return cudaErrorInvalidValue. Work is asynchronous.
template<int in_bits, typename Hash, typename In>
requires (in_bits < sizeof(size_t) * 8)
template<int threads_per_block>
requires (in_bits < sizeof(size_t) * 8)
Evaluate all comparison shares from device packed leaves.
Unpacks blocks and scans their prefix XOR without hash calls. The parity entries pt.p are not read. Scan scratch is allocated and released on stream.
- Template Parameters
-
| threads_per_block | Power-of-two unpack block size in [1,1024], default 256. |
- Parameters
-
| pt | Borrowed view with at least 2^kDepth device packed blocks. |
| ys | Device output of at least 2^in_bits bool entries, disjoint from pt.blocks. |
| stream | Stream used for unpacking, scanning, and temporary storage. |
- Precondition
- Input and output buffers remain valid until queued work completes.
- Returns
- The first immediate CUDA failure, including allocation or release. Invalid buffers/counts return cudaErrorInvalidValue. Work is asynchronous.