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 SHA0

    java.lang.Object
      |
      +--java.security.MessageDigestSpi
            |
            +--java.security.MessageDigest
                  |
                  +--cryptix.provider.md.BlockMessageDigest
                        |
                        +--cryptix.provider.md.SHA0

public final class SHA0
extends cryptix.provider.md.BlockMessageDigest
implements Cloneable

This class implements the SHA-0 message digest algorithm (not to be confused with the revised SHA-1 algorithm). SHA-1 is preferred for new applications.

BUG: The update method is missing.

References:

1. NIST FIPS PUB 180, "Secure Hash Standard", U.S. Department of Commerce, May 1993.

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

$Revision: 1.7 $

Since:
  Cryptix 2.2.2
Author:
  Systemics Ltd, David Hopwood

Field Summary
`static int` | `DATA_LENGTH` Length of a block (i.e.
`static int` | `HASH_LENGTH` Length of the final hash (in bytes).

Constructor Summary
`SHA0()` The public constructor.

Method Summary
`Object` | `clone()` Returns a copy of this MD object.
`protected byte[]` | `engineDigest(byte[] in, int length)` Returns the digest of the data added and resets the digest.
`protected int` | `engineGetDataLength()` Returns the length of the data (in bytes) hashed in every transform.
`protected int` | `engineGetDigestLength()` Returns the length of the hash (in bytes).
`protected void` | `engineReset()` Initializes (resets) the message digest.
`protected void` | `engineTransform(byte[] in)` Adds data to the message digest.
`static void` | `main(String[] argv)` Entry point for `self_test`.
`static void` | `self_test()` Do some basic tests.

Methods inherited from class cryptix.provider.md.BlockMessageDigest
`bitcount, engineDigest, engineUpdate, engineUpdate`

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`

Field Detail

### HASH_LENGTH

    public static final int HASH_LENGTH

  Length of the final hash (in bytes).

### DATA_LENGTH

    public static final int DATA_LENGTH

  Length of a block (i.e. the number of bytes hashed in every transform).

Constructor Detail

### SHA0

    public SHA0()

  The public constructor.

Method Detail

### engineGetDigestLength

    protected int engineGetDigestLength()

  Returns the length of the hash (in bytes).
  Overrides:
    engineGetDigestLength in class MessageDigestSpi

### engineGetDataLength

    protected int engineGetDataLength()

  Returns the length of the data (in bytes) hashed in every transform.
  Overrides:
    engineGetDataLength in class cryptix.provider.md.BlockMessageDigest

### clone

    public Object clone()

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

### engineReset

    protected void engineReset()

  Initializes (resets) the message digest.
  Overrides:
    engineReset in class cryptix.provider.md.BlockMessageDigest

### engineTransform

    protected void engineTransform(byte[] in)

  Adds data to the message digest.
  Overrides:
    engineTransform in class cryptix.provider.md.BlockMessageDigest
  Parameters:
    `data` - The data to be added.
    `offset` - The start of the data in the array.
    `length` - The amount of data to add.

### engineDigest

    protected byte[] engineDigest(byte[] in,
                                  int length)

  Returns the digest of the data added and resets the digest.
  Overrides:
    engineDigest in class cryptix.provider.md.BlockMessageDigest
  Returns:
    the digest of all the data added to the message digest as a byte array.

### main

    public static final void main(String[] argv)

  Entry point for `self_test`.

### self_test

    public static final void self_test()
                                throws Exception

  Do some basic tests. Three of the validation data are included only, no output, success or exception. If you want more, write a test program!
  See Also:
    `cryptix.test.TestSHA0`

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.