Package de.tilman_neumann.jml.factor.ecm
Class TinyEcm64_MontInline
- java.lang.Object
-
- de.tilman_neumann.jml.factor.FactorAlgorithm
-
- de.tilman_neumann.jml.factor.ecm.TinyEcm64_MontInline
-
public class TinyEcm64_MontInline extends FactorAlgorithm
A port of Ben Buhrow's tinyecm.c (https://www.mersenneforum.org/showpost.php?p=521028&postcount=84) an ECM implementation for unsigned 64 bit integers. So far it works for inputs up to 62 bit, albeit not as fast as the C original. The (lack of an) assembler instruction to multiply two 64 bit integers seems to make a big impact here... This variant has inlined all methods called within montMul64().- Author:
- Tilman Neumann
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TinyEcm64_MontInline.EcmResult
-
Field Summary
-
Fields inherited from class de.tilman_neumann.jml.factor.FactorAlgorithm
DEFAULT, NUM_PRIMES_FOR_31_BIT_TDIV, tdivLimit
-
-
Constructor Summary
Constructors Constructor Description TinyEcm64_MontInline()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BigInteger
findSingleFactor(BigInteger N)
Find a single factor of the given N, which is composite and odd.String
getName()
static void
main(String[] args)
static long
montMul64(long a, long b, long N, long Nhat)
Montgomery multiplication of a*b mod n.-
Methods inherited from class de.tilman_neumann.jml.factor.FactorAlgorithm
factor, factor, searchFactors
-
-
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getName
in classFactorAlgorithm
- Returns:
- The name of the algorithm, possibly including important parameters.
-
montMul64
public static long montMul64(long a, long b, long N, long Nhat)
Montgomery multiplication of a*b mod n. ("mulredcx" in Yafu)- Parameters:
a
-b
-N
-Nhat
- complement of N mod 2^64- Returns:
- Montgomery multiplication of a*b mod n
-
findSingleFactor
public BigInteger findSingleFactor(BigInteger N)
Description copied from class:FactorAlgorithm
Find a single factor of the given N, which is composite and odd.- Specified by:
findSingleFactor
in classFactorAlgorithm
- Returns:
- factor
-
main
public static void main(String[] args)
-
-