Annotate noexcept and constexpr with HEDLEY, and add interval containment, ChaCha, and the dyadic range tables.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ryan Henry 2026-09-24 20:44:07 -06:00
parent 875f09fec1
commit 0d8a5a8131
97 changed files with 9212 additions and 1159 deletions

View file

@ -166,17 +166,22 @@ class wire
friend class session<Ring>;
public:
HEDLEY_NO_THROW
constexpr wire() noexcept = default;
HEDLEY_NO_THROW
constexpr std::uint32_t id() const noexcept { return id_; }
HEDLEY_NO_THROW
constexpr session<Ring> * owner() const noexcept { return sess_; }
HEDLEY_NO_THROW
friend bool operator==(wire a, wire b) noexcept
{
return a.sess_ == b.sess_ && a.id_ == b.id_;
}
HEDLEY_NO_THROW
friend bool operator!=(wire a, wire b) noexcept
{
return !(a == b);
@ -240,13 +245,16 @@ public:
static constexpr std::uint32_t mono_role_base = 0x40000000u;
static constexpr std::uint32_t dot_role_base = 0x80000000u;
HEDLEY_NO_THROW
static constexpr std::uint32_t wire_role(std::uint32_t id) noexcept { return id; }
HEDLEY_NO_THROW
static constexpr std::uint32_t mono_role(std::uint32_t i) noexcept
{
return mono_role_base + i;
}
HEDLEY_NO_THROW
static constexpr std::uint32_t dot_role(std::uint32_t gate) noexcept
{
return dot_role_base + gate;
@ -255,6 +263,7 @@ public:
/// Fused within-polynomial λ combinations (Appendix E groupings).
static constexpr std::uint32_t bundle_role_base = 0xC0000000u;
HEDLEY_NO_THROW
static constexpr std::uint32_t bundle_role(std::uint32_t i) noexcept
{
return bundle_role_base + i;
@ -268,6 +277,7 @@ public:
: lanes_(std::move(seed), window)
{ }
HEDLEY_NO_THROW
const seed_type & seed() const noexcept { return lanes_.seed(); }
Ring blind(std::uint32_t role, std::uint64_t index) const
@ -822,11 +832,13 @@ public:
return wires_[check(w)].ready_round;
}
HEDLEY_NO_THROW
std::size_t wire_count() const noexcept { return wires_.size(); }
/// Product shares beyond the per-wire blinds: subset monomials from
/// `product` gates, plus one fused bundle per public-δ class in a
/// polynomial (Appendix E). A lone mask is not counted.
HEDLEY_NO_THROW
std::size_t monomial_count() const noexcept
{
return monos_.size() + bundles_.size();