From 18a1dc1fd56b4a5b468ad5bf984a2b0ea5ee8c69 Mon Sep 17 00:00:00 2001 From: Yael Chemla Date: Thu, 18 Oct 2018 13:59:58 +0100 Subject: crypto: ccree - modify set_cipher_mode usage from cc_hash encapsulate set_cipher_mode call with another api, preparation for specific hash behavior as needed in later patches when SM3 introduced. Signed-off-by: Yael Chemla Signed-off-by: Herbert Xu --- drivers/crypto/ccree/cc_hw_queue_defs.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'drivers/crypto/ccree/cc_hw_queue_defs.h') diff --git a/drivers/crypto/ccree/cc_hw_queue_defs.h b/drivers/crypto/ccree/cc_hw_queue_defs.h index f719ff9c0277..6e8438a71478 100644 --- a/drivers/crypto/ccree/cc_hw_queue_defs.h +++ b/drivers/crypto/ccree/cc_hw_queue_defs.h @@ -457,6 +457,20 @@ static inline void set_cipher_mode(struct cc_hw_desc *pdesc, int mode) pdesc->word[4] |= FIELD_PREP(WORD4_CIPHER_MODE, mode); } +/* + * Set the cipher mode for hash algorithms. + * + * @pdesc: pointer HW descriptor struct + * @cipher_mode: Any one of the modes defined in [CC7x-DESC] + * @hash_mode: specifies which hash is being handled + */ +static inline void set_hash_cipher_mode(struct cc_hw_desc *pdesc, + enum drv_cipher_mode cipher_mode, + enum drv_hash_mode hash_mode) +{ + set_cipher_mode(pdesc, cipher_mode); +} + /* * Set the cipher configuration fields. * -- cgit v1.2.3-59-g8ed1b