OSDN Git Service

crypto: caam - update IV using HW support
authorHoria Geantă <horia.geanta@nxp.com>
Mon, 10 Jun 2019 13:30:59 +0000 (16:30 +0300)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 20 Jun 2019 06:18:33 +0000 (14:18 +0800)
commit334d37c9e26364511f0673ef155e2ad207316e90
treecdca67aac29710e65aa0d36515d6b965a04ac20e
parent059d73eea6409873446a858dd64a5bec9bf68b70
crypto: caam - update IV using HW support

Modify drivers to perform skcipher IV update using the crypto engine,
instead of performing the operation in SW.

Besides being more efficient, this also fixes IV update for CTR mode.

Output HW S/G table is appended with an entry pointing to the same
IV buffer used as input (which is now mapped BIDIRECTIONAL).

AS (Algorithm State) parameter of the OPERATION command is changed
from INIFINAL to INIT in descriptors used by ctr(aes), cbc(aes).
This is needed since in case FINAL bit is set, HW skips IV updating
in the Context Register for the last data block.

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/caam/caamalg.c
drivers/crypto/caam/caamalg_desc.c
drivers/crypto/caam/caamalg_desc.h
drivers/crypto/caam/caamalg_qi.c
drivers/crypto/caam/caamalg_qi2.c