I\'m wondering about the performance/complexity of constructing BigInteger objects with the new BigInteger(String) constructor
The O(n^2) effort is caused by the decimal to binary conversion if the BigInteger is specified as decimal digits.
Also, 10^7 digits is a really huge number. For typical cryptographic algorithms like RSA you would deal with 10^3 to 10^4 digits. Most of the BigInteger operations are not optimized for such a large number of digits.