Re: [PATCH libgcrypt 1/2] cipher:aria: Fix compiler error on NetBSD.

Jussi Kivilinna <[email protected]> Fri, 2 May 2025 12:42:48 +0300
Newsgroups gmane.comp.encryption.gpg.libgcrypt.devel
Message-ID <[email protected]>
Hello,

On 02/05/2025 08:20, Collin Funk via Gcrypt-devel wrote:
> * cipher/aria.c (bswap32) [__NetBSD__]: Define internal function to
> something else to avoid possible system definitions.
> 
> --
> 
> GnuPG-bug-id: 7633
> Signed-off-by: Collin Funk <[email protected]>
> ---
>   cipher/aria.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/cipher/aria.c b/cipher/aria.c
> index bc2d4384..cabae4a6 100644
> --- a/cipher/aria.c
> +++ b/cipher/aria.c
> @@ -641,6 +641,11 @@ u32 rotr32(u32 v, u32 r)
>     return ror(v, r);
>   }
>   
> +/* Avoid a compiler error due to the definition of bswap32 on NetBSD.  */
> +#if defined (__NetBSD__)
> +#undef bswap32
> +#define bswap32 _aria_bswap32
> +#endif
>   static ALWAYS_INLINE
>   u32 bswap32(u32 v)
>   {

I think it would be better to just remove this bswap32 wrapper function
and change aria_diff_byte() to use _gcry_bswap32 directly.

-Jussi