src/java.base/share/classes/sun/security/provider/SHA5.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/java.base/share/classes/sun/security/provider/SHA5.java	Thu Jun 25 12:09:51 2015
--- new/src/java.base/share/classes/sun/security/provider/SHA5.java	Thu Jun 25 12:09:50 2015

*** 24,35 **** --- 24,37 ---- */ 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.*; /** * This class implements the Secure Hash Algorithm SHA-384 and SHA-512 * developed by the National Institute of Standards and Technology along
*** 203,214 **** --- 205,235 ---- * This is in the same vein as Peter Gutmann's algorithm listed in * the back of Applied Cryptography, Compact implementation of * "old" NIST Secure Hash Algorithm. */ final void implCompress(byte[] buf, int ofs) { + implCompressCheck(buf, ofs); + implCompressImpl(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 implCompressImpl(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++) { W[t] = lf_delta1(W[t-2]) + W[t-7] + lf_delta0(W[t-15]) + W[t-16];

src/java.base/share/classes/sun/security/provider/SHA5.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File