crypto: sahara - remove FLAGS_NEW_KEY logic
authorOvidiu Panait <ovidiu.panait@windriver.com>
Fri, 1 Dec 2023 17:06:19 +0000 (19:06 +0200)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 Dec 2023 03:59:45 +0000 (11:59 +0800)
commit8fd183435728b139248a77978ea3732039341779
tree0d0e75e5db3ed628e7e674abaf31ad7c4f4dda98
parent87e02063d07708cac5bfe9fd3a6a242898758ac8
crypto: sahara - remove FLAGS_NEW_KEY logic

Remove the FLAGS_NEW_KEY logic as it has the following issues:
- the wrong key may end up being used when there are multiple data streams:
       t1            t2
    setkey()
    encrypt()
                   setkey()
                   encrypt()

    encrypt() <--- key from t2 is used
- switching between encryption and decryption with the same key is not
  possible, as the hdr flags are only updated when a new setkey() is
  performed

With this change, the key is always sent along with the cryptdata when
performing encryption/decryption operations.

Fixes: 5de8875281e1 ("crypto: sahara - Add driver for SAHARA2 accelerator.")
Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
drivers/crypto/sahara.c