Struct libsecp256k1_core::curve::Jacobian
source · pub struct Jacobian {
pub x: Field,
pub y: Field,
pub z: Field,
pub infinity: bool,
}
Expand description
A group element of the secp256k1 curve, in jacobian coordinates.
Fields§
§x: Field
§y: Field
§z: Field
§infinity: bool
Implementations§
source§impl Jacobian
impl Jacobian
sourcepub fn set_infinity(&mut self)
pub fn set_infinity(&mut self)
Set a group element (jacobian) equal to the point at infinity.
sourcepub fn set_ge(&mut self, a: &Affine)
pub fn set_ge(&mut self, a: &Affine)
Set a group element (jacobian) equal to another which is given in affine coordinates.
pub fn from_ge(a: &Affine) -> Self
sourcepub fn eq_x_var(&self, x: &Field) -> bool
pub fn eq_x_var(&self, x: &Field) -> bool
Compare the X coordinate of a group element (jacobian).
sourcepub fn neg_in_place(&mut self, a: &Jacobian)
pub fn neg_in_place(&mut self, a: &Jacobian)
Set r equal to the inverse of a (i.e., mirrored around the X axis).
pub fn neg(&self) -> Jacobian
sourcepub fn is_infinity(&self) -> bool
pub fn is_infinity(&self) -> bool
Check whether a group element is the point at infinity.
sourcepub fn has_quad_y_var(&self) -> bool
pub fn has_quad_y_var(&self) -> bool
Check whether a group element’s y coordinate is a quadratic residue.
sourcepub fn double_nonzero_in_place(&mut self, a: &Jacobian, rzr: Option<&mut Field>)
pub fn double_nonzero_in_place(&mut self, a: &Jacobian, rzr: Option<&mut Field>)
Set r equal to the double of a. If rzr is not-NULL, r->z = a->z * *rzr (where infinity means an implicit z = 0). a may not be zero. Constant time.
sourcepub fn double_var_in_place(&mut self, a: &Jacobian, rzr: Option<&mut Field>)
pub fn double_var_in_place(&mut self, a: &Jacobian, rzr: Option<&mut Field>)
Set r equal to the double of a. If rzr is not-NULL, r->z = a->z * *rzr (where infinity means an implicit z = 0).
pub fn double_var(&self, rzr: Option<&mut Field>) -> Jacobian
sourcepub fn add_var_in_place(
&mut self,
a: &Jacobian,
b: &Jacobian,
rzr: Option<&mut Field>
)
pub fn add_var_in_place( &mut self, a: &Jacobian, b: &Jacobian, rzr: Option<&mut Field> )
Set r equal to the sum of a and b. If rzr is non-NULL, r->z = a->z * *rzr (a cannot be infinity in that case).
pub fn add_var(&self, b: &Jacobian, rzr: Option<&mut Field>) -> Jacobian
sourcepub fn add_ge_in_place(&mut self, a: &Jacobian, b: &Affine)
pub fn add_ge_in_place(&mut self, a: &Jacobian, b: &Affine)
Set r equal to the sum of a and b (with b given in affine coordinates, and not infinity).
pub fn add_ge(&self, b: &Affine) -> Jacobian
sourcepub fn add_ge_var_in_place(
&mut self,
a: &Jacobian,
b: &Affine,
rzr: Option<&mut Field>
)
pub fn add_ge_var_in_place( &mut self, a: &Jacobian, b: &Affine, rzr: Option<&mut Field> )
Set r equal to the sum of a and b (with b given in affine coordinates). This is more efficient than secp256k1_gej_add_var. It is identical to secp256k1_gej_add_ge but without constant-time guarantee, and b is allowed to be infinity. If rzr is non-NULL, r->z = a->z * *rzr (a cannot be infinity in that case).
pub fn add_ge_var(&self, b: &Affine, rzr: Option<&mut Field>) -> Jacobian
sourcepub fn add_zinv_var_in_place(&mut self, a: &Jacobian, b: &Affine, bzinv: &Field)
pub fn add_zinv_var_in_place(&mut self, a: &Jacobian, b: &Affine, bzinv: &Field)
Set r equal to the sum of a and b (with the inverse of b’s Z coordinate passed as bzinv).