Crate ecm

source ·
Expand description

ecm-rs

Build Crate.io

Lenstra’s Elliptic Curve Factorization Implementation.

The code is based on the sympy implementation and translated to Rust.

Performance

Using a Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz CPU, the following results were obtained:

Numbersympyecm-rssympy / ecm-rs
3988834343372870.074s0.057s1.23x faster
461670451314151130.148s0.039s3.8x faster
642118166005151930.552s0.017s32.47x faster
1685415121310946513230.071s0.038s1.87x faster
6312110323156707768410.081s0.128s0.63x faster
41328465138186541364510.266s0.038s7.0x faster
45165113264513412816845130.495s0.038s13.03x faster
31465312465312412451324513211.22s0.22s5.55x faster
42690211800541894161981697868942271.916s0.018s106.44x faster
706000565581575429997696139445280913.555s3.467s3.91x faster

License

Licensed under either of

  • Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

Enums

  • Error occured during ecm factorization.

Functions

  • Performs factorization using Lenstra’s Elliptic curve method.
  • Returns one factor of n using Lenstra’s 2 Stage Elliptic curve Factorization with Suyama’s Parameterization. Here Montgomery arithmetic is used for fast computation of addition and doubling of points in elliptic curve.
  • Performs factorization using Lenstra’s Elliptic curve method.