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

pack-priv Class MD5Digest

extends GeneralDigest
Class Inheritance
Imports
org.bouncycastle.crypto.internal.digests.GeneralDigest, org.bouncycastle.util.Memoable

implementation of MD5 as outlined in "Handbook of Applied Cryptography", pages 346 - 347.

Field Summary

Modifier and TypeField and Description
private static final int
private int
private int
private int
private int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private static final int
private int[]
X

private int

Constructor Summary

AccessConstructor and Description
public
MD5Digest()

Standard constructor

public
MD5Digest(MD5Digest t)

Copy constructor.

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.internal.Digest.doFinal.

close the digest, producing the final digest value.
private int
F(int u, int v, int w)

private int
G(int u, int v, int w)

public String
public int
getDigestSize()

Implements org.bouncycastle.crypto.internal.Digest.getDigestSize.

return the size, in bytes, of the digest produced by this message digest.
private int
H(int u, int v, int w)

private int
K(int u, int v, int w)

protected void
protected void
protected void
public void
reset()

Overrides org.bouncycastle.crypto.internal.digests.GeneralDigest.reset.

Implements org.bouncycastle.crypto.internal.Digest.reset.

reset the chaining variables to the IV values.
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.
private int
rotateLeft(int x, int n)

private void
unpackWord(int word, byte[] out, int outOff)

Inherited from org.bouncycastle.crypto.internal.digests.GeneralDigest:
copyInfinishgetByteLengthupdateupdate

Field Detail

DIGEST_LENGTHback to summary
private static final int DIGEST_LENGTH
H1back to summary
private int H1
H2back to summary
private int H2
H3back to summary
private int H3
H4back to summary
private int H4
S11back to summary
private static final int S11
S12back to summary
private static final int S12
S13back to summary
private static final int S13
S14back to summary
private static final int S14
S21back to summary
private static final int S21
S22back to summary
private static final int S22
S23back to summary
private static final int S23
S24back to summary
private static final int S24
S31back to summary
private static final int S31
S32back to summary
private static final int S32
S33back to summary
private static final int S33
S34back to summary
private static final int S34
S41back to summary
private static final int S41
S42back to summary
private static final int S42
S43back to summary
private static final int S43
S44back to summary
private static final int S44
Xback to summary
private int[] X
xOffback to summary
private int xOff

Constructor Detail

MD5Digestback to summary
public MD5Digest()

Standard constructor

MD5Digestback to summary
public MD5Digest(MD5Digest t)

Copy constructor. This will copy the state of the provided message digest.

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(MD5Digest t)
doFinalback to summary
public int doFinal(byte[] out, int outOff)

Implements org.bouncycastle.crypto.internal.Digest.doFinal.

Doc from org.bouncycastle.crypto.internal.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.

Fback to summary
private int F(int u, int v, int w)
Gback to summary
private int G(int u, int v, int w)
getAlgorithmNameback to summary
public String getAlgorithmName()

Implements org.bouncycastle.crypto.internal.Digest.getAlgorithmName.

Doc from org.bouncycastle.crypto.internal.Digest.getAlgorithmName.

return the algorithm name

Returns:String

the algorithm name

getDigestSizeback to summary
public int getDigestSize()

Implements org.bouncycastle.crypto.internal.Digest.getDigestSize.

Doc from org.bouncycastle.crypto.internal.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.

Hback to summary
private int H(int u, int v, int w)
Kback to summary
private int K(int u, int v, int w)
processBlockback to summary
protected void processBlock()

Implements abstract org.bouncycastle.crypto.internal.digests.GeneralDigest.processBlock.

processLengthback to summary
protected void processLength(long bitLength)

Implements abstract org.bouncycastle.crypto.internal.digests.GeneralDigest.processLength.

processWordback to summary
protected void processWord(byte[] in, int inOff)

Implements abstract org.bouncycastle.crypto.internal.digests.GeneralDigest.processWord.

resetback to summary
public void reset()

Overrides org.bouncycastle.crypto.internal.digests.GeneralDigest.reset.

Implements org.bouncycastle.crypto.internal.Digest.reset.

reset the chaining variables to the IV values.

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.

rotateLeftback to summary
private int rotateLeft(int x, int n)
unpackWordback to summary
private void unpackWord(int word, byte[] out, int outOff)