summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-02-23 13:29:14 +0100
committerBruno Haible <bruno@clisp.org>2020-02-23 13:29:14 +0100
commit46b3b6881a8a677c7a577ec4182b2eb4d5aa230c (patch)
tree2f692e4be6c01648978ea08a7c64abba751f69e9
parent7c69c58720bc2b3cdfca4a3d8564f77aa662e576 (diff)
downloadgnulib-46b3b6881a8a677c7a577ec4182b2eb4d5aa230c.tar.gz
crypto/gc: Use 'restrict'.
* lib/gc.h (gc_pbkdf2_hmac, gc_pbkdf2_sha1): Use 'restrict'. * m4/gc.m4 (gl_GC): Require AC_C_RESTRICT.
-rw-r--r--ChangeLog4
-rw-r--r--lib/gc.h4
-rw-r--r--m4/gc.m44
3 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index e62e1aa3fb..5b5b35d227 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
2020-02-23 Bruno Haible <bruno@clisp.org>
+ 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 05fb8a3d25..87acdbc5eb 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 0180d32b78..7f8f462714 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])
])