author | Mingyen Hung <mingyen.hung@amlogic.com> | 2020-01-13 02:29:58 (GMT) |
---|---|---|
committer | Shen Liu <shen.liu@amlogic.com> | 2020-02-14 08:40:25 (GMT) |
commit | d0e7e1952c9e8253a76c48007f334fe0453f6fea (patch) | |
tree | d61a18ef1883d7264e35c2285f675ecca546db41 | |
parent | 5535dc4632f2f674694a5060a541e36bc8a87532 (diff) | |
download | common-d0e7e1952c9e8253a76c48007f334fe0453f6fea.zip common-d0e7e1952c9e8253a76c48007f334fe0453f6fea.tar.gz common-d0e7e1952c9e8253a76c48007f334fe0453f6fea.tar.bz2 |
crypto: disable HMAC for VtsKernelNetTest [1/1]
PD#SWPL-19138
Problem:
Failures of VtsKernelNetTest are reported
Solution:
1. It seems that performance of HMAC doesn't
meet the requirement of VtsKernelNetTest. We may
need to restructure driver to fix this issue.
2. Set a flag to disable HMAC temporarily.
3. Correct a usage case in aml_sha_update_dma_slow()
in which ctx->total is zero.
Verify:
verified on Android P + u212(franklin)
Change-Id: Ie618e1bf57093eaa7b68157c576ccf57eb1a88aa
Signed-off-by: Mingyen Hung <mingyen.hung@amlogic.com>
-rw-r--r-- | drivers/amlogic/crypto/aml-sha-dma.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/amlogic/crypto/aml-sha-dma.c b/drivers/amlogic/crypto/aml-sha-dma.c index fde19f1..0f2001f 100644 --- a/drivers/amlogic/crypto/aml-sha-dma.c +++ b/drivers/amlogic/crypto/aml-sha-dma.c @@ -43,6 +43,7 @@ #include <linux/amlogic/iomap.h> #include "aml-crypto-dma.h" +#define HMAC 0 /* SHA flags */ #define SHA_FLAGS_BUSY BIT(0) #define SHA_FLAGS_DMA_ACTIVE BIT(1) @@ -337,6 +338,9 @@ static int aml_sha_update_dma_slow(struct aml_sha_dev *dd, unsigned int final; size_t count; + if (!ctx->total) + return 0; + ctx->flags &= ~SHA_FLAGS_FAST; aml_sha_append_sg(ctx); @@ -951,6 +955,7 @@ static int aml_sha_export(struct ahash_request *req, void *out) return 0; } +#if HMAC static int aml_shash_digest(struct crypto_shash *tfm, u32 flags, const u8 *data, unsigned int len, u8 *out) { @@ -1007,6 +1012,7 @@ static int aml_sha_setkey(struct crypto_ahash *tfm, const u8 *key, return err; } +#endif static int aml_sha_cra_init_alg(struct crypto_tfm *tfm, const char *alg_base) { @@ -1047,7 +1053,7 @@ static void aml_sha_cra_exit(struct crypto_tfm *tfm) if (tctx->is_hmac && tctx->shash != NULL) crypto_free_shash(tctx->shash); } - +#if HMAC static int aml_hmac_sha1_cra_init(struct crypto_tfm *tfm) { struct aml_sha_ctx *tctx = crypto_tfm_ctx(tfm); @@ -1075,7 +1081,7 @@ static int aml_hmac_sha256_cra_init(struct crypto_tfm *tfm) static void aml_hmac_cra_exit(struct crypto_tfm *tfm) { } - +#endif static struct ahash_alg sha_algs[] = { { .init = aml_sha_init, @@ -1155,6 +1161,7 @@ static struct ahash_alg sha_algs[] = { } } }, +#if HMAC { .init = aml_sha_init, .update = aml_sha_update, @@ -1239,6 +1246,7 @@ static struct ahash_alg sha_algs[] = { } } } +#endif }; static void aml_sha_done_task(unsigned long data) |