#[repr(transparent)]pub struct NonIdentity<P> {
point: P,
}Expand description
Non-identity point type.
This type ensures that its value is not the identity point, ala core::num::NonZero*.
In the context of ECC, it’s useful for ensuring that certain arithmetic cannot result in the identity point.
Fields§
§point: PImplementations§
Source§impl<P> NonIdentity<P>
impl<P> NonIdentity<P>
Sourcepub fn new(point: P) -> CtOption<Self>
pub fn new(point: P) -> CtOption<Self>
Create a NonIdentity from a point.
pub(crate) fn new_unchecked(point: P) -> Self
Source§impl<P> NonIdentity<P>
impl<P> NonIdentity<P>
Sourcepub fn from_repr(repr: &P::Repr) -> CtOption<Self>
pub fn from_repr(repr: &P::Repr) -> CtOption<Self>
Decode a NonIdentity from its encoding.
Source§impl<P> NonIdentity<P>
impl<P> NonIdentity<P>
Sourcepub fn array_as_inner<const N: usize>(points: &[Self; N]) -> &[P; N]
pub fn array_as_inner<const N: usize>(points: &[Self; N]) -> &[P; N]
Transform array reference containing NonIdentity points to an array reference to the
inner point type.
Sourcepub fn slice_as_inner(points: &[Self]) -> &[P]
pub fn slice_as_inner(points: &[Self]) -> &[P]
Transform slice containing NonIdentity points to a slice of the inner point type.
Sourcepub fn cast_array_as_inner<const N: usize>(points: &[Self; N]) -> &[P; N]
👎Deprecated since 0.14.0: use NonIdentity::array_as_inner instead
pub fn cast_array_as_inner<const N: usize>(points: &[Self; N]) -> &[P; N]
NonIdentity::array_as_inner insteadTransform array reference containing NonIdentity points to an array reference to the
inner point type.
Sourcepub fn cast_slice_as_inner(points: &[Self]) -> &[P]
👎Deprecated since 0.14.0: use NonIdentity::slice_as_inner instead
pub fn cast_slice_as_inner(points: &[Self]) -> &[P]
NonIdentity::slice_as_inner insteadTransform slice containing NonIdentity points to a slice of the inner point type.
Source§impl<P> NonIdentity<P>
impl<P> NonIdentity<P>
Sourcepub fn random<R: CryptoRng + ?Sized>(rng: &mut R) -> Self
👎Deprecated since 0.14.0: use the Generate trait instead
pub fn random<R: CryptoRng + ?Sized>(rng: &mut R) -> Self
Generate trait insteadGenerate a random NonIdentity<ProjectivePoint>.
Sourcepub fn to_affine(self) -> NonIdentity<P::Affine>
pub fn to_affine(self) -> NonIdentity<P::Affine>
Converts this element into its affine representation.
Sourcepub fn mul_by_generator<C: CurveArithmetic>(scalar: &NonZeroScalar<C>) -> Self
pub fn mul_by_generator<C: CurveArithmetic>(scalar: &NonZeroScalar<C>) -> Self
Multiply by the generator of the prime-order subgroup.
Source§impl<P> NonIdentity<P>where
P: PrimeCurveAffine,
impl<P> NonIdentity<P>where
P: PrimeCurveAffine,
Sourcepub fn to_curve(self) -> NonIdentity<P::Curve>
pub fn to_curve(self) -> NonIdentity<P::Curve>
Converts this element to its curve representation.
Trait Implementations§
Source§impl<P> AsRef<P> for NonIdentity<P>
impl<P> AsRef<P> for NonIdentity<P>
Source§impl<P> BatchNormalize<[NonIdentity<P>]> for NonIdentity<P>
Available on crate feature alloc only.
impl<P> BatchNormalize<[NonIdentity<P>]> for NonIdentity<P>
alloc only.Source§type Output = Vec<NonIdentity<<P as Curve>::Affine>>
type Output = Vec<NonIdentity<<P as Curve>::Affine>>
Source§fn batch_normalize(points: &[Self]) -> Vec<NonIdentity<P::Affine>>
fn batch_normalize(points: &[Self]) -> Vec<NonIdentity<P::Affine>>
InvertBatch.Source§impl<const N: usize, P> BatchNormalize<[NonIdentity<P>; N]> for NonIdentity<P>
impl<const N: usize, P> BatchNormalize<[NonIdentity<P>; N]> for NonIdentity<P>
Source§type Output = [NonIdentity<<P as Curve>::Affine>; N]
type Output = [NonIdentity<<P as Curve>::Affine>; N]
Source§fn batch_normalize(points: &[Self; N]) -> [NonIdentity<P::Affine>; N]
fn batch_normalize(points: &[Self; N]) -> [NonIdentity<P::Affine>; N]
InvertBatch.Source§impl<P: Clone> Clone for NonIdentity<P>
impl<P: Clone> Clone for NonIdentity<P>
Source§fn clone(&self) -> NonIdentity<P>
fn clone(&self) -> NonIdentity<P>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<P> ConditionallySelectable for NonIdentity<P>where
P: ConditionallySelectable,
impl<P> ConditionallySelectable for NonIdentity<P>where
P: ConditionallySelectable,
Source§fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self
Source§fn conditional_assign(&mut self, other: &Self, choice: Choice)
fn conditional_assign(&mut self, other: &Self, choice: Choice)
Source§fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)
self and other if choice == 1; otherwise,
reassign both unto themselves. Read moreSource§impl<P> ConstantTimeEq for NonIdentity<P>where
P: ConstantTimeEq,
impl<P> ConstantTimeEq for NonIdentity<P>where
P: ConstantTimeEq,
Source§impl<P: Debug> Debug for NonIdentity<P>
impl<P: Debug> Debug for NonIdentity<P>
Source§impl<P> Deref for NonIdentity<P>
impl<P> Deref for NonIdentity<P>
Source§impl<C, P> From<&NonIdentity<P>> for PublicKey<C>
impl<C, P> From<&NonIdentity<P>> for PublicKey<C>
Source§fn from(value: &NonIdentity<P>) -> Self
fn from(value: &NonIdentity<P>) -> Self
Source§impl<C> From<&PublicKey<C>> for NonIdentity<AffinePoint<C>>where
C: CurveArithmetic,
impl<C> From<&PublicKey<C>> for NonIdentity<AffinePoint<C>>where
C: CurveArithmetic,
Source§impl<C, P> From<NonIdentity<P>> for PublicKey<C>
impl<C, P> From<NonIdentity<P>> for PublicKey<C>
Source§fn from(value: NonIdentity<P>) -> Self
fn from(value: NonIdentity<P>) -> Self
Source§impl<C> From<PublicKey<C>> for NonIdentity<AffinePoint<C>>where
C: CurveArithmetic,
impl<C> From<PublicKey<C>> for NonIdentity<AffinePoint<C>>where
C: CurveArithmetic,
Source§impl<P> Generate for NonIdentity<P>
impl<P> Generate for NonIdentity<P>
Source§fn try_generate_from_rng<R: TryCryptoRng + ?Sized>(
rng: &mut R,
) -> Result<Self, R::Error>
fn try_generate_from_rng<R: TryCryptoRng + ?Sized>( rng: &mut R, ) -> Result<Self, R::Error>
TryCryptoRng. Read moreSource§fn generate_from_rng<R>(rng: &mut R) -> Self
fn generate_from_rng<R>(rng: &mut R) -> Self
CryptoRng.Source§impl<P> GroupEncoding for NonIdentity<P>
impl<P> GroupEncoding for NonIdentity<P>
Source§impl<C, P> Mul<&NonIdentity<P>> for &NonZeroScalar<C>where
C: CurveArithmetic,
for<'a> &'a NonIdentity<P>: Mul<&'a NonZeroScalar<C>, Output = NonIdentity<P>>,
impl<C, P> Mul<&NonIdentity<P>> for &NonZeroScalar<C>where
C: CurveArithmetic,
for<'a> &'a NonIdentity<P>: Mul<&'a NonZeroScalar<C>, Output = NonIdentity<P>>,
Source§type Output = NonIdentity<P>
type Output = NonIdentity<P>
* operator.Source§impl<C, P> Mul<&NonIdentity<P>> for NonZeroScalar<C>where
C: CurveArithmetic,
for<'a> &'a NonIdentity<P>: Mul<NonZeroScalar<C>, Output = NonIdentity<P>>,
impl<C, P> Mul<&NonIdentity<P>> for NonZeroScalar<C>where
C: CurveArithmetic,
for<'a> &'a NonIdentity<P>: Mul<NonZeroScalar<C>, Output = NonIdentity<P>>,
Source§type Output = NonIdentity<P>
type Output = NonIdentity<P>
* operator.Source§impl<C, P> Mul<&NonZeroScalar<C>> for &NonIdentity<P>
impl<C, P> Mul<&NonZeroScalar<C>> for &NonIdentity<P>
Source§type Output = NonIdentity<P>
type Output = NonIdentity<P>
* operator.Source§impl<C, P> Mul<&NonZeroScalar<C>> for NonIdentity<P>
impl<C, P> Mul<&NonZeroScalar<C>> for NonIdentity<P>
Source§type Output = NonIdentity<P>
type Output = NonIdentity<P>
* operator.Source§impl<C, P> Mul<NonIdentity<P>> for &NonZeroScalar<C>where
C: CurveArithmetic,
for<'a> NonIdentity<P>: Mul<&'a NonZeroScalar<C>, Output = NonIdentity<P>>,
impl<C, P> Mul<NonIdentity<P>> for &NonZeroScalar<C>where
C: CurveArithmetic,
for<'a> NonIdentity<P>: Mul<&'a NonZeroScalar<C>, Output = NonIdentity<P>>,
Source§type Output = NonIdentity<P>
type Output = NonIdentity<P>
* operator.Source§impl<C, P> Mul<NonIdentity<P>> for NonZeroScalar<C>
impl<C, P> Mul<NonIdentity<P>> for NonZeroScalar<C>
Source§type Output = NonIdentity<P>
type Output = NonIdentity<P>
* operator.Source§impl<C, P> Mul<NonZeroScalar<C>> for &NonIdentity<P>
impl<C, P> Mul<NonZeroScalar<C>> for &NonIdentity<P>
Source§type Output = NonIdentity<P>
type Output = NonIdentity<P>
* operator.Source§impl<C, P> Mul<NonZeroScalar<C>> for NonIdentity<P>
impl<C, P> Mul<NonZeroScalar<C>> for NonIdentity<P>
Source§type Output = NonIdentity<P>
type Output = NonIdentity<P>
* operator.