>From 46b3b6881a8a677c7a577ec4182b2eb4d5aa230c Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 23 Feb 2020 13:29:14 +0100 Subject: [PATCH 29/29] crypto/gc: Use 'restrict'. * lib/gc.h (gc_pbkdf2_hmac, gc_pbkdf2_sha1): Use 'restrict'. * m4/gc.m4 (gl_GC): Require AC_C_RESTRICT. --- ChangeLog | 4 ++++ lib/gc.h | 4 ++-- m4/gc.m4 | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e62e1aa..5b5b35d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2020-02-23 Bruno Haible + crypto/gc: Use 'restrict'. + * lib/gc.h (gc_pbkdf2_hmac, gc_pbkdf2_sha1): Use 'restrict'. + * m4/gc.m4 (gl_GC): Require AC_C_RESTRICT. + crypto/hmac-*: Use 'restrict'. * lib/hmac.h (hmac_md5, hmac_sha1, hmac_sha256, hmac_sha512): Use 'restrict'. diff --git a/lib/gc.h b/lib/gc.h index 05fb8a3..87acdbc 100644 --- a/lib/gc.h +++ b/lib/gc.h @@ -185,12 +185,12 @@ extern Gc_rc gc_pbkdf2_hmac (Gc_hash hash, const char *P, size_t Plen, const char *S, size_t Slen, - unsigned int c, char *DK, size_t dkLen); + unsigned int c, char *restrict DK, size_t dkLen); extern Gc_rc gc_pbkdf2_sha1 (const char *P, size_t Plen, const char *S, size_t Slen, - unsigned int c, char *DK, size_t dkLen); + unsigned int c, char *restrict DK, size_t dkLen); /* TODO: diff --git a/m4/gc.m4 b/m4/gc.m4 index 0180d32..7f8f462 100644 --- a/m4/gc.m4 +++ b/m4/gc.m4 @@ -1,4 +1,4 @@ -# gc.m4 serial 12 +# gc.m4 serial 13 dnl Copyright (C) 2005-2020 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, @@ -25,4 +25,6 @@ AC_DEFUN([gl_GC], fi fi AC_SUBST([LIB_CRYPTO]) + + AC_REQUIRE([AC_C_RESTRICT]) ]) -- 2.7.4