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

Small-domain AES-128 Feistel PRP for Cuckoo hashing. More...

Public Member Functions

 Aes128Feistel ()
 Construct with a new OpenSSL cipher context.
 Aes128Feistel (const Aes128Feistel &)
 Copy by creating a new OpenSSL cipher context.
__uint128_t Permu (int4 seed, __uint128_t x, __uint128_t domain)
 Small-domain PRP on [0, domain) using 4-round Feistel + cycle-walking.

Detailed Description

Small-domain AES-128 Feistel PRP for Cuckoo hashing.

This backend is host-only because it uses OpenSSL. It satisfies Permutable and is intended for VDMPF setup paths that need a permutation over a compact integer domain. All special members and Permu() are __host__ __device__, so pure host use of schemes that hold a Prp by value builds without execution-space warnings. Device use of any of them, e.g. calling Permu() or copying the object in a kernel, fails to build with an unresolved-extern error that names fss_host_only_Aes128Feistel_used_in_device_code.

After a move the source owns no context. It may be destroyed or assigned to. Permu() on a moved-from object is undefined behavior, and only a successful assignment restores the context. A failed assignment does not restore it.

Constructor & Destructor Documentation

◆ Aes128Feistel() [1/2]

fss::prp::Aes128Feistel::Aes128Feistel ( )
inline

Construct with a new OpenSSL cipher context.

Exceptions
std::runtime_errorif an OpenSSL context allocation or setup call fails.

◆ Aes128Feistel() [2/2]

fss::prp::Aes128Feistel::Aes128Feistel ( const Aes128Feistel & )
inline

Copy by creating a new OpenSSL cipher context.

Copy assignment reuses the destination context, or creates one when the destination is moved-from.

Exceptions
std::runtime_errorif an OpenSSL context allocation or setup call fails.

Member Function Documentation

◆ Permu()

__uint128_t fss::prp::Aes128Feistel::Permu ( int4 seed,
__uint128_t x,
__uint128_t domain )
inline

Small-domain PRP on [0, domain) using 4-round Feistel + cycle-walking.

Host-only. Device use fails to build with an unresolved-extern error naming fss_host_only_Aes128Feistel_used_in_device_code.

Parameters
seed16-byte PRP key.
xInput in [0, domain).
domainDomain size. Must be >= 2.
Returns
Output in [0, domain).
Precondition
x < domain. A violation aborts with a diagnostic in Debug builds and is undefined behavior in Release builds.
The object is not moved-from. A moved-from object needs a successful assignment to restore its context; a failed assignment does not restore it.

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