Re: [PATCH v2] crypto: add key wrapping block chaining mode

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

 



Am Dienstag, 28. April 2015, 09:10:47 schrieb Herbert Xu:

Hi Herbert,

> On Mon, Apr 27, 2015 at 04:34:19PM +0200, Stephan Mueller wrote:
> > Why do you think that will not work? I thought that the code works when
> > the
> > non-linear scatterlists are at least broken at an 8 byte boundary.
> 
> There is no guarantee that SG lists are set at 8-byte boundaries.
> In fact, you need to be able to handle any SG list, including the
> worst-case 1-byte per-entry SG lists.

In this case, shouldn't we just have a loop where:

1. from the given endpoint, we go a semiblock back

2. now we see how many bytes we get when fetching the SG list till the end,

3a. if answer from 2 is semiblock or larger -> fetch it and exit

3b. if answer from 2 is less than a semiblock, fetch the available data, 
advance to the next SGL and go to step 2 to try to fetch semiblock - obtained 
data.

-- 
Ciao
Stephan
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




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

  Powered by Linux