|
myl7/fss 2.0.0
Function secret sharing (FSS) primitives including distributed point/comparison function (DPF/DCF)
|
AES-128 with Matyas-Meyer-Oseas and pre-initialized cipher contexts as a PRG. More...
Public Member Functions | |
| Aes128Mmo (cuda::std::span< EVP_CIPHER_CTX *, mul > ctxs) | |
| Constructor. | |
| cuda::std::array< int4, mul > | Gen (int4 seed) |
| Expand one seed into mul blocks. | |
| cuda::std::array< int4, mul/2 > | GenHalf (int4 seed, bool right) |
| Return the selected half of Gen() with the same call requirements. | |
Static Public Member Functions | |
| static cuda::std::array< EVP_CIPHER_CTX *, mul > | CreateCtxs (const unsigned char *keys[mul]) |
| Create cipher contexts. | |
AES-128 with Matyas-Meyer-Oseas and pre-initialized cipher contexts as a PRG.
Host-only. Device use of Gen() or GenHalf() fails to build with an unresolved-extern error naming fss_host_only_Aes128Mmo_used_in_device_code.
Concurrency: Gen() runs EVP_EncryptUpdate on the ctxs, and copies of an instance share the same ctxs. OpenSSL does not document one ctx as safe for concurrent updates even for full-block no-padding ECB, so Gen() must not run concurrently on instances sharing ctxs. Parallel host evaluation needs a PRG whose Gen() is safe to call concurrently, such as ChaCha or Aes128MmoRaw.
| mul | See Prgable mul. |
|
inline |
Constructor.
| ctxs | Generated by CreateCtxs() and freed by FreeCtxs(). Copies borrow the same mutable contexts. Concurrent Gen() calls require distinct contexts. Users are responsible for managing their lifetime. |
|
inlinestatic |
Create cipher contexts.
| keys | mul 16B AES-128 keys. |
| std::runtime_error | if an OpenSSL context allocation or setup call fails. |
| cuda::std::array< int4, mul > fss::prg::Aes128Mmo< mul >::Gen | ( | int4 | seed | ) |
Expand one seed into mul blocks.
| std::runtime_error | if EVP_EncryptUpdate fails. |
| cuda::std::array< int4, mul/2 > fss::prg::Aes128Mmo< mul >::GenHalf | ( | int4 | seed, |
| bool | right ) |