summaryrefslogtreecommitdiff
path: root/lib/md5.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2017-03-31 22:03:49 +0200
committerBruno Haible <bruno@clisp.org>2017-03-31 22:40:40 +0200
commit3e7178b337e3a83df9e4f36a4aef516f089e3796 (patch)
tree6ae4f939bf390ae4e97c1e913ce9cdf4883a5866 /lib/md5.h
parent948db16eee9dc2f39c14ec297bb06adad5b344a6 (diff)
downloadgnulib-3e7178b337e3a83df9e4f36a4aef516f089e3796.tar.gz
md5, sha1, sha256, sha512: Add comments regarding correctness.
* lib/md5.h (buflen): Add comments regarding range. * lib/sha1.h (buflen): Likewise. * lib/sha256.h (buflen): Likewise. * lib/sha512.h (buflen): Likewise. * lib/md5.c (md5_process_bytes): Add comment why memmove is not needed. * lib/sha1.c (sha1_process_bytes): Likewise. * lib/sha256.c (sha256_process_bytes): Likewise. * lib/sha512.c (sha512_process_bytes): Likewise. Reported by Coverity via Tim Rühsen.
Diffstat (limited to 'lib/md5.h')
-rw-r--r--lib/md5.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/md5.h b/lib/md5.h
index 9c2c09815a..543a366443 100644
--- a/lib/md5.h
+++ b/lib/md5.h
@@ -74,8 +74,8 @@ struct md5_ctx
uint32_t D;
uint32_t total[2];
- uint32_t buflen;
- uint32_t buffer[32];
+ uint32_t buflen; /* ≥ 0, ≤ 128 */
+ uint32_t buffer[32]; /* 128 bytes; the first buflen bytes are in use */
};
/*