lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 23 Dec 2016 18:26:37 -0800
From:   Andy Lutomirski <>
To:     Andy Lutomirski <>
Cc:     Daniel Borkmann <>,
        Netdev <>,
        LKML <>,
        Linux Crypto Mailing List <>,
        "Jason A. Donenfeld" <>,
        Hannes Frederic Sowa <>,
        Alexei Starovoitov <>,
        Eric Dumazet <>,
        Eric Biggers <>,
        Tom Herbert <>,
        "David S. Miller" <>,
        Ard Biesheuvel <>,
        Herbert Xu <>
Subject: Re: [RFC PATCH 4.10 1/6] crypto/sha256: Refactor the API so it can be
 used without shash

On Fri, Dec 23, 2016 at 6:22 PM, Andy Lutomirski <> wrote:
> There are some pieecs of kernel code that want to compute SHA256
> directly without going through the crypto core.  Adjust the exported
> API to decouple it from the crypto core.
> I suspect this will very slightly speed up the SHA256 shash operations
> as well by reducing the amount of indirection involved.

I should also mention: there's a nice potential cleanup that's
possible on top of this.  Currently, most of the accelerated SHA256
implementations just swap out the block function.  Another approach to
enabling this would be to restructure sha256_update along the lines

sha256_block_fn_t fn = arch_sha256_block_fn(len);
sha256_base_do_update(sctx, data, len, arch_sha256_block_fn(len));

The idea being that arch code can decide whether to use an accelerated
block function based on context (x86, for example, can't always use
xmm regs) and length (on x86, using the accelerated versions for short
digests is very slow due to the state save/restore that happens) and
then the core code can just use it.

This would allow a lot of the boilerplate that this patch was forced
to modify to be deleted outright.


Powered by blists - more mailing lists