|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.java.security.MessageDigest | +--org.apache.java.security.MD5
This class implements the Message Digest 5 algorithm (MD5) as defined in RFC-1321.
Note: even if standard Java 1.1 APIs already provide
a MD5 implementation, this class is used on those Java runtime
environments (like Kaffe) where the package java.security
is highly improbable to be found.
Field Summary | |
private byte[] |
buffer
|
private long |
counter
|
private static java.lang.String[] |
digests
|
private static java.lang.String[] |
messages
Self Test |
(package private) static byte[] |
padding
MD5 Functions |
private int |
reminder
|
private int[] |
state
|
private int[] |
x
|
Constructor Summary | |
MD5()
Creates the algorithm and reset its state. |
Method Summary | |
void |
append(byte[] block,
int offset,
int length)
Append another block of specified length to the message starting at the given offset. |
private static void |
byte2int(byte[] in,
int[] out)
Converts a 64-byte array into a 16-int array. |
byte[] |
digest(byte[] block,
int offset,
int length)
Appends a message block with specified length starting from the given offset and return its message digest. |
private static int |
F(int x,
int y,
int z)
|
private static int |
FF(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
|
private static int |
G(int x,
int y,
int z)
|
private static int |
GG(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
|
private static int |
H(int x,
int y,
int z)
|
private static int |
HH(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
|
private static int |
I(int x,
int y,
int z)
|
private static int |
II(int a,
int b,
int c,
int d,
int x,
int s,
int ac)
|
private static void |
int2byte(int[] in,
byte[] out)
Converts a 4-int array into a 16-byte array. |
static void |
main(java.lang.String[] ignored)
|
void |
reset()
Resets the state of the class. |
static byte[] |
toBytes(long n)
Converts a long to a 8-byte array using low order first. |
private void |
transform(byte[] buffer)
|
Methods inherited from class org.apache.java.security.MessageDigest |
append,
append,
digest,
digest |
Methods inherited from class java.lang.Object |
|
Field Detail |
private long counter
private int reminder
private byte[] buffer
private int[] state
private int[] x
static byte[] padding
private static java.lang.String[] messages
private static java.lang.String[] digests
Constructor Detail |
public MD5()
Method Detail |
public void reset()
public void append(byte[] block, int offset, int length)
public byte[] digest(byte[] block, int offset, int length)
private static void byte2int(byte[] in, int[] out)
private static void int2byte(int[] in, byte[] out)
public static byte[] toBytes(long n)
private static int F(int x, int y, int z)
private static int G(int x, int y, int z)
private static int H(int x, int y, int z)
private static int I(int x, int y, int z)
private static int FF(int a, int b, int c, int d, int x, int s, int ac)
private static int GG(int a, int b, int c, int d, int x, int s, int ac)
private static int HH(int a, int b, int c, int d, int x, int s, int ac)
private static int II(int a, int b, int c, int d, int x, int s, int ac)
private void transform(byte[] buffer)
public static final void main(java.lang.String[] ignored)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |