diff options
| author | Herbert Xu <[email protected]> | 2020-09-14 04:22:14 +0000 |
|---|---|---|
| committer | Herbert Xu <[email protected]> | 2020-09-25 07:48:13 +0000 |
| commit | 78cf1c8bfcb81a21347dfa57ce71d475cea9f595 (patch) | |
| tree | 0145d63947e14df916292f019e12bbf607f83714 /drivers/crypto/inside-secure/safexcel.h | |
| parent | crypto: inside-secure - Move priv pointer into safexcel_context (diff) | |
| download | kernel-78cf1c8bfcb81a21347dfa57ce71d475cea9f595.tar.gz kernel-78cf1c8bfcb81a21347dfa57ce71d475cea9f595.zip | |
crypto: inside-secure - Move ipad/opad into safexcel_context
As both safexcel_ahash_ctx and safexcel_cipher_ctx contain ipad
and opad buffers this patch moves them into the common struct
safexcel_context. It also adds a union so that they can be accessed
in the appropriate endian without crazy casts.
Signed-off-by: Herbert Xu <[email protected]>
Diffstat (limited to 'drivers/crypto/inside-secure/safexcel.h')
| -rw-r--r-- | drivers/crypto/inside-secure/safexcel.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/crypto/inside-secure/safexcel.h b/drivers/crypto/inside-secure/safexcel.h index 1c3e65841c0c..016f2ec9d3fb 100644 --- a/drivers/crypto/inside-secure/safexcel.h +++ b/drivers/crypto/inside-secure/safexcel.h @@ -12,7 +12,9 @@ #include <crypto/algapi.h> #include <crypto/internal/hash.h> #include <crypto/sha.h> +#include <crypto/sha3.h> #include <crypto/skcipher.h> +#include <linux/types.h> #define EIP197_HIA_VERSION_BE 0xca35 #define EIP197_HIA_VERSION_LE 0x35ca @@ -835,6 +837,13 @@ struct safexcel_context { struct safexcel_crypto_priv *priv; dma_addr_t ctxr_dma; + union { + __le32 le[SHA3_512_BLOCK_SIZE / 4]; + __be32 be[SHA3_512_BLOCK_SIZE / 4]; + u32 word[SHA3_512_BLOCK_SIZE / 4]; + u8 byte[SHA3_512_BLOCK_SIZE]; + } ipad, opad; + int ring; bool needs_inv; bool exit_inv; |
