Re: RFR: 8294997: Improve ECC math operations [v2]

2022-10-12 Thread Xue-Lei Andrew Fan
On Wed, 12 Oct 2022 12:43:09 GMT, Daniel Jeliński wrote: >> This patch rewrites some BigInteger and curve point operations used in EC >> calculations: >> - coefficient * 2^power is equivalent to coefficient << power >> - number mod 2^n is equivalent to number & (2^n-1) >> - pair of IntegerModulo

Re: RFR: 8294997: Improve ECC math operations [v2]

2022-10-12 Thread Xue-Lei Andrew Fan
On Wed, 12 Oct 2022 12:31:20 GMT, Daniel Jeliński 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; >> >

Re: RFR: 8294997: Improve ECC math operations [v2]

2022-10-12 Thread Daniel Jeliński
> This patch rewrites some BigInteger and curve point operations used in EC > calculations: > - coefficient * 2^power is equivalent to coefficient << power > - number mod 2^n is equivalent to number & (2^n-1) > - pair of IntegerModuloP operations: > t2 = t1+t1 > t1 = t1+t2 > is equivalent to t1=t1

Re: RFR: 8294997: Improve ECC math operations

2022-10-12 Thread Daniel Jeliński
On Tue, 11 Oct 2022 17:30:02 GMT, Xue-Lei Andrew Fan wrote: >> This patch rewrites some BigInteger and curve point operations used in EC >> calculations: >> - coefficient * 2^power is equivalent to coefficient << power >> - number mod 2^n is equivalent to number & (2^n-1) >> - pair of IntegerMod

Re: RFR: 8294997: Improve ECC math operations

2022-10-11 Thread Xue-Lei Andrew Fan
On Fri, 7 Oct 2022 21:11:39 GMT, Daniel Jeliński wrote: > This patch rewrites some BigInteger and curve point operations used in EC > calculations: > - coefficient * 2^power is equivalent to coefficient << power > - number mod 2^n is equivalent to number & (2^n-1) > - pair of IntegerModuloP oper

Re: RFR: 8294997: Improve ECC math operations

2022-10-11 Thread Ferenc Rakoczi
On Fri, 7 Oct 2022 21:11:39 GMT, Daniel Jeliński wrote: > This patch rewrites some BigInteger and curve point operations used in EC > calculations: > - coefficient * 2^power is equivalent to coefficient << power > - number mod 2^n is equivalent to number & (2^n-1) > - pair of IntegerModuloP oper

RFR: 8294997: Improve ECC math operations

2022-10-11 Thread Daniel Jeliński
This patch rewrites some BigInteger and curve point operations used in EC calculations: - coefficient * 2^power is equivalent to coefficient << power - number mod 2^n is equivalent to number & (2^n-1) - pair of IntegerModuloP operations: t2 = t1+t1 t1 = t1+t2 is equivalent to t1=t1*3, which is now