pub struct Coset {
pub log_2_size: u32,
pub shift: CirclePoint<Mersenne31Field>,
}Expand description
Given g_n, a generator of the subgroup of size n of the circle, i.e. <g_n>, and given a shift, that is a another point of the circle, we define the coset shift + <g_n> which is the set of all the points in <g_n> plus the shift. For example, if <g_4> = {p1, p2, p3, p4}, then g_8 + <g_4> = {g_8 + p1, g_8 + p2, g_8 + p3, g_8 + p4}.
Fields§
§log_2_size: u32§shift: CirclePoint<Mersenne31Field>Implementations§
Source§impl Coset
impl Coset
pub fn new(log_2_size: u32, shift: CirclePoint<Mersenne31Field>) -> Self
Sourcepub fn new_standard(log_2_size: u32) -> Self
pub fn new_standard(log_2_size: u32) -> Self
Returns the coset g_2n + <g_n>
Sourcepub fn get_generator(&self) -> CirclePoint<Mersenne31Field>
pub fn get_generator(&self) -> CirclePoint<Mersenne31Field>
Returns g_n, the generator of the subgroup of order n = 2^log_2_size.
Sourcepub fn half_coset(coset: Self) -> Self
pub fn half_coset(coset: Self) -> Self
Given a standard coset g_2n + <g_n>, returns the subcoset with half size g_2n + <g_{n/2}>
Sourcepub fn conjugate(coset: Self) -> Self
pub fn conjugate(coset: Self) -> Self
Given a coset shift + G returns the coset -shift + G. Note that (g_2n + <g_{n/2}>) U (-g_2n + <g_{n/2}>) = g_2n + <g_n>.
Sourcepub fn get_coset_points(coset: &Self) -> Vec<CirclePoint<Mersenne31Field>>
pub fn get_coset_points(coset: &Self) -> Vec<CirclePoint<Mersenne31Field>>
Returns the vector of shift + g for every g in <g_n>. where g = i * g_n for i = 0, …, n-1.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Coset
impl RefUnwindSafe for Coset
impl Send for Coset
impl Sync for Coset
impl Unpin for Coset
impl UnwindSafe for Coset
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