Checkpoint the party/runtime stack before share-program and malicious-mode work.
Ship the TLS mesh, composer, Beaver/Yao/leaf MPC, prep/online paths, apps, and docs so the tree is pushable before elevating share_expr, security_mode, and prep resume. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
695f8e84f7
commit
0d22946a0e
1835 changed files with 170291 additions and 2849 deletions
|
|
@ -12,6 +12,7 @@
|
|||
#define LIBDPF_INCLUDE_DPF_CONSTRAINED_CMP_HPP__
|
||||
|
||||
#include <cstdint>
|
||||
#include <stdexcept>
|
||||
#include <type_traits>
|
||||
|
||||
#include "hedley/hedley.h"
|
||||
|
|
@ -61,15 +62,18 @@ constexpr void ccmp_party_terms(std::uint64_t x, uint8_t party,
|
|||
}
|
||||
|
||||
/// @brief Opened result of Π_CCMP when both inputs are known (local joint sim).
|
||||
/// @details Precondition: `|x0 - x1| = 1`.
|
||||
/// @details Aborts unless `|x0 - x1| = 1`.
|
||||
/// @param x0 the `x0`
|
||||
/// @param x1 the `x1`
|
||||
/// @return Opened result of Π_CCMP when both inputs are known (local joint sim)
|
||||
HEDLEY_NO_THROW
|
||||
/// @throws std::invalid_argument when the inputs do not differ by one
|
||||
HEDLEY_ALWAYS_INLINE
|
||||
HEDLEY_CONST
|
||||
constexpr uint8_t local_ccmp(std::uint64_t x0, std::uint64_t x1) noexcept
|
||||
uint8_t local_ccmp(std::uint64_t x0, std::uint64_t x1)
|
||||
{
|
||||
const std::uint64_t diff = x0 > x1 ? x0 - x1 : x1 - x0;
|
||||
if (diff != 1ULL)
|
||||
throw std::invalid_argument(
|
||||
"constrained comparison: inputs must differ by exactly one");
|
||||
uint8_t z00 = 0, z01 = 0, l0 = 0;
|
||||
uint8_t z10 = 0, z11 = 0, l1 = 0;
|
||||
ccmp_party_terms(x0, 0, z00, z01, l0);
|
||||
|
|
@ -87,11 +91,10 @@ constexpr uint8_t local_ccmp(std::uint64_t x0, std::uint64_t x1) noexcept
|
|||
/// @param x0 the first integer
|
||||
/// @param x1 the second integer
|
||||
/// @return Same as `local_ccmp` for any unsigned or enum-convertible integer
|
||||
/// @throws std::invalid_argument when the inputs do not differ by one
|
||||
template <typename T0, typename T1>
|
||||
HEDLEY_NO_THROW
|
||||
HEDLEY_ALWAYS_INLINE
|
||||
HEDLEY_CONST
|
||||
constexpr uint8_t local_ccmp_int(T0 x0, T1 x1) noexcept
|
||||
uint8_t local_ccmp_int(T0 x0, T1 x1)
|
||||
{
|
||||
static_assert(std::is_integral_v<T0> && std::is_integral_v<T1>,
|
||||
"local_ccmp_int: integral operands");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue