pub struct Curve {
pub a: BigInt,
pub b: BigInt,
pub p: BigInt,
}Expand description
A short Weierstrass curve y² = x³ + a·x + b over the prime field 𝔽_p.
Fields§
§a: BigInt§b: BigInt§p: BigIntImplementations§
Source§impl Curve
impl Curve
pub fn new(a: BigInt, b: BigInt, p: BigInt) -> Curve
Sourcepub fn is_on_curve(&self, pt: &Point) -> bool
pub fn is_on_curve(&self, pt: &Point) -> bool
Whether pt satisfies the curve equation.
Sourcepub fn mul(&self, k: &BigInt, pt: &Point) -> Point
pub fn mul(&self, k: &BigInt, pt: &Point) -> Point
Scalar multiplication k·P by double-and-add (k ≥ 0).
Sourcepub fn count_points(&self) -> u64
pub fn count_points(&self) -> u64
#E(𝔽_p) by direct point counting (includes the identity). O(p) — small p only.
Trait Implementations§
impl Eq for Curve
impl StructuralPartialEq for Curve
Auto Trait Implementations§
impl Freeze for Curve
impl RefUnwindSafe for Curve
impl Send for Curve
impl Sync for Curve
impl Unpin for Curve
impl UnsafeUnpin for Curve
impl UnwindSafe for Curve
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