crypto: arc4 - Add internal state
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 28 Nov 2023 06:52:57 +0000 (14:52 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 8 Dec 2023 03:59:46 +0000 (11:59 +0800)
commit47309ea1359115125d9cab17a279c8df72b47235
tree08c92a0855dd0b24b6129286c15c149fffeff7eb
parent662ea18d089ba6fa02859fbd64f2aa78d88c6648
crypto: arc4 - Add internal state

The arc4 algorithm has always had internal state.  It's been buggy
from day one in that the state has been stored in the shared tfm
object.  That means two users sharing the same tfm will end up
affecting each other's output, or worse, they may end up with the
same output.

Fix this by declaring an internal state and storing the state there
instead of within the tfm context.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/arc4.c