[GH-ISSUE #158] Regression: Compilation failure on Ubuntu 20.04 (Kernel 5.4) after blake2s API update #95

Open
opened 2026-10-13 21:06:29 +00:00 by bsakaguchi · 0 comments
Owner

Originally created by @h1de0x on GitHub (Mar 24, 2026).
Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/158

The issue is caused by the global change in blake2s argument order and context naming, which didn't account for specific header behaviors in older LTS distributions.

  CC [M]  /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.o
In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11:
/var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:13:6: error: nested redefinition of 'enum blake2s_lengths'
   13 | enum blake2s_lengths {
      |      ^~~~~~~~~~~~~~~
/var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:13:6: error: redeclaration of 'enum blake2s_lengths'
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:14:6: note: originally defined here
   14 | enum blake2s_lengths {
      |      ^~~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11:
/var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:14:2: error: redeclaration of enumerator 'BLAKE2S_BLOCK_SIZE'
   14 |  BLAKE2S_BLOCK_SIZE = 64,
      |  ^~~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:15:2: note: previous definition of 'BLAKE2S_BLOCK_SIZE' was here
   15 |  BLAKE2S_BLOCK_SIZE = 64,
      |  ^~~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11:
/var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:15:2: error: redeclaration of enumerator 'BLAKE2S_HASH_SIZE'
   15 |  BLAKE2S_HASH_SIZE = 32,
      |  ^~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:16:2: note: previous definition of 'BLAKE2S_HASH_SIZE' was here
   16 |  BLAKE2S_HASH_SIZE = 32,
./include/crypto/blake2s.h:16:2: note: previous definition of 'BLAKE2S_HASH_SIZE' was here
   16 |  BLAKE2S_HASH_SIZE = 32,
      |  ^~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11:
/var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:16:2: error: redeclaration of enumerator 'BLAKE2S_KEY_SIZE'
   16 |  BLAKE2S_KEY_SIZE = 32
      |  ^~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:17:2: note: previous definition of 'BLAKE2S_KEY_SIZE' was here
   17 |  BLAKE2S_KEY_SIZE = 32,
      |  ^~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11:
/var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:19:8: error: redefinition of 'struct blake2s_state'
   19 | struct blake2s_state {
      |        ^~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:25:8: note: originally defined here
   25 | struct blake2s_state {
      |        ^~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11:
/var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:28:6: error: conflicting types for 'blake2s_init'
   28 | void blake2s_init(struct blake2s_state *state, const size_t outlen);
      |      ^~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:63:20: note: previous definition of 'blake2s_init' was here
   63 | static inline void blake2s_init(struct blake2s_state *state,
      |                    ^~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11:
/var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:29:6: error: conflicting types for 'blake2s_init_key'
   29 | void blake2s_init_key(struct blake2s_state *state, const size_t outlen,
      |      ^~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:70:20: note: previous definition of 'blake2s_init_key' was here
   70 | static inline void blake2s_init_key(struct blake2s_state *state,
      |                    ^~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11:
/var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:31:6: error: conflicting types for 'blake2s_update'
   31 | void blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen);
      |      ^~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:45:6: note: previous declaration of 'blake2s_update' was here
   45 | void blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen);
      |      ^~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11:
/var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:32:6: error: conflicting types for 'blake2s_final'
   32 | void blake2s_final(struct blake2s_state *state, u8 *out);
      |      ^~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
      |      ^~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:46:6: note: previous declaration of 'blake2s_final' was here
   46 | void blake2s_final(struct blake2s_state *state, u8 *out);
      |      ^~~~~~~~~~~~~
In file included from <command-line>:
/var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1407:2: error: conflicting types for 'blake2s'
 1407 |  blake2s(out, in, key, outlen, inlen, keylen)
      |  ^~~~~~~
/var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:34:20: note: in expansion of macro 'blake2s'
   34 | static inline void blake2s(u8 *out, const u8 *in, const u8 *key,
      |                    ^~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:83:20: note: previous definition of 'blake2s' was here
   83 | static inline void blake2s(u8 *out, const u8 *in, const u8 *key,
      |                    ^~~~~~~
/var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:52:20: error: conflicting types for 'blake2s_init_param'
   52 | static inline void blake2s_init_param(struct blake2s_state *state,
      |                    ^~~~~~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:48:20: note: previous definition of 'blake2s_init_param' was here
   48 | static inline void blake2s_init_param(struct blake2s_state *state,
      |                    ^~~~~~~~~~~~~~~~~~
/var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:170:6: error: conflicting types for 'blake2s_update'
  170 | void blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen)
      |      ^~~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:45:6: note: previous declaration of 'blake2s_update' was here
   45 | void blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen);
      |      ^~~~~~~~~~~~~~
/var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:194:6: error: conflicting types for 'blake2s_final'
  194 | void blake2s_final(struct blake2s_state *state, u8 *out)
      |      ^~~~~~~~~~~~~
In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404,
                 from <command-line>:
./include/crypto/blake2s.h:46:6: note: previous declaration of 'blake2s_final' was here
   46 | void blake2s_final(struct blake2s_state *state, u8 *out);
      |      ^~~~~~~~~~~~~
make[1]: *** [scripts/Makefile.build:270: /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.o] Error 1
Originally created by @h1de0x on GitHub (Mar 24, 2026). Original GitHub issue: https://github.com/amnezia-vpn/amneziawg-linux-kernel-module/issues/158 The issue is caused by the global change in `blake2s` argument order and context naming, which didn't account for specific header behaviors in older LTS distributions. ``` CC [M] /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.o In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11: /var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:13:6: error: nested redefinition of 'enum blake2s_lengths' 13 | enum blake2s_lengths { | ^~~~~~~~~~~~~~~ /var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:13:6: error: redeclaration of 'enum blake2s_lengths' In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:14:6: note: originally defined here 14 | enum blake2s_lengths { | ^~~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11: /var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:14:2: error: redeclaration of enumerator 'BLAKE2S_BLOCK_SIZE' 14 | BLAKE2S_BLOCK_SIZE = 64, | ^~~~~~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:15:2: note: previous definition of 'BLAKE2S_BLOCK_SIZE' was here 15 | BLAKE2S_BLOCK_SIZE = 64, | ^~~~~~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11: /var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:15:2: error: redeclaration of enumerator 'BLAKE2S_HASH_SIZE' 15 | BLAKE2S_HASH_SIZE = 32, | ^~~~~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:16:2: note: previous definition of 'BLAKE2S_HASH_SIZE' was here 16 | BLAKE2S_HASH_SIZE = 32, ./include/crypto/blake2s.h:16:2: note: previous definition of 'BLAKE2S_HASH_SIZE' was here 16 | BLAKE2S_HASH_SIZE = 32, | ^~~~~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11: /var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:16:2: error: redeclaration of enumerator 'BLAKE2S_KEY_SIZE' 16 | BLAKE2S_KEY_SIZE = 32 | ^~~~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:17:2: note: previous definition of 'BLAKE2S_KEY_SIZE' was here 17 | BLAKE2S_KEY_SIZE = 32, | ^~~~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11: /var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:19:8: error: redefinition of 'struct blake2s_state' 19 | struct blake2s_state { | ^~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:25:8: note: originally defined here 25 | struct blake2s_state { | ^~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11: /var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:28:6: error: conflicting types for 'blake2s_init' 28 | void blake2s_init(struct blake2s_state *state, const size_t outlen); | ^~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:63:20: note: previous definition of 'blake2s_init' was here 63 | static inline void blake2s_init(struct blake2s_state *state, | ^~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11: /var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:29:6: error: conflicting types for 'blake2s_init_key' 29 | void blake2s_init_key(struct blake2s_state *state, const size_t outlen, | ^~~~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:70:20: note: previous definition of 'blake2s_init_key' was here 70 | static inline void blake2s_init_key(struct blake2s_state *state, | ^~~~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11: /var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:31:6: error: conflicting types for 'blake2s_update' 31 | void blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen); | ^~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:45:6: note: previous declaration of 'blake2s_update' was here 45 | void blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen); | ^~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:11: /var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:32:6: error: conflicting types for 'blake2s_final' 32 | void blake2s_final(struct blake2s_state *state, u8 *out); | ^~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, | ^~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:46:6: note: previous declaration of 'blake2s_final' was here 46 | void blake2s_final(struct blake2s_state *state, u8 *out); | ^~~~~~~~~~~~~ In file included from <command-line>: /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1407:2: error: conflicting types for 'blake2s' 1407 | blake2s(out, in, key, outlen, inlen, keylen) | ^~~~~~~ /var/lib/dkms/amneziawg/1.0.0/build/crypto/include/zinc/blake2s.h:34:20: note: in expansion of macro 'blake2s' 34 | static inline void blake2s(u8 *out, const u8 *in, const u8 *key, | ^~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:83:20: note: previous definition of 'blake2s' was here 83 | static inline void blake2s(u8 *out, const u8 *in, const u8 *key, | ^~~~~~~ /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:52:20: error: conflicting types for 'blake2s_init_param' 52 | static inline void blake2s_init_param(struct blake2s_state *state, | ^~~~~~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:48:20: note: previous definition of 'blake2s_init_param' was here 48 | static inline void blake2s_init_param(struct blake2s_state *state, | ^~~~~~~~~~~~~~~~~~ /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:170:6: error: conflicting types for 'blake2s_update' 170 | void blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen) | ^~~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:45:6: note: previous declaration of 'blake2s_update' was here 45 | void blake2s_update(struct blake2s_state *state, const u8 *in, size_t inlen); | ^~~~~~~~~~~~~~ /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.c:194:6: error: conflicting types for 'blake2s_final' 194 | void blake2s_final(struct blake2s_state *state, u8 *out) | ^~~~~~~~~~~~~ In file included from /var/lib/dkms/amneziawg/1.0.0/build/compat/compat.h:1404, from <command-line>: ./include/crypto/blake2s.h:46:6: note: previous declaration of 'blake2s_final' was here 46 | void blake2s_final(struct blake2s_state *state, u8 *out); | ^~~~~~~~~~~~~ make[1]: *** [scripts/Makefile.build:270: /var/lib/dkms/amneziawg/1.0.0/build/crypto/zinc/blake2s/blake2s.o] Error 1 ```
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
amnezia-vpn/amneziawg-linux-kernel-module#95
No description provided.