NativeBN: use bn_correct_top on negative BN
If you use BN_bin2bn, it will call bn_correct_top for you. However,
since this code is poking into the structure of the BIGNUM itself
without using API, we must call it ourselves.
Before the test_negativeValues_superfluousZeroes would fail with this
confusing error:
libcore.java.math.BigIntegerTest#test_negativeValues_superfluousZeros
junit.framework.AssertionFailedError: expected -1374707309 but was -1374707309
at junit.framework.Assert.assertEquals(Assert.java:99)
at libcore.java.math.BigIntegerTest.test_negativeValues_superfluousZeros(BigIntegerTest.java:171)
Bug: 12761797
Change-Id: I724c1313e4febca8ce2bda9d10f9b5ebde96a6b1
2 files changed