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
|
|
@ -24,8 +24,17 @@ HEDLEY_DIAGNOSTIC_PUSH
|
|||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
/// @brief Cleartext `abs`.
|
||||
/// @see grotto::make_abs_lut
|
||||
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
|
||||
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_abs_lut) abs
|
||||
{
|
||||
/// @brief Evaluate the cleartext map.
|
||||
/// @tparam T argument and result type
|
||||
/// @param x the input
|
||||
/// @return the cleartext image of `x`
|
||||
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
|
||||
template <typename T>
|
||||
T operator()(T x) { return std::abs(static_cast<double>(x)); }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,10 +23,21 @@ namespace gadgets
|
|||
static constexpr double approx_default_target = 0;
|
||||
static constexpr unsigned approx_default_ULPs = 1;
|
||||
|
||||
/// @brief Cleartext `approx`.
|
||||
/// @see grotto::make_threshold_lut
|
||||
/// @tparam ULPs functor parameter (a `double` bound or scale)
|
||||
/// @tparam target functor parameter (a `double` bound or scale)
|
||||
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
|
||||
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
|
||||
template <double const & target = approx_default_target,
|
||||
unsigned const & ULPs = approx_default_ULPs>
|
||||
struct approx
|
||||
{
|
||||
/// @brief Evaluate the cleartext map.
|
||||
/// @tparam T argument and result type
|
||||
/// @param x the input
|
||||
/// @return the cleartext image of `x`
|
||||
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
|
||||
template <typename T>
|
||||
T operator()(T x) { return std::abs(x - target) <= ULPs * ulp_of(target) ? 1 : 0; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,12 +22,25 @@ namespace gadgets
|
|||
static constexpr double boxcar_default_outside = 0;
|
||||
static constexpr double boxcar_default_inside = 1;
|
||||
|
||||
/// @brief Cleartext `boxcar`.
|
||||
/// @see grotto::make_interval_lut
|
||||
/// @tparam inside functor parameter (a `double` bound or scale)
|
||||
/// @tparam outside functor parameter (a `double` bound or scale)
|
||||
/// @tparam to functor parameter (a `double` bound or scale)
|
||||
/// @tparam from functor parameter (a `double` bound or scale)
|
||||
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
|
||||
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
|
||||
template <double const & from,
|
||||
double const & to,
|
||||
double const & outside = boxcar_default_outside,
|
||||
double const & inside = boxcar_default_inside>
|
||||
struct boxcar
|
||||
{
|
||||
/// @brief Evaluate the cleartext map.
|
||||
/// @tparam T argument and result type
|
||||
/// @param x the input
|
||||
/// @return the cleartext image of `x`
|
||||
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
|
||||
template <typename T>
|
||||
T operator()(T x) { return (x < from || x > to) ? outside : inside; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,11 +23,22 @@ HEDLEY_DIAGNOSTIC_PUSH
|
|||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
/// @brief Cleartext `clip`.
|
||||
/// @see grotto::make_clip_lut
|
||||
/// @tparam upper functor parameter (a `double` bound or scale)
|
||||
/// @tparam lower functor parameter (a `double` bound or scale)
|
||||
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
|
||||
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
|
||||
template <double const & lower,
|
||||
double const & upper>
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_clip_lut) clip
|
||||
{
|
||||
static_assert(lower <= upper);
|
||||
/// @brief Evaluate the cleartext map.
|
||||
/// @tparam T argument and result type
|
||||
/// @param x the input
|
||||
/// @return the cleartext image of `x`
|
||||
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
|
||||
template <typename T>
|
||||
T operator()(T x) { return std::max(std::min(x, upper), lower); }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,9 +19,19 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
/// @brief Cleartext `eq`.
|
||||
/// @see grotto::make_threshold_lut
|
||||
/// @tparam target functor parameter (a `double` bound or scale)
|
||||
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
|
||||
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
|
||||
template <double const & target>
|
||||
struct eq
|
||||
{
|
||||
/// @brief Evaluate the cleartext map.
|
||||
/// @tparam T argument and result type
|
||||
/// @param x the input
|
||||
/// @return the cleartext image of `x`
|
||||
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
|
||||
template <typename T>
|
||||
T operator()(T x) { return x == target; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,9 +19,19 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
/// @brief Cleartext `geq`.
|
||||
/// @see grotto::make_threshold_lut
|
||||
/// @tparam target functor parameter (a `double` bound or scale)
|
||||
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
|
||||
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
|
||||
template <double const & target>
|
||||
struct geq
|
||||
{
|
||||
/// @brief Evaluate the cleartext map.
|
||||
/// @tparam T argument and result type
|
||||
/// @param x the input
|
||||
/// @return the cleartext image of `x`
|
||||
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
|
||||
template <typename T>
|
||||
T operator()(T x) { return x >= target; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,9 +19,19 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
/// @brief Cleartext `gt`.
|
||||
/// @see grotto::make_threshold_lut
|
||||
/// @tparam target functor parameter (a `double` bound or scale)
|
||||
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
|
||||
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
|
||||
template <double const & target>
|
||||
struct gt
|
||||
{
|
||||
/// @brief Evaluate the cleartext map.
|
||||
/// @tparam T argument and result type
|
||||
/// @param x the input
|
||||
/// @return the cleartext image of `x`
|
||||
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
|
||||
template <typename T>
|
||||
T operator()(T x) { return x > target; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,6 +16,9 @@ namespace gadgets
|
|||
|
||||
|
||||
|
||||
/// @note This header declares no callable.
|
||||
/// Complexity is stated on the sibling that evaluates the map, when one exists.
|
||||
/// @see grotto::fixedpoint
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -19,9 +19,19 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
/// @brief Cleartext `leq`.
|
||||
/// @see grotto::make_threshold_lut
|
||||
/// @tparam target functor parameter (a `double` bound or scale)
|
||||
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
|
||||
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
|
||||
template <double const & target>
|
||||
struct leq
|
||||
{
|
||||
/// @brief Evaluate the cleartext map.
|
||||
/// @tparam T argument and result type
|
||||
/// @param x the input
|
||||
/// @return the cleartext image of `x`
|
||||
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
|
||||
template <typename T>
|
||||
T operator()(T x) { return x <= target; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,9 +19,19 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
/// @brief Cleartext `lt`.
|
||||
/// @see grotto::make_threshold_lut
|
||||
/// @tparam target functor parameter (a `double` bound or scale)
|
||||
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
|
||||
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
|
||||
template <double const & target>
|
||||
struct lt
|
||||
{
|
||||
/// @brief Evaluate the cleartext map.
|
||||
/// @tparam T argument and result type
|
||||
/// @param x the input
|
||||
/// @return the cleartext image of `x`
|
||||
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
|
||||
template <typename T>
|
||||
T operator()(T x) { return x < target; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ namespace gadgets
|
|||
{
|
||||
|
||||
static constexpr double lt_target_zero = 0;
|
||||
/// @brief Alias of another cleartext functor, under the name `negative`.
|
||||
/// @see grotto::exact_constant
|
||||
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
|
||||
using negative HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) = lt<lt_target_zero>;
|
||||
|
||||
} // namespace gadgets
|
||||
|
|
|
|||
|
|
@ -19,9 +19,19 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
/// @brief Cleartext `neq`.
|
||||
/// @see grotto::make_nonzero_lut
|
||||
/// @tparam target functor parameter (a `double` bound or scale)
|
||||
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
|
||||
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
|
||||
template <double const & target>
|
||||
struct neq
|
||||
{
|
||||
/// @brief Evaluate the cleartext map.
|
||||
/// @tparam T argument and result type
|
||||
/// @param x the input
|
||||
/// @return the cleartext image of `x`
|
||||
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
|
||||
template <typename T>
|
||||
T operator()(T x) { return x != target; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ namespace gadgets
|
|||
{
|
||||
|
||||
static constexpr double geq_target_zero = 0;
|
||||
/// @brief Alias of another cleartext functor, under the name `nonnegative`.
|
||||
/// @see grotto::exact_constant
|
||||
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
|
||||
using nonnegative HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) = geq<geq_target_zero>;
|
||||
|
||||
} // namespace gadgets
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ namespace gadgets
|
|||
{
|
||||
|
||||
static constexpr double leq_target_zero = 0;
|
||||
/// @brief Alias of another cleartext functor, under the name `nonpositive`.
|
||||
/// @see grotto::exact_constant
|
||||
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
|
||||
using nonpositive HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) = leq<leq_target_zero>;
|
||||
|
||||
} // namespace gadgets
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ namespace gadgets
|
|||
{
|
||||
|
||||
static constexpr double neq_target_zero = 0;
|
||||
/// @brief Alias of another cleartext functor, under the name `nonzero`.
|
||||
/// @see grotto::exact_constant
|
||||
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
|
||||
using nonzero HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) = neq<neq_target_zero>;
|
||||
|
||||
} // namespace gadgets
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ namespace gadgets
|
|||
|
||||
|
||||
|
||||
/// @note This header declares no callable.
|
||||
/// Complexity is stated on the sibling that evaluates the map, when one exists.
|
||||
/// @see grotto::gadget_hints
|
||||
/// @note No fixed-point table in `eval_closed`, `eval_window`, or `eval_reduced` is named after this file. Complexity is not stated here.
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ namespace gadgets
|
|||
{
|
||||
|
||||
static constexpr double gt_target_zero = 0;
|
||||
/// @brief Alias of another cleartext functor, under the name `positive`.
|
||||
/// @see grotto::exact_constant
|
||||
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
|
||||
using positive HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) = gt<gt_target_zero>;
|
||||
|
||||
} // namespace gadgets
|
||||
|
|
|
|||
|
|
@ -19,8 +19,17 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
/// @brief Cleartext `rect`.
|
||||
/// @see grotto::make_zero_lut
|
||||
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
|
||||
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
|
||||
struct rect
|
||||
{
|
||||
/// @brief Evaluate the cleartext map.
|
||||
/// @tparam T argument and result type
|
||||
/// @param x the input
|
||||
/// @return the cleartext image of `x`
|
||||
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
|
||||
template <typename T>
|
||||
T operator()(T x) { return x == 0; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,11 +22,23 @@ namespace gadgets
|
|||
static constexpr double step_default_before = 0;
|
||||
static constexpr double step_default_after = 1;
|
||||
|
||||
/// @brief Cleartext `step`.
|
||||
/// @see grotto::make_exact_step_lut
|
||||
/// @tparam after functor parameter (a `double` bound or scale)
|
||||
/// @tparam before functor parameter (a `double` bound or scale)
|
||||
/// @tparam at functor parameter (a `double` bound or scale)
|
||||
/// @note Straight-line cleartext. Fixed-point evaluation is the symbol in `@see` when that symbol is a LUT or an `eval_*` function.
|
||||
/// \complexity One evaluation of `operator()` as written in this header. There is no domain scan and no loop. `Θ(1)` time and extra space relative to that expression.
|
||||
template <double const & at,
|
||||
double const & before = step_default_before,
|
||||
double const & after = step_default_after>
|
||||
struct step
|
||||
{
|
||||
/// @brief Evaluate the cleartext map.
|
||||
/// @tparam T argument and result type
|
||||
/// @param x the input
|
||||
/// @return the cleartext image of `x`
|
||||
/// \complexity The body is straight-line. `Θ(1)` time and extra space.
|
||||
template <typename T>
|
||||
T operator()(T x) { return x < at ? before : after; }
|
||||
};
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ namespace gadgets
|
|||
|
||||
|
||||
|
||||
/// @note This header declares no callable.
|
||||
/// Complexity is stated on the sibling that evaluates the map, when one exists.
|
||||
/// @see grotto::gadget_hints
|
||||
/// @note No fixed-point table in `eval_closed`, `eval_window`, or `eval_reduced` is named after this file. Complexity is not stated here.
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -17,6 +17,9 @@ namespace gadgets
|
|||
{
|
||||
|
||||
static constexpr double eq_target_zero = 0;
|
||||
/// @brief Alias of another cleartext functor, under the name `zero`.
|
||||
/// @see grotto::exact_constant
|
||||
/// \complexity Same as the functor it aliases: one straight-line `operator()`. `Θ(1)`.
|
||||
using zero HEDLEY_DEPRECATED_FOR(2026, grotto::exact_constant) = eq<eq_target_zero>;
|
||||
|
||||
} // namespace gadgets
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue