Paul Eggert <[email protected]> writes:

> The ‘BLOCKSIZE + 72’ business apparently dates back to 30 years
> ago when the buffer was local (not heap allocated) and was multi-use.
> That code died long ago, so stop allocating the cargo-cult bytes.
> * lib/md2-stream.c (md2_stream):
> * lib/md4-stream.c (md4_stream):
> * lib/md5-stream.c (md5_stream):
> * lib/sha1-stream.c (sha1_stream):
> * lib/sha256-stream.c (shaxxx_stream):
> * lib/sha3-stream.c (sha3_xxx_stream):
> * lib/sha512-stream.c (shaxxx_stream):
> * lib/sm3-stream.c (sm3_stream):
> Don’t allocate an unnecessary 72 extra bytes.
> ---
>  ChangeLog           | 14 ++++++++++++++
>  lib/md2-stream.c    |  2 +-
>  lib/md4-stream.c    |  2 +-
>  lib/md5-stream.c    |  2 +-
>  lib/sha1-stream.c   |  2 +-
>  lib/sha256-stream.c |  2 +-
>  lib/sha3-stream.c   |  2 +-
>  lib/sha512-stream.c |  2 +-
>  lib/sm3-stream.c    |  2 +-
>  9 files changed, 22 insertions(+), 8 deletions(-)

Thanks for this and the other fixes to SHA-3 and the other crypto
modules.

I was a bit confused by the rationale for the 72 extra bytes since I
couldn't find it in the commit messages at the time. I guess it was
probably described somewhere in glibc's history. IIRC, those files
originated from there.

Collin

Reply via email to