OSDN Git Service

crypto: inside-secure - refrain from unneeded invalidations
authorOfer Heifetz <oferh@marvell.com>
Thu, 14 Dec 2017 14:26:47 +0000 (15:26 +0100)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 22 Dec 2017 09:03:30 +0000 (20:03 +1100)
commitc4daf4cc9c8dc728ff4afc043a82997072bfb2fa
tree245704889279b72b67720aa362cfab6b23239d72
parentcc75f5ce82cc52a1c152fa22ea8c172d84fb5bdf
crypto: inside-secure - refrain from unneeded invalidations

The check to know if an invalidation is needed (i.e. when the context
changes) is done even if the context does not exist yet. This happens
when first setting a key for ciphers and/or hmac operations.

This commits adds a check in the _setkey functions to only check if an
invalidation is needed when a context exists, as there is no need to
perform this check otherwise.

Signed-off-by: Ofer Heifetz <oferh@marvell.com>
[Antoine: commit message and added a comment and reworked one of the
checks]
Signed-off-by: Antoine Tenart <antoine.tenart@free-electrons.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/inside-secure/safexcel_cipher.c
drivers/crypto/inside-secure/safexcel_hash.c