lib: add BLAKE2 hash support
The code is cross-ported from BLAKE2 reference implementation
(https://github.com/BLAKE2/BLAKE2).
With minimal change to remove unused macros/features.
Currently there is only one user inside U-boot (btrfs), and since it
only utilize BLAKE2B, all other favors are all removed.
Signed-off-by: Qu Wenruo <wqu@suse.com>
[trini: Rename ROUND to R to avoid clash with <linux/bitops.h>
Signed-off-by: Tom Rini <trini@konsulko.com>
diff --git a/lib/Kconfig b/lib/Kconfig
index 35fc9e4..38051cc 100644
--- a/lib/Kconfig
+++ b/lib/Kconfig
@@ -367,6 +367,14 @@
menu "Hashing Support"
+config BLAKE2
+ bool "Enable BLAKE2 support"
+ help
+ This option enables support of hashing using BLAKE2B algorithm.
+ The hash is calculated in software.
+ The BLAKE2 algorithm produces a hash value (digest) between 1 and
+ 64 bytes.
+
config SHA1
bool "Enable SHA1 support"
help