mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-04-17 11:43:51 +00:00
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>
19 lines
485 B
C
19 lines
485 B
C
/* SPDX-License-Identifier: GPL-2.0 OR MIT */
|
|
|
|
#ifndef BLAKE2S_INTERNAL_H
|
|
#define BLAKE2S_INTERNAL_H
|
|
|
|
#include <crypto/blake2s.h>
|
|
|
|
void blake2s_compress_generic(struct blake2s_state *state,const u8 *block,
|
|
size_t nblocks, const u32 inc);
|
|
|
|
void blake2s_compress_arch(struct blake2s_state *state,const u8 *block,
|
|
size_t nblocks, const u32 inc);
|
|
|
|
static inline void blake2s_set_lastblock(struct blake2s_state *state)
|
|
{
|
|
state->f[0] = -1;
|
|
}
|
|
|
|
#endif /* BLAKE2S_INTERNAL_H */
|