Skip to content

Commit

Permalink
fill in c api
Browse files Browse the repository at this point in the history
  • Loading branch information
rnburn committed Feb 12, 2025
1 parent 6960ffb commit 65f64bb
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions cbindings/sumcheck.t.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,16 @@ TEST_CASE("todo") {
{0x1_s25, 1},
};
std::vector<unsigned> product_terms = {0};
sumcheck_descriptor descriptor{
.mles = mles.data(),
.product_table = product_table.data(),
.product_terms = product_terms.data(),
.n = 2,
.num_mles = 1,
.num_products = 1,
.num_product_terms = 1,
.round_degree = 1,
};

auto f = [](s25t::element* r, void* context, const s25t::element* polynomial,
unsigned polynomial_len) noexcept {
Expand All @@ -35,11 +45,9 @@ TEST_CASE("todo") {
cbn::reset_backend_for_testing();
const sxt_config config = {SXT_GPU_BACKEND, 0};
REQUIRE(sxt_init(&config) == 0);
#if 0
void sxt_prove_sumcheck(void* polynomials, void* evaluation_point, unsigned field_id,
const sumcheck_descriptor* descriptor, void* transcript_callback,
void* transcript_context) {
#endif

sxt_prove_sumcheck(polynomials.data(), evaluation_point.data(), SXT_FIELD_SCALAR255,
&descriptor, reinterpret_cast<void*>(+f), &transcript);
}
}
#if 0
Expand Down
2 changes: 1 addition & 1 deletion sxt/cbindings/backend/callback_sumcheck_transcript.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace sxt::cbnbck {
class callback_sumcheck_transcript final : public prfsk::sumcheck_transcript {
public:
using callback_t = void (*)(s25t::element* r, void* context, const s25t::element* polynomial,
unsigned round_degree);
unsigned polynomial_len);

callback_sumcheck_transcript(callback_t f, void* context) noexcept : f_{f}, context_{context} {}

Expand Down

0 comments on commit 65f64bb

Please sign in to comment.