Re: [PATCH v5 3/8] crypto: AF_ALG: add AEAD support

2014-12-25 Thread Herbert Xu
On Wed, Dec 24, 2014 at 09:54:33AM +0100, Stephan Mueller wrote: > > That is right, but isn't that the nature of AEAD ciphers in general? Even if > you are in the kernel, you need to have all scatter lists together for one > invocation of the AEAD cipher. It's actually only the nature of certai

Re: [PATCH v5 3/8] crypto: AF_ALG: add AEAD support

2014-12-25 Thread Stephan Mueller
Am Mittwoch, 24. Dezember 2014, 09:54:33 schrieb Stephan Mueller: Hi Stephan, > Am Mittwoch, 24. Dezember 2014, 07:24:01 schrieb Herbert Xu: > > Hi Herbert, > > > On Tue, Dec 23, 2014 at 03:52:27PM +0100, Stephan Mueller wrote: > > > Am Dienstag, 23. Dezember 2014, 22:56:26 schrieb Herbert Xu:

Re: [PATCH v5 3/8] crypto: AF_ALG: add AEAD support

2014-12-24 Thread Stephan Mueller
Am Mittwoch, 24. Dezember 2014, 07:24:01 schrieb Herbert Xu: Hi Herbert, > On Tue, Dec 23, 2014 at 03:52:27PM +0100, Stephan Mueller wrote: > > Am Dienstag, 23. Dezember 2014, 22:56:26 schrieb Herbert Xu: > > > In fact AEAD is rather awkward because you need to do everything > > > in one go. Per

Re: [PATCH v5 3/8] crypto: AF_ALG: add AEAD support

2014-12-23 Thread Herbert Xu
On Tue, Dec 23, 2014 at 03:52:27PM +0100, Stephan Mueller wrote: > Am Dienstag, 23. Dezember 2014, 22:56:26 schrieb Herbert Xu: > > > In fact AEAD is rather awkward because you need to do everything > > in one go. Perhaps we could adapt our kernel interface to allow > > partial AEAD operations? >

Re: [PATCH v5 3/8] crypto: AF_ALG: add AEAD support

2014-12-23 Thread Stephan Mueller
Am Dienstag, 23. Dezember 2014, 22:56:26 schrieb Herbert Xu: Hi Herbert, > On Tue, Dec 23, 2014 at 09:14:43AM +0100, Stephan Mueller wrote: > > - the check aead_readable() immediately before this check implements the > > blocking if we do not have sufficient data *and* more data is to be > > expe

Re: [PATCH v5 3/8] crypto: AF_ALG: add AEAD support

2014-12-23 Thread Herbert Xu
On Tue, Dec 23, 2014 at 09:14:43AM +0100, Stephan Mueller wrote: > > - the check aead_readable() immediately before this check implements the > blocking if we do not have sufficient data *and* more data is to be expected Good point. In fact AEAD is rather awkward because you need to do everythin

Re: [PATCH v5 3/8] crypto: AF_ALG: add AEAD support

2014-12-23 Thread Stephan Mueller
Am Montag, 22. Dezember 2014, 22:23:41 schrieb Herbert Xu: Hi Herbert, > On Sun, Dec 07, 2014 at 11:22:30PM +0100, Stephan Mueller wrote: > > +static inline bool aead_sufficient_data(struct aead_ctx *ctx) > > +{ > > + unsigned as = crypto_aead_authsize(crypto_aead_reqtfm(&ctx- >aead_req)); > >

Re: [PATCH v5 3/8] crypto: AF_ALG: add AEAD support

2014-12-22 Thread Herbert Xu
On Sun, Dec 07, 2014 at 11:22:30PM +0100, Stephan Mueller wrote: > > +static inline bool aead_sufficient_data(struct aead_ctx *ctx) > +{ > + unsigned as = crypto_aead_authsize(crypto_aead_reqtfm(&ctx->aead_req)); > + > + return (ctx->used >= (ctx->aead_assoclen + ctx->enc ? : as )); Is thi