Re: [PATCH v2 3/3] crypto: aria: implement aria-avx512

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/5/22 09:20, Elliott, Robert (Servers) wrote:
> --- a/arch/x86/crypto/aesni-intel_glue.c
> +++ b/arch/x86/crypto/aesni-intel_glue.c
> @@ -288,6 +288,10 @@ static int aes_set_key_common(struct crypto_tfm *tfm, void *raw_ctx,
>         struct crypto_aes_ctx *ctx = aes_ctx(raw_ctx);
>         int err;
> 
> +       BUILD_BUG_ON(offsetof(struct crypto_aes_ctx, key_enc) != 0);
> +       BUILD_BUG_ON(offsetof(struct crypto_aes_ctx, key_dec) != 240);
> +       BUILD_BUG_ON(offsetof(struct crypto_aes_ctx, key_length) != 480);

We have a nice fancy way of doing these.  See things like
CPU_ENTRY_AREA_entry_stack or TSS_sp0.  It's all put together from
arch/x86/kernel/asm-offsets.c and gets plopped in
include/generated/asm-offsets.h.

This is vastly preferred to hard-coded magic number offsets, even if
they do have a BUILD_BUG_ON() somewhere.



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]
  Powered by Linux