Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8081778

Use Intel x64 CPU instructions for RSA acceleration

    Details

    • Subcomponent:
    • Resolved In Build:
      b70
    • CPU:
      x86
    • OS:
      generic

      Backports

        Description

        The optimization is achieved through intrinsics for BigInteger squareToLen and mulAdd methods.

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

          Issue Links

            Activity

            Hide
            kvn Vladimir Kozlov added a comment -
            Changes were contributed by Sandhya Viswanathan (Intel):

            http://cr.openjdk.java.net/~kvn/8069539/webrev.01/
            Show
            kvn Vladimir Kozlov added a comment - Changes were contributed by Sandhya Viswanathan (Intel): http://cr.openjdk.java.net/~kvn/8069539/webrev.01/
            Hide
            kvn Vladimir Kozlov added a comment -
            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
            Show
            kvn Vladimir Kozlov added a comment - 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
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/rev/578f086f3435
            User: kvn
            Date: 2015-06-03 23:50:15 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/hs-comp/hotspot/rev/578f086f3435 User: kvn Date: 2015-06-03 23:50:15 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/hs-comp/jdk/rev/de309dbe42bf
            User: kvn
            Date: 2015-06-03 23:50:16 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/hs-comp/jdk/rev/de309dbe42bf User: kvn Date: 2015-06-03 23:50:16 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/578f086f3435
            User: lana
            Date: 2015-06-20 18:07:53 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/578f086f3435 User: lana Date: 2015-06-20 18:07:53 +0000
            Hide
            hgupdate HG Updates added a comment -
            URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/de309dbe42bf
            User: lana
            Date: 2015-06-20 18:08:09 +0000
            Show
            hgupdate HG Updates added a comment - URL: http://hg.openjdk.java.net/jdk9/jdk9/jdk/rev/de309dbe42bf User: lana Date: 2015-06-20 18:08:09 +0000
            Hide
            mcastegr Mattis Castegren (Inactive) added a comment -
            Note, for the release note, document if any flags are needed to enable this
            Show
            mcastegr Mattis Castegren (Inactive) added a comment - Note, for the release note, document if any flags are needed to enable this
            Hide
            coffeys Sean Coffey added a comment -
            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
            Show
            coffeys Sean Coffey added a comment - 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

              People

              • Assignee:
                kvn Vladimir Kozlov
                Reporter:
                kvn Vladimir Kozlov
              • Votes:
                0 Vote for this issue
                Watchers:
                6 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: