Request for Review: AESCrypt.init performance JDK change

Deneau, Tom tom.deneau at amd.com
Tue Jul 17 08:10:59 PDT 2012


Alan --

Can you tell me the procedure I should follow?
I have submitted hotspot webrevs before but not JDK webrevs?

-- Tom

-----Original Message-----
From: Alan Bateman [mailto:Alan.Bateman at oracle.com] 
Sent: Tuesday, July 17, 2012 3:00 AM
To: Deneau, Tom
Cc: jdk7u-dev at openjdk.java.net; security-dev at openjdk.java.net
Subject: Re: Request for Review: AESCrypt.init performance JDK change

On 16/07/2012 21:08, Deneau, Tom wrote:
> Please review the following webrev which improves performance for the
> com/sun/crypto/provider when the algorithm is AES for some kinds of
> Cipher usage patterns.
>
> http://cr.openjdk.java.net/~tdeneau/aescrypt-init-performance/webrev.01/
>
> I do not have a bug number for this change but a description would be
> something like the following:
>
>     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.
>
> The proposed code saves the key and, if it has not changed, does not
> need to recompute on subsequent calls to Cipher.init.  The proposed
> code also incorporates into the key calculation the final step which
> was the expansion of the key to a 1-dimensional array of ints.  This
> step used to be done in the routine setSubKey.
>
> -- Tom Deneau
Tom - I assume this will need to get reviewed for jdk8 and bake in that 
forest for a bit before it can be considered for 7u.

-Alan.





More information about the security-dev mailing list