Trait group_math::Group
source · pub trait Group<const LAMBDA: usize>where
Self: Add<Output = Self> + AddAssign + PartialEq + Eq + Debug + Sized + Clone + Sync + Send,{
// Required methods
fn convert(y: [u8; LAMBDA]) -> Self;
fn zero() -> Self;
fn add_inverse(self) -> Self;
// Provided methods
fn clone_convert(y: &[u8; LAMBDA]) -> Self { ... }
fn add_inverse_if(self, t: bool) -> Self { ... }
}
Expand description
Group (mathematics) that can be converted from a byte array
Required Methods§
sourcefn add_inverse(self) -> Self
fn add_inverse(self) -> Self
Additive inverse in the group, e.g., -x
for x
in the integer group
Provided Methods§
sourcefn clone_convert(y: &[u8; LAMBDA]) -> Self
fn clone_convert(y: &[u8; LAMBDA]) -> Self
Helper to convert from a byte array to a group element by cloning the byte array
sourcefn add_inverse_if(self, t: bool) -> Self
fn add_inverse_if(self, t: bool) -> Self
Helper to get the additive inverse if true.
Used for expressions like $(-1)^n x$
, in which t
can be computed from n
.
Object Safety§
This trait is not object safe.