I'm implementing Pollard's rho algorithm in J2ME, but the number I want to factorise is a long
already and I need to be able to square the input number and subsequent 128-bit numbers produced. Seeing as this is J2ME and I have no access to BigInteger
how can I calculate the result of these multiplication as a high and a low long
in software.
Asked
Active
Viewed 60 times
0

0x777C
- 993
- 7
- 21
-
Solution in C, in case you know how to convert from that: [How can I multiply 64 bit operands and get 128 bit result portably?](https://stackoverflow.com/a/25096197/5221149) – Andreas Mar 22 '20 at 01:43
-
Possible duplicate of [high bits of long multiplication in Java?](https://stackoverflow.com/q/18859207/5221149) – Andreas Mar 22 '20 at 01:48
-
See also: [How can I handle 128 bit little endian multiplication in Java without resorting to BigInteger](https://stackoverflow.com/q/47941995/5221149) – Andreas Mar 22 '20 at 01:51
-
@Andreas This isn't a duplicate of that, since I want to be able to multiply two emulated 128-bit integers together wheras in the linked question they're attempting to multiply two 64-bit integers to produce a 128-bit integer – 0x777C Mar 22 '20 at 01:55
-
1The first answer of the duplink directly answers your question. Split your 128 bit number into 2 64 bit numbers ... – Stephen C Mar 22 '20 at 02:01