-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconstants.py
More file actions
36 lines (29 loc) · 782 Bytes
/
constants.py
File metadata and controls
36 lines (29 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# coding=utf-8
"""
File that contains constants tuned specifically for the factoring algorithms
and the prime sieves. Tweakable if required.
"""
# Prime sieve constants
SMALL_THRESHOLD = 60
ERAT_THRESHOLD = 35 * 10**5
ATKIN_THERSHOLD = 10**10
LOWER_SEG_SIZE = 65536
UPPER_SEG_SIZE = 2097152
# Pollard rho constants
PRIME_THRESHOLD_RHO = 500
SIZE_THRESHOLD_RHO = 10**20
# Pollard (p-1) constants
MAX_B1_PM1 = 10**8
MAX_B2_PM1 = 10**10
MAX_D_PM1 = 500
# ECM constants
MAX_CURVES_ECM = 10000
MAX_RND_ECM = 2**63
MAX_B1_ECM = 43 * 10**7
MAX_B2_ECM = 2 * 10**10
# General factorization constants
PRIME_THRESHOLD_BF = 25000
# Names of factoring routines for displaying purposes
NAME_ECM = "Lenstra's Elliptic curve factorization"
NAME_RHO = "Pollard Rho"
NAME_PM1 = "Pollard p-1"