Thank you Sean for review!

On 6/25/19 10:55 AM, Sean Mullan wrote:
Hi Ivan,

This fix looks good.

--Sean

On 6/20/19 10:22 PM, Ivan Gerasimov wrote:
Hello!

In PBES1Core.deriveCipherKey() there are loops that look like following:

             for (int i = 0; i < iCount; i++) {
                 md.update(toBeHashed);
                 toBeHashed = md.digest(); // this resets the digest
             }

Calling md.digest() each time allocates a new byte[] array.
It would be more GC friendly, if the same array were reused.

In the fix, a first call to md.digest() allocates a properly sized array.
Subsequent iterations reuse this array.

Would you please help review?

BUGURL: https://bugs.openjdk.java.net/browse/JDK-8226543
WEBREV: http://cr.openjdk.java.net/~igerasim/8226543/00/webrev/

No new regression test, as the behavior was not changed.
Mach5 control job is green (tiers 1-4 on all supported platforms).



--
With kind regards,
Ivan Gerasimov

Reply via email to