pub struct EllipticCurve {
pub field: String,
pub a: i64,
pub b: i64,
}Expand description
An elliptic curve E: y² = x³ + ax + b over a field k.
Fields§
§field: StringThe base field.
a: i64Coefficient a.
b: i64Coefficient b.
Implementations§
Source§impl EllipticCurve
impl EllipticCurve
Sourcepub fn new(field: impl Into<String>, a: i64, b: i64) -> Self
pub fn new(field: impl Into<String>, a: i64, b: i64) -> Self
Create an elliptic curve y² = x³ + ax + b.
Sourcepub fn discriminant(&self) -> i64
pub fn discriminant(&self) -> i64
Discriminant Δ = -16(4a³ + 27b²). Non-zero iff the curve is non-singular.
Sourcepub fn is_non_singular(&self) -> bool
pub fn is_non_singular(&self) -> bool
Whether the curve is non-singular (Δ ≠ 0).
Sourcepub fn j_invariant(&self) -> Option<f64>
pub fn j_invariant(&self) -> Option<f64>
j-invariant j = -1728 * (4a)³ / Δ (simplified for short Weierstrass).
Trait Implementations§
Source§impl Clone for EllipticCurve
impl Clone for EllipticCurve
Source§fn clone(&self) -> EllipticCurve
fn clone(&self) -> EllipticCurve
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EllipticCurve
impl Debug for EllipticCurve
Auto Trait Implementations§
impl Freeze for EllipticCurve
impl RefUnwindSafe for EllipticCurve
impl Send for EllipticCurve
impl Sync for EllipticCurve
impl Unpin for EllipticCurve
impl UnsafeUnpin for EllipticCurve
impl UnwindSafe for EllipticCurve
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