summaryrefslogtreecommitdiff
path: root/crypto/arc4.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2023-11-27 18:14:08 +0800
committerHerbert Xu <herbert@gondor.apana.org.au>2023-12-08 11:59:46 +0800
commit0ae4dcc1ebf63118364d540b84c70352e8b2b2a4 (patch)
tree34e64203306550392bd1f459adf7cbfa953abfa2 /crypto/arc4.c
parent412ac51ce0b8c5581b6ff57fff6501e905a5471f (diff)
crypto: skcipher - Add internal state support
Unlike chaining modes such as CBC, stream ciphers other than CTR usually hold an internal state that must be preserved if the operation is to be done piecemeal. This has not been represented in the API, resulting in the inability to split up stream cipher operations. This patch adds the basic representation of an internal state to skcipher and lskcipher. In the interest of backwards compatibility, the default has been set such that existing users are assumed to be operating in one go as opposed to piecemeal. With the new API, each lskcipher/skcipher algorithm has a new attribute called statesize. For skcipher, this is the size of the buffer that can be exported or imported similar to ahash. For lskcipher, instead of providing a buffer of ivsize, the user now has to provide a buffer of ivsize + statesize. Each skcipher operation is assumed to be final as they are now, but this may be overridden with a request flag. When the override occurs, the user may then export the partial state and reimport it later. For lskcipher operations this is reversed. All operations are not final and the state will be exported unless the FINAL bit is set. However, the CONT bit still has to be set for the state to be used. Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'crypto/arc4.c')
-rw-r--r--crypto/arc4.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/arc4.c b/crypto/arc4.c
index eb3590dc9282..2150f94e7d03 100644
--- a/crypto/arc4.c
+++ b/crypto/arc4.c
@@ -23,7 +23,7 @@ static int crypto_arc4_setkey(struct crypto_lskcipher *tfm, const u8 *in_key,
}
static int crypto_arc4_crypt(struct crypto_lskcipher *tfm, const u8 *src,
- u8 *dst, unsigned nbytes, u8 *iv, bool final)
+ u8 *dst, unsigned nbytes, u8 *iv, u32 flags)
{
struct arc4_ctx *ctx = crypto_lskcipher_ctx(tfm);