Trait group_math::Group

source ·
pub trait Group<const LAMBDA: usize>
where Self: Add<Output = Self> + AddAssign + PartialEq + Eq + Debug + Sized + Clone + Sync + Send + From<[u8; LAMBDA]>,
{ // Required methods fn zero() -> Self; fn add_inverse(self) -> Self; // Provided method fn add_inverse_if(self, t: bool) -> Self { ... } }
Expand description

Group (mathematics) that can be converted from a byte array

Into<[u8; LAMBDA]> is not used in any fss crate so not included. But it is implemented by all groups in the submodules.

Required Methods§

source

fn zero() -> Self

Zero in the group

source

fn add_inverse(self) -> Self

Additive inverse in the group, e.g., -x for x in the integer group

Provided Methods§

source

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.

Implementors§

source§

impl<const LAMBDA: usize> Group<LAMBDA> for ByteGroup<LAMBDA>

source§

impl<const LAMBDA: usize> Group<LAMBDA> for I8Group

source§

impl<const LAMBDA: usize> Group<LAMBDA> for I16Group

source§

impl<const LAMBDA: usize> Group<LAMBDA> for I32Group

source§

impl<const LAMBDA: usize> Group<LAMBDA> for I64Group

source§

impl<const LAMBDA: usize> Group<LAMBDA> for I128Group

source§

impl<const LAMBDA: usize> Group<LAMBDA> for IsizeGroup

source§

impl<const LAMBDA: usize> Group<LAMBDA> for group_math::int::U8Group

source§

impl<const LAMBDA: usize> Group<LAMBDA> for group_math::int::U16Group

source§

impl<const LAMBDA: usize> Group<LAMBDA> for group_math::int::U32Group

source§

impl<const LAMBDA: usize> Group<LAMBDA> for group_math::int::U64Group

source§

impl<const LAMBDA: usize> Group<LAMBDA> for group_math::int::U128Group

source§

impl<const LAMBDA: usize> Group<LAMBDA> for UsizeGroup

source§

impl<const LAMBDA: usize, const MOD: u8> Group<LAMBDA> for group_math::int_prime::U8Group<MOD>

source§

impl<const LAMBDA: usize, const MOD: u16> Group<LAMBDA> for group_math::int_prime::U16Group<MOD>

source§

impl<const LAMBDA: usize, const MOD: u32> Group<LAMBDA> for group_math::int_prime::U32Group<MOD>

source§

impl<const LAMBDA: usize, const MOD: u64> Group<LAMBDA> for group_math::int_prime::U64Group<MOD>

source§

impl<const LAMBDA: usize, const MOD: u128> Group<LAMBDA> for group_math::int_prime::U128Group<MOD>