org.bouncycastle.crypto.digests

Class ShortenedDigest

public class ShortenedDigest extends Object implements ExtendedDigest

Wrapper class that reduces the output length of a particular digest to only the first n bytes of the digest function.
Constructor Summary
ShortenedDigest(ExtendedDigest baseDigest, int length)
Base constructor.
Method Summary
intdoFinal(byte[] out, int outOff)
StringgetAlgorithmName()
intgetByteLength()
intgetDigestSize()
voidreset()
voidupdate(byte in)
voidupdate(byte[] in, int inOff, int len)

Constructor Detail

ShortenedDigest

public ShortenedDigest(ExtendedDigest baseDigest, int length)
Base constructor.

Parameters: baseDigest underlying digest to use. length length in bytes of the output of doFinal.

Throws: IllegalArgumentException if baseDigest is null, or length is greater than baseDigest.getDigestSize().

Method Detail

doFinal

public int doFinal(byte[] out, int outOff)

getAlgorithmName

public String getAlgorithmName()

getByteLength

public int getByteLength()

getDigestSize

public int getDigestSize()

reset

public void reset()

update

public void update(byte in)

update

public void update(byte[] in, int inOff, int len)