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

@ -145,7 +145,8 @@ bool same_cmp_channel(const Key & a, const Key & b)
const auto & cb = b.cmp();
if (ca.nbits != cb.nbits || ca.mask != cb.mask || ca.kind != cb.kind
|| ca.trivial != cb.trivial || ca.eval_as_ge != cb.eval_as_ge
|| ca.include_eq != cb.include_eq || ca.active != cb.active)
|| ca.include_eq != cb.include_eq || ca.active != cb.active
|| ca.incremental != cb.incremental)
return false;
using word = typename Key::value_cw_word;
if (!same_bytes(a.value_cw().data(), b.value_cw().data(),
@ -874,6 +875,32 @@ TEST_F(StressScenariosTest, PrgDummyAesClassicPoint)
}
}
TEST_F(StressScenariosTest, PrgChachaInteriorAesExteriorClassicPoint)
{
uint8_t x = 0x2a;
auto [k0, k1] = dpf::make_dpf<dpf::prg::chacha20, dpf::prg::aes128>(x, uint32_t{0x01020304});
for (int i = 0; i < 256; ++i)
{
auto s = recon(*dpf::eval_point(k0, static_cast<uint8_t>(i)),
*dpf::eval_point(k1, static_cast<uint8_t>(i)));
EXPECT_EQ(static_cast<uint32_t>(s),
static_cast<uint8_t>(i) == x ? 0x01020304u : 0u);
}
}
TEST_F(StressScenariosTest, PrgAesInteriorChachaExteriorClassicPoint)
{
uint8_t x = 0x91;
auto [k0, k1] = dpf::make_dpf<dpf::prg::aes128, dpf::prg::chacha20>(x, uint32_t{0xdeadbeef});
for (int i = 0; i < 256; ++i)
{
auto s = recon(*dpf::eval_point(k0, static_cast<uint8_t>(i)),
*dpf::eval_point(k1, static_cast<uint8_t>(i)));
EXPECT_EQ(static_cast<uint32_t>(s),
static_cast<uint8_t>(i) == x ? 0xdeadbeefu : 0u);
}
}
TEST_F(StressScenariosTest, PrgLowmcLowmcMultilevelPacking)
{
uint16_t x = 0x4c1d;