Struct libsecp256k1::curve::Affine

source ·
pub struct Affine {
    pub x: Field,
    pub y: Field,
    pub infinity: bool,
}
Expand description

A group element of the secp256k1 curve, in affine coordinates.

Fields§

§x: Field§y: Field§infinity: bool

Implementations§

source§

impl Affine

source

pub const fn new(x: Field, y: Field) -> Affine

Create a new affine.

source

pub fn set_xy(&mut self, x: &Field, y: &Field)

Set a group element equal to the point with given X and Y coordinates.

source

pub fn set_xquad(&mut self, x: &Field) -> bool

Set a group element (affine) equal to the point with the given X coordinate and a Y coordinate that is a quadratic residue modulo p. The return value is true iff a coordinate with the given X coordinate exists.

source

pub fn set_xo_var(&mut self, x: &Field, odd: bool) -> bool

Set a group element (affine) equal to the point with the given X coordinate, and given oddness for Y. Return value indicates whether the result is valid.

source

pub fn is_infinity(&self) -> bool

Check whether a group element is the point at infinity.

source

pub fn is_valid_var(&self) -> bool

Check whether a group element is valid (i.e., on the curve).

source

pub fn neg_in_place(&mut self, other: &Affine)

source

pub fn neg(&self) -> Affine

source

pub fn set_gej(&mut self, a: &Jacobian)

Set a group element equal to another which is given in jacobian coordinates.

source

pub fn from_gej(a: &Jacobian) -> Affine

source

pub fn set_gej_var(&mut self, a: &Jacobian)

source

pub fn set_gej_zinv(&mut self, a: &Jacobian, zi: &Field)

source

pub fn clear(&mut self)

Clear a secp256k1_ge to prevent leaking sensitive information.

Trait Implementations§

source§

impl Clone for Affine

source§

fn clone(&self) -> Affine

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Affine

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Default for Affine

source§

fn default() -> Affine

Returns the “default value” for a type. Read more
source§

impl From<AffineStorage> for Affine

source§

fn from(a: AffineStorage) -> Affine

Converts to this type from the input type.
source§

impl Into<Affine> for PublicKey

source§

fn into(self) -> Affine

Converts this type into the (usually inferred) input type.
source§

impl Into<AffineStorage> for Affine

source§

fn into(self) -> AffineStorage

Converts this type into the (usually inferred) input type.
source§

impl PartialEq for Affine

source§

fn eq(&self, other: &Affine) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl TryFrom<Affine> for PublicKey

§

type Error = Error

The type returned in the event of a conversion error.
source§

fn try_from(value: Affine) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Copy for Affine

source§

impl Eq for Affine

source§

impl StructuralPartialEq for Affine

Auto Trait Implementations§

§

impl Freeze for Affine

§

impl RefUnwindSafe for Affine

§

impl Send for Affine

§

impl Sync for Affine

§

impl Unpin for Affine

§

impl UnwindSafe for Affine

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V