MLK-22039: crypto: caam - update IV using HW support
authorHoria Geantă <horia.geanta@nxp.com>
Mon, 10 Jun 2019 13:30:59 +0000 (16:30 +0300)
committerHoria Geantă <horia.geanta@nxp.com>
Fri, 5 Jul 2019 15:00:15 +0000 (18:00 +0300)
commitd342b9781f8c5aae138a4b38fc3f94544cbae202
tree2d9252ec46f348de2618703c96ed49e27219bb21
parent87414e1e091e050e4372c2d7a5613ea7ae4ed3ca
MLK-22039: 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>
(cherry picked from commit 334d37c9e26364511f0673ef155e2ad207316e90)

backported to imx_4.19.y

Signed-off-by: Horia Geantă <horia.geanta@nxp.com>
Reviewed-by: Iuliana Prodan <iuliana.prodan@nxp.com>
drivers/crypto/caam/caamalg.c
drivers/crypto/caam/caamalg_desc.c
drivers/crypto/caam/caamalg_desc.h
drivers/crypto/caam/caamalg_qi.c