JDK-8081778 : Use Intel x64 CPU instructions for RSA acceleration
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: x86
  • Submitted: 2015-06-03
  • Updated: 2017-03-20
  • Resolved: 2015-06-04
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u101Fixed 9 b70Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Relates :  
Description
The optimization is achieved through intrinsics for BigInteger squareToLen and mulAdd methods.

We see ~50% improvement for SPECjvm2008 crypto.rsa with this patch.


Comments
Duplicating a comment from JDK-8133781 ====================================== java.math.BigInteger.montReduce(int[], int[], int, int) 498 7.366 java.math.BigInteger.oddModPow(BigInteger, BigInteger) 498 7.366 java.math.BigInteger.modPow(BigInteger, BigInteger) 498 7.366 sun.security.rsa.RSACore.crtCrypt(byte[], RSAPrivateCrtKey) 491 7.262 sun.security.rsa.RSACore.rsa(byte[], RSAPrivateKey) 491 7.262 Such a call stack is common for TLS servers busy handling TLS connections associated with RSA certificates. Recent trends have been for increased RSA key lengths to be used when issuing RSA certificates. 2048 bit certs are more common now. This places extra load on CPUs. The JDK-8081778 intrinsics enhancement optimizes instructions at the hotspot compiler level in some of the BigInteger calculations which are heavily used in TLS. Interesting blog on the subject can be found here : https://certsimple.com/blog/measuring-ssl-rsa-keys
22-11-2016

Note, for the release note, document if any flags are needed to enable this
29-04-2016

Changeset: de309dbe42bf Author: kvn Date: 2015-06-03 12:54 -0700 URL: http://hg.openjdk.java.net/jdk9/hs-comp/jdk/rev/de309dbe42bf Changeset: 578f086f3435 Author: kvn Date: 2015-06-03 15:02 -0700 URL: http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/rev/578f086f3435
04-06-2015

Changes were contributed by Sandhya Viswanathan (Intel): http://cr.openjdk.java.net/~kvn/8069539/webrev.01/
04-06-2015