LLVM
15.0.0git
|
#include <assert.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include "llvm-c/blake3.h"
#include "llvm/Support/Compiler.h"
Go to the source code of this file.
Macros | |
#define | BLAKE3_VERSION_STRING LLVM_BLAKE3_VERSION_STRING |
#define | BLAKE3_KEY_LEN LLVM_BLAKE3_KEY_LEN |
#define | BLAKE3_OUT_LEN LLVM_BLAKE3_OUT_LEN |
#define | BLAKE3_BLOCK_LEN LLVM_BLAKE3_BLOCK_LEN |
#define | BLAKE3_CHUNK_LEN LLVM_BLAKE3_CHUNK_LEN |
#define | BLAKE3_MAX_DEPTH LLVM_BLAKE3_MAX_DEPTH |
#define | blake3_hasher llvm_blake3_hasher |
#define | blake3_chunk_state llvm_blake3_chunk_state |
#define | INLINE static inline __attribute__((always_inline)) |
#define | BLAKE3_USE_NEON 0 |
#define | MAX_SIMD_DEGREE 1 |
#define | MAX_SIMD_DEGREE_OR_2 (MAX_SIMD_DEGREE > 2 ? MAX_SIMD_DEGREE : 2) |
Enumerations | |
enum | blake3_flags { CHUNK_START = 1 << 0, CHUNK_END = 1 << 1, PARENT = 1 << 2, ROOT = 1 << 3, KEYED_HASH = 1 << 4, DERIVE_KEY_CONTEXT = 1 << 5, DERIVE_KEY_MATERIAL = 1 << 6 } |
Variables | |
static const uint32_t | IV [8] |
static const uint8_t | MSG_SCHEDULE [7][16] |
#define BLAKE3_BLOCK_LEN LLVM_BLAKE3_BLOCK_LEN |
Definition at line 18 of file blake3_impl.h.
#define BLAKE3_CHUNK_LEN LLVM_BLAKE3_CHUNK_LEN |
Definition at line 19 of file blake3_impl.h.
#define blake3_chunk_state llvm_blake3_chunk_state |
Definition at line 22 of file blake3_impl.h.
#define blake3_hasher llvm_blake3_hasher |
Definition at line 21 of file blake3_impl.h.
#define BLAKE3_KEY_LEN LLVM_BLAKE3_KEY_LEN |
Definition at line 16 of file blake3_impl.h.
#define BLAKE3_MAX_DEPTH LLVM_BLAKE3_MAX_DEPTH |
Definition at line 20 of file blake3_impl.h.
#define BLAKE3_OUT_LEN LLVM_BLAKE3_OUT_LEN |
Definition at line 17 of file blake3_impl.h.
#define BLAKE3_USE_NEON 0 |
Definition at line 69 of file blake3_impl.h.
#define BLAKE3_VERSION_STRING LLVM_BLAKE3_VERSION_STRING |
Definition at line 15 of file blake3_impl.h.
#define INLINE static inline __attribute__((always_inline)) |
Definition at line 40 of file blake3_impl.h.
#define MAX_SIMD_DEGREE 1 |
Definition at line 78 of file blake3_impl.h.
#define MAX_SIMD_DEGREE_OR_2 (MAX_SIMD_DEGREE > 2 ? MAX_SIMD_DEGREE : 2) |
Definition at line 83 of file blake3_impl.h.
enum blake3_flags |
Enumerator | |
---|---|
CHUNK_START | |
CHUNK_END | |
PARENT | |
ROOT | |
KEYED_HASH | |
DERIVE_KEY_CONTEXT | |
DERIVE_KEY_MATERIAL |
Definition at line 25 of file blake3_impl.h.
LLVM_LIBRARY_VISIBILITY void blake3_compress_in_place | ( | uint32_t | cv[8], |
const uint8_t | block[BLAKE3_BLOCK_LEN], | ||
uint8_t | block_len, | ||
uint64_t | counter, | ||
uint8_t | flags | ||
) |
Definition at line 137 of file blake3_dispatch.c.
References AVX512VL, blake3_compress_in_place_avx512(), blake3_compress_in_place_portable(), blake3_compress_in_place_sse2(), blake3_compress_in_place_sse41(), block, get_cpu_features(), MAYBE_UNUSED, SSE2, and SSE41.
Referenced by chunk_state_update(), and output_chaining_value().
LLVM_LIBRARY_VISIBILITY void blake3_compress_in_place_portable | ( | uint32_t | cv[8], |
const uint8_t | block[BLAKE3_BLOCK_LEN], | ||
uint8_t | block_len, | ||
uint64_t | counter, | ||
uint8_t | flags | ||
) |
Definition at line 84 of file blake3_portable.c.
References block, and compress_pre().
Referenced by blake3_compress_in_place(), and hash_one_portable().
LLVM_LIBRARY_VISIBILITY void blake3_compress_xof | ( | const uint32_t | cv[8], |
const uint8_t | block[BLAKE3_BLOCK_LEN], | ||
uint8_t | block_len, | ||
uint64_t | counter, | ||
uint8_t | flags, | ||
uint8_t | out[64] | ||
) |
Definition at line 166 of file blake3_dispatch.c.
References AVX512VL, blake3_compress_xof_avx512(), blake3_compress_xof_portable(), blake3_compress_xof_sse2(), blake3_compress_xof_sse41(), block, get_cpu_features(), MAYBE_UNUSED, SSE2, and SSE41.
Referenced by output_root_bytes().
LLVM_LIBRARY_VISIBILITY void blake3_compress_xof_portable | ( | const uint32_t | cv[8], |
const uint8_t | block[BLAKE3_BLOCK_LEN], | ||
uint8_t | block_len, | ||
uint64_t | counter, | ||
uint8_t | flags, | ||
uint8_t | out[64] | ||
) |
Definition at line 100 of file blake3_portable.c.
References block, compress_pre(), and store32().
Referenced by blake3_compress_xof().
LLVM_LIBRARY_VISIBILITY void blake3_hash_many | ( | const uint8_t *const * | inputs, |
size_t | num_inputs, | ||
size_t | blocks, | ||
const uint32_t | key[8], | ||
uint64_t | counter, | ||
bool | increment_counter, | ||
uint8_t | flags, | ||
uint8_t | flags_start, | ||
uint8_t | flags_end, | ||
uint8_t * | out | ||
) |
Definition at line 195 of file blake3_dispatch.c.
References AVX2, AVX512F, AVX512VL, blake3_hash_many_avx2(), blake3_hash_many_avx512(), blake3_hash_many_portable(), blake3_hash_many_sse2(), blake3_hash_many_sse41(), get_cpu_features(), MAYBE_UNUSED, SSE2, and SSE41.
Referenced by compress_chunks_parallel(), and compress_parents_parallel().
LLVM_LIBRARY_VISIBILITY void blake3_hash_many_portable | ( | const uint8_t *const * | inputs, |
size_t | num_inputs, | ||
size_t | blocks, | ||
const uint32_t | key[8], | ||
uint64_t | counter, | ||
bool | increment_counter, | ||
uint8_t | flags, | ||
uint8_t | flags_start, | ||
uint8_t | flags_end, | ||
uint8_t * | out | ||
) |
Definition at line 145 of file blake3_portable.c.
References BLAKE3_OUT_LEN, and hash_one_portable().
Referenced by blake3_hash_many(), and blake3_hash_many_avx2().
LLVM_LIBRARY_VISIBILITY size_t blake3_simd_degree | ( | void | ) |
Definition at line 248 of file blake3_dispatch.c.
References AVX2, AVX512F, AVX512VL, get_cpu_features(), MAYBE_UNUSED, SSE2, and SSE41.
Referenced by blake3_compress_subtree_wide().
Definition at line 152 of file blake3_impl.h.
Referenced by compress_pre().
Definition at line 150 of file blake3_impl.h.
Referenced by compress_pre().
Definition at line 101 of file blake3_impl.h.
Referenced by round_down_to_power_of_2().
Definition at line 156 of file blake3_impl.h.
References p.
Referenced by compress_pre(), and load_key_words().
Definition at line 162 of file blake3_impl.h.
References load32().
Referenced by llvm_blake3_hasher_init_derive_key_raw(), and llvm_blake3_hasher_init_keyed().
Definition at line 131 of file blake3_impl.h.
References llvm::count(), and x.
Referenced by hasher_merge_cv_stack().
Definition at line 146 of file blake3_impl.h.
References highest_one(), and x.
Referenced by left_len(), and llvm_blake3_hasher_update().
Definition at line 174 of file blake3_impl.h.
References p.
Referenced by blake3_compress_xof_portable(), and store_cv_words().
Definition at line 182 of file blake3_impl.h.
References store32().
Referenced by hash_one_portable(), and output_chaining_value().
Definition at line 85 of file blake3_impl.h.
Referenced by addPHINodeEntriesForMappedBlock(), blake3_hash16_avx512(), blake3_hash4_avx512(), blake3_hash4_sse2(), blake3_hash4_sse41(), blake3_hash8_avx2(), blake3_hash8_avx512(), compress_pre(), llvm::VPRecipeBuilder::createBlockInMask(), detectShiftUntilZeroIdiom(), llvm::JumpThreadingPass::duplicateCondBranchOnPHIIntoPred(), llvm::VPWidenIntOrFpInductionRecipe::execute(), llvm::InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse(), getAggregateSize(), llvm::DenseMapInfo< PointerIntPair< PointerTy, IntBits, IntType >, void >::getHashValue(), llvm::DenseMapInfo< cflaa::InstantiatedValue >::getHashValue(), GetInductionVariable(), llvm::getInsertIndex(), insertUniqueBackedgeBlock(), isLoopIncrement(), llvm::isUniformLoop(), IsValueFullyAvailableInBlock(), likeBitCastFromVector(), llvm_blake3_hasher_init(), llvm_blake3_hasher_init_derive_key_raw(), LLVMGetIndices(), LLVMGetNumIndices(), llvm::VPlanTransforms::optimizeInductions(), llvm::VPlan::prepareToExecute(), llvm::VPWidenIntOrFpInductionRecipe::print(), ReduceLoopStrength(), llvm::VPlanTransforms::removeRedundantInductionCasts(), simplifyInstructionWithOperands(), simplifyInstsInBlock(), llvm::SCCPInstVisitor::trackValueOfGlobalVariable(), tryToReplaceWithConstant(), llvm::MemorySSAUpdater::updatePhisWhenInsertingUniqueBackedgeBlock(), llvm::InstCombinerImpl::visitExtractValueInst(), and llvm::InstCombinerImpl::visitPHINode().
|
static |
Definition at line 89 of file blake3_impl.h.
Referenced by round_fn(), round_fn16(), round_fn4(), and round_fn8().