iaik.cms
Interface HashEngine

All Known Subinterfaces:
InputStreamHashEngine, OutputStreamHashEngine

public interface HashEngine

Generic hash engine. It does not take care about the way the data to be hashed is provided (this may be done by, e.g., piping the data through a stream or, e.g., by supplying the data by means of byte array(s). This interface only contains one single method, getHash that must return the hash value calculated on the data.


Method Summary
 byte[] getHash()
          Gets the calculated hash value.
 byte[] getHash(int hashLen)
          Gets the calculated hash value of the given length.
 

Method Detail

getHash

byte[] getHash()
Gets the calculated hash value.
A call to this method resets the underlying hash engine.

Returns:
the hash value.

getHash

byte[] getHash(int hashLen)
               throws java.security.DigestException
Gets the calculated hash value of the given length.
This method is used to calculate the hash value for Extendable Output Functions (like SHAKE) where the hahs output maybe of variable length.
A call to this method resets the underlying hash engine.

Parameters:
hashLen - the length (in bytes) of the hash value
Returns:
the hash value.
Throws:
java.security.DigestException - if an error occurs when calculating the hash value

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

IAIK-CMS 6.0, (c) 2002 IAIK, (c) 2003, 2023 SIC