Struct libsecp256k1::curve::Affine[][src]

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: Fieldy: Fieldinfinity: bool

Implementations

impl Affine[src]

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

Create a new affine.

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

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

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

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.

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

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.

pub fn is_infinity(&self) -> bool[src]

Check whether a group element is the point at infinity.

pub fn is_valid_var(&self) -> bool[src]

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

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

pub fn neg(&self) -> Affine[src]

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

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

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

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

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

pub fn clear(&mut self)[src]

Clear a secp256k1_ge to prevent leaking sensitive information.

Trait Implementations

impl Clone for Affine[src]

pub fn clone(&self) -> Affine[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Affine[src]

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

Formats the value using the given formatter. Read more

impl Default for Affine[src]

pub fn default() -> Affine[src]

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

impl From<AffineStorage> for Affine[src]

pub fn from(a: AffineStorage) -> Affine[src]

Performs the conversion.

impl Into<Affine> for PublicKey[src]

fn into(self) -> Affine[src]

Performs the conversion.

impl Into<AffineStorage> for Affine[src]

pub fn into(self) -> AffineStorage[src]

Performs the conversion.

impl PartialEq<Affine> for Affine[src]

pub fn eq(&self, other: &Affine) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

pub fn ne(&self, other: &Affine) -> bool[src]

This method tests for !=.

impl Copy for Affine[src]

impl Eq for Affine[src]

impl StructuralEq for Affine[src]

impl StructuralPartialEq for Affine[src]

Auto Trait Implementations

impl RefUnwindSafe for Affine

impl Send for Affine

impl Sync for Affine

impl Unpin for Affine

impl UnwindSafe for Affine

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

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

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

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

pub fn vzip(self) -> V