GMP compared to JAVA

Florian Pigorsch pigorsch at informatik.uni-freiburg.de
Fri Dec 21 16:11:24 CET 2007


Hi,

your measurements are very hard to compare since I don't see any common points 
in both code snippets except the calculation of "op1^op2 mod m" with some 
very obscure values for op1, op2 and m.

I really doubt that both programs do the equivalent "op1^op2 mod m" 
operations!

I suggest that you prepare a minimal example that 
1. shows the problematic behaviour,
2. is as short as possible
3. uses similar operations in the GMP and JAVA versions

Post this example again to the list and you will certainly get many helpful 
comments.

And btw.: I guess
> BigInteger p = new BigInteger(aleatorio.toString().substring(0, 
aleatorio.toString().indexOf(".")));
is supposed to cut off the fractional part of "aleatorio" and store it in "p". 
This can be done with a simple "BigInteger p = aleatorio.toBigInteger();" 
without any weird string conversations!

Regards
Florian


More information about the gmp-discuss mailing list