ants.p2p.utils.donkey
Class MD4

java.lang.Object
  extended by ants.p2p.utils.donkey.MD4

public final class MD4
extends java.lang.Object

Use this class for getting a MD4 message digest. Create a MD4 and reuse it after a message digest calculation. There can be as many MD4 objects as you want to have multiple calculations same time. The message can be passed in one or a sequenze of parts wrapped in a ByteBuffer to the update of the same MD4 instance. To finish the calculation use final, it will reset the MD4 instance for a new calculation.


Constructor Summary
MD4()
          Constructor returns a MD4 ready for use.
 
Method Summary
 void finalDigest(java.nio.ByteBuffer digest)
          Finishs a MD4 message digest calculation.
 void reset()
          Resets the MD4 to initial state for a new message digest calculation.
 void update(java.nio.ByteBuffer input)
          Starts or continues a MD4 message digest calculation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MD4

public MD4()
Constructor returns a MD4 ready for use.

Method Detail

reset

public void reset()
Resets the MD4 to initial state for a new message digest calculation.


update

public void update(java.nio.ByteBuffer input)
Starts or continues a MD4 message digest calculation. input.remaining() should be a multiple of 64 to be most efficant, but other amounts work too. Only remaining bytes of the ByteBuffer are used and input.position() will be input.limit() after return.

Parameters:
input - hold a part of the message. input.order() have to be ByteOrder.LITTLE_ENDIAN

finalDigest

public void finalDigest(java.nio.ByteBuffer digest)
Finishs a MD4 message digest calculation. The result is stored in digest and the MD4-object is reset and so ready for a new message digest calculation.

Parameters:
digest - should be a ByteBuffer with digest.remaining() >= 16