Top Description Fields Constructors Methods
org.bouncycastle.crypto.digests

public Class MD2Digest

extends Object
implements ExtendedDigest, Memoable
Class Inheritance
All Implemented Interfaces
org.bouncycastle.util.Memoable, org.bouncycastle.crypto.ExtendedDigest, org.bouncycastle.crypto.Digest
Imports
org.bouncycastle.crypto.CryptoServicePurpose, .CryptoServicesRegistrar, .ExtendedDigest, org.bouncycastle.util.Memoable

implementation of MD2 as outlined in RFC1319 by B.Kaliski from RSA Laboratories April 1992

Field Summary

Modifier and TypeField and Description
private byte[]
C

private int
private static final int
private byte[]
M

private int
private final CryptoServicePurpose
private static final byte[]
S

private byte[]
X

private int

Constructor Summary

AccessConstructor and Description
public
public
public

Method Summary

Modifier and TypeMethod and Description
public Memoable
copy()

Implements org.bouncycastle.util.Memoable.copy.

Produce a copy of this object with its configuration and in its current state.

private void
public int
doFinal(byte[]
the array the digest is to be copied into.
out
,
int
the offset into the out array the digest is to start at.
outOff
)

Implements org.bouncycastle.crypto.Digest.doFinal.

close the digest, producing the final digest value.

public String

Returns:

the algorithm name
getAlgorithmName
()

Implements org.bouncycastle.crypto.Digest.getAlgorithmName.

return the algorithm name

public int
getByteLength()

Implements org.bouncycastle.crypto.ExtendedDigest.getByteLength.

Return the size in bytes of the internal buffer the digest applies it's compression function to.

public int

Returns:

the size, in bytes, of the digest produced by this message digest.
getDigestSize
()

Implements org.bouncycastle.crypto.Digest.getDigestSize.

return the size, in bytes, of the digest produced by this message digest.

protected void
processBlock(byte[] m)

protected void
processCheckSum(byte[] m)

public void
reset()

Implements org.bouncycastle.crypto.Digest.reset.

reset the digest back to it's initial state.

public void
reset(Memoable
an object originally copied from an object of the same type as this instance.
other
)

Implements org.bouncycastle.util.Memoable.reset.

Restore a copied object state into this object.

public void
update(byte
the input byte to be entered.
in
)

Implements org.bouncycastle.crypto.Digest.update.

update the message digest with a single byte.

public void
update(byte[]
the byte array containing the data.
in
,
int
the offset into the byte array where the data starts.
inOff
,
int
the length of the data.
len
)

Implements org.bouncycastle.crypto.Digest.update.

update the message digest with a block of bytes.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

Cback to summary
private byte[] C
COffback to summary
private int COff
DIGEST_LENGTHback to summary
private static final int DIGEST_LENGTH
Mback to summary
private byte[] M
mOffback to summary
private int mOff
purposeback to summary
private final CryptoServicePurpose purpose
Sback to summary
private static final byte[] S
Xback to summary
private byte[] X
xOffback to summary
private int xOff

Constructor Detail

MD2Digestback to summary
public MD2Digest()
MD2Digestback to summary
public MD2Digest(CryptoServicePurpose purpose)
MD2Digestback to summary
public MD2Digest(MD2Digest t)

Method Detail

copyback to summary
public Memoable copy()

Implements org.bouncycastle.util.Memoable.copy.

Doc from org.bouncycastle.util.Memoable.copy.

Produce a copy of this object with its configuration and in its current state.

The returned object may be used simply to store the state, or may be used as a similar object starting from the copied state.

copyInback to summary
private void copyIn(MD2Digest t)
doFinalback to summary
public int doFinal(byte[] out, int outOff)

Implements org.bouncycastle.crypto.Digest.doFinal.

close the digest, producing the final digest value. The doFinal call leaves the digest reset.

Parameters
out:byte[]

the array the digest is to be copied into.

outOff:int

the offset into the out array the digest is to start at.

getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.Digest.getAlgorithmName.

return the algorithm name

Returns:String

the algorithm name

getByteLengthback to summary
public int getByteLength()

Implements org.bouncycastle.crypto.ExtendedDigest.getByteLength.

Doc from org.bouncycastle.crypto.ExtendedDigest.getByteLength.

Return the size in bytes of the internal buffer the digest applies it's compression function to.

Returns:int

byte length of the digests internal buffer.

getDigestSizeback to summary
public int getDigestSize()

Implements org.bouncycastle.crypto.Digest.getDigestSize.

return the size, in bytes, of the digest produced by this message digest.

Returns:int

the size, in bytes, of the digest produced by this message digest.

processBlockback to summary
protected void processBlock(byte[] m)
processCheckSumback to summary
protected void processCheckSum(byte[] m)
resetback to summary
public void reset()

Implements org.bouncycastle.crypto.Digest.reset.

reset the digest back to it's initial state.

resetback to summary
public void reset(Memoable other)

Implements org.bouncycastle.util.Memoable.reset.

Doc from org.bouncycastle.util.Memoable.reset.

Restore a copied object state into this object.

Implementations of this method should try to avoid or minimise memory allocation to perform the reset.

Parameters
other:Memoable

an object originally copied from an object of the same type as this instance.

updateback to summary
public void update(byte in)

Implements org.bouncycastle.crypto.Digest.update.

update the message digest with a single byte.

Parameters
in:byte

the input byte to be entered.

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

Implements org.bouncycastle.crypto.Digest.update.

update the message digest with a block of bytes.

Parameters
in:byte[]

the byte array containing the data.

inOff:int

the offset into the byte array where the data starts.

len:int

the length of the data.