Re: RFR: 8295010: Reduce if required in EC limbs operations [v5]

2022-11-29 Thread Sean Mullan
On Tue, 29 Nov 2022 18:38:34 GMT, Sean Mullan wrote: >>> I may run it again after the integration of multiplicative inversion and >>> point multiplication improvement. >> >> After the integration of the improvement above, here is the benchmark >> numbers with this patch: >> >> Benchmark

Re: RFR: 8295010: Reduce if required in EC limbs operations [v5]

2022-11-29 Thread Xue-Lei Andrew Fan
On Tue, 29 Nov 2022 18:38:34 GMT, Sean Mullan wrote: >>> I may run it again after the integration of multiplicative inversion and >>> point multiplication improvement. >> >> After the integration of the improvement above, here is the benchmark >> numbers with this patch: >> >> Benchmark

Re: RFR: 8295010: Reduce if required in EC limbs operations [v5]

2022-11-29 Thread Sean Mullan
On Wed, 23 Nov 2022 08:05:05 GMT, Xue-Lei Andrew Fan wrote: >>> Can you share the updated benchmarks? >> >> The benchmark number in the PR description is the latest run that I have. I >> may run it again after the integration of multiplicative inversion and point >> multiplication improvemen

Re: RFR: 8295010: Reduce if required in EC limbs operations [v6]

2022-11-27 Thread John Jiang
On Wed, 23 Nov 2022 06:21:05 GMT, Xue-Lei Andrew Fan wrote: >> Hi, >> >> May I have this update reviewed? With this update, the result will be >> reduced if required in EC limbs operations in the JDK implementation. >> >> In the current implementation, the EC limbs addition and subtraction re

Re: RFR: 8295010: Reduce if required in EC limbs operations [v6]

2022-11-23 Thread Daniel Jeliński
On Wed, 23 Nov 2022 06:21:05 GMT, Xue-Lei Andrew Fan wrote: >> Hi, >> >> May I have this update reviewed? With this update, the result will be >> reduced if required in EC limbs operations in the JDK implementation. >> >> In the current implementation, the EC limbs addition and subtraction re

Re: RFR: 8295010: Reduce if required in EC limbs operations [v6]

2022-11-23 Thread Daniel Jeliński
On Wed, 23 Nov 2022 06:21:05 GMT, Xue-Lei Andrew Fan wrote: >> Hi, >> >> May I have this update reviewed? With this update, the result will be >> reduced if required in EC limbs operations in the JDK implementation. >> >> In the current implementation, the EC limbs addition and subtraction re

Re: RFR: 8295010: Reduce if required in EC limbs operations [v5]

2022-11-23 Thread Xue-Lei Andrew Fan
On Mon, 21 Nov 2022 08:15:53 GMT, Xue-Lei Andrew Fan wrote: > I may run it again after the integration of multiplicative inversion and > point multiplication improvement. After the integration of the improvement above, here is the benchmark numbers with this patch: Benchmark

Re: RFR: 8295010: Reduce if required in EC limbs operations [v6]

2022-11-22 Thread Xue-Lei Andrew Fan
> Hi, > > May I have this update reviewed? With this update, the result will be > reduced if required in EC limbs operations in the JDK implementation. > > In the current implementation, the EC limbs addition and subtraction result > is not reduced before the value is returned. This behavior

Re: RFR: 8295010: Reduce if required in EC limbs operations [v5]

2022-11-22 Thread Xue-Lei Andrew Fan
On Tue, 22 Nov 2022 08:58:16 GMT, Daniel Jeliński wrote: > Now that `reduce` is called as needed, how do we guarantee that > `ECOperations.multiply` will remain constant-time, i.e. call `reduce` a fixed > number of times regardless of the input? As the reducing operation is depends on the numb

Re: RFR: 8295010: Reduce if required in EC limbs operations [v5]

2022-11-22 Thread Daniel Jeliński
On Sat, 19 Nov 2022 07:17:19 GMT, Xue-Lei Andrew Fan wrote: >> Hi, >> >> May I have this update reviewed? With this update, the result will be >> reduced if required in EC limbs operations in the JDK implementation. >> >> In the current implementation, the EC limbs addition and subtraction re

Re: RFR: 8295010: Reduce if required in EC limbs operations [v5]

2022-11-22 Thread Daniel Jeliński
On Mon, 21 Nov 2022 16:19:00 GMT, Xue-Lei Andrew Fan wrote: >> src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial.java >> line 561: >> >>> 559: // Reduce if required. >>> 560: // if (numAdds >= maxAdds) { >>> 561: if (numAdds > 32 -

Re: RFR: 8295010: Reduce if required in EC limbs operations [v5]

