* modules/crypto/af_alg (Status, Notice): New sections.
(configure.ac): Add a module indicator.
* lib/md5-stream.c (md5_stream): Only use the AF_ALG API if the module
indicator is defined.
* lib/sha1-stream.c (sha1_stream): Likewise.
* lib/sha256-stream.c (shaxxx_stream): Likewise.
* lib/sha3-stream.c (sha3_xxx_stream): Likewise.
* lib/sha512-stream.c (shaxxx_stream): Likewise.
* modules/crypto/md5 (Depends-on): Remove crypto/af_alg dependency.
* modules/crypto/sha1 (Depends-on): Likewise.
* modules/crypto/sha256 (Depends-on): Likewise.
* modules/crypto/sha3 (Depends-on): Likewise.
* modules/crypto/sha512 (Depends-on): Likewise.
* NEWS: Mention the deprecation.
+2026-06-22 Collin Funk <collin.funk1@gmail.com>
+
+ crypto/af_alg: Deprecate.
+ * modules/crypto/af_alg (Status, Notice): New sections.
+ (configure.ac): Add a module indicator.
+ * lib/md5-stream.c (md5_stream): Only use the AF_ALG API if the module
+ indicator is defined.
+ * lib/sha1-stream.c (sha1_stream): Likewise.
+ * lib/sha256-stream.c (shaxxx_stream): Likewise.
+ * lib/sha3-stream.c (sha3_xxx_stream): Likewise.
+ * lib/sha512-stream.c (shaxxx_stream): Likewise.
+ * modules/crypto/md5 (Depends-on): Remove crypto/af_alg dependency.
+ * modules/crypto/sha1 (Depends-on): Likewise.
+ * modules/crypto/sha256 (Depends-on): Likewise.
+ * modules/crypto/sha3 (Depends-on): Likewise.
+ * modules/crypto/sha512 (Depends-on): Likewise.
+ * NEWS: Mention the deprecation.
+
2026-06-20 Paul Eggert <eggert@cs.ucla.edu>
gethrxtime: don’t use nanouptime, microuptime
Date Modules Changes
+2026-06-22 crypto/af_alg This module has been deprecated following the
+ deprecation of the AF_ALG API in Linux 7.2. If your
+ package requires optimized hash algorithms, place
+ gl_SET_CRYPTO_CHECK_DEFAULT([auto-gpl-compat]) in
+ your configure.ac to use OpenSSL when
+ possible. Alternatively, use 'crypto/gc'
+ which uses libgcrypt when possible.
+
2026-06-08 strerror The return type of the strerror function is now
'const char *' on most platforms. You may need to
adjust assignments of the form
# include "unlocked-io.h"
#endif
-#include "af_alg.h"
+#if GNULIB_AF_ALG
+# include "af_alg.h"
+#endif
#ifdef _LIBC
# include <endian.h>
int
md5_stream (FILE *stream, void *resblock)
{
+#if GNULIB_AF_ALG
switch (afalg_stream (stream, "md5", resblock, MD5_DIGEST_SIZE))
{
case 0: return 0;
case -EIO: return 1;
}
+#endif
char *buffer = malloc (BLOCKSIZE);
if (!buffer)
# include "unlocked-io.h"
#endif
-#include "af_alg.h"
+#if GNULIB_AF_ALG
+# include "af_alg.h"
+#endif
#define BLOCKSIZE 32768
#if BLOCKSIZE % 64 != 0
int
sha1_stream (FILE *restrict stream, void *restrict resblock)
{
+#if GNULIB_AF_ALG
switch (afalg_stream (stream, "sha1", resblock, SHA1_DIGEST_SIZE))
{
case 0: return 0;
case -EIO: return 1;
}
+#endif
char *buffer = malloc (BLOCKSIZE);
if (!buffer)
# include "unlocked-io.h"
#endif
-#include "af_alg.h"
+#if GNULIB_AF_ALG
+# include "af_alg.h"
+#endif
#define BLOCKSIZE 32768
#if BLOCKSIZE % 64 != 0
void *(*finish_ctx) (struct sha256_ctx *restrict,
void *restrict))
{
+#if GNULIB_AF_ALG
switch (afalg_stream (stream, alg, resblock, hashlen))
{
case 0: return 0;
case -EIO: return 1;
}
+#endif
char *buffer = malloc (BLOCKSIZE);
if (!buffer)
# include "unlocked-io.h"
#endif
-#include "af_alg.h"
+#if GNULIB_AF_ALG
+# include "af_alg.h"
+#endif
#define BLOCKSIZE 31824
#if (BLOCKSIZE % 144 != 0 && BLOCKSIZE % 136 != 0 && BLOCKSIZE % 104 != 0 \
void *restrict resblock,
ssize_t hashlen, bool (*init_ctx) (struct sha3_ctx *))
{
+#if GNULIB_AF_ALG
switch (afalg_stream (stream, alg, resblock, hashlen))
{
case 0: return 0;
case -EIO: return 1;
}
+#endif
char *buffer = malloc (BLOCKSIZE);
if (!buffer)
# include "unlocked-io.h"
#endif
-#include "af_alg.h"
+#if GNULIB_AF_ALG
+# include "af_alg.h"
+#endif
#define BLOCKSIZE 32768
#if BLOCKSIZE % 128 != 0
void *(*finish_ctx) (struct sha512_ctx *restrict,
void *restrict))
{
+#if GNULIB_AF_ALG
switch (afalg_stream (stream, alg, resblock, hashlen))
{
case 0: return 0;
case -EIO: return 1;
}
+#endif
char *buffer = malloc (BLOCKSIZE);
if (!buffer)
Description:
Compute message digest using kernel-supported cryptography algorithms.
+Status:
+deprecated
+
+Notice:
+This module is deprecated because AF_ALG was deprecated in Linux 7.2.
+
Files:
lib/af_alg.h
lib/af_alg.c
configure.ac:
gl_AF_ALG
+gl_MODULE_INDICATOR([af_alg])
Makefile.am:
lib_SOURCES += af_alg.c
lib/md5-stream.c
Depends-on:
-crypto/af_alg
crypto/md5-buffer
configure.ac:
lib/sha1-stream.c
Depends-on:
-crypto/af_alg
crypto/sha1-buffer
configure.ac:
lib/sha256-stream.c
Depends-on:
-crypto/af_alg
crypto/sha256-buffer
configure.ac:
lib/sha3-stream.c
Depends-on:
-crypto/af_alg
crypto/sha3-buffer
free-posix
lib/sha512-stream.c
Depends-on:
-crypto/af_alg
crypto/sha512-buffer
configure.ac: