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

pack-priv abstract Class SHA2

extends DigestBase
Class Inheritance
Known Direct Subclasses
sun.security.provider.SHA2.SHA224, sun.security.provider.SHA2.SHA256
Imports
java.util.Arrays, .Objects, jdk.internal.util.Preconditions, jdk.internal.vm.annotation.IntrinsicCandidate

This class implements the Secure Hash Algorithm SHA-256 developed by the National Institute of Standards and Technology along with the National Security Agency.

It implements java.security.MessageDigestSpi, and can be used through Java Cryptography Architecture (JCA), as a pluggable MessageDigest implementation.

Authors
Valerie Peng, Andreas Sterbenz
Since
1.4.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
SHA2.SHA224

SHA-224 implementation class.

public static class
SHA2.SHA256

SHA-256 implementation class.

Field Summary

Modifier and TypeField and Description
private static final int
private 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
pack-priv
SHA2(String name, int digestLength, int[] initialHashes)

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.

Process the current block to update the state variable state.

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.

Return the digest.

protected void
implDigestFixedLengthPreprocessed(byte[] input, int inLen, byte[] output, int outOffset, int outLen)

Overrides sun.security.provider.DigestBase.implDigestFixedLengthPreprocessed.

Digest block-length bytes in a single operation.

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:
engineDigestengineDigestengineGetDigestLengthengineResetengineUpdateengineUpdate

Field Detail

BLOCKSIZEback to summary
private static final int BLOCKSIZE
initialHashesback to summary
private final int[] initialHashes
ITERATIONback to summary
private static final int ITERATION
ROUND_CONSTSback to summary
private static final int[] ROUND_CONSTS
stateback to summary
private int[] state
Wback to summary
private int[] W

Constructor Detail

SHA2back to summary
pack-priv SHA2(String name, int digestLength, int[] initialHashes)

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.

Process the current block to update the state variable state.

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.

Doc from sun.security.provider.DigestBase.implDigest.

Return the digest. Subclasses do not need to reset() themselves, DigestBase calls implReset() when necessary.

implDigestFixedLengthPreprocessedback to summary
protected void implDigestFixedLengthPreprocessed(byte[] input, int inLen, byte[] output, int outOffset, int outLen)

Overrides sun.security.provider.DigestBase.implDigestFixedLengthPreprocessed.

Doc from sun.security.provider.DigestBase.implDigestFixedLengthPreprocessed.

Digest block-length bytes in a single operation. Subclasses are expected to override this method. It is intended for fixed-length short input where input includes padding bytes.

Annotations
@Override
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()
sun.security.provider back to summary

public final Class SHA2.SHA224

extends SHA2
Class Inheritance

SHA-224 implementation class.

Field Summary

Modifier and TypeField and Description
private static final int[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from sun.security.provider.SHA2:
cloneimplCompressimplDigestimplDigestFixedLengthPreprocessedimplReset

Field Detail

INITIAL_HASHESback to summary
private static final int[] INITIAL_HASHES

Constructor Detail

SHA224back to summary
public SHA224()
sun.security.provider back to summary

public final Class SHA2.SHA256

extends SHA2
Class Inheritance

SHA-256 implementation class.

Field Summary

Modifier and TypeField and Description
private static final int[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from sun.security.provider.SHA2:
cloneimplCompressimplDigestimplDigestFixedLengthPreprocessedimplReset

Field Detail

INITIAL_HASHESback to summary
private static final int[] INITIAL_HASHES

Constructor Detail

SHA256back to summary
public SHA256()