2022-11-21 Thread Xue-Lei Andrew Fan
On Mon, 21 Nov 2022 07:41:12 GMT, Daniel Jeliński wrote: >> Xue-Lei Andrew Fan has updated the pull request incrementally with one >> additional commit since the last revision: >> >> remove duplicated bench test > > src/java.base/share/classes/sun/security/util/math/intpoly/IntegerPolynomial.

Re: RFR: 8295010: Reduce if required in EC limbs operations [v5]

2022-11-21 Thread Xue-Lei Andrew Fan
On Mon, 21 Nov 2022 07:44:15 GMT, Daniel Jeliński wrote: > Can you share the updated benchmarks? The benchmark number in the PR description is the latest run that I have. I may run it again after the integration of multiplicative inversion and point multiplication improvement. -

Re: RFR: 8295010: Reduce if required in EC limbs operations [v5]

2022-11-20 Thread Daniel Jeliński
On Sat, 19 Nov 2022 07:17:19 GMT, Xue-Lei Andrew Fan wrote: >> Hi, >> >> May I have this update reviewed? With this update, the result will be >> reduced if required in EC limbs operations in the JDK implementation. >> >> In the current implementation, the EC limbs addition and subtraction re

Re: RFR: 8295010: Reduce if required in EC limbs operations [v5]

2022-11-20 Thread Daniel Jeliński
On Sat, 19 Nov 2022 07:17:19 GMT, Xue-Lei Andrew Fan wrote: >> Hi, >> >> May I have this update reviewed? With this update, the result will be >> reduced if required in EC limbs operations in the JDK implementation. >> >> In the current implementation, the EC limbs addition and subtraction re

Re: RFR: 8295010: Reduce if required in EC limbs operations

2022-11-20 Thread Xue-Lei Andrew Fan
On Mon, 10 Oct 2022 12:11:54 GMT, Daniel Jeliński wrote: >> Hi, >> >> May I have this update reviewed? With this update, the result will be >> reduced if required in EC limbs operations in the JDK implementation. >> >> In the current implementation, the EC limbs addition and subtraction resul

Re: RFR: 8295010: Reduce if required in EC limbs operations [v4]

2022-11-20 Thread Xue-Lei Andrew Fan
On Wed, 9 Nov 2022 14:27:26 GMT, Ferenc Rakoczi wrote: >> Xue-Lei Andrew Fan has updated the pull request with a new target base due >> to a merge or a rebase. The pull request now contains six commits: >> >> - Merge master >> - missed reduce >> - reduce if needed >> - add the key pair gene

Re: RFR: 8295010: Reduce if required in EC limbs operations [v5]

2022-11-18 Thread Xue-Lei Andrew Fan
> Hi, > > May I have this update reviewed? With this update, the result will be > reduced if required in EC limbs operations in the JDK implementation. > > In the current implementation, the EC limbs addition and subtraction result > is not reduced before the value is returned. This behavior

Re: RFR: 8295010: Reduce if required in EC limbs operations [v4]

2022-11-09 Thread Xue-Lei Andrew Fan
On Wed, 9 Nov 2022 16:38:38 GMT, Xue-Lei Andrew Fan wrote: > > The way I see it is this: as limbs are 64-bit wide, the only place where > > they can possibly overflow (during the computations they are used for) is > > the multiplication (including multiply by int and squaring). So I would > >

Re: RFR: 8295010: Reduce if required in EC limbs operations [v4]

2022-11-09 Thread Xue-Lei Andrew Fan
On Wed, 9 Nov 2022 14:27:26 GMT, Ferenc Rakoczi wrote: > The way I see it is this: as limbs are 64-bit wide, the only place where they > can possibly overflow (during the computations they are used for) is the > multiplication (including multiply by int and squaring). So I would first try > to

Re: RFR: 8295010: Reduce if required in EC limbs operations [v4]

2022-11-09 Thread Ferenc Rakoczi
On Thu, 13 Oct 2022 18:15:30 GMT, Xue-Lei Andrew Fan wrote: >> Hi, >> >> May I have this update reviewed? With this update, the result will be >> reduced if required in EC limbs operations in the JDK implementation. >> >> In the current implementation, the EC limbs addition and subtraction re

Re: RFR: 8295010: Reduce if required in EC limbs operations [v4]

2022-11-07 Thread Xue-Lei Andrew Fan
On Thu, 13 Oct 2022 18:15:30 GMT, Xue-Lei Andrew Fan wrote: >> Hi, >> >> May I have this update reviewed? With this update, the result will be >> reduced if required in EC limbs operations in the JDK implementation. >> >> In the current implementation, the EC limbs addition and subtraction re

Re: RFR: 8295010: Reduce if required in EC limbs operations [v4]

2022-10-13 Thread Xue-Lei Andrew Fan
> Hi, > > May I have this update reviewed? With this update, the result will be > reduced if required in EC limbs operations in the JDK implementation. > > In the current implementation, the EC limbs addition and subtraction result > is not reduced before the value is returned. This behavior