]> Savannah Git Hosting - gnulib.git/commitdiff
crypto/sha1-buffer: Use 'restrict'.
authorBruno Haible <bruno@clisp.org>
Sun, 23 Feb 2020 12:16:44 +0000 (13:16 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 23 Feb 2020 12:16:44 +0000 (13:16 +0100)
* lib/sha1.h (sha1_finish_ctx, sha1_read_ctx, sha1_buffer): Use
'restrict'.
* modules/crypto/sha1-buffer (configure.ac): Require AC_C_RESTRICT.

ChangeLog
lib/sha1.h
modules/crypto/sha1-buffer

index 2ed99c45f06f33cad9ac9baed016135fbec4df8d..379083a3d337592c47ca81c43adaf875e2f82741 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2020-02-23  Bruno Haible  <bruno@clisp.org>
 
+       crypto/sha1-buffer: Use 'restrict'.
+       * lib/sha1.h (sha1_finish_ctx, sha1_read_ctx, sha1_buffer): Use
+       'restrict'.
+       * modules/crypto/sha1-buffer (configure.ac): Require AC_C_RESTRICT.
+
        crypto/md5-buffer: Use 'restrict'.
        * lib/md5.h (__md5_finish_ctx, __md5_read_ctx, __md5_buffer): Use
        'restrict'.
index 99c53da745febe8fa4db54a9b6e1eaf19162002a..51496a97fa05c344f7925a9e1e67fce6a8d49451 100644 (file)
@@ -71,20 +71,21 @@ extern void sha1_process_bytes (const void *buffer, size_t len,
    in first 20 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 *sha1_finish_ctx (struct sha1_ctx *ctx, void *resbuf);
+extern void *sha1_finish_ctx (struct sha1_ctx *ctx, void *restrict resbuf);
 
 
 /* Put result from CTX in first 20 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 *sha1_read_ctx (const struct sha1_ctx *ctx, void *resbuf);
+extern void *sha1_read_ctx (const struct sha1_ctx *ctx, void *restrict resbuf);
 
 
 /* Compute SHA1 message digest for LEN bytes beginning at BUFFER.  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 *sha1_buffer (const char *buffer, size_t len, void *resblock);
+extern void *sha1_buffer (const char *buffer, size_t len,
+                          void *restrict resblock);
 
 # endif
 /* Compute SHA1 message digest for bytes read from STREAM.
index 807f2dcc0b2bcd17bd04bf699257826dc40a2b1c..55a542065d0b533e7e23540221b3470cac6faf91 100644 (file)
@@ -15,6 +15,7 @@ stdalign
 stdint
 
 configure.ac:
+AC_REQUIRE([AC_C_RESTRICT])
 gl_SHA1
 
 Makefile.am: