Struct libsecp256k1_core::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
impl Affine
sourcepub fn set_xy(&mut self, x: &Field, y: &Field)
pub fn set_xy(&mut self, x: &Field, y: &Field)
Set a group element equal to the point with given X and Y coordinates.
sourcepub fn set_xquad(&mut self, x: &Field) -> bool
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.
sourcepub fn set_xo_var(&mut self, x: &Field, odd: bool) -> bool
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.
sourcepub fn is_infinity(&self) -> bool
pub fn is_infinity(&self) -> bool
Check whether a group element is the point at infinity.
sourcepub fn is_valid_var(&self) -> bool
pub fn is_valid_var(&self) -> bool
Check whether a group element is valid (i.e., on the curve).
pub fn neg_in_place(&mut self, other: &Affine)
pub fn neg(&self) -> Affine
sourcepub fn set_gej(&mut self, a: &Jacobian)
pub fn set_gej(&mut self, a: &Jacobian)
Set a group element equal to another which is given in jacobian coordinates.
pub fn from_gej(a: &Jacobian) -> Self
pub fn set_gej_var(&mut self, a: &Jacobian)
pub fn set_gej_zinv(&mut self, a: &Jacobian, zi: &Field)
Trait Implementations§
source§impl From<AffineStorage> for Affine
impl From<AffineStorage> for Affine
source§fn from(a: AffineStorage) -> Affine
fn from(a: AffineStorage) -> Affine
Converts to this type from the input type.
source§impl Into<AffineStorage> for Affine
impl Into<AffineStorage> for Affine
source§fn into(self) -> AffineStorage
fn into(self) -> AffineStorage
Converts this type into the (usually inferred) input type.
source§impl PartialEq for Affine
impl PartialEq for Affine
impl Copy for Affine
impl Eq for Affine
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> 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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)