Registry / data / passagemath-libecm

passagemath-libecm

JSON →
library10.8.4pypypiunverified

passagemath-libecm provides Python bindings to GMP-ECM for elliptic curve method (ECM) integer factorization. Version 10.8.4 supports Python 3.11-3.14. It is part of the passagemath ecosystem and is released on a regular cadence alongside other components.

pip install passagemath-libecm
INSTALL
IMPORT
SIG · PASSAGEMATH-LIBECM
P
passagemath-libecm
datapythonv10.8.4
Install
6.8s avg
Import
Disk
250MB
Pass rate
8/ 10
Env Coverage8 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v10.6.48 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 7.1s
py 3.11
✓ —
✓ 7s
py 3.12
✓ —
✓ 5.9s
py 3.13
✕ build_error
✕ build_error
py 3.9
✓ —
✓ 7.1s
250MB installed
● package 250MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

find_factor
from passagemath_libecm import find_factor
from passagemath.libecm import find_factor

Basic usage: attempt integer factorization with ECM using the find_factor function.

from passagemath.libecm import find_factor # Factor a composite number n = 9999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999999 B1 = 1000000 B2 = 100000000 result = find_factor(n, B1, B2) print('Found factor:' if result else 'No factor found')
Debug
Known issues
breakingThe function signature changed between 10.8.2 and 10.8.3: the 'seed' parameter was removed and replaced by an internal RNG. Code using 'seed' will raise TypeError.
fix
Remove the seed argument; RNG is now seeded automatically.
affects: >=10.8.3
gotchaDo not import directly from 'ecm' or 'libecm' - the correct top-level module is 'passagemath.libecm'.
fix
Use 'from passagemath.libecm import ...'
affects: all
deprecatedThe 'curves' argument in ECM constructor is deprecated; use 'ncurves' instead.
fix
Replace curves=10 with ncurves=10
affects: >=10.8.0
gotchaPassing large numbers (over ~1000 digits) may hang or exhaust memory; tune B1/B2 appropriately.
fix
Reduce B1 bounds or use the 'max_stage2_input' parameter.
affects: all
Upgrade
Version history
10.8.4latest on PyPI · released Apr 20, 2026
Audit
Dependencies
gmpy2requiredRequired for MPZ arithmetic used in the ECM implementation.
passagemath-sageoptionalOften used side-by-side for number theory; not strictly required.
Agent activity
2 hits · last 30 days
node
2
Resources