summaryrefslogtreecommitdiff
path: root/drivers/crypto/keembay/ocs-hcu.h
diff options
context:
space:
mode:
authorDaniele Alessandrelli <daniele.alessandrelli@intel.com>2020-12-16 11:46:37 +0000
committerHerbert Xu <herbert@gondor.apana.org.au>2021-01-03 08:41:36 +1100
commitae832e329a8d17144e5ae625e1704901f0e0b024 (patch)
treea29f22148e8fb1a9391bf0e6b3c72e700de41038 /drivers/crypto/keembay/ocs-hcu.h
parent472b04444cd39e16ba54987b2e901a79cf175463 (diff)
crypto: keembay-ocs-hcu - Add HMAC support
Add HMAC support to the Keem Bay OCS HCU driver, thus making it provide the following additional transformations: - hmac(sha256) - hmac(sha384) - hmac(sha512) - hmac(sm3) The Keem Bay OCS HCU hardware does not allow "context-switch" for HMAC operations, i.e., it does not support computing a partial HMAC, save its state and then continue it later. Therefore, full hardware acceleration is provided only when possible (e.g., when crypto_ahash_digest() is called); in all other cases hardware acceleration is only partial (OPAD and IPAD calculation is done in software, while hashing is hardware accelerated). Co-developed-by: Declan Murphy <declan.murphy@intel.com> Signed-off-by: Declan Murphy <declan.murphy@intel.com> Signed-off-by: Daniele Alessandrelli <daniele.alessandrelli@intel.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/keembay/ocs-hcu.h')
-rw-r--r--drivers/crypto/keembay/ocs-hcu.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/crypto/keembay/ocs-hcu.h b/drivers/crypto/keembay/ocs-hcu.h
index 6a467dcaf99c..fbbbb92a0592 100644
--- a/drivers/crypto/keembay/ocs-hcu.h
+++ b/drivers/crypto/keembay/ocs-hcu.h
@@ -95,4 +95,12 @@ int ocs_hcu_hash_final(struct ocs_hcu_dev *hcu_dev,
const struct ocs_hcu_hash_ctx *ctx, u8 *dgst,
size_t dgst_len);
+int ocs_hcu_digest(struct ocs_hcu_dev *hcu_dev, enum ocs_hcu_algo algo,
+ void *data, size_t data_len, u8 *dgst, size_t dgst_len);
+
+int ocs_hcu_hmac(struct ocs_hcu_dev *hcu_dev, enum ocs_hcu_algo algo,
+ const u8 *key, size_t key_len,
+ const struct ocs_hcu_dma_list *dma_list,
+ u8 *dgst, size_t dgst_len);
+
#endif /* _CRYPTO_OCS_HCU_H */