On Fri, 4 Oct 2019 at 16:03, Jason A. Donenfeld [off-list ref] wrote:
On Wed, Oct 02, 2019 at 04:17:13PM +0200, Ard Biesheuvel wrote:
quoted
Reimplement the library routines to perform chacha20poly1305 en/decryption
on scatterlists, without [ab]using the [deprecated] blkcipher interface,
which is rather heavyweight and does things we don't really need.
Instead, we use the sg_miter API in a novel and clever way, to iterate
over the scatterlist in-place (i.e., source == destination, which is the
only way this library is expected to be used). That way, we don't have to
iterate over two scatterlists in parallel.
Nice idea. Probably this will result in a real speedup, as I suspect
those extra prior kmaps weren't free. Looking forward to benching it.
They weren't only non-free, they were also using kmap_atomic()
unconditionally, which means that these routines were running with
preemption disabled even with non-SIMD crypto on non-highmem
architectures.