Skip to content

Commit

Permalink
add write method
Browse files Browse the repository at this point in the history
  • Loading branch information
rnburn committed Oct 21, 2024
1 parent 68effce commit aea2d00
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/compute/fixed_msm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,20 @@ impl<T: CurveId> MsmHandle<T> {
}
}

/// Serialize the handle to a file.
///
/// This function can be used together with new_from_file to reduce
/// the cost of creating a handle.
pub fn write(&self, filename: &str) {
let filename = CString::new(filename).expect("filename cannot have null bytes");
unsafe {
blitzar_sys::sxt_multiexp_handle_write_to_file(
self.handle,
filename.as_ptr(),
);
}
}

/// Compute an MSM using pre-specified generators.
///
/// Suppose g_1, ..., g_n are pre-specified generators and
Expand Down

0 comments on commit aea2d00

Please sign in to comment.