Group

Trait Group 

Source
pub trait Group<const LAMBDA: usize>:
    Sized
    + Add<Output = Self>
    + AddAssign
    + PartialEq
    + Eq
    + Debug
    + 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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§