|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.security.MessageDigestSpi
java.security.MessageDigest
org.alliance.core.file.hash.Tiger
public final class Tiger
Tiger is a fast new hash function, by Ross Anderson and Eli Biham. This class is a simple Java implementation of the 192-bit Tiger algorithm, based on the sample C code published by Eli Biham on http://www.cs.technion.ac.il/~biham/Reports/Tiger/ in its HTML reference Appendix. It computes a 192-bit digest that is considered stronger, but faster to compute than 160-bit SHA-1. Its input is a set of 64-bytes blocks. The last block of a digested message must include a required padding byte which must be 0x01, the remaining padding bytes must be set to 0x00. May be in the future, this class will be part of the standard JCE (Java Cryptography Environment) included in Java 1.5, code named... Tiger! For now Java 1.4, code named Merlin, does not have this digest algorithm, and only includes Adler32 or CRC32 (in java.util.zip), and MD4, MD5 or SHA1 (in javax.crypto.Mac, included in the SUN JCE). You can include it in your own Secrurty Provider by inserting these properties in your Provider derived class: put("MessageDigest.Tiger", "com.limegroup.gnutella.security.Tiger");
| Constructor Summary | |
|---|---|
Tiger()
Creates a Tiger object with default initial state. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Clones this object. |
byte[] |
engineDigest()
Completes the hash computation by performing final operations such as padding. |
int |
engineDigest(byte[] hashvalue,
int offset,
int len)
Completes the hash computation by performing final operations such as padding. |
int |
engineGetDigestLength()
Returns the digest length in bytes. |
void |
engineReset()
Reset then initialize the digest context. |
void |
engineUpdate(byte input)
Updates the digest using the specified byte. |
void |
engineUpdate(byte[] input,
int offset,
int len)
Updates the digest using the specified array of bytes, starting at the specified offset. |
protected void |
init()
Initialize the digest context. |
| Methods inherited from class java.security.MessageDigest |
|---|
digest, digest, digest, getAlgorithm, getDigestLength, getInstance, getInstance, getInstance, getProvider, isEqual, reset, toString, update, update, update, update |
| Methods inherited from class java.security.MessageDigestSpi |
|---|
engineUpdate |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Tiger()
| Method Detail |
|---|
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class java.security.MessageDigestjava.lang.CloneNotSupportedExceptionpublic int engineGetDigestLength()
engineGetDigestLength in class java.security.MessageDigestSpipublic void engineReset()
java.security.MessageDigestSpi.
engineReset in class java.security.MessageDigestSpiprotected void init()
public void engineUpdate(byte input)
engineUpdate in class java.security.MessageDigestSpiinput - the byte to use for the update.
public void engineUpdate(byte[] input,
int offset,
int len)
engineUpdate in class java.security.MessageDigestSpiinput - the array of bytes to use for the update.offset - the offset to start from in the array of bytes.public byte[] engineDigest()
engineDigest in class java.security.MessageDigestSpi
public int engineDigest(byte[] hashvalue,
int offset,
int len)
throws java.security.DigestException
engineDigest in class java.security.MessageDigestSpihashvalue - the output buffer in which to store the digest.offset - offset to start from in the output bufferlen - number of bytes within buf allotted for the digest.
Both this default implementation and the SUN provider
do not return partial digests. The presence of this
parameter is solely for consistency in our API's.
If the value of this parameter is less than the
actual digest length, the method will throw a
DigestException. This parameter is ignored if its
value is greater than or equal to the actual digest
length.
java.security.DigestException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||