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
|
|
@ -1,6 +1,8 @@
|
|||
/// @file dpf/packed_lane.hpp
|
||||
/// @brief Extract and deposit one `dpf::bit`, `dpf::twobit`, or `dpf::nyble`
|
||||
/// lane in a leaf node. Lane 0 is the low bits of the first byte.
|
||||
/// @brief Extract and deposit one sub-byte lane in a leaf node.
|
||||
/// Lane 0 is the low bits of the first byte. Widths are 1
|
||||
/// (`dpf::bit`, `dpf::gf2`), 2 (`dpf::twobit`, `dpf::gf22`), or 4
|
||||
/// (`dpf::nyble`, `dpf::gf24`).
|
||||
|
||||
#ifndef LIBDPF_INCLUDE_DPF_PACKED_LANE_HPP__
|
||||
#define LIBDPF_INCLUDE_DPF_PACKED_LANE_HPP__
|
||||
|
|
@ -8,6 +10,7 @@
|
|||
#include <cassert>
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
#include <type_traits>
|
||||
|
||||
#include "hedley/hedley.h"
|
||||
|
||||
|
|
@ -20,6 +23,21 @@ namespace dpf
|
|||
namespace packed
|
||||
{
|
||||
|
||||
/// @brief Low bits of one lane as an unsigned integer.
|
||||
/// @details Enums convert directly. Class lanes such as `gf2n` expose
|
||||
/// `integral_type` and an explicit conversion to it.
|
||||
template <typename LaneT>
|
||||
HEDLEY_ALWAYS_INLINE
|
||||
HEDLEY_NO_THROW
|
||||
HEDLEY_PURE
|
||||
constexpr unsigned lane_unsigned(LaneT value) noexcept
|
||||
{
|
||||
if constexpr (std::is_enum_v<LaneT> || std::is_integral_v<LaneT>)
|
||||
return static_cast<unsigned>(value);
|
||||
else
|
||||
return static_cast<unsigned>(static_cast<typename LaneT::integral_type>(value));
|
||||
}
|
||||
|
||||
template <typename LaneT, typename LeafT>
|
||||
HEDLEY_ALWAYS_INLINE
|
||||
HEDLEY_NO_THROW
|
||||
|
|
@ -59,7 +77,7 @@ void deposit_lane(LeafT & leaf, std::size_t lane, LaneT value) noexcept
|
|||
const std::size_t bit = lane * bits;
|
||||
assert(bit / 8u < sizeof(LeafT));
|
||||
const unsigned shift = static_cast<unsigned>(bit % 8u);
|
||||
const unsigned val = static_cast<unsigned>(value) & mask;
|
||||
const unsigned val = lane_unsigned(value) & mask;
|
||||
unsigned char & cell = bytes[bit / 8u];
|
||||
cell = static_cast<unsigned char>((cell & ~(mask << shift)) | (val << shift));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue