]> Savannah Git Hosting - gnulib.git/commitdiff
crypto/sha256-buffer: Use 'restrict'.
authorBruno Haible <bruno@clisp.org>
Sun, 23 Feb 2020 12:18:33 +0000 (13:18 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 23 Feb 2020 12:18:33 +0000 (13:18 +0100)
* lib/sha256.h (sha256_finish_ctx, sha224_finish_ctx, sha256_read_ctx,
sha224_read_ctx, sha256_buffer, sha224_buffer): Use 'restrict'.
* modules/crypto/sha256-buffer (configure.ac): Require AC_C_RESTRICT.

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

index 379083a3d337592c47ca81c43adaf875e2f82741..6e782e1be0aabb91b3d55400504b422f4b93fcf8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2020-02-23  Bruno Haible  <bruno@clisp.org>
 
+       crypto/sha256-buffer: Use 'restrict'.
+       * lib/sha256.h (sha256_finish_ctx, sha224_finish_ctx, sha256_read_ctx,
+       sha224_read_ctx, sha256_buffer, sha224_buffer): Use 'restrict'.
+       * modules/crypto/sha256-buffer (configure.ac): Require AC_C_RESTRICT.
+
        crypto/sha1-buffer: Use 'restrict'.
        * lib/sha1.h (sha1_finish_ctx, sha1_read_ctx, sha1_buffer): Use
        'restrict'.
index 1bc61d437c9b3fa3777942c4e18424d2411a8adc..750d78a269652abade752c966d50cf98ed8ff76c 100644 (file)
@@ -70,23 +70,27 @@ extern void sha256_process_bytes (const void *buffer, size_t len,
    in first 32 (28) 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 *sha256_finish_ctx (struct sha256_ctx *ctx, void *resbuf);
-extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *resbuf);
+extern void *sha256_finish_ctx (struct sha256_ctx *ctx, void *restrict resbuf);
+extern void *sha224_finish_ctx (struct sha256_ctx *ctx, void *restrict resbuf);
 
 
 /* Put result from CTX in first 32 (28) 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 *sha256_read_ctx (const struct sha256_ctx *ctx, void *resbuf);
-extern void *sha224_read_ctx (const struct sha256_ctx *ctx, void *resbuf);
+extern void *sha256_read_ctx (const struct sha256_ctx *ctx,
+                              void *restrict resbuf);
+extern void *sha224_read_ctx (const struct sha256_ctx *ctx,
+                              void *restrict resbuf);
 
 
-/* Compute SHA256 (SHA224) message digest for LEN bytes beginning at BUFFER.  The
-   result is always in little endian byte order, so that a byte-wise
+/* Compute SHA256 (SHA224) 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 *sha256_buffer (const char *buffer, size_t len, void *resblock);
-extern void *sha224_buffer (const char *buffer, size_t len, void *resblock);
+extern void *sha256_buffer (const char *buffer, size_t len,
+                            void *restrict resblock);
+extern void *sha224_buffer (const char *buffer, size_t len,
+                            void *restrict resblock);
 
 # endif
 /* Compute SHA256 (SHA224) message digest for bytes read from STREAM.
index e5a4703ec0c48833acde660c2bed6231015b1a58..055275a38e070f6c56b3d04a8dc6ab77ce49fde6 100644 (file)
@@ -15,6 +15,7 @@ stdalign
 stdint
 
 configure.ac:
+AC_REQUIRE([AC_C_RESTRICT])
 gl_SHA256
 
 Makefile.am: