2014-07-11 13:02:20

by Horia Geantă

[permalink] [raw]
Subject: [PATCH] crypto: caam - set DK (Decrypt Key) bit only for AES accelerator

AES currently shares descriptor creation functions with DES and 3DES.
DK bit is set in all cases, however it is valid only for
the AES accelerator.

Signed-off-by: Horia Geanta <[email protected]>
---
drivers/crypto/caam/caamalg.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index 64c606d9e821..7848be88ea5a 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -97,6 +97,13 @@ static inline void append_dec_op1(u32 *desc, u32 type)
{
u32 *jump_cmd, *uncond_jump_cmd;

+ /* DK bit is valid only for AES */
+ if ((type & OP_ALG_ALGSEL_MASK) != OP_ALG_ALGSEL_AES) {
+ append_operation(desc, type | OP_ALG_AS_INITFINAL |
+ OP_ALG_DECRYPT);
+ return;
+ }
+
jump_cmd = append_jump(desc, JUMP_TEST_ALL | JUMP_COND_SHRD);
append_operation(desc, type | OP_ALG_AS_INITFINAL |
OP_ALG_DECRYPT);
--
1.8.3.1


2014-07-23 13:36:10

by Herbert Xu

[permalink] [raw]
Subject: Re: [PATCH] crypto: caam - set DK (Decrypt Key) bit only for AES accelerator

On Fri, Jul 11, 2014 at 03:46:58PM +0300, Horia Geanta wrote:
> AES currently shares descriptor creation functions with DES and 3DES.
> DK bit is set in all cases, however it is valid only for
> the AES accelerator.
>
> Signed-off-by: Horia Geanta <[email protected]>

Patch applied.
--
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt