Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
rnburn committed Oct 21, 2024
1 parent e2ee08e commit 2ddadee
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 4 additions & 9 deletions src/compute/fixed_msm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use super::backend::init_backend;
use crate::compute::{curve::SwCurveConfig, CurveId, ElementP2};
use ark_ec::short_weierstrass::Affine;
use rayon::prelude::*;
use std::marker::PhantomData;
use std::ffi::CString;
use std::marker::PhantomData;

fn count_scalars_per_output(scalars_len: usize, output_bit_table: &[u32]) -> u32 {
let bit_sum: usize = output_bit_table.iter().map(|s| *s as usize).sum();
Expand Down Expand Up @@ -55,10 +55,8 @@ impl<T: CurveId> MsmHandle<T> {
init_backend();
let filename = CString::new(filename).expect("filename cannot have null bytes");
unsafe {
let handle = blitzar_sys::sxt_multiexp_handle_new_from_file(
T::CURVE_ID,
filename.as_ptr(),
);
let handle =
blitzar_sys::sxt_multiexp_handle_new_from_file(T::CURVE_ID, filename.as_ptr());
Self {
handle,
phantom: PhantomData,
Expand All @@ -73,10 +71,7 @@ impl<T: CurveId> MsmHandle<T> {
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(),
);
blitzar_sys::sxt_multiexp_handle_write_to_file(self.handle, filename.as_ptr());
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/compute/fixed_msm_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn we_can_serialize_a_handle_to_a_file() {

// read the handle back from file
let handle = MsmHandle::<RistrettoPoint>::new_from_file(&filename);

// we can compute a multiexponentiation
let scalars: Vec<u8> = vec![1, 2];
handle.msm(&mut res, 1, &scalars);
Expand Down

0 comments on commit 2ddadee

Please sign in to comment.