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.
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