Re: [v3 PATCH 10/31] crypto: chacha-generic - Add support for chaining

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 10, 2020 at 06:20:16PM +0300, Horia Geantă wrote:
> On 7/28/2020 10:19 AM, Herbert Xu wrote:
> > @@ -40,30 +39,41 @@ static int chacha_stream_xor(struct skcipher_request *req,
> >  static int crypto_chacha_crypt(struct skcipher_request *req)
> >  {
> >  	struct crypto_skcipher *tfm = crypto_skcipher_reqtfm(req);
> > +	struct chacha_reqctx *rctx = skcipher_request_ctx(req);
> >  	struct chacha_ctx *ctx = crypto_skcipher_ctx(tfm);
> >  
> > -	return chacha_stream_xor(req, ctx, req->iv);
> > +	if (!rctx->init)
> > +		chacha_init_generic(rctx->state, ctx->key, req->iv);
> It would probably be better to rename "init" to "no_init" or "final".

This turns out to be broken so it'll disappear anyway.  It'll
be replaced with a request flag instead.

Thanks,
-- 
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt



[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux