Struct EcPoint
pub struct EcPoint(/* private fields */);
Expand description
Represents a point on the curve
OpenSSL documentation at EC_POINT_new
Implementations§
§impl EcPoint
impl EcPoint
pub fn new(group: &EcGroupRef) -> Result<EcPoint, ErrorStack>
pub fn new(group: &EcGroupRef) -> Result<EcPoint, ErrorStack>
Creates a new point on the specified curve.
This corresponds to EC_POINT_new
.
pub fn from_bytes(
group: &EcGroupRef,
buf: &[u8],
ctx: &mut BigNumContextRef,
) -> Result<EcPoint, ErrorStack>
pub fn from_bytes( group: &EcGroupRef, buf: &[u8], ctx: &mut BigNumContextRef, ) -> Result<EcPoint, ErrorStack>
Creates point from a binary representation
This corresponds to EC_POINT_oct2point
.
Methods from Deref<Target = EcPointRef>§
pub fn add(
&mut self,
group: &EcGroupRef,
a: &EcPointRef,
b: &EcPointRef,
ctx: &mut BigNumContextRef,
) -> Result<(), ErrorStack>
pub fn add( &mut self, group: &EcGroupRef, a: &EcPointRef, b: &EcPointRef, ctx: &mut BigNumContextRef, ) -> Result<(), ErrorStack>
Computes a + b
, storing the result in self
.
This corresponds to EC_POINT_add
.
pub fn mul(
&mut self,
group: &EcGroupRef,
q: &EcPointRef,
m: &BigNumRef,
ctx: &BigNumContextRef,
) -> Result<(), ErrorStack>
pub fn mul( &mut self, group: &EcGroupRef, q: &EcPointRef, m: &BigNumRef, ctx: &BigNumContextRef, ) -> Result<(), ErrorStack>
Computes q * m
, storing the result in self
.
This corresponds to EC_POINT_mul
.
pub fn mul_generator(
&mut self,
group: &EcGroupRef,
n: &BigNumRef,
ctx: &BigNumContextRef,
) -> Result<(), ErrorStack>
pub fn mul_generator( &mut self, group: &EcGroupRef, n: &BigNumRef, ctx: &BigNumContextRef, ) -> Result<(), ErrorStack>
Computes generator * n
, storing the result in self
.
pub fn mul_full(
&mut self,
group: &EcGroupRef,
n: &BigNumRef,
q: &EcPointRef,
m: &BigNumRef,
ctx: &mut BigNumContextRef,
) -> Result<(), ErrorStack>
pub fn mul_full( &mut self, group: &EcGroupRef, n: &BigNumRef, q: &EcPointRef, m: &BigNumRef, ctx: &mut BigNumContextRef, ) -> Result<(), ErrorStack>
Computes generator * n + q * m
, storing the result in self
.
pub fn invert(
&mut self,
group: &EcGroupRef,
ctx: &BigNumContextRef,
) -> Result<(), ErrorStack>
pub fn invert( &mut self, group: &EcGroupRef, ctx: &BigNumContextRef, ) -> Result<(), ErrorStack>
Inverts self
.
This corresponds to EC_POINT_invert
.
pub fn to_bytes(
&self,
group: &EcGroupRef,
form: PointConversionForm,
ctx: &mut BigNumContextRef,
) -> Result<Vec<u8>, ErrorStack>
pub fn to_bytes( &self, group: &EcGroupRef, form: PointConversionForm, ctx: &mut BigNumContextRef, ) -> Result<Vec<u8>, ErrorStack>
Serializes the point to a binary representation.
This corresponds to EC_POINT_point2oct
.
pub fn to_owned(&self, group: &EcGroupRef) -> Result<EcPoint, ErrorStack>
pub fn to_owned(&self, group: &EcGroupRef) -> Result<EcPoint, ErrorStack>
Creates a new point on the specified curve with the same value.
This corresponds to EC_POINT_dup
.
pub fn eq(
&self,
group: &EcGroupRef,
other: &EcPointRef,
ctx: &mut BigNumContextRef,
) -> Result<bool, ErrorStack>
pub fn eq( &self, group: &EcGroupRef, other: &EcPointRef, ctx: &mut BigNumContextRef, ) -> Result<bool, ErrorStack>
Determines if this point is equal to another.
OpenSSL doucmentation at EC_POINT_cmp
pub fn affine_coordinates_gfp(
&self,
group: &EcGroupRef,
x: &mut BigNumRef,
y: &mut BigNumRef,
ctx: &mut BigNumContextRef,
) -> Result<(), ErrorStack>
pub fn affine_coordinates_gfp( &self, group: &EcGroupRef, x: &mut BigNumRef, y: &mut BigNumRef, ctx: &mut BigNumContextRef, ) -> Result<(), ErrorStack>
Place affine coordinates of a curve over a prime field in the provided
x
and y
BigNum
s
This corresponds to EC_POINT_get_affine_coordinates_GFp
.
Trait Implementations§
§impl AsMut<EcPointRef> for EcPoint
impl AsMut<EcPointRef> for EcPoint
§fn as_mut(&mut self) -> &mut EcPointRef
fn as_mut(&mut self) -> &mut EcPointRef
§impl AsRef<EcPointRef> for EcPoint
impl AsRef<EcPointRef> for EcPoint
§fn as_ref(&self) -> &EcPointRef
fn as_ref(&self) -> &EcPointRef
§impl Borrow<EcPointRef> for EcPoint
impl Borrow<EcPointRef> for EcPoint
§fn borrow(&self) -> &EcPointRef
fn borrow(&self) -> &EcPointRef
§impl BorrowMut<EcPointRef> for EcPoint
impl BorrowMut<EcPointRef> for EcPoint
§fn borrow_mut(&mut self) -> &mut EcPointRef
fn borrow_mut(&mut self) -> &mut EcPointRef
§impl Deref for EcPoint
impl Deref for EcPoint
§type Target = EcPointRef
type Target = EcPointRef
§fn deref(&self) -> &EcPointRef
fn deref(&self) -> &EcPointRef
§impl DerefMut for EcPoint
impl DerefMut for EcPoint
§fn deref_mut(&mut self) -> &mut EcPointRef
fn deref_mut(&mut self) -> &mut EcPointRef
§impl ForeignType for EcPoint
impl ForeignType for EcPoint
impl Send for EcPoint
impl Sync for EcPoint
Auto Trait Implementations§
impl Freeze for EcPoint
impl RefUnwindSafe for EcPoint
impl Unpin for EcPoint
impl UnwindSafe for EcPoint
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more