public class MD4 extends MessageDigestSpi implements Cloneable
An implementation of Ron Rivest's MD4 message digest algorithm. MD4 was the precursor to the stronger MD5 algorithm, and while not considered cryptograpically secure itself, MD4 is in use in various applications. It is slightly faster than MD5.
This implementation is derived from the version of MD4 in GNU Crypto.
References:
| Modifier and Type | Field and Description |
|---|---|
protected int |
a |
protected static int |
A |
protected int |
b |
protected static int |
B |
static int |
BLOCK_LENGTH
The MD4 algorithm operates on 512-bit blocks, or 64 bytes.
|
protected byte[] |
buffer |
protected int |
c |
protected static int |
C |
protected long |
count |
protected int |
d |
protected static int |
D |
static int |
DIGEST_LENGTH
An MD4 message digest is always 128-bits long, or 16 bytes.
|
| Constructor and Description |
|---|
MD4()
Trivial zero-argument constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Object |
clone() |
protected byte[] |
engineDigest()
Pack the four chaining variables into a byte array.
|
protected int |
engineDigest(byte[] out,
int off,
int len) |
protected int |
engineGetDigestLength() |
protected void |
engineReset()
Reset the four chaining variables.
|
void |
engineUpdate(byte b) |
protected void |
engineUpdate(byte[] b,
int offset,
int len) |
protected byte[] |
padBuffer()
Pad the buffer by appending the byte 0x80, then as many zero bytes
to fill the buffer 8 bytes shy of being a multiple of 64 bytes, then
append the length of the buffer, in bits, before padding.
|
protected void |
transform(byte[] in,
int offset)
Transform a 64-byte block.
|
engineUpdatepublic static final int DIGEST_LENGTH
public static final int BLOCK_LENGTH
protected static final int A
protected static final int B
protected static final int C
protected static final int D
protected int a
protected int b
protected int c
protected int d
protected long count
protected final byte[] buffer
public Object clone()
clone in class MessageDigestSpiprotected int engineGetDigestLength()
engineGetDigestLength in class MessageDigestSpipublic void engineUpdate(byte b)
engineUpdate in class MessageDigestSpiprotected void engineUpdate(byte[] b,
int offset,
int len)
engineUpdate in class MessageDigestSpiprotected byte[] engineDigest()
engineDigest in class MessageDigestSpiprotected int engineDigest(byte[] out,
int off,
int len)
throws DigestException
engineDigest in class MessageDigestSpiDigestExceptionprotected void engineReset()
engineReset in class MessageDigestSpiprotected byte[] padBuffer()
protected void transform(byte[] in,
int offset)
Copyright © 2021 McEvoy Software Ltd. All rights reserved.