Class cryptix.security.SHA0
All Packages Class Hierarchy This Package Previous Next Index
Class cryptix.security.SHA0
java.lang.Object
|
+----cryptix.security.MessageDigest
|
+----cryptix.security.SHA0
- public final class SHA0
- extends MessageDigest
This class implements the SHA-0 message digest.
Not to be confused with the revised SHA algorithm.
Copyright (C) 1995, 1996 Systemics Ltd (http://www.systemics.com/)
All rights reserved.
-
data
-
-
DATA_LENGTH
-
-
digest
-
-
HASH_LENGTH
- Length of the final hash (in bytes).
-
tmp
-
-
w
-
-
SHA0()
- The public constructor.
-
byte2int(int[], int, byte[], int, int)
-
-
CreateHash(byte[])
- Returns the hash of a single byte array.
-
data_length()
- Return length of the data (in bytes) hashed in every transform.
-
digestAsHash()
- Returns the digest of the data added and resets the digest.
-
f1(int, int, int)
-
-
f2(int, int, int)
-
-
f3(int, int, int)
-
-
f4(int, int, int)
-
-
getLinkErrorString()
-
-
hasFileLibraryLoaded()
-
-
hash(byte[])
- Returns the hash of a single byte array.
-
hash(String)
- Returns the hash of a single string.
-
hash_length()
- Return length of the hash (in bytes).
-
hashAsMessageHash(byte[])
- Returns the MessageHash of a single byte array.
-
hashAsMessageHash(String)
- Returns the MessageHash of a single string.
-
isLibraryCorrect()
-
-
java_transform()
-
-
main(String[])
-
-
md_digest()
- Returns the digest of the data added and resets the digest.
-
md_reset()
- Initialise (reset) the message digest.
-
md_transform()
- Add data to the message digest
-
name()
- Return name of this hash function.
-
self_test(PrintStream, String[])
-
-
transform(int[])
-
HASH_LENGTH
public final static int HASH_LENGTH
- Length of the final hash (in bytes).
DATA_LENGTH
public final static int DATA_LENGTH
data
protected int data[]
digest
protected int digest[]
tmp
protected byte tmp[]
w
protected int w[]
SHA0
public SHA0()
- The public constructor.
hasFileLibraryLoaded
public final static boolean hasFileLibraryLoaded()
isLibraryCorrect
public final static boolean isLibraryCorrect()
getLinkErrorString
public final static String getLinkErrorString()
hash_length
public final int hash_length()
- Return length of the hash (in bytes).
- Returns:
- The length of the hash.
- Overrides:
- hash_length in class MessageDigest
- See Also:
- HASH_LENGTH
data_length
public final int data_length()
- Return length of the data (in bytes) hashed in every transform.
- Returns:
- The length of the data block.
- Overrides:
- data_length in class MessageDigest
name
public String name()
- Return name of this hash function.
- Returns:
- The name of the hash function.
- Overrides:
- name in class MessageDigest
md_reset
public void md_reset()
- Initialise (reset) the message digest.
- Overrides:
- md_reset in class MessageDigest
md_transform
protected void md_transform()
- Add data to the message digest
- Parameters:
- data - The data to be added.
- offset - The start of the data in the array.
- length - The amount of data to add.
- Overrides:
- md_transform in class MessageDigest
java_transform
protected void java_transform()
md_digest
protected byte[] md_digest()
- Returns the digest of the data added and resets the digest.
- Returns:
- the digest of all the data added to the message digest as a byte array.
- Overrides:
- md_digest in class MessageDigest
digestAsHash
public MessageHash digestAsHash()
- Returns the digest of the data added and resets the digest.
- Returns:
- the digest of all the data added to the message digest as an object.
- Overrides:
- digestAsHash in class MessageDigest
hash
public static byte[] hash(String msg)
- Returns the hash of a single string.
- Parameters:
- msg - the string to hash.
- Returns:
- the hash of the string.
hash
public static byte[] hash(byte msg[])
- Returns the hash of a single byte array.
- Parameters:
- msg - the byte array to hash.
- Returns:
- the hash of the string.
hashAsMessageHash
public static HashSHA0 hashAsMessageHash(String msg)
- Returns the MessageHash of a single string.
- Parameters:
- msg - the string to hash.
- Returns:
- the MessageHash of the string.
hashAsMessageHash
public static HashSHA0 hashAsMessageHash(byte msg[])
- Returns the MessageHash of a single byte array.
- Parameters:
- msg - the byte array to hash.
- Returns:
- the MessageHash of the byte array.
CreateHash
public static HashSHA0 CreateHash(byte hash[])
- Returns the hash of a single byte array.
- Parameters:
- msg - the byte array to hash.
- Returns:
- the hash of the string.
f1
protected static int f1(int a,
int b,
int c)
f2
protected static int f2(int a,
int b,
int c)
f3
protected static int f3(int a,
int b,
int c)
f4
protected static int f4(int a,
int b,
int c)
transform
protected void transform(int X[])
byte2int
public final static void byte2int(int dst[],
int dst_off,
byte src[],
int src_off,
int len)
main
public final static void main(String argv[])
self_test
public static void self_test(PrintStream out,
String argv[]) throws Exception
All Packages Class Hierarchy This Package Previous Next Index