>From 67f3b5ba252ac2962276ddc8e3431d4897549cf1 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 23 Feb 2020 13:12:16 +0100 Subject: [PATCH 20/29] 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. --- ChangeLog | 4 ++++ lib/md2.h | 7 ++++--- modules/crypto/md2 | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e51ac6..33a233e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-02-23 Bruno Haible + 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. + crypto/rijndael: Use 'restrict'. * lib/rijndael-api-fst.h (rijndaelBlockEncrypt, rijndaelPadEncrypt, rijndaelBlockDecrypt, rijndaelPadDecrypt): Use 'restrict'. diff --git a/lib/md2.h b/lib/md2.h index 8fa912f..6cb58a9 100644 --- a/lib/md2.h +++ b/lib/md2.h @@ -57,13 +57,13 @@ extern void md2_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 *md2_finish_ctx (struct md2_ctx *ctx, void *resbuf); +extern void *md2_finish_ctx (struct md2_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 *md2_read_ctx (const struct md2_ctx *ctx, void *resbuf); +extern void *md2_read_ctx (const struct md2_ctx *ctx, void *restrict resbuf); /* Compute MD2 message digest for bytes read from STREAM. The @@ -75,7 +75,8 @@ extern int md2_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 *md2_buffer (const char *buffer, size_t len, void *resblock); +extern void *md2_buffer (const char *buffer, size_t len, + void *restrict resblock); # ifdef __cplusplus } diff --git a/modules/crypto/md2 b/modules/crypto/md2 index 0cc8499..d89eb95 100644 --- a/modules/crypto/md2 +++ b/modules/crypto/md2 @@ -9,6 +9,7 @@ Depends-on: minmax configure.ac: +AC_REQUIRE([AC_C_RESTRICT]) Makefile.am: lib_SOURCES += md2.c -- 2.7.4