From 2ddadee4c4f3efdef32bafb43af7884f6f53e1a4 Mon Sep 17 00:00:00 2001 From: rnburn Date: Mon, 21 Oct 2024 10:50:11 -0700 Subject: [PATCH] format --- src/compute/fixed_msm.rs | 13 ++++--------- src/compute/fixed_msm_tests.rs | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/src/compute/fixed_msm.rs b/src/compute/fixed_msm.rs index bec1a27..87cff77 100644 --- a/src/compute/fixed_msm.rs +++ b/src/compute/fixed_msm.rs @@ -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(); @@ -55,10 +55,8 @@ impl MsmHandle { 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, @@ -73,10 +71,7 @@ impl MsmHandle { 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()); } } diff --git a/src/compute/fixed_msm_tests.rs b/src/compute/fixed_msm_tests.rs index 8629ad9..9ebe175 100644 --- a/src/compute/fixed_msm_tests.rs +++ b/src/compute/fixed_msm_tests.rs @@ -69,7 +69,7 @@ fn we_can_serialize_a_handle_to_a_file() { // read the handle back from file let handle = MsmHandle::::new_from_file(&filename); - + // we can compute a multiexponentiation let scalars: Vec = vec![1, 2]; handle.msm(&mut res, 1, &scalars);