From a980436785d7c09128934591ad7cee85f42fe968 Mon Sep 17 00:00:00 2001 From: rnburn Date: Thu, 17 Oct 2024 20:02:32 -0700 Subject: [PATCH] fill in serialization --- cbindings/blitzar_api.h | 6 ++++++ cbindings/fixed_pedersen.cc | 10 ++++++++++ 2 files changed, 16 insertions(+) diff --git a/cbindings/blitzar_api.h b/cbindings/blitzar_api.h index 2af94ba7..0e5546a5 100644 --- a/cbindings/blitzar_api.h +++ b/cbindings/blitzar_api.h @@ -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 */ diff --git a/cbindings/fixed_pedersen.cc b/cbindings/fixed_pedersen.cc index c726d738..a63b4616 100644 --- a/cbindings/fixed_pedersen.cc +++ b/cbindings/fixed_pedersen.cc @@ -48,6 +48,16 @@ struct sxt_multiexp_handle* sxt_multiexp_handle_new_from_file(unsigned curve_id, return reinterpret_cast(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(handle); + backend->write_partition_table_accessor(h->curve_id, *h->partition_table_accessor, filename); +} + //-------------------------------------------------------------------------------------------------- // sxt_multiexp_handle_free //--------------------------------------------------------------------------------------------------