cralgebra 0.2.1

A fast crypto algebra library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/// Multiplicative identity element.
///
/// The value returned by this operation must leave an operand
/// unchanged when multiplied with it.
/// Optionally, it can take an extra parameter that describes the
/// underlying algebraic structure at runtime.
pub trait OneDyn<C>: Sized + Eq {
    /// Returns the multiplicative identity, `1`. [Read more][OneDyn]
    fn one_d(ctx: &C) -> Self;

    /// Checks whether a value matches `1`. [Read more][OneDyn]
    fn is_one_d(&self, ctx: &C) -> bool {
        self == &Self::one_d(ctx)
    }
}