APIdia Launch Partner
Top Description Fields Constructors Methods
sun.security.provider

public final Class SHA

extends DigestBase
Class Inheritance
Imports
java.util.Arrays, .Objects, jdk.internal.util.Preconditions, jdk.internal.vm.annotation.IntrinsicCandidate

This class implements the Secure Hash Algorithm (SHA) developed by the National Institute of Standards and Technology along with the National Security Agency. This is the updated version of SHA fip-180 as superseded by fip-180-1.

It implement JavaSecurity MessageDigest, and can be used by in the Java Security framework, as a pluggable implementation, as a filter for the digest stream classes.

Authors
Roger Riggs, Benjamin Renaud, Andreas Sterbenz

Field Summary

Modifier and TypeField and Description
private static final int
private static final int
private static final int
private static final int
private int[]
private int[]
W

Inherited from sun.security.provider.DigestBase:
blockSizebufferbytesProcessedpadding

Constructor Summary

AccessConstructor and Description
public
SHA()

Creates a new SHA object.

Method Summary

Modifier and TypeMethod and Description
public Object
clone()

Overrides sun.security.provider.DigestBase.clone.

Returns a clone if the implementation is cloneable.

pack-priv void
implCompress(byte[] buf, int ofs)

Implements abstract sun.security.provider.DigestBase.implCompress.

Compute the hash for the current block.

private void
implCompress0(byte[] buf, int ofs)

private void
implCompressCheck(byte[] buf, int ofs)

pack-priv void
implDigest(byte[] out, int ofs)

Implements abstract sun.security.provider.DigestBase.implDigest.

Computes the final hash and copies the 20 bytes to the output array.

pack-priv void
implReset()

Implements abstract sun.security.provider.DigestBase.implReset.

Resets the buffers and hash value to start a new hash.

private void
Inherited from sun.security.provider.DigestBase:
engineDigestengineDigestengineGetDigestLengthengineResetengineUpdateengineUpdateimplDigestFixedLengthPreprocessed

Field Detail

round1_ktback to summary
private static final int round1_kt
round2_ktback to summary
private static final int round2_kt
round3_ktback to summary
private static final int round3_kt
round4_ktback to summary
private static final int round4_kt
stateback to summary
private int[] state
Wback to summary
private int[] W

Constructor Detail

SHAback to summary
public SHA()

Creates a new SHA object.

Method Detail

cloneback to summary
public Object clone() throws CloneNotSupportedException

Overrides sun.security.provider.DigestBase.clone.

Doc from java.security.MessageDigestSpi.clone.

Returns a clone if the implementation is cloneable.

Exceptions
CloneNotSupportedException:
if this is called on an implementation that does not support Cloneable.
implCompressback to summary
pack-priv void implCompress(byte[] buf, int ofs)

Implements abstract sun.security.provider.DigestBase.implCompress.

Compute the hash for the current block. 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.

implCompress0back to summary
private void implCompress0(byte[] buf, int ofs)
Annotations
@IntrinsicCandidate
implCompressCheckback to summary
private void implCompressCheck(byte[] buf, int ofs)
implDigestback to summary
pack-priv void implDigest(byte[] out, int ofs)

Implements abstract sun.security.provider.DigestBase.implDigest.

Computes the final hash and copies the 20 bytes to the output array.

implResetback to summary
pack-priv void implReset()

Implements abstract sun.security.provider.DigestBase.implReset.

Resets the buffers and hash value to start a new hash.

resetHashesback to summary
private void resetHashes()