summaryrefslogtreecommitdiffstats
path: root/drivers/crypto
diff options
context:
space:
mode:
authorAntoine Tenart <antoine.tenart@bootlin.com>2018-03-19 09:21:18 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2018-03-30 19:32:46 +0200
commit15f64ee0aecdd7a65bd8a6067511e14abf159590 (patch)
tree212ed848f12e6bc55284e8a9f8f2875eb20e92b8 /drivers/crypto
parentcrypto: inside-secure - do not access buffers mapped to the device (diff)
downloadlinux-15f64ee0aecdd7a65bd8a6067511e14abf159590.tar.xz
linux-15f64ee0aecdd7a65bd8a6067511e14abf159590.zip
crypto: inside-secure - improve the skcipher token
The token used for encryption and decryption of skcipher algorithms sets its stat field to "last packet". As it's a cipher only algorithm, there is not hash operation and thus the "last hash" bit should be set to tell the internal engine no hash operation should be performed. This does not fix a bug, but improves the token definition to follow exactly what's advised by the datasheet. Signed-off-by: Antoine Tenart <antoine.tenart@bootlin.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r--drivers/crypto/inside-secure/safexcel_cipher.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/crypto/inside-secure/safexcel_cipher.c b/drivers/crypto/inside-secure/safexcel_cipher.c
index 17a7725a6f6d..bafb60505fab 100644
--- a/drivers/crypto/inside-secure/safexcel_cipher.c
+++ b/drivers/crypto/inside-secure/safexcel_cipher.c
@@ -58,7 +58,8 @@ static void safexcel_cipher_token(struct safexcel_cipher_ctx *ctx,
token[0].opcode = EIP197_TOKEN_OPCODE_DIRECTION;
token[0].packet_length = length;
- token[0].stat = EIP197_TOKEN_STAT_LAST_PACKET;
+ token[0].stat = EIP197_TOKEN_STAT_LAST_PACKET |
+ EIP197_TOKEN_STAT_LAST_HASH;
token[0].instructions = EIP197_TOKEN_INS_LAST |
EIP197_TOKEN_INS_TYPE_CRYTO |
EIP197_TOKEN_INS_TYPE_OUTPUT;