Skip to content

Commit

Permalink
fill in serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
rnburn committed Oct 18, 2024
1 parent 53b62c9 commit a980436
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions cbindings/blitzar_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -585,6 +585,12 @@ struct sxt_multiexp_handle* sxt_multiexp_handle_new(unsigned curve_id, const voi
struct sxt_multiexp_handle* sxt_multiexp_handle_new_from_file(unsigned curve_id,
const char* filename);

/**
* Write to file
*/
void sxt_multiexp_handle_write_to_file(const struct sxt_multiexp_handle* handle,
const char* filename);

/**
* Free resources for a multiexponentiation handle
*/
Expand Down
10 changes: 10 additions & 0 deletions cbindings/fixed_pedersen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,16 @@ struct sxt_multiexp_handle* sxt_multiexp_handle_new_from_file(unsigned curve_id,
return reinterpret_cast<sxt_multiexp_handle*>(res.release());
}

//--------------------------------------------------------------------------------------------------
// sxt_multiexp_handle_write_to_file
//--------------------------------------------------------------------------------------------------
void sxt_multiexp_handle_write_to_file(const struct sxt_multiexp_handle* handle,
const char* filename) {
auto backend = cbn::get_backend();
auto h = reinterpret_cast<const cbnb::multiexp_handle*>(handle);
backend->write_partition_table_accessor(h->curve_id, *h->partition_table_accessor, filename);
}

//--------------------------------------------------------------------------------------------------
// sxt_multiexp_handle_free
//--------------------------------------------------------------------------------------------------
Expand Down

0 comments on commit a980436

Please sign in to comment.