-
- Downloads
[Support] Introduce the BLAKE3 hashing function implementation
BLAKE3 is a cryptographic hash function that is secure and very performant. The C implementation originates from https://github.com/BLAKE3-team/BLAKE3/tree/1.3.1/c License is at https://github.com/BLAKE3-team/BLAKE3/blob/1.3.1/LICENSE This patch adds: * `llvm/include/llvm-c/blake3.h`: The BLAKE3 C API * `llvm/include/llvm/Support/BLAKE3.h`: C++ wrapper of the C API * `llvm/lib/Support/BLAKE3`: Directory containing the BLAKE3 C implementation files, including the `LICENSE` file * `llvm/unittests/Support/BLAKE3Test.cpp`: unit tests for the BLAKE3 C++ wrapper This initial patch contains the pristine BLAKE3 sources, a follow-up patch will introduce LLVM-specific prefixes to avoid conflicts if a client also links with its own BLAKE3 version. And here's some timings comparing BLAKE3 with LLVM's SHA1/SHA256/MD5. Timings include `AVX512`, `AVX2`, `neon`, and the generic/portable implementations. The table shows the speed-up multiplier of BLAKE3 for hashing 100 MBs: | Processor | SHA1 | SHA256 | MD5 | |-------------------------|-------|--------|------| | Intel Xeon W (AVX512) | 10.4x | 27x | 9.4x | | Intel Xeon W (AVX2) | 6.5x | 17x | 5.9x | | Intel Xeon W (portable) | 1.3x | 3.3x | 1.1x | | M1Pro (neon) | 2.1x | 4.7x | 2.8x | | M1Pro (portable) | 1.1x | 2.4x | 1.5x | Differential Revision: https://reviews.llvm.org/D121510
Showing
- llvm/include/llvm-c/blake3.h 60 additions, 0 deletionsllvm/include/llvm-c/blake3.h
- llvm/include/llvm/Support/BLAKE3.h 86 additions, 0 deletionsllvm/include/llvm/Support/BLAKE3.h
- llvm/lib/Support/BLAKE3/.clang-format 2 additions, 0 deletionsllvm/lib/Support/BLAKE3/.clang-format
- llvm/lib/Support/BLAKE3/CMakeLists.txt 48 additions, 0 deletionsllvm/lib/Support/BLAKE3/CMakeLists.txt
- llvm/lib/Support/BLAKE3/LICENSE 330 additions, 0 deletionsllvm/lib/Support/BLAKE3/LICENSE
- llvm/lib/Support/BLAKE3/README.md 316 additions, 0 deletionsllvm/lib/Support/BLAKE3/README.md
- llvm/lib/Support/BLAKE3/blake3.c 616 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3.c
- llvm/lib/Support/BLAKE3/blake3.h 60 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3.h
- llvm/lib/Support/BLAKE3/blake3_avx2.c 326 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3_avx2.c
- llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S 1815 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3_avx2_x86-64_unix.S
- llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_gnu.S 1817 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_gnu.S
- llvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_msvc.asm 1828 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3_avx2_x86-64_windows_msvc.asm
- llvm/lib/Support/BLAKE3/blake3_avx512.c 1207 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3_avx512.c
- llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S 2585 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3_avx512_x86-64_unix.S
- llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_gnu.S 2615 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_gnu.S
- llvm/lib/Support/BLAKE3/blake3_avx512_x86-64_windows_msvc.asm 2634 additions, 0 deletions.../lib/Support/BLAKE3/blake3_avx512_x86-64_windows_msvc.asm
- llvm/lib/Support/BLAKE3/blake3_dispatch.c 276 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3_dispatch.c
- llvm/lib/Support/BLAKE3/blake3_impl.h 282 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3_impl.h
- llvm/lib/Support/BLAKE3/blake3_neon.c 351 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3_neon.c
- llvm/lib/Support/BLAKE3/blake3_portable.c 160 additions, 0 deletionsllvm/lib/Support/BLAKE3/blake3_portable.c
llvm/include/llvm-c/blake3.h
0 → 100644
llvm/include/llvm/Support/BLAKE3.h
0 → 100644
llvm/lib/Support/BLAKE3/.clang-format
0 → 100644
llvm/lib/Support/BLAKE3/CMakeLists.txt
0 → 100644
llvm/lib/Support/BLAKE3/LICENSE
0 → 100644
llvm/lib/Support/BLAKE3/README.md
0 → 100644
llvm/lib/Support/BLAKE3/blake3.c
0 → 100644
This diff is collapsed.
llvm/lib/Support/BLAKE3/blake3.h
0 → 100644
llvm/lib/Support/BLAKE3/blake3_avx2.c
0 → 100644
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
llvm/lib/Support/BLAKE3/blake3_avx512.c
0 → 100644
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
llvm/lib/Support/BLAKE3/blake3_dispatch.c
0 → 100644
This diff is collapsed.
llvm/lib/Support/BLAKE3/blake3_impl.h
0 → 100644
This diff is collapsed.
llvm/lib/Support/BLAKE3/blake3_neon.c
0 → 100644
This diff is collapsed.
llvm/lib/Support/BLAKE3/blake3_portable.c
0 → 100644
This diff is collapsed.
Please register or sign in to comment