Class TinyEcm64_MontSqr


  • public class TinyEcm64_MontSqr
    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 uses a special implementation for Montgomery squares. Not a very impressing improvement...
    Author:
    Tilman Neumann
    • Constructor Detail

      • TinyEcm64_MontSqr

        public TinyEcm64_MontSqr()
    • Method Detail

      • getName

        public String getName()
        Specified by:
        getName in class FactorAlgorithm
        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
      • montSqr64

        public static long montSqr64​(long a,
                                     long N,
                                     long Nhat)
        Montgomery square of a mod n.
        Parameters:
        a -
        N -
        Nhat - complement of N mod 2^64
        Returns:
        Montgomery square of a mod n
      • main

        public static void main​(String[] args)