Re: sha512_process_bytes doesn't like odd sized buffers
From:
Jim Meyering
Subject:
Re: sha512_process_bytes doesn't like odd sized buffers
Date:
Sat, 15 Mar 2008 15:59:07 +0100
Andreas Schwab <address@hidden> wrote:
> Jim Meyering <address@hidden> writes:
>
>> The bug strikes whenever ctx->buflen|64 != 0.
>
> Btw, ctx->buflen|64 != 0 is always true because it is the same as
> ctx->buflen|(64 != 0).
Shameful ;-) I meant "ctx->buflen&64", of course.
>> - sha256_process_block (ctx->buffer, ctx->buflen & ~63, ctx);
>> -
>> ctx->buflen &= 63;
>> + sha256_process_block (ctx->buffer, ctx->buflen, ctx);
>
> I hope you are aware of that a & 63 is different from a & ~63?
Of course. My mistake was in not *seeing* that "63 != ~63"
Thanks. So I won't be making that latter change.