Skip to content

Commit

Permalink
add serialization api
Browse files Browse the repository at this point in the history
  • Loading branch information
rnburn committed Oct 19, 2024
1 parent 0f77b4e commit 5142650
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
9 changes: 7 additions & 2 deletions cbindings/blitzar_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -579,14 +579,19 @@ struct sxt_multiexp_handle* sxt_multiexp_handle_new(unsigned curve_id, const voi
unsigned n);

/**
* Use a serialized file to create a handle for computing multiexponentiations using a fixed
* Use a serialized file to create a handle for computing multiexponentiations using a fixed
* sequence of generators.
*
* Reading the handle from a file can be significantly faster than calling
* sxt_multiexp_handle_new.
*/
struct sxt_multiexp_handle* sxt_multiexp_handle_new_from_file(unsigned curve_id,
const char* filename);

/**
* Write to file
* Write a multiexponentiation handle to file.
*
* Use this function in combination with sxt_multiexp_handle_new_from_file.
*/
void sxt_multiexp_handle_write_to_file(const struct sxt_multiexp_handle* handle,
const char* filename);
Expand Down
6 changes: 3 additions & 3 deletions sxt/cbindings/backend/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ load(

sxt_cc_component(
name = "computational_backend",
impl_deps = [
"//sxt/multiexp/pippenger2:in_memory_partition_table_accessor",
],
with_test = False,
deps = [
":computational_backend_utility",
Expand All @@ -15,9 +18,6 @@ sxt_cc_component(
"//sxt/multiexp/pippenger2:partition_table_accessor_base",
"//sxt/ristretto/type:compressed_element",
],
impl_deps = [
"//sxt/multiexp/pippenger2:in_memory_partition_table_accessor",
],
)

sxt_cc_component(
Expand Down
3 changes: 2 additions & 1 deletion sxt/cbindings/backend/computational_backend.cc
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
* limitations under the License.
*/

#include "sxt/cbindings/backend/computational_backend.h"
#include "computational_backend.h"
#include "sxt/cbindings/backend/computational_backend.h"

#include "sxt/cbindings/base/curve_id_utility.h"
#include "sxt/multiexp/pippenger2/in_memory_partition_table_accessor.h"

Expand Down
1 change: 0 additions & 1 deletion sxt/cbindings/backend/computational_backend.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,6 @@ class computational_backend {
make_partition_table_accessor(cbnb::curve_id_t curve_id, const void* generators,
unsigned n) const noexcept = 0;


virtual void fixed_multiexponentiation(void* res, cbnb::curve_id_t curve_id,
const mtxpp2::partition_table_accessor_base& accessor,
unsigned element_num_bytes, unsigned num_outputs,
Expand Down

0 comments on commit 5142650

Please sign in to comment.