Package org.jboss.crypto.digest
Class SHAReverseInterleave
- java.lang.Object
-
- java.security.MessageDigestSpi
-
- org.jboss.crypto.digest.SHAReverseInterleave
-
public class SHAReverseInterleave extends MessageDigestSpi
An alternate SHA Interleave algorithm as implemented in the SRP distribution. This version reverses the even and odd byte streams before performing the SHA digest. This product includes software developed by Tom Wu and Eugene Jhong for the SRP Distribution (http://srp.stanford.edu/srp/).- Version:
- $Revision$
- Author:
- Scott.Stark@jboss.org
-
-
Constructor Summary
Constructors Constructor Description SHAReverseInterleave()
Creates a new instance of SHAReverseInterleave
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected byte[]
engineDigest()
Completes the digest computation by performing final operations such as padding.protected int
engineGetDigestLength()
protected void
engineReset()
Resets the digest for further use.protected void
engineUpdate(byte input)
Updates the digest using the specified byte.protected void
engineUpdate(byte[] input, int offset, int len)
Updates the digest using the specified array of bytes, starting at the specified offset.-
Methods inherited from class java.security.MessageDigestSpi
clone, engineDigest, engineUpdate
-
-
-
-
Constructor Detail
-
SHAReverseInterleave
public SHAReverseInterleave()
Creates a new instance of SHAReverseInterleave- Throws:
ProviderException
- thrown if MessageDigest.getInstance("SHA") throws a NoSuchAlgorithmException.
-
-
Method Detail
-
engineGetDigestLength
protected int engineGetDigestLength()
- Overrides:
engineGetDigestLength
in classMessageDigestSpi
-
engineDigest
protected byte[] engineDigest()
Completes the digest computation by performing final operations such as padding. OnceengineDigest
has been called, the engine should be reset (seeengineReset
). Resetting is the responsibility of the engine implementor.- Specified by:
engineDigest
in classMessageDigestSpi
- Returns:
- the array of bytes for the resulting digest value.
-
engineReset
protected void engineReset()
Resets the digest for further use.- Specified by:
engineReset
in classMessageDigestSpi
-
engineUpdate
protected void engineUpdate(byte input)
Updates the digest using the specified byte.- Specified by:
engineUpdate
in classMessageDigestSpi
- Parameters:
input
- the byte to use for the update.
-
engineUpdate
protected void engineUpdate(byte[] input, int offset, int len)
Updates the digest using the specified array of bytes, starting at the specified offset.- Specified by:
engineUpdate
in classMessageDigestSpi
- Parameters:
input
- the array of bytes to use for the update.offset
- the offset to start from in the array of bytes.len
- the input of bytes to use, starting atoffset
.
-
-