Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Herbert Xu
On Mon, Jan 26, 2015 at 05:39:27AM +0100, Stephan Mueller wrote: > > But does it really matter if we consider size == 0 or != at this point? In > case size == 0, the len calculation before the inner while loop will return > 0. Of course it matters because you may die due to the aead_writable che

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Stephan Mueller
Am Montag, 26. Januar 2015, 15:37:33 schrieb Herbert Xu: Hi Herbert, > On Mon, Jan 26, 2015 at 05:35:07AM +0100, Stephan Mueller wrote: > > It seems I have misunderstood you in the last discussion. > > I thought you were limiting the receive SGL by ALG_MAX_PAGES rather > than a single IOV entry.

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Stephan Mueller
Am Montag, 26. Januar 2015, 15:32:18 schrieb Herbert Xu: Hi Herbert, > On Mon, Jan 26, 2015 at 05:26:33AM +0100, Stephan Mueller wrote: > > Am Montag, 26. Januar 2015, 10:55:50 schrieb Herbert Xu: > > > > Hi Herbert, > > > > > On Wed, Jan 21, 2015 at 02:19:17AM +0100, Stephan Mueller wrote: > >

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Herbert Xu
On Mon, Jan 26, 2015 at 05:35:07AM +0100, Stephan Mueller wrote: > > It seems I have misunderstood you in the last discussion. I thought you were limiting the receive SGL by ALG_MAX_PAGES rather than a single IOV entry. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herber

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Stephan Mueller
Am Montag, 26. Januar 2015, 11:06:31 schrieb Herbert Xu: Hi Herbert, > On Wed, Jan 21, 2015 at 02:19:17AM +0100, Stephan Mueller wrote: > > + /* > > +* Require exactly one IOV block as the AEAD operation is a one shot > > +* due to the authentication tag. > > +*/ > > + if (msg->ms

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Herbert Xu
On Mon, Jan 26, 2015 at 05:26:33AM +0100, Stephan Mueller wrote: > Am Montag, 26. Januar 2015, 10:55:50 schrieb Herbert Xu: > > Hi Herbert, > > > On Wed, Jan 21, 2015 at 02:19:17AM +0100, Stephan Mueller wrote: > > > + /* use the existing memory in an allocated page */ > > > + if

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Stephan Mueller
Am Montag, 26. Januar 2015, 10:55:50 schrieb Herbert Xu: Hi Herbert, > On Wed, Jan 21, 2015 at 02:19:17AM +0100, Stephan Mueller wrote: > > + /* use the existing memory in an allocated page */ > > + if (ctx->merge) { > > + sg = sgl->sg + sgl->cur - 1; > > +

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Herbert Xu
On Wed, Jan 21, 2015 at 02:19:17AM +0100, Stephan Mueller wrote: > > + /* > + * Require exactly one IOV block as the AEAD operation is a one shot > + * due to the authentication tag. > + */ > + if (msg->msg_iter.nr_segs != 1) > + return -ENOMSG; Why does limit ex

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Herbert Xu
On Wed, Jan 21, 2015 at 02:19:17AM +0100, Stephan Mueller wrote: > > + if (!aead_writable(sk)) { > + /* user space sent too much data */ > + aead_put_sgl(sk); > + err = -EMSGSIZE; > + goto unlock; > +

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Herbert Xu
On Wed, Jan 21, 2015 at 02:19:17AM +0100, Stephan Mueller wrote: > > + /* use the existing memory in an allocated page */ > + if (ctx->merge) { > + sg = sgl->sg + sgl->cur - 1; > + len = min_t(unsigned long, len, > +

Re: [PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-25 Thread Herbert Xu
On Wed, Jan 21, 2015 at 02:19:17AM +0100, Stephan Mueller wrote: > > +static void aead_data_wakeup(struct sock *sk) > +{ > + struct alg_sock *ask = alg_sk(sk); > + struct aead_ctx *ctx = ask->private; > + struct socket_wq *wq; > + > + if (ctx->more) > + return; You shou

[PATCH v11 1/2] crypto: AF_ALG: add AEAD support

2015-01-20 Thread Stephan Mueller
This patch adds the AEAD support for AF_ALG. The implementation is based on algif_skcipher, but contains heavy modifications to streamline the interface for AEAD uses. To use AEAD, the user space consumer has to use the salg_type named "aead". The AEAD implementation includes some overhead to ca