pub struct BatchMulPreprocessing<T>where
T: ScalarMul,{
pub window: usize,
pub max_scalar_size: usize,
pub table: Vec<Vec<<T as ScalarMul>::MulBase>>,
}
Expand description
Preprocessing used internally for batch scalar multiplication via ScalarMul::batch_mul
.
window
is the window size used for the precomputationmax_scalar_size
is the maximum size of the scalars that will be multipliedtable
is the precomputed table of multiples ofbase
Fields§
§window: usize
§max_scalar_size: usize
§table: Vec<Vec<<T as ScalarMul>::MulBase>>
Implementations§
Source§impl<T> BatchMulPreprocessing<T>where
T: ScalarMul,
impl<T> BatchMulPreprocessing<T>where
T: ScalarMul,
pub fn new(base: T, num_scalars: usize) -> BatchMulPreprocessing<T>
pub fn with_num_scalars_and_scalar_size( base: T, num_scalars: usize, max_scalar_size: usize, ) -> BatchMulPreprocessing<T>
pub fn compute_window_size(num_scalars: usize) -> usize
pub fn batch_mul( &self, v: &[<T as PrimeGroup>::ScalarField], ) -> Vec<<T as ScalarMul>::MulBase>
Auto Trait Implementations§
impl<T> Freeze for BatchMulPreprocessing<T>
impl<T> RefUnwindSafe for BatchMulPreprocessing<T>
impl<T> Send for BatchMulPreprocessing<T>
impl<T> Sync for BatchMulPreprocessing<T>
impl<T> Unpin for BatchMulPreprocessing<T>
impl<T> UnwindSafe for BatchMulPreprocessing<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more