cryptix.provider.md

Class HAVAL

public class HAVAL extends MessageDigest implements Parameterized, VariableLengthDigest, Cloneable

A Java class to digest input according to the HAVAL algorithm.

HAVAL is a variable length MD with a variable number of passes. The values for these two parameters are read from the provider '.properties' file. Here is an example of the two property lines that do that:

    Alg.passes.HAVAL = 3
    Alg.bitLength.HAVAL = 256
 

References:

  1. Y. Zheng, J. Pieprzyk and J. Seberry, "HAVAL --- a one-way hashing algorithm with variable length of output", Advances in Cryptology --- AUSCRYPT'92, Lecture Notes in Computer Science, Springer-Verlag, 1993.

      Copyright © 1997 Systemics Ltd on behalf of the Cryptix Development Team.
      All rights reserved.

      $Revision: 1.5 $

      Since: Cryptix 2.2.2

      Author: Raif S. Naffah David Hopwood

Constructor Summary
HAVAL()
Method Summary
Objectclone()
Returns a copy of this MD object.
protected byte[]engineDigest()
Completes the hash computation by performing final operations such as padding.
protected intengineGetDigestLength()
SPI: Returns the digest length in bytes.
protected ObjectengineGetParameter(String param)
protected voidengineReset()
Resets this object disregarding any temporary data present at the time of the invocation of this call.
protected voidengineSetParameter(String param, Object value)
protected voidengineUpdate(byte input)
Continues a HAVAL message digest using the input byte.
protected voidengineUpdate(byte[] input, int offset, int len)
Hashes a byte array from a given offset for a specified length. to be used in conjunction with engineReset() and finish().
static LinkStatusgetLinkStatus()
ObjectgetParameter(String param)
voidsetBitLength(int len)
Sets the output length of this HAVAL object in bits, resetting all internal variables.
voidsetDigestLength(int len)
Sets the output length of this HAVAL object in bytes, resetting all internal variables.
voidsetParameter(String param, Object value)
voidsetPasses(int p)
Sets the number of passes for this HAVAL object, resetting all internal variables.

Constructor Detail

HAVAL

public HAVAL()

Method Detail

clone

public Object clone()
Returns a copy of this MD object.

engineDigest

protected byte[] engineDigest()
Completes the hash computation by performing final operations such as padding. At the return of this engineDigest, the MD engine is reset.

Returns: the array of bytes for the resulting hash value.

engineGetDigestLength

protected int engineGetDigestLength()
SPI: Returns the digest length in bytes.

engineGetParameter

protected Object engineGetParameter(String param)

engineReset

protected void engineReset()
Resets this object disregarding any temporary data present at the time of the invocation of this call.

engineSetParameter

protected void engineSetParameter(String param, Object value)

engineUpdate

protected void engineUpdate(byte input)
Continues a HAVAL message digest using the input byte.

engineUpdate

protected void engineUpdate(byte[] input, int offset, int len)
Hashes a byte array from a given offset for a specified length. to be used in conjunction with engineReset() and finish().

Parameters: input byte array from which data is to be hashed. offset start index of bytes to hash in input. len number of bytes to hash.

getLinkStatus

public static LinkStatus getLinkStatus()

getParameter

public Object getParameter(String param)

setBitLength

public void setBitLength(int len)
Sets the output length of this HAVAL object in bits, resetting all internal variables.

setDigestLength

public void setDigestLength(int len)
Sets the output length of this HAVAL object in bytes, resetting all internal variables.

setParameter

public void setParameter(String param, Object value)

setPasses

public void setPasses(int p)
Sets the number of passes for this HAVAL object, resetting all internal variables.