...
This malicious BigInteger
class is clearly mutable, thanks to the setValue()
method. Furthermore, the modPow()
method is subject to precision loss (see NUM00-J. Ensure that integer operations do not result in Detect or prevent integer overflow, NUM11-J. Check floating point inputs for exceptional values, NUM15-J. Ensure conversions of numeric types to narrower types do not result in lost or misinterpreted data and NUM17-J. Beware of precision loss when converting primitive integers to floating-point for more info). Any code that receives an object of this class, and assumes it is imutable will have unexpected behavior. (The BigInteger.modPow()
method has several useful cryptographic applications.)
...