src/java.base/share/classes/sun/security/provider/SHA2.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/java.base/share/classes/sun/security/provider/SHA2.java	Fri Jun 26 17:30:27 2015
--- new/src/java.base/share/classes/sun/security/provider/SHA2.java	Fri Jun 26 17:30:26 2015

*** 23,32 **** --- 23,35 ---- * questions. */ package sun.security.provider; + import java.util.Objects; + + import jdk.internal.HotSpotIntrinsicCandidate; import static sun.security.provider.ByteArrayAccess.*; /** * This class implements the Secure Hash Algorithm SHA-256 developed by * the National Institute of Standards and Technology along with the
*** 184,195 **** --- 187,217 ---- /** * Process the current block to update the state variable state. */ void implCompress(byte[] buf, int ofs) { + implCompressCheck(buf, ofs); + implCompress0(buf, ofs); + } + + private void implCompressCheck(byte[] buf, int ofs) { + Objects.requireNonNull(buf); + + // The checks performed by the method 'b2iBig64' + // are sufficient for the case when the method + // 'implCompressImpl' is replaced with a compiler + // intrinsic. b2iBig64(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 void implCompress0(byte[] buf, int ofs) { // The first 16 ints 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/SHA2.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File