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,4 +1,5 @@
|
|||
#include <gtest/gtest.h>
|
||||
#include <tuple>
|
||||
|
||||
#include "dpf.hpp"
|
||||
#include "dpf/blocked_dcf.hpp"
|
||||
|
|
@ -422,14 +423,18 @@ TEST(BlockedDcf, WideCheckpointFrontierMatchesDense)
|
|||
TEST(BlockedDcf, PathRecipesStayOnThePerLevelChannel)
|
||||
{
|
||||
const uint8_t alpha = 0x3C;
|
||||
EXPECT_THROW(dpf::make_dpf(alpha, dpf::block_width<4>(dpf::lcp(uint64_t{1}))),
|
||||
EXPECT_THROW(
|
||||
dpf::make_dpf(alpha, dpf::block_width<4>(dpf::lcp(uint64_t{1}))),
|
||||
std::invalid_argument);
|
||||
EXPECT_THROW(dpf::make_dpf(alpha, dpf::block_width<4>(dpf::break_bit(uint64_t{3}))),
|
||||
EXPECT_THROW(
|
||||
dpf::make_dpf(alpha, dpf::block_width<4>(dpf::break_bit(uint64_t{3}))),
|
||||
std::invalid_argument);
|
||||
EXPECT_THROW(dpf::make_dpf(alpha,
|
||||
EXPECT_THROW(
|
||||
dpf::make_dpf(alpha,
|
||||
dpf::block_width<4>(dpf::prefix_with_length<4>(uint64_t{1}))),
|
||||
std::invalid_argument);
|
||||
EXPECT_THROW(dpf::make_dpf(alpha, dpf::block_width<2>(dpf::path_paint(
|
||||
EXPECT_THROW(
|
||||
dpf::make_dpf(alpha, dpf::block_width<2>(dpf::path_paint(
|
||||
[](std::size_t matched, uint64_t, bool) {
|
||||
return static_cast<uint64_t>(matched);
|
||||
}))),
|
||||
|
|
@ -459,32 +464,34 @@ TEST(BlockedDcf, GrottoPrefixSegmentAndHorner)
|
|||
|
||||
const uint16_t center = 30;
|
||||
auto mat = grotto::make_offset_horner_keys<uint16_t, 1>(center);
|
||||
uint64_t payload[2];
|
||||
payload[0] = 1;
|
||||
payload[1] = center;
|
||||
using bare_pair = decltype(dpf::make_dpf(center, dpf::gt(uint64_t{0})));
|
||||
using pair = decltype(dpf::make_dpf(center,
|
||||
dpf::block_width<4>(dpf::gt(uint64_t{0}))));
|
||||
std::vector<bare_pair> bare_keys{
|
||||
dpf::make_dpf(center, dpf::gt(payload[0])),
|
||||
dpf::make_dpf(center, dpf::gt(payload[1]))};
|
||||
std::vector<pair> keys{
|
||||
dpf::make_dpf(center, dpf::block_width<4>(dpf::gt(payload[0]))),
|
||||
dpf::make_dpf(center, dpf::block_width<4>(dpf::gt(payload[1])))};
|
||||
std::vector<uint16_t> knots{0, 10, 40};
|
||||
std::vector<std::array<uint64_t, 2>> coeff{
|
||||
{1, 0},
|
||||
{2, 3},
|
||||
{4, 1}};
|
||||
const uint16_t eta = 0;
|
||||
const auto b0s = grotto::offset_horner_coefficient_share<0, 1>(
|
||||
bare_keys, mat.wrap_share, knots, coeff, eta);
|
||||
const auto b1s = grotto::offset_horner_coefficient_share<1, 1>(
|
||||
bare_keys, mat.wrap_share, knots, coeff, eta);
|
||||
const auto c0 = grotto::offset_horner_coefficient_share<0, 1>(
|
||||
keys, mat.wrap_share, knots, coeff, eta);
|
||||
const auto c1 = grotto::offset_horner_coefficient_share<1, 1>(
|
||||
keys, mat.wrap_share, knots, coeff, eta);
|
||||
for (std::size_t m = 0; m < 2; ++m)
|
||||
EXPECT_EQ(b0s[m] + b1s[m], c0[m] + c1[m]);
|
||||
const auto p0 = grotto::offset_horner_eval<0, 1>(mat, knots, coeff, eta);
|
||||
const auto p1 = grotto::offset_horner_eval<1, 1>(mat, knots, coeff, eta);
|
||||
EXPECT_EQ(p0 + p1, grotto::offset_horner_clear<1>(center, knots, coeff, eta));
|
||||
}
|
||||
|
||||
TEST(BlockedDcf, VerifiableUint8DomainMatchesThePredicate)
|
||||
{
|
||||
const uint8_t alpha = 0x2a;
|
||||
auto [k0, k1] = dpf::make_dpf(alpha,
|
||||
dpf::block_width<4>(dpf::lt(uint64_t{1})), dpf::verifiable{});
|
||||
for (int x = 0; x < 256; ++x)
|
||||
{
|
||||
const auto q = static_cast<uint8_t>(x);
|
||||
dpf::proof_token a{}, b{};
|
||||
const uint64_t got = recon(dpf::eval_point(dpf::cmp, k0, q, dpf::prove(a)),
|
||||
dpf::eval_point(dpf::cmp, k1, q, dpf::prove(b)))
|
||||
& k0.cmp().mask;
|
||||
EXPECT_EQ(got, q < alpha ? 1u : 0u) << x;
|
||||
EXPECT_TRUE(dpf::verify(a, b)) << x;
|
||||
const uint64_t swapped = recon(dpf::eval_point(dpf::cmp, k1, q),
|
||||
dpf::eval_point(dpf::cmp, k0, q))
|
||||
& k0.cmp().mask;
|
||||
EXPECT_EQ(swapped, got) << x;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue