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

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

    XMLWordPrintable

    Details

    • Subcomponent:
    • Resolved In Build:
      b55
    • CPU:
      generic
    • OS:
      generic
    • Verification:
      Not verified

      Backports

        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:
                valeriep Valerie Peng
                Reporter:
                valeriep Valerie Peng
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:
                  Imported:
                  Indexed: