lkml.org 
[lkml]   [2022]   [Dec]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC][PATCH 01/12] crypto: Remove u128 usage
On Mon, Dec 19, 2022 at 04:35:26PM +0100, Peter Zijlstra wrote:
> As seems to be the common (majority) usage in crypto, use __uint128_t
> instead of u128.
>
> This frees up u128 for definition in linux/types.h.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
> ---
> lib/crypto/curve25519-hacl64.c | 142 ++++++++++++++++++++---------------------
> lib/crypto/poly1305-donna64.c | 22 ++----
> 2 files changed, 80 insertions(+), 84 deletions(-)
>
> --- a/lib/crypto/curve25519-hacl64.c
> +++ b/lib/crypto/curve25519-hacl64.c
> @@ -14,8 +14,6 @@
> #include <crypto/curve25519.h>
> #include <linux/string.h>
>
> -typedef __uint128_t u128;
> -
> static __always_inline u64 u64_eq_mask(u64 a, u64 b)
> {
> u64 x = a ^ b;
> @@ -50,77 +48,77 @@ static __always_inline void modulo_carry
> b[0] = b0_;
> }
>
> -static __always_inline void fproduct_copy_from_wide_(u64 *output, u128 *input)
> +static __always_inline void fproduct_copy_from_wide_(u64 *output, __uint128_t *input)
> {
> {
> - u128 xi = input[0];
> + __uint128_t xi = input[0];

Why not just use `u128` from types.h in this file?

Jason

\
 
 \ /
  Last update: 2022-12-19 16:59    [W:0.519 / U:1.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site