Search code examples
cmd5md5sum

Is this comparison dummy?


In the RFC1321

I notice this piece of code:

if ((context->count[0] += ((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3))
    context->count[1]++;
context->count[1] += ((UINT4)inputLen >> 29);

I don't understand the comparison:

((UINT4)inputLen << 3)) < ((UINT4)inputLen << 3))

It is like it always returns 0, right?


Solution

  • There is no such comparison. Look how the parentheses are paired:

    It is

    (X < ((UINT4)inputLen << 3))
    

    where X =

    (context->count[0] += ((UINT4)inputLen << 3))