forked from OSchip/llvm-project
9aa701984d
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 |
||
---|---|---|
.. | ||
CommandLineInit | ||
DynamicLibrary | ||
ARMAttributeParser.cpp | ||
AlignOfTest.cpp | ||
AlignmentTest.cpp | ||
AllocatorTest.cpp | ||
AnnotationsTest.cpp | ||
ArrayRecyclerTest.cpp | ||
BLAKE3Test.cpp | ||
Base64Test.cpp | ||
BinaryStreamTest.cpp | ||
BlockFrequencyTest.cpp | ||
BranchProbabilityTest.cpp | ||
CMakeLists.txt | ||
CRCTest.cpp | ||
CSKYAttributeParserTest.cpp | ||
CSKYTargetParserTest.cpp | ||
CachePruningTest.cpp | ||
Casting.cpp | ||
CheckedArithmeticTest.cpp | ||
Chrono.cpp | ||
CommandLineTest.cpp | ||
CompressionTest.cpp | ||
ConvertUTFTest.cpp | ||
CrashRecoveryTest.cpp | ||
DJBTest.cpp | ||
DataExtractorTest.cpp | ||
DebugCounterTest.cpp | ||
DebugTest.cpp | ||
ELFAttributeParserTest.cpp | ||
EndianStreamTest.cpp | ||
EndianTest.cpp | ||
ErrnoTest.cpp | ||
ErrorOrTest.cpp | ||
ErrorTest.cpp | ||
ExtensibleRTTITest.cpp | ||
FSUniqueIDTest.cpp | ||
FileCollectorTest.cpp | ||
FileOutputBufferTest.cpp | ||
FileUtilitiesTest.cpp | ||
FormatVariadicTest.cpp | ||
GlobPatternTest.cpp | ||
HashBuilderTest.cpp | ||
Host.cpp | ||
IndexedAccessorTest.cpp | ||
InstructionCostTest.cpp | ||
ItaniumManglingCanonicalizerTest.cpp | ||
JSONTest.cpp | ||
KnownBitsTest.cpp | ||
KnownBitsTest.h | ||
LEB128Test.cpp | ||
LineIteratorTest.cpp | ||
LinearPolyBaseTest.cpp | ||
LockFileManagerTest.cpp | ||
MD5Test.cpp | ||
ManagedStatic.cpp | ||
MatchersTest.cpp | ||
MathExtrasTest.cpp | ||
MemoryBufferRefTest.cpp | ||
MemoryBufferTest.cpp | ||
MemoryTest.cpp | ||
NativeFormatTests.cpp | ||
OptimizedStructLayoutTest.cpp | ||
ParallelTest.cpp | ||
Path.cpp | ||
ProcessTest.cpp | ||
ProgramTest.cpp | ||
RISCVAttributeParserTest.cpp | ||
RegexTest.cpp | ||
ReplaceFileTest.cpp | ||
ReverseIterationTest.cpp | ||
SHA256.cpp | ||
ScaledNumberTest.cpp | ||
ScopedPrinterTest.cpp | ||
SourceMgrTest.cpp | ||
SpecialCaseListTest.cpp | ||
SuffixTreeTest.cpp | ||
SwapByteOrderTest.cpp | ||
SymbolRemappingReaderTest.cpp | ||
TarWriterTest.cpp | ||
TargetParserTest.cpp | ||
TaskQueueTest.cpp | ||
ThreadLocalTest.cpp | ||
ThreadPool.cpp | ||
Threading.cpp | ||
TimerTest.cpp | ||
ToolOutputFileTest.cpp | ||
TrailingObjectsTest.cpp | ||
TrigramIndexTest.cpp | ||
TypeNameTest.cpp | ||
TypeTraitsTest.cpp | ||
UnicodeTest.cpp | ||
VersionTupleTest.cpp | ||
VirtualFileSystemTest.cpp | ||
WithColorTest.cpp | ||
YAMLIOTest.cpp | ||
YAMLParserTest.cpp | ||
buffer_ostream_test.cpp | ||
formatted_raw_ostream_test.cpp | ||
raw_fd_stream_test.cpp | ||
raw_ostream_test.cpp | ||
raw_pwrite_stream_test.cpp | ||
raw_sha1_ostream_test.cpp | ||
xxhashTest.cpp |