I'm doing some maths using the Java BigInteger class but getting an error when I'm trying to use a negative number as an exponent. Am I right in thinking that you can rearrange:
b · φ(N)^−1 mod N
as:
b
------------
φ(N)^1 mod N
If not how can I rearrange the expression as to not get a negative exponent error in my Java code?
BigInteger can't have negative exponents, because that would make it a fraction (1 over something), which is not an "integer".
Try using BigDecimal instead.
As for your rearrangement of the expression, it should be rearranged like this:
b
------------ mod N
φ(N)^1
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With