Commit Graph

2 Commits

Author SHA1 Message Date
Prarit Bhargava 11a695f447 lib/crypto: blake2s: include as built-in
Bugzilla: https://bugzilla.redhat.com/2079030

commit 6048fdcc5f269c7f31d774c295ce59081b36e6f9
Author: Jason A. Donenfeld <Jason@zx2c4.com>
Date:   Wed Dec 22 14:56:58 2021 +0100

    lib/crypto: blake2s: include as built-in

    In preparation for using blake2s in the RNG, we change the way that it
    is wired-in to the build system. Instead of using ifdefs to select the
    right symbol, we use weak symbols. And because ARM doesn't need the
    generic implementation, we make the generic one default only if an arch
    library doesn't need it already, and then have arch libraries that do
    need it opt-in. So that the arch libraries can remain tristate rather
    than bool, we then split the shash part from the glue code.

    Acked-by: Herbert Xu <herbert@gondor.apana.org.au>
    Acked-by: Ard Biesheuvel <ardb@kernel.org>
    Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
    Cc: Masahiro Yamada <masahiroy@kernel.org>
    Cc: linux-kbuild@vger.kernel.org
    Cc: linux-crypto@vger.kernel.org
    Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
2022-04-27 10:48:58 -04:00
Jason A. Donenfeld 66d7fb94e4 crypto: blake2s - generic C library implementation and selftest
The C implementation was originally based on Samuel Neves' public
domain reference implementation but has since been heavily modified
for the kernel. We're able to do compile-time optimizations by moving
some scaffolding around the final function into the header file.

Information: https://blake2.net/

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Signed-off-by: Samuel Neves <sneves@dei.uc.pt>
Co-developed-by: Samuel Neves <sneves@dei.uc.pt>
[ardb: - move from lib/zinc to lib/crypto
       - remove simd handling
       - rewrote selftest for better coverage
       - use fixed digest length for blake2s_hmac() and rename to
         blake2s256_hmac() ]
Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2019-11-17 09:02:42 +08:00