aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/crypto/caam/error.h
diff options
context:
space:
mode:
authorHoria Geantă <horia.geanta@nxp.com>2018-12-21 14:47:46 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2019-01-10 21:37:31 +0800
commit2dd3fde41bf3dc68e38de23da87e72a07719b708 (patch)
tree15a68d8de0dfa57a3db654230c26a4683e41d752 /drivers/crypto/caam/error.h
parentcrypto: caam - fix zero-length buffer DMA mapping (diff)
downloadlinux-dev-2dd3fde41bf3dc68e38de23da87e72a07719b708.tar.xz
linux-dev-2dd3fde41bf3dc68e38de23da87e72a07719b708.zip
crypto: caam - fix SHA support detection
The addition of Chacha20 + Poly1305 authenc support inadvertently broke detection of algorithms supported by MDHA (Message Digest Hardware Accelerator), fix it. Fixes: d6bbd4eea243 ("crypto: caam/jr - add support for Chacha20 + Poly1305") Signed-off-by: Horia Geantă <horia.geanta@nxp.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
-rw-r--r--drivers/crypto/caam/error.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/crypto/caam/error.h b/drivers/crypto/caam/error.h
index 67ea94079837..8c6b83e02a70 100644
--- a/drivers/crypto/caam/error.h
+++ b/drivers/crypto/caam/error.h
@@ -7,6 +7,9 @@
#ifndef CAAM_ERROR_H
#define CAAM_ERROR_H
+
+#include "desc.h"
+
#define CAAM_ERROR_STR_MAX 302
void caam_strstatus(struct device *dev, u32 status, bool qi_v2);
@@ -17,4 +20,10 @@ void caam_strstatus(struct device *dev, u32 status, bool qi_v2);
void caam_dump_sg(const char *level, const char *prefix_str, int prefix_type,
int rowsize, int groupsize, struct scatterlist *sg,
size_t tlen, bool ascii);
+
+static inline bool is_mdha(u32 algtype)
+{
+ return (algtype & OP_ALG_ALGSEL_MASK & ~OP_ALG_ALGSEL_SUBMASK) ==
+ OP_ALG_CHA_MDHA;
+}
#endif /* CAAM_ERROR_H */