linux/drivers/crypto/inside-secure
Pascal van Leeuwen 5bdb6e6aa5 crypto: inside-secure - fix incorrect skcipher output IV
This patch fixes corruption issues with the skcipher output IV
witnessed on x86+EIP197-FPGA (devboard). The original fix, commit
57660b11d5 ("crypto: inside-secure - implement IV retrieval"),
attempted to write out the result IV through the context record.
However, this is not a reliable mechanism as there is no way of
knowing the hardware context update actually arrived in memory, so
it is possible to read the old contents instead of the updated IV.
(and indeed, this failed for the x86/FPGA case)

The alternative approach used here recognises the fact that the
result IV for CBC is actually the last cipher block, which is the last
input block in case of decryption and the last output block in case
of encryption. So the result IV is taken from the input data buffer
respectively the output data buffer instead, which *is* reliable.

Signed-off-by: Pascal van Leeuwen <pvanleeuwen@verimatrix.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2019-07-26 14:51:59 +10:00
..
Makefile treewide: Add SPDX license identifier - Makefile/Kconfig 2019-05-21 10:50:46 +02:00
safexcel.c crypto: inside-secure - silently return -EINVAL for input error cases 2019-07-26 14:51:58 +10:00
safexcel.h crypto: inside-secure - add support for HMAC updates 2019-06-06 14:38:56 +08:00
safexcel_cipher.c crypto: inside-secure - fix incorrect skcipher output IV 2019-07-26 14:51:59 +10:00
safexcel_hash.c crypto: inside-secure - fix use of the SG list 2019-06-06 14:38:56 +08:00
safexcel_ring.c crypto: inside-secure - enable context reuse 2019-06-06 14:38:56 +08:00