mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-23 05:56:14 -04:00
crypto: sa2ul - Reduce stack usage
This patch reduces the stack usage in sa2ul:
1. Move the exported sha state into sa_prepare_iopads so that it
can occupy the same space as the k_pad buffer.
2. Use one buffer for ipad/opad in sa_prepare_iopads.
3. Remove ipad/opad buffer from sa_set_sc_auth.
4. Use async skcipher fallback and remove on-stack request from
sa_cipher_run.
Reported-by: kernel test robot <lkp@intel.com>
Fixes: d2c8ac187f ("crypto: sa2ul - Add AEAD algorithm support")
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
This commit is contained in:
@@ -12,10 +12,8 @@
|
||||
#ifndef _K3_SA2UL_
|
||||
#define _K3_SA2UL_
|
||||
|
||||
#include <linux/interrupt.h>
|
||||
#include <linux/skbuff.h>
|
||||
#include <linux/hw_random.h>
|
||||
#include <crypto/aes.h>
|
||||
#include <crypto/sha.h>
|
||||
|
||||
#define SA_ENGINE_ENABLE_CONTROL 0x1000
|
||||
|
||||
@@ -311,7 +309,7 @@ struct sa_tfm_ctx {
|
||||
struct crypto_shash *shash;
|
||||
/* for fallback */
|
||||
union {
|
||||
struct crypto_sync_skcipher *skcipher;
|
||||
struct crypto_skcipher *skcipher;
|
||||
struct crypto_ahash *ahash;
|
||||
struct crypto_aead *aead;
|
||||
} fallback;
|
||||
|
||||
Reference in New Issue
Block a user