]> Savannah Git Hosting - gnulib.git/commitdiff
crypto/sha512-buffer: Use 'restrict'.
authorBruno Haible <bruno@clisp.org>
Sun, 23 Feb 2020 12:20:18 +0000 (13:20 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 23 Feb 2020 12:20:18 +0000 (13:20 +0100)
* lib/sha512.h (sha512_finish_ctx, sha384_finish_ctx, sha512_read_ctx,
sha384_read_ctx, sha512_buffer, sha384_buffer): Use 'restrict'.
* modules/crypto/sha512-buffer (configure.ac): Require AC_C_RESTRICT.

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

index 6e782e1be0aabb91b3d55400504b422f4b93fcf8..8701bead110846ae94a1f05782ea08eddb9ab22f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2020-02-23  Bruno Haible  <bruno@clisp.org>
 
+       crypto/sha512-buffer: Use 'restrict'.
+       * lib/sha512.h (sha512_finish_ctx, sha384_finish_ctx, sha512_read_ctx,
+       sha384_read_ctx, sha512_buffer, sha384_buffer): Use 'restrict'.
+       * modules/crypto/sha512-buffer (configure.ac): Require AC_C_RESTRICT.
+
        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'.
index aaf35a5f7d817db60da36eec1594ffdfab0eac76..21c2f580147368303047391025feeb14d3b42e81 100644 (file)
@@ -70,8 +70,8 @@ extern void sha512_process_bytes (const void *buffer, size_t len,
    in first 64 (48) 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 *sha512_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
-extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
+extern void *sha512_finish_ctx (struct sha512_ctx *ctx, void *restrict resbuf);
+extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *restrict resbuf);
 
 
 /* Put result from CTX in first 64 (48) bytes following RESBUF.  The result is
@@ -80,16 +80,20 @@ extern void *sha384_finish_ctx (struct sha512_ctx *ctx, void *resbuf);
 
    IMPORTANT: On some systems it is required that RESBUF is correctly
    aligned for a 32 bits value.  */
-extern void *sha512_read_ctx (const struct sha512_ctx *ctx, void *resbuf);
-extern void *sha384_read_ctx (const struct sha512_ctx *ctx, void *resbuf);
+extern void *sha512_read_ctx (const struct sha512_ctx *ctx,
+                              void *restrict resbuf);
+extern void *sha384_read_ctx (const struct sha512_ctx *ctx,
+                              void *restrict resbuf);
 
 
-/* Compute SHA512 (SHA384) message digest for LEN bytes beginning at BUFFER.  The
-   result is always in little endian byte order, so that a byte-wise
+/* Compute SHA512 (SHA384) 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 *sha512_buffer (const char *buffer, size_t len, void *resblock);
-extern void *sha384_buffer (const char *buffer, size_t len, void *resblock);
+extern void *sha512_buffer (const char *buffer, size_t len,
+                            void *restrict resblock);
+extern void *sha384_buffer (const char *buffer, size_t len,
+                            void *restrict resblock);
 
 # endif
 /* Compute SHA512 (SHA384) message digest for bytes read from STREAM.
index 32170a9a8a9929603078fe5079aa97a1c882b57a..7c5f64d64a4b6463cf90947754cd553423fe4fcb 100644 (file)
@@ -16,6 +16,7 @@ stdint
 u64
 
 configure.ac:
+AC_REQUIRE([AC_C_RESTRICT])
 gl_SHA512
 
 Makefile.am: