From 1fa14c798c517aae775149ebcbe5577a73515dfc Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 23 Feb 2020 13:13:38 +0100 Subject: [PATCH 21/29] crypto/md4: Use 'restrict'. * lib/md4.h (md4_finish_ctx, md4_read_ctx, md4_buffer): Use 'restrict'. * modules/crypto/md4 (configure.ac): Require AC_C_RESTRICT. --- ChangeLog | 4 ++++ lib/md4.h | 7 ++++--- modules/crypto/md4 | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33a233e..bd40d1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-02-23 Bruno Haible + crypto/md4: Use 'restrict'. + * lib/md4.h (md4_finish_ctx, md4_read_ctx, md4_buffer): Use 'restrict'. + * modules/crypto/md4 (configure.ac): Require AC_C_RESTRICT. + crypto/md2: Use 'restrict'. * lib/md2.h (md2_finish_ctx, md2_read_ctx, md2_buffer): Use 'restrict'. * modules/crypto/md2 (configure.ac): Require AC_C_RESTRICT. diff --git a/lib/md4.h b/lib/md4.h index 4cb5aa0..37f3ff2 100644 --- a/lib/md4.h +++ b/lib/md4.h @@ -63,13 +63,13 @@ extern void md4_process_bytes (const void *buffer, size_t len, in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ -extern void *md4_finish_ctx (struct md4_ctx *ctx, void *resbuf); +extern void *md4_finish_ctx (struct md4_ctx *ctx, void *restrict resbuf); /* Put result from CTX in first 16 bytes following RESBUF. The result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ -extern void *md4_read_ctx (const struct md4_ctx *ctx, void *resbuf); +extern void *md4_read_ctx (const struct md4_ctx *ctx, void *restrict resbuf); /* Compute MD4 message digest for bytes read from STREAM. The @@ -81,7 +81,8 @@ extern int md4_stream (FILE * stream, void *resblock); result is always in little endian byte order, so that a byte-wise output yields to the wanted ASCII representation of the message digest. */ -extern void *md4_buffer (const char *buffer, size_t len, void *resblock); +extern void *md4_buffer (const char *buffer, size_t len, + void *restrict resblock); # ifdef __cplusplus } diff --git a/modules/crypto/md4 b/modules/crypto/md4 index 03d28e9..f5a5f16 100644 --- a/modules/crypto/md4 +++ b/modules/crypto/md4 @@ -12,6 +12,7 @@ stdalign stdint configure.ac: +AC_REQUIRE([AC_C_RESTRICT]) gl_MD4 Makefile.am: -- 2.7.4