Home GnuPG

Fix message digest final function for MD4, MD5 and RMD160

Description

Fix message digest final function for MD4, MD5 and RMD160

* cipher/md4.c (md4_final): Use buffer offset '64 + 56' for bit count
on 'need one extra block' path.
* cipher/md5.c (md5_final): Ditto.
* cipher/rmd160.c (rmd160_final): Ditto.
* tests/basic.c (check_one_md_final): New.
(check_digest): Add new '*' test vectors and handle them with
check_one_md_final.

This commit fixes bug introduced with commit "Optimizations for
digest final functions" e76cd0e2b1f6025c1319576a5848815d1d231aeb
to MD4, MD5 and RMD160 where digest ended up being wrong for input
message sizes 64*x+56..64. Patch also adds new test case that runs
message digest algorithms with different message lengths from 0 to

  • Reported-by: Guido Vranken <guidovranken@gmail.com>
  • Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>

Details

Provenance
jukiviliAuthored on May 9 2019, 8:43 PM
Parents
rCda6cd4fea30f: Fix carry overflow in Stribog in 512-bit addition
Branches
Unknown
Tags
Unknown