From 06b590e6e5370d0b148a1c4c17ee2b54d617baaf Mon Sep 17 00:00:00 2001
From: Collin Funk <collin.funk1@gmail.com>
Date: Fri, 2 May 2025 10:53:49 -0700
Subject: [PATCH 6/6] cipher:aria: Fix compiler error on NetBSD.

* cipher/aria.c (bswap32): Remove function that conflicts with system
definitions on NetBSD.
(aria_diff_byte): Use _gcry_bswap32.

--

Cherry pick the master commit of:
	df684aca7407a4179771d79b5ef04ef8e4bedcc6

GnuPG-bug-id: 7633
Signed-off-by: Collin Funk <collin.funk1@gmail.com>
---
 cipher/aria.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/cipher/aria.c b/cipher/aria.c
index bc2d4384..26546a63 100644
--- a/cipher/aria.c
+++ b/cipher/aria.c
@@ -637,20 +637,14 @@ prefetch_sboxes(void)
 
 static ALWAYS_INLINE
 u32 rotr32(u32 v, u32 r)
 {
   return ror(v, r);
 }
 
-static ALWAYS_INLINE
-u32 bswap32(u32 v)
-{
-  return _gcry_bswap32(v);
-}
-
 static ALWAYS_INLINE u32
 get_u8(u32 x, u32 y)
 {
   return (x >> ((3 - y) * 8)) & 0xFF;
 }
 
 static ALWAYS_INLINE u32
@@ -723,15 +717,15 @@ aria_diff_word(u32 *t0, u32 *t1, u32 *t2, u32 *t3)
 }
 
 /* Byte-level diffusion */
 static inline void aria_diff_byte(u32 *t1, u32 *t2, u32 *t3)
 {
   *t1 = ((*t1 << 8) & 0xff00ff00) ^ ((*t1 >> 8) & 0x00ff00ff);
   *t2 = rotr32(*t2, 16);
-  *t3 = bswap32(*t3);
+  *t3 = _gcry_bswap32(*t3);
 }
 
 /* Key XOR Layer */
 static ALWAYS_INLINE void
 aria_add_round_key(u32 *rk, u32 *t0, u32 *t1, u32 *t2, u32 *t3)
 {
   *t0 ^= rk[0];
-- 
2.51.0

