Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Cryptix V3.1
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## cryptix.provider.md
Class HAVAL

    java.lang.Object
      |
      +--java.security.MessageDigestSpi
            |
            +--java.security.MessageDigest
                  |
                  +--cryptix.provider.md.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.4 $

   Since:
     Cryptix 2.2.2
   Author:
     Raif S. Naffah, David Hopwood

   Constructor Summary
   `HAVAL()`

   Method Summary
   `Object` | `clone()` Returns a copy of this MD object.
   `protected byte[]` | `engineDigest()` Completes the hash computation by performing final operations such as padding.
   `protected int` | `engineGetDigestLength()` SPI: Returns the digest length in bytes.
   `protected Object` | `engineGetParameter(String param)`
   `protected void` | `engineReset()` Resets this object disregarding any temporary data present at the time of the invocation of this call.
   `protected void` | `engineSetParameter(String param, Object value)`
   `protected void` | `engineUpdate(byte input)` Continues a HAVAL message digest using the input byte.
   `protected void` | `engineUpdate(byte[] input, int offset, int len)` Hashes a byte array from a given offset for a specified length.
   `static LinkStatus` | `getLinkStatus()`
   `Object` | `getParameter(String param)` Gets the value of the specified algorithm parameter.
   `void` | `setBitLength(int len)` Sets the output length of this HAVAL object in bits, resetting all internal variables.
   `void` | `setDigestLength(int len)` Sets the output length of this HAVAL object in bytes, resetting all internal variables.
   `void` | `setParameter(String param, Object value)` Sets the specified algorithm parameter to the specified value.
   `void` | `setPasses(int p)` Sets the number of passes for this HAVAL object, resetting all internal variables.

   Methods inherited from class java.security.MessageDigest
   `digest, digest, digest, getAlgorithm, getDigestLength, getInstance, getInstance, getProvider, isEqual, reset, toString, update, update, update`

   Methods inherited from class java.security.MessageDigestSpi
   `engineDigest`

   Methods inherited from class java.lang.Object
   `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

   Constructor Detail

   ### HAVAL

       public HAVAL()

   Method Detail

   ### getLinkStatus

       public static LinkStatus getLinkStatus()

   ### clone

       public Object clone()

     Returns a copy of this MD object.
     Overrides:
       clone in class MessageDigest

   ### engineReset

       protected void engineReset()

     Resets this object disregarding any temporary data present at the time of the invocation of this call.
     Overrides:
       engineReset in class MessageDigestSpi

   ### engineUpdate

       protected void engineUpdate(byte input)

     Continues a HAVAL message digest using the input byte.
     Overrides:
       engineUpdate in class MessageDigestSpi

   ### 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().
     Overrides:
       engineUpdate in class MessageDigestSpi
     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.

   ### 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.
     Overrides:
       engineDigest in class MessageDigestSpi
     Returns:
       the array of bytes for the resulting hash value.

   ### engineGetDigestLength

       protected int engineGetDigestLength()

     SPI: Returns the digest length in bytes.
     Overrides:
       engineGetDigestLength in class MessageDigestSpi

   ### setParameter

       public void setParameter(String param,
                                Object value)
                         throws NoSuchParameterException,
                                InvalidParameterException,
                                InvalidParameterTypeException

     Description copied from interface: Parameterized
     Sets the specified algorithm parameter to the specified value.

     This method supplies a general-purpose mechanism through which it is possible to set the various parameters of this object. A uniform algorithm-specific naming scheme for each parameter is desirable but left unspecified at this time.

     Specified by:
       setParameter in interface Parameterized
     Tags copied from interface: Parameterized
     Parameters:
       `param` - the string identifier of the parameter.
       `value` - the parameter value.
     Throws:
       NullPointerException - if param == null
       NoSuchParameterException - if there is no parameter with name param for this cipher implementation.
       InvalidParameterException - if the parameter exists but cannot be set (for example because the object is in the wrong state).
       InvalidParameterTypeException - if value is the wrong type for this parameter.

   ### getParameter

       public Object getParameter(String param)
                           throws NoSuchParameterException,
                                  InvalidParameterException

     Description copied from interface: Parameterized
     Gets the value of the specified algorithm parameter.

     This method supplies a general-purpose mechanism through which it is possible to get the various parameters of this object. A uniform algorithm-specific naming scheme for each parameter is desirable but left unspecified at this time.

     Specified by:
       getParameter in interface Parameterized
     Tags copied from interface: Parameterized
     Parameters:
       `param` - the string name of the parameter.
     Returns:
       the object that represents the parameter value.
     Throws:
       NullPointerException - if param == null
       NoSuchParameterException - if there is no parameter with name param for this implementation.
       InvalidParameterException - if the parameter exists but cannot be read.

   ### engineSetParameter

       protected void engineSetParameter(String param,
                                         Object value)
                                  throws NoSuchParameterException,
                                         InvalidParameterException,
                                         InvalidParameterTypeException

   ### engineGetParameter

       protected Object engineGetParameter(String param)
                                    throws NoSuchParameterException,
                                           InvalidParameterException

   ### setPasses

       public void setPasses(int p)

     Sets the number of passes for this HAVAL object, resetting all internal variables.

   ### 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.
     Specified by:
       setDigestLength in interface VariableLengthDigest
     Tags copied from interface: VariableLengthDigest
     Parameters:
       `nbytes` - the new length in bytes.

   Overview | Package | Class | Use | Tree | Deprecated | Index | Help
   | Cryptix V3.1
   PREV CLASS NEXT CLASS | FRAMES NO FRAMES
   SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

   Copyright (C) 1995-2000 The Cryptix Foundation Ltd. All rights reserved.