|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--cryptix.MessageDigest | +--cryptix.MD5
This class implements the MD5 message digest.
Copyright (C) 1995, 1996 Systemics Ltd (http://www.systemics.com/) All rights reserved.
Field Summary | |
protected int[] |
data
|
static int |
DATA_LENGTH
|
protected int[] |
digest
|
static int |
HASH_LENGTH
Length of the final hash (in bytes). |
protected byte[] |
tmp
|
Constructor Summary | |
MD5()
The public constructor. |
Method Summary | |
static void |
byte2int(int[] dst,
int dst_off,
byte[] src,
int src_off,
int len)
|
static HashMD5 |
CreateHash(byte[] hash)
Returns the hash of a single byte array. |
int |
data_length()
Return length of the data (in bytes) hashed in every transform. |
MessageHash |
digestAsHash()
Returns the digest of the data added and resets the digest. |
protected static int |
F(int x,
int y,
int z)
|
protected static int |
FF(int a,
int b,
int c,
int d,
int k,
int s,
int t)
|
protected static int |
G(int x,
int y,
int z)
|
static java.lang.String |
getLinkErrorString()
|
protected static int |
GG(int a,
int b,
int c,
int d,
int k,
int s,
int t)
|
protected static int |
H(int x,
int y,
int z)
|
static boolean |
hasFileLibraryLoaded()
|
int |
hash_length()
Return length of the hash (in bytes). |
static byte[] |
hash(byte[] msg)
Returns the hash of a single byte array. |
static byte[] |
hash(java.lang.String msg)
Returns the hash of a single string. |
static HashMD5 |
hashAsMessageHash(byte[] msg)
Returns the MessageHash of a single byte array. |
static HashMD5 |
hashAsMessageHash(java.lang.String msg)
Returns the MessageHash of a single string. |
protected static int |
HH(int a,
int b,
int c,
int d,
int k,
int s,
int t)
|
protected static int |
I(int x,
int y,
int z)
|
protected static int |
II(int a,
int b,
int c,
int d,
int k,
int s,
int t)
|
static boolean |
isLibraryCorrect()
|
protected void |
java_transform()
|
static void |
main(java.lang.String[] argv)
|
protected byte[] |
md_digest()
Returns the digest of the data added and resets the digest. |
void |
md_reset()
Initialise (reset) the message digest. |
protected void |
md_transform()
Add data to the message digest |
java.lang.String |
name()
Return name of this hash function. |
static void |
self_test(java.io.PrintStream out,
java.lang.String[] argv)
|
protected void |
transform(int[] M)
|
Methods inherited from class cryptix.MessageDigest |
add, add, add, add, addToDigest, bitcount, buf_off, buf, digest, hash, hash, length, reset |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int HASH_LENGTH
public static final int DATA_LENGTH
protected int[] data
protected int[] digest
protected byte[] tmp
Constructor Detail |
public MD5()
UnsatisfiedLinkError
- if the library is not of the correct versionMethod Detail |
public static final boolean hasFileLibraryLoaded()
public static final boolean isLibraryCorrect()
public static final java.lang.String getLinkErrorString()
public final int hash_length()
hash_length
in class MessageDigest
HASH_LENGTH
public final int data_length()
data_length
in class MessageDigest
public java.lang.String name()
name
in class MessageDigest
public void md_reset()
md_reset
in class MessageDigest
protected void md_transform()
md_transform
in class MessageDigest
data
- The data to be added.offset
- The start of the data in the array.length
- The amount of data to add.protected void java_transform()
protected byte[] md_digest()
md_digest
in class MessageDigest
public MessageHash digestAsHash()
digestAsHash
in class MessageDigest
public static byte[] hash(java.lang.String msg)
msg
- the string to hash.public static byte[] hash(byte[] msg)
msg
- the byte array to hash.public static HashMD5 hashAsMessageHash(java.lang.String msg)
msg
- the string to hash.public static HashMD5 hashAsMessageHash(byte[] msg)
msg
- the byte array to hash.public static HashMD5 CreateHash(byte[] hash)
msg
- the byte array to hash.protected static int F(int x, int y, int z)
protected static int G(int x, int y, int z)
protected static int H(int x, int y, int z)
protected static int I(int x, int y, int z)
protected static int FF(int a, int b, int c, int d, int k, int s, int t)
protected static int GG(int a, int b, int c, int d, int k, int s, int t)
protected static int HH(int a, int b, int c, int d, int k, int s, int t)
protected static int II(int a, int b, int c, int d, int k, int s, int t)
protected void transform(int[] M)
public static final void byte2int(int[] dst, int dst_off, byte[] src, int src_off, int len)
public static final void main(java.lang.String[] argv) throws java.io.IOException
public static void self_test(java.io.PrintStream out, java.lang.String[] argv) throws java.lang.Exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |