RFR: 8294997: Improve ECC math operations [v2]

Xue-Lei Andrew Fan xuelei at openjdk.org
Wed Oct 12 14:59:24 UTC 2022


On Wed, 12 Oct 2022 12:31:20 GMT, Daniel Jeliński <djelinski at openjdk.org> wrote:

>> src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial.java line 332:
>> 
>>> 330: 
>>> 331:     protected void setLimbsValuePositive(BigInteger v, long[] limbs) {
>>> 332:         assert bitsPerLimb < 32;
>> 
>> I may have this assert in the constructors as it is a final field.
>
> I added it here as a comment explaining why using intValue is okay here; it wouldn't serve its purpose if I moved it elsewhere.
> Asserts are eliminated by the compiler by default anyway. If you think this assert shouldn't be here, I can replace it with a normal comment.

The assert feature can be turned on.  I may prefer to use comment if that's the intention.  I'm fine to you want to keep it.

-------------

PR: https://git.openjdk.org/jdk/pull/10614



More information about the security-dev mailing list