iaik.me.security.md
Class SHA256

java.lang.Object
  |
  +--iaik.me.security.MessageDigest
        |
        +--iaik.me.security.md.SHA256
Direct Known Subclasses:
SHA224

public class SHA256
extends MessageDigest

This class implements the 32-bit hash algorithm SHA-256 from NIST (FIPS PUB 186-2).

Version:
File Revision 2
See Also:
java.security.MessageDigest, SHA224

Fields inherited from class iaik.me.security.MessageDigest
buffer, count, digestLength, padding
 
Constructor Summary
SHA256()
          Construct a new SHA-256 message digest.
 
Method Summary
 Object clone()
          Returns a clone of this SHA256 Object.
protected  void compress(byte[] input, int offset)
          The heart of this hash algorithm--the compression function.
 int digest(byte[] output, int offset)
          Get digest value of the hash, but do not reset the hash automatically.
 byte[][] getEncodedDigestInfo()
          Returns the pregenerated ASN1 encoding of the DigestInfo structure for the corresponding digest algorithm, see .
 void reset()
          Resets this SHA256 message digest object for being supplied with new data.
 
Methods inherited from class iaik.me.security.MessageDigest
digest, digest, getAlgorithm, getDigestLength, getInstance, register, update, update, update
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SHA256

public SHA256()
Construct a new SHA-256 message digest.
Method Detail

clone

public Object clone()
Returns a clone of this SHA256 Object.
Overrides:
clone in class MessageDigest
Returns:
a clone of this SHA256 Object

reset

public void reset()
Resets this SHA256 message digest object for being supplied with new data.

This method is called by digest(byte[], int) after the actual hash computation has been finished to automatically reset the message digest object for being supplied with new data for starting a new hash computation.

Overrides:
reset in class MessageDigest
See Also:
java.security.MessageDigest#digest

digest

public int digest(byte[] output,
                  int offset)
Get digest value of the hash, but do not reset the hash automatically. offset + digestlength < output.
Overrides:
digest in class MessageDigest
Parameters:
output - The buffer where to put the hash value.
offset - The offset in the buffer where to start writing the hash.

compress

protected void compress(byte[] input,
                        int offset)
The heart of this hash algorithm--the compression function.
Overrides:
compress in class MessageDigest
Parameters:
input - The input data.
offset - The offset where the input block starts.

getEncodedDigestInfo

public byte[][] getEncodedDigestInfo()
Description copied from class: MessageDigest
Returns the pregenerated ASN1 encoding of the DigestInfo structure for the corresponding digest algorithm, see . The digest value is of course NOT included. The two dimensional array cotains the enconding with (index = 0) and without the ASN1 parameter NULL (index = 1).
Overrides:
getEncodedDigestInfo in class MessageDigest
Following copied from class: iaik.me.security.MessageDigest
Returns:
a two dimensional byte array containing the digestinfo encodings

This Javadoc may contain text parts from IETF Internet Standard specifications, see copyright note) and RSA Data Security Public-Key Cryptography Standards (see copyright note).

IAIK-JCE ME 3.04, (c) 2002 IAIK, (c) 2003 to 2006 Stiftung SIC