pub struct Generator<E: Curve>(/* private fields */);
Expand description
Generator of curve E
Curve generator is a point on curve defined in curve specs. For some curves,
generator multiplication may be optimized, so Scalar<E> * Generator<E>
would more efficient than Scalar<E> * Point<E>
. That’s the only purpose
of Generator<E>
structure: to distinguish generator multiplication and
potentially use more efficient algorithm.
Curve generator Generator<E>
should be obtained by calling Point::generator()
.
You may convert Generator<E>
to Point<E>
or NonZero<Point<E>>
by calling
.to_point()
or .to_nonzero_point()
, but then multiplication may be less
efficient.
Implementations§
Trait Implementations§
Source§impl<E: Curve> AddAssign<&Generator<E>> for Point<E>
impl<E: Curve> AddAssign<&Generator<E>> for Point<E>
Source§fn add_assign(&mut self, rhs: &Generator<E>)
fn add_assign(&mut self, rhs: &Generator<E>)
Performs the
+=
operation. Read moreSource§impl<E: Curve> AddAssign<Generator<E>> for Point<E>
impl<E: Curve> AddAssign<Generator<E>> for Point<E>
Source§fn add_assign(&mut self, rhs: Generator<E>)
fn add_assign(&mut self, rhs: Generator<E>)
Performs the
+=
operation. Read moreSource§impl<E: Ord + Curve> Ord for Generator<E>
impl<E: Ord + Curve> Ord for Generator<E>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<E: PartialOrd + Curve> PartialOrd for Generator<E>
impl<E: PartialOrd + Curve> PartialOrd for Generator<E>
Source§impl<E: Curve> SubAssign<&Generator<E>> for Point<E>
impl<E: Curve> SubAssign<&Generator<E>> for Point<E>
Source§fn sub_assign(&mut self, rhs: &Generator<E>)
fn sub_assign(&mut self, rhs: &Generator<E>)
Performs the
-=
operation. Read moreSource§impl<E: Curve> SubAssign<Generator<E>> for Point<E>
impl<E: Curve> SubAssign<Generator<E>> for Point<E>
Source§fn sub_assign(&mut self, rhs: Generator<E>)
fn sub_assign(&mut self, rhs: Generator<E>)
Performs the
-=
operation. Read moreimpl<E: Copy + Curve> Copy for Generator<E>
impl<E: Eq + Curve> Eq for Generator<E>
impl<E: Curve> StructuralPartialEq for Generator<E>
Auto Trait Implementations§
impl<E> Freeze for Generator<E>
impl<E> RefUnwindSafe for Generator<E>where
E: RefUnwindSafe,
impl<E> Send for Generator<E>
impl<E> Sync for Generator<E>
impl<E> Unpin for Generator<E>
impl<E> UnwindSafe for Generator<E>where
E: UnwindSafe,
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