pub struct SRS {
pub g1: Vec<G1Affine>,
pub order: u32,
}
Expand description
Represents the Structured Reference String (SRS) used in KZG commitments.
Fields§
§g1: Vec<G1Affine>
§order: u32
The order of the SRS.
Implementations§
Source§impl SRS
impl SRS
Sourcepub fn new(
path_to_g1_points: &str,
order: u32,
points_to_load: u32,
) -> Result<Self, KzgError>
pub fn new( path_to_g1_points: &str, order: u32, points_to_load: u32, ) -> Result<Self, KzgError>
pub fn process_chunks<T>(
receiver: Receiver<(Vec<u8>, usize, bool)>,
) -> Vec<(T, usize)>where
T: ReadPointFromBytes,
Sourcepub fn parallel_read_g1_points_native(
file_path: String,
points_to_load: u32,
is_native: bool,
) -> Result<Vec<G1Affine>, KzgError>
pub fn parallel_read_g1_points_native( file_path: String, points_to_load: u32, is_native: bool, ) -> Result<Vec<G1Affine>, KzgError>
read G1 points in parallel, by creating one reader thread, which reads bytes from the file, and fans them out to worker threads (one per cpu) which parse the bytes into G1Affine points. The worker threads then fan in the parsed points to the main thread, which sorts them by their original position in the file to maintain order. Not used anywhere but kept as a reference.
§Arguments
file_path
- The path to the file containing the G1 pointspoints_to_load
- The number of points to load from the fileis_native
- Whether the points are in native arkworks format or not
§Returns
Ok(Vec<G1Affine>)
- The G1 points read from the fileErr(KzgError)
- An error occurred while reading the file
Trait Implementations§
impl StructuralPartialEq for SRS
Auto Trait Implementations§
impl Freeze for SRS
impl RefUnwindSafe for SRS
impl Send for SRS
impl Sync for SRS
impl Unpin for SRS
impl UnwindSafe for SRS
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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