Request for Review: AESCrypt.init performance JDK change

Alan Bateman Alan.Bateman at
Tue Jul 17 01:00:23 PDT 2012

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.
> 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
> 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.


More information about the security-dev mailing list