Document the new DPF surfaces in one command set, and test the field, half-tree, and multipoint edges.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Ryan Henry 2026-09-24 23:18:10 -06:00
parent 0d8a5a8131
commit 0dff6df8ed
250 changed files with 12199 additions and 1981 deletions

View file

@ -94,7 +94,7 @@ TEST(ContextBlast, ModintEdgesAndFullDomain)
every_point(m7{64}, dpf::xor_wrapper<uint32_t>{0x00ff}, 128);
for (unsigned a : {0u, 1u, 511u, 512u, 1023u})
every_point(m10{a}, uint32_t{0xabcdu}, 1024);
every_point(m10{static_cast<m10::integral_type>(a)}, uint32_t{0xabcdu}, 1024);
every_point(m9{0}, uint16_t{2}, 512);
every_point(m9{511}, uint16_t{2}, 512);
@ -140,11 +140,11 @@ TEST(ContextBlast, BitstringPointIntervalSequence)
const uint32_t y = 0x11111111u;
for (unsigned a : {0u, 1u, 31u, 32u, 63u})
{
bs alpha{a};
bs alpha{static_cast<bs::word_type>(a)};
auto [k0, k1] = dpf::make_dpf(alpha, y);
for (unsigned i = 0; i < 64; ++i)
{
bs q{i};
bs q{static_cast<bs::word_type>(i)};
EXPECT_EQ(opened(ev(k0, q), ev(k1, q)), q == alpha ? y : 0u) << i;
}
bs from{0};
@ -280,8 +280,11 @@ TEST(ContextBlast, XorWrapperAndGenevalIntegers)
const int32_t secret = -2;
const int32_t x1 = secret ^ x0;
reset_roots();
HEDLEY_PRAGMA(GCC diagnostic push)
HEDLEY_PRAGMA(GCC diagnostic ignored "-Wignored-attributes")
auto g = dpf::geneval_point(x0, x1, secret,
dpf::ds_randomness<simde__m128i (*)(), Pad>{take_root, Pad{}}, X{7});
HEDLEY_PRAGMA(GCC diagnostic pop)
EXPECT_TRUE(g.leaf_live);
EXPECT_EQ(g.live_levels, std::decay_t<decltype(keys.first)>::depth);
EXPECT_EQ(opened(g.party0[0], g.party1[0]), X{7});
@ -289,8 +292,11 @@ TEST(ContextBlast, XorWrapperAndGenevalIntegers)
const int32_t far = 100;
reset_roots();
HEDLEY_PRAGMA(GCC diagnostic push)
HEDLEY_PRAGMA(GCC diagnostic ignored "-Wignored-attributes")
auto off = dpf::geneval_point(x0, x1, far,
dpf::ds_randomness<simde__m128i (*)(), Pad>{take_root, Pad{}}, X{7});
HEDLEY_PRAGMA(GCC diagnostic pop)
EXPECT_FALSE(off.leaf_live);
EXPECT_GT(off.live_levels, 0u);
EXPECT_LT(off.live_levels, off.correction_words.size());
@ -307,8 +313,11 @@ TEST(ContextBlast, XorWrapperAndGenevalIntegers)
uint64_t{99});
reset_roots();
const uint32_t qs[] = {0u, 1u, u, u ^ 1u, 0xffffffffu};
HEDLEY_PRAGMA(GCC diagnostic push)
HEDLEY_PRAGMA(GCC diagnostic ignored "-Wignored-attributes")
auto sq = dpf::geneval_sequence(u0, u1, std::begin(qs), std::end(qs),
dpf::ds_randomness<simde__m128i (*)(), Pad>{take_root, Pad{}}, uint64_t{99});
HEDLEY_PRAGMA(GCC diagnostic pop)
EXPECT_TRUE(sq.leaf_live);
for (std::size_t i = 0; i < sq.live_levels; ++i)
EXPECT_EQ(std::memcmp(&sq.correction_words[i], &uk.first.correction_word(i),