--- old/src/java.base/share/classes/sun/security/provider/SHA5.java 2015-06-26 17:30:26.961117298 +0200 +++ new/src/java.base/share/classes/sun/security/provider/SHA5.java 2015-06-26 17:30:26.369117282 +0200 @@ -26,8 +26,10 @@ package sun.security.provider; import java.security.*; +import java.util.Objects; import java.math.BigInteger; +import jdk.internal.HotSpotIntrinsicCandidate; import static sun.security.provider.ByteArrayAccess.*; /** @@ -205,8 +207,27 @@ * "old" NIST Secure Hash Algorithm. */ final void implCompress(byte[] buf, int ofs) { - b2lBig128(buf, ofs, W); + implCompressCheck(buf, ofs); + implCompress0(buf, ofs); + } + + private void implCompressCheck(byte[] buf, int ofs) { + Objects.requireNonNull(buf); + // The checks performed by the method 'b2iBig128' + // are sufficient for the case when the method + // 'implCompressImpl' is replaced with a compiler + // intrinsic. + b2lBig128(buf, ofs, W); + } + + // The method 'implCompressImpl' seems not to use its parameters. + // The method can, however, be replaced with a compiler intrinsic + // that operates directly on the array 'buf' (starting from + // offset 'ofs') and not on array 'W', therefore 'buf' and 'ofs' + // must be passed as parameter the method. + @HotSpotIntrinsicCandidate + private final void implCompress0(byte[] buf, int ofs) { // The first 16 longs are from the byte stream, compute the rest of // the W[]'s for (int t = 16; t < ITERATION; t++) {