Class MD4Digest
java.lang.Object
org.gudy.bouncycastle.crypto.digests.GeneralDigest
org.gudy.bouncycastle.crypto.digests.MD4Digest
- All Implemented Interfaces:
Digest
implementation of MD4 as RFC 1320 by R. Rivest, MIT Laboratory for
Computer Science and RSA Data Security, Inc.
NOTE: This algorithm is only included for backwards compatibility with legacy applications, it's not secure, don't use it for anything new!
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate 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 int[]
private int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
doFinal
(byte[] out, int outOff) 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) return the algorithm nameint
return the size, in bytes, of the digest produced by this message digest.private int
H
(int u, int v, int w) protected void
protected void
processLength
(long bitLength) protected void
processWord
(byte[] in, int inOff) void
reset()
reset the chaining variables to the IV values.private int
rotateLeft
(int x, int n) private void
unpackWord
(int word, byte[] out, int outOff) Methods inherited from class org.gudy.bouncycastle.crypto.digests.GeneralDigest
finish, update, update
-
Field Details
-
DIGEST_LENGTH
private static final int DIGEST_LENGTH- See Also:
-
H1
private int H1 -
H2
private int H2 -
H3
private int H3 -
H4
private int H4 -
X
private int[] X -
xOff
private int xOff -
S11
private static final int S11- See Also:
-
S12
private static final int S12- See Also:
-
S13
private static final int S13- See Also:
-
S14
private static final int S14- See Also:
-
S21
private static final int S21- See Also:
-
S22
private static final int S22- See Also:
-
S23
private static final int S23- See Also:
-
S24
private static final int S24- See Also:
-
S31
private static final int S31- See Also:
-
S32
private static final int S32- See Also:
-
S33
private static final int S33- See Also:
-
S34
private static final int S34- See Also:
-
-
Constructor Details
-
MD4Digest
public MD4Digest()Standard constructor -
MD4Digest
Copy constructor. This will copy the state of the provided message digest.
-
-
Method Details
-
getAlgorithmName
Description copied from interface:Digest
return the algorithm name- Returns:
- the algorithm name
-
getDigestSize
public int getDigestSize()Description copied from interface:Digest
return the size, in bytes, of the digest produced by this message digest.- Returns:
- the size, in bytes, of the digest produced by this message digest.
-
processWord
protected void processWord(byte[] in, int inOff) - Specified by:
processWord
in classGeneralDigest
-
processLength
protected void processLength(long bitLength) - Specified by:
processLength
in classGeneralDigest
-
unpackWord
private void unpackWord(int word, byte[] out, int outOff) -
doFinal
public int doFinal(byte[] out, int outOff) Description copied from interface:Digest
close the digest, producing the final digest value. The doFinal call leaves the digest reset.- Parameters:
out
- the array the digest is to be copied into.outOff
- the offset into the out array the digest is to start at.
-
reset
public void reset()reset the chaining variables to the IV values.- Specified by:
reset
in interfaceDigest
- Overrides:
reset
in classGeneralDigest
-
rotateLeft
private int rotateLeft(int x, int n) -
F
private int F(int u, int v, int w) -
G
private int G(int u, int v, int w) -
H
private int H(int u, int v, int w) -
processBlock
protected void processBlock()- Specified by:
processBlock
in classGeneralDigest
-