lkml.org 
[lkml]   [2018]   [May]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 01/10] crypto: aead - allow to allocate AEAD requests on the stack
Date
From: Antoine Tenart
> Sent: 02 May 2018 10:57
> Adds the AEAD_REQUEST_ON_STACK primitive to allow allocating AEAD
> requests on the stack, as it can already be done with various other
> crypto algorithms within the kernel.
>
> Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com>
> ---
> include/crypto/aead.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/crypto/aead.h b/include/crypto/aead.h
> index 1e26f790b03f..b67064786546 100644
> --- a/include/crypto/aead.h
> +++ b/include/crypto/aead.h
> @@ -151,6 +151,11 @@ struct aead_alg {
> struct crypto_alg base;
> };
>
> +#define AEAD_REQUEST_ON_STACK(name, tfm) \
> + char __##name##_desc[sizeof(struct aead_request) + \
> + crypto_aead_reqsize(tfm)] CRYPTO_MINALIGN_ATTR; \
> + struct aead_request *name = (void *)__##name##_desc
> +

This looks stunningly like a VLA.

David

\
 
 \ /
  Last update: 2018-05-02 16:55    [W:0.075 / U:3.860 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site