|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rit.crypto.MuH1MessageDigest
public class MuH1MessageDigest
Class MuH1MessageDigest provides a message digest algorithm using the MicroHash-One (μH-1) 32-bit one-way hash function. The algorithm is:
μH-1 Message Digest Algorithm
The μH-1 compression function used in Step (3b) is defined in class MuH1
.
As with the μH-1 compression function, the μH-1 message digest
algorithm is intended to be used in applications where it only has to
withstand attack for a short time, a few milliseconds at most. See class
MuH1
for further information.
Note: Class MuH1MessageDigest is not multiple thread safe.
Constructor Summary | |
---|---|
MuH1MessageDigest()
Construct a new message digest object for calculating the μH-1 message digest of a sequence of bytes. |
Method Summary | |
---|---|
void |
accumulate(byte b)
Accumulate a byte into this message digest object. |
void |
accumulate(byte[] buf)
Accumulate a byte array into this message digest object. |
void |
accumulate(byte[] buf,
int off,
int len)
Accumulate a portion of a byte array into this message digest object. |
void |
accumulate(int i)
Accumulate a four-byte integer into this message digest object. |
int |
hash()
Obtain this message digest object's one-way hash value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MuH1MessageDigest()
Method Detail |
---|
public void accumulate(int i)
i
- Integer.public void accumulate(byte b)
b
- Byte.public void accumulate(byte[] buf)
buf
- Byte array.
NullPointerException
- (unchecked exception) Thrown if buf is null.public void accumulate(byte[] buf, int off, int len)
buf
- Byte array.off
- Index of first byte to accumulate.len
- Number of bytes to accumulate.
NullPointerException
- (unchecked exception) Thrown if buf is null.
IndexOutOfBoundsException
- (unchecked exception) Thrown if off < 0, len
< 0, or off+len > buf.length.public int hash()
Note: After calling hash(), do not accumulate anything further into this message digest object. The results will be incorrect.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |