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

Avoid key expansion when AES cipher is re-init w/ the same key

    Details

    • Subcomponent:
    • Resolved In Build:
      b12
    • Verification:
      Not verified

      Description

      Consider an application which holds on to a Cipher object for AES and keeps the same key but calls Cipher.init to change the Cipher between encryption and decryption. The current code in AESCrypt.java recomputes the expanded key (which is an expensive operation) with each call to init.

      One possible optimization is to save the key and, if it has not changed, skip recomputation on subsequent calls to Cipher.init. It'd also benefit the performance if the key expansion which currently is done in the method setSubKey() is moved to the same time when the keys are recomputed.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                coffeys Sean Coffey
                Reporter:
                valeriep Valerie Peng
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: