Unsigned BigInteger
843810May 23 2002 — edited May 27 2002I am loading a DH prime from a byte array. The first byte is 0xe5 which, of course, implies negative. Indeed BigInteger interprets the value as negative. When I go do a keyAgreement.generateSecret(), an exception is thrown saying that the modulus must be positive. How can I load BigInteger with the byte array values being assumed to be unsigned?
java.lang.ArithmeticException: BigInteger: modulus not positive
at java.math.BigInteger.modPow(BigInteger.java:1417)
...