]> Savannah Git Hosting - gnulib.git/commitdiff
crypto/hmac-*: Use 'restrict'.
authorBruno Haible <bruno@clisp.org>
Sun, 23 Feb 2020 12:27:35 +0000 (13:27 +0100)
committerBruno Haible <bruno@clisp.org>
Sun, 23 Feb 2020 12:27:35 +0000 (13:27 +0100)
* lib/hmac.h (hmac_md5, hmac_sha1, hmac_sha256, hmac_sha512): Use
'restrict'.
* modules/crypto/hmac-md5 (configure.ac): Require AC_C_RESTRICT.
* modules/crypto/hmac-sha1 (configure.ac): Likewise.
* modules/crypto/hmac-sha256 (configure.ac): Likewise.
* modules/crypto/hmac-sha512 (configure.ac): Likewise.

ChangeLog
lib/hmac.h
modules/crypto/hmac-md5
modules/crypto/hmac-sha1
modules/crypto/hmac-sha256
modules/crypto/hmac-sha512

index 5a1c59151b4352810732bfefe56e94fd6418b3e2..e62e1aa3fb6a2181c479b4df4dad82902c80fcbd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
 2020-02-23  Bruno Haible  <bruno@clisp.org>
 
+       crypto/hmac-*: Use 'restrict'.
+       * lib/hmac.h (hmac_md5, hmac_sha1, hmac_sha256, hmac_sha512): Use
+       'restrict'.
+       * modules/crypto/hmac-md5 (configure.ac): Require AC_C_RESTRICT.
+       * modules/crypto/hmac-sha1 (configure.ac): Likewise.
+       * modules/crypto/hmac-sha256 (configure.ac): Likewise.
+       * modules/crypto/hmac-sha512 (configure.ac): Likewise.
+
        crypto/sm3: Use 'restrict'.
        * lib/sm3.h (sm3_finish_ctx, sm3_read_ctx, sm3_buffer): Use 'restrict'.
        * m4/sm3.m4 (gl_SM3): Require AC_C_RESTRICT.
index a39070221f45963e21093f4a9dd132f6c9394736..135eb2a8b05a240ac0a291e915dff94f0d0d6bab 100644 (file)
@@ -27,7 +27,7 @@
    RESBUF buffer.  Return 0 on success.  */
 int
 hmac_md5 (const void *key, size_t keylen,
-          const void *buffer, size_t buflen, void *resbuf);
+          const void *buffer, size_t buflen, void *restrict resbuf);
 
 /* Compute Hashed Message Authentication Code with SHA-1, over BUFFER
    data of BUFLEN bytes using the KEY of KEYLEN bytes, writing the
@@ -35,7 +35,7 @@ hmac_md5 (const void *key, size_t keylen,
    success.  */
 int
 hmac_sha1 (const void *key, size_t keylen,
-           const void *in, size_t inlen, void *resbuf);
+           const void *in, size_t inlen, void *restrict resbuf);
 
 /* Compute Hashed Message Authentication Code with SHA-256, over BUFFER
    data of BUFLEN bytes using the KEY of KEYLEN bytes, writing the
@@ -43,7 +43,7 @@ hmac_sha1 (const void *key, size_t keylen,
    success.  */
 int
 hmac_sha256 (const void *key, size_t keylen,
-             const void *in, size_t inlen, void *resbuf);
+             const void *in, size_t inlen, void *restrict resbuf);
 
 /* Compute Hashed Message Authentication Code with SHA-512, over BUFFER
    data of BUFLEN bytes using the KEY of KEYLEN bytes, writing the
@@ -51,6 +51,6 @@ hmac_sha256 (const void *key, size_t keylen,
    success.  */
 int
 hmac_sha512 (const void *key, size_t keylen,
-             const void *in, size_t inlen, void *resbuf);
+             const void *in, size_t inlen, void *restrict resbuf);
 
 #endif /* HMAC_H */
index a2bb9ede7d684d21f8fa5a61408efbec7649fe17..8739c063014ba1194211ef266d6f012c31b0f17c 100644 (file)
@@ -11,6 +11,7 @@ memxor
 crypto/md5
 
 configure.ac:
+AC_REQUIRE([AC_C_RESTRICT])
 
 Makefile.am:
 lib_SOURCES += hmac-md5.c
index 6bec8ae0923587ad53964c791db5eaf5773ed189..d49d68d2adbdeeab73b99b1898d9f5dcd6a03d1b 100644 (file)
@@ -11,6 +11,7 @@ memxor
 crypto/sha1
 
 configure.ac:
+AC_REQUIRE([AC_C_RESTRICT])
 
 Makefile.am:
 lib_SOURCES += hmac-sha1.c
index 8bd47e8fe9d8684543064f74ff9ec1067fcc8e9e..e67ffd43df8cabcb470d1fedec4eebd0cae91c1b 100644 (file)
@@ -11,6 +11,7 @@ memxor
 crypto/sha256
 
 configure.ac:
+AC_REQUIRE([AC_C_RESTRICT])
 
 Makefile.am:
 lib_SOURCES += hmac-sha256.c
index ad0e81b278cae21dfdb39dd42be2d77d28e52875..53e11f8cb62f0ac12b16a003a98a9a9dee0652e9 100644 (file)
@@ -11,6 +11,7 @@ memxor
 crypto/sha512
 
 configure.ac:
+AC_REQUIRE([AC_C_RESTRICT])
 
 Makefile.am:
 lib_SOURCES += hmac-sha512.c