In RFC 1320, It is stated that "A 64-bit representation of b (the length of the message before the padding bits were added) is appended to the result of the previous step. In the unlikely event that b is greater than 2^64, then only the low-order 64 bits of b are used. (These bits are appended as two 32-bit words and appended low-order word first in accordance with the previous conventions.)".
I have three Java implementation of MD4, and each of them first shifts the lenght 3-bit to left. I could not understand why? I am sure it is a Java related issue, but I do not know what causes that?
Implementation 1: https://svn.apache.org/repos/asf/mina/mina/branches/2.0/mina-core/src/main/java/org/apache/mina/proxy/utils/MD4.java
Implementation 2: https://llvm.org/svn/llvm-project/llvm-gcc-4.2/trunk/libjava/classpath/gnu/java/security/hash/MD4.java
You can google for more implementations, I could not enter more than 2 links because of my reputation.
Regards, Bünyamin.