RFR: 8294997: Improve ECC math operations [v2]

Daniel Jeliński djelinski at openjdk.org
Wed Oct 12 12:43:09 UTC 2022


> 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 implemented more efficiently.
> 
> Benchmarked the code using not-yet-merged benchmark from #10544. Results on x64 before:
> 
> Benchmark        (messageLength)   Mode  Cnt     Score   Error  Units
> Signatures.sign               64  thrpt   15  1578.907 ± 1.522  ops/s
> 
> After:
> 
> Benchmark        (messageLength)   Mode  Cnt     Score   Error  Units
> Signatures.sign               64  thrpt   15  1679.495 ± 3.883  ops/s
> 
> Greatest part of the improvement is related to ECOperations changes; BigInteger modifications provide only marginal gains (1584 ops/s without ECOperations changes).
> 
> Tier1-3 tests continue to pass.

Daniel Jeliński has updated the pull request incrementally with two additional commits since the last revision:

 - Update copyright year
 - Revert DSA changes

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/10614/files
  - new: https://git.openjdk.org/jdk/pull/10614/files/effc1a65..ecc7f41b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=10614&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=10614&range=00-01

  Stats: 5 lines in 3 files changed: 0 ins; 0 del; 5 mod
  Patch: https://git.openjdk.org/jdk/pull/10614.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/10614/head:pull/10614

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



More information about the security-dev mailing list