LLVM 22.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"
#include "llvm_blake3_prefix.h"
Go to the source code of this file.
Macros | |
#define | BLAKE3_PRIVATE |
#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_PRIVATE |
Definition at line 16 of file blake3_impl.h.
#define BLAKE3_USE_NEON 0 |
Definition at line 67 of file blake3_impl.h.
#define INLINE static inline __attribute__((always_inline)) |
Definition at line 34 of file blake3_impl.h.
Referenced by add_128(), add_256(), add_512(), addv(), addv(), blake3_hasher_update_base(), blend_epi16(), chunk_state_fill_buf(), chunk_state_init(), chunk_state_len(), chunk_state_maybe_start_flag(), chunk_state_output(), chunk_state_reset(), chunk_state_update(), compress_chunks_parallel(), compress_parents_parallel(), compress_pre(), compress_pre(), counter_high(), counter_low(), diagonalize(), g(), g1(), g2(), hash_one_avx512(), hash_one_portable(), hash_one_sse2(), hash_one_sse41(), hasher_init_base(), hasher_merge_cv_stack(), hasher_push_cv(), left_subtree_len(), load32(), load_block_words(), load_counters(), load_counters(), load_counters16(), load_counters4(), load_counters8(), load_key_words(), loadu(), loadu(), loadu_128(), loadu_256(), loadu_512(), make_output(), output_chaining_value(), output_root_bytes(), parent_output(), popcnt(), rot12(), rot12(), rot12_128(), rot12_256(), rot12_512(), rot16(), rot16(), rot16_128(), rot16_256(), rot16_512(), rot7(), rot7(), rot7_128(), rot7_256(), rot7_512(), rot8(), rot8(), rot8_128(), rot8_256(), rot8_512(), rotr32(), round_down_to_power_of_2(), round_fn(), round_fn(), round_fn(), round_fn16(), round_fn4(), round_fn8(), set1(), set1_128(), set1_256(), set1_512(), set4(), store32(), store_cv_words(), storeu(), storeu(), storeu_128(), storeu_256(), storeu_512(), transpose_msg_vecs(), transpose_msg_vecs(), transpose_msg_vecs16(), transpose_msg_vecs4(), transpose_msg_vecs8(), transpose_vecs(), transpose_vecs(), transpose_vecs_128(), transpose_vecs_256(), transpose_vecs_512(), undiagonalize(), unpack_hi_128(), unpack_lo_128(), xor_128(), xor_256(), xor_512(), xorv(), and xorv().
#define MAX_SIMD_DEGREE 1 |
Definition at line 76 of file blake3_impl.h.
Referenced by compress_chunks_parallel().
#define MAX_SIMD_DEGREE_OR_2 (MAX_SIMD_DEGREE > 2 ? MAX_SIMD_DEGREE : 2) |
Definition at line 81 of file blake3_impl.h.
Referenced by blake3_compress_subtree_wide(), compress_parents_parallel(), and compress_subtree_to_parent_node().
enum blake3_flags |
Enumerator | |
---|---|
CHUNK_START | |
CHUNK_END | |
PARENT | |
ROOT | |
KEYED_HASH | |
DERIVE_KEY_CONTEXT | |
DERIVE_KEY_MATERIAL |
Definition at line 19 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 169 of file blake3_dispatch.c.
References AVX512VL, BLAKE3_BLOCK_LEN, 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.
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 BLAKE3_BLOCK_LEN, block, and compress_pre().
BLAKE3_PRIVATE size_t blake3_compress_subtree_wide | ( | const uint8_t * | input, |
size_t | input_len, | ||
const uint32_t | key[8], | ||
uint64_t | chunk_counter, | ||
uint8_t | flags, | ||
uint8_t * | out, | ||
bool | use_tbb ) |
Definition at line 275 of file blake3.c.
References BLAKE3_CHUNK_LEN, blake3_compress_subtree_wide, BLAKE3_OUT_LEN, blake3_simd_degree, compress_chunks_parallel(), compress_parents_parallel(), left_subtree_len(), and MAX_SIMD_DEGREE_OR_2.
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 198 of file blake3_dispatch.c.
References AVX512VL, BLAKE3_BLOCK_LEN, 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.
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 BLAKE3_BLOCK_LEN, block, compress_pre(), and store32().
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 251 of file blake3_dispatch.c.
References AVX2, AVX512F, AVX512VL, blake3_hash_many_avx2, blake3_hash_many_avx512, blake3_hash_many_neon, blake3_hash_many_portable, blake3_hash_many_sse2, blake3_hash_many_sse41, blocks, get_cpu_features(), MAYBE_UNUSED, SSE2, and SSE41.
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, blocks, and hash_one_portable().
LLVM_LIBRARY_VISIBILITY size_t blake3_simd_degree | ( | void | ) |
Definition at line 304 of file blake3_dispatch.c.
References AVX2, AVX512F, AVX512VL, get_cpu_features(), MAYBE_UNUSED, SSE2, and SSE41.
LLVM_LIBRARY_VISIBILITY void blake3_xof_many | ( | 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], | ||
size_t | outblocks ) |
Definition at line 228 of file blake3_dispatch.c.
References AVX512VL, BLAKE3_BLOCK_LEN, blake3_compress_xof, blake3_xof_many_avx512, block, get_cpu_features(), and MAYBE_UNUSED.
Definition at line 150 of file blake3_impl.h.
References INLINE.
Referenced by compress_pre(), and compress_pre().
Definition at line 148 of file blake3_impl.h.
References INLINE.
Referenced by compress_pre(), and compress_pre().
Definition at line 99 of file blake3_impl.h.
Referenced by round_down_to_power_of_2().
Definition at line 154 of file blake3_impl.h.
References INLINE.
Referenced by compress_pre(), load_block_words(), and load_key_words().
Definition at line 172 of file blake3_impl.h.
References BLAKE3_BLOCK_LEN, block, INLINE, and load32().
Referenced by blake3_xof16_avx512(), blake3_xof4_avx512(), and blake3_xof8_avx512().
Definition at line 160 of file blake3_impl.h.
References BLAKE3_KEY_LEN, INLINE, and load32().
Referenced by llvm_blake3_hasher_init_derive_key_raw(), and llvm_blake3_hasher_init_keyed().
Definition at line 129 of file blake3_impl.h.
References INLINE.
Referenced by hasher_merge_cv_stack().
Definition at line 144 of file blake3_impl.h.
References highest_one(), and INLINE.
Referenced by blake3_hasher_update_base(), and left_subtree_len().
Definition at line 179 of file blake3_impl.h.
References INLINE.
Referenced by blake3_compress_xof_portable(), and store_cv_words().
Definition at line 187 of file blake3_impl.h.
References INLINE, and store32().
Referenced by hash_one_portable(), and output_chaining_value().
Definition at line 83 of file blake3_impl.h.
Referenced by addFullyUnrolledInstructionsToIgnore(), addPHINodeEntriesForMappedBlock(), llvm::MCELFStreamer::AttributeItem::AttributeItem(), blake3_hash16_avx512(), blake3_hash4_avx512(), blake3_hash4_sse2(), blake3_hash4_sse41(), blake3_hash8_avx2(), blake3_hash8_avx512(), blake3_xof16_avx512(), blake3_xof4_avx512(), blake3_xof8_avx512(), llvm::BuildAttributeItem::BuildAttributeItem(), compress_pre(), compress_pre(), llvm::VPBuilder::createScalarIVSteps(), detectShiftUntilZeroIdiom(), llvm::JumpThreadingPass::duplicateCondBranchOnPHIIntoPred(), llvm::InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse(), getAggregateSize(), getElementIndex(), llvm::DenseMapInfo< PointerIntPair< PointerTy, IntBits, IntType >, void >::getHashValue(), GetInductionVariable(), getTrueOrFalseValue(), insertUniqueBackedgeBlock(), llvm::isUniformLoop(), IsValueFullyAvailableInBlock(), likeBitCastFromVector(), llvm_blake3_hasher_init(), llvm_blake3_hasher_init_derive_key_raw(), LLVMGetIndices(), LLVMGetNumIndices(), preparePlanForEpilogueVectorLoop(), ReduceLoopStrength(), removeRedundantInductionCasts(), simplifyInstructionWithOperands(), llvm::SplitBlockAndInsertSimpleForLoop(), llvm::SCCPInstVisitor::trackValueOfGlobalVariable(), llvm::MemorySSAUpdater::updatePhisWhenInsertingUniqueBackedgeBlock(), llvm::slpvectorizer::BoUpSLP::vectorizeTree(), llvm::InstCombinerImpl::visitExtractValueInst(), llvm::InstCombinerImpl::visitPHINode(), llvm::InstCombinerImpl::visitSelectInst(), llvm::VPDerivedIVRecipe::VPDerivedIVRecipe(), llvm::VPScalarIVStepsRecipe::VPScalarIVStepsRecipe(), llvm::VPScalarIVStepsRecipe::VPScalarIVStepsRecipe(), llvm::VPWidenInductionRecipe::VPWidenInductionRecipe(), llvm::VPWidenIntOrFpInductionRecipe::VPWidenIntOrFpInductionRecipe(), and llvm::VPWidenIntOrFpInductionRecipe::VPWidenIntOrFpInductionRecipe().
Definition at line 87 of file blake3_impl.h.
Referenced by round_fn(), round_fn(), round_fn(), round_fn16(), round_fn4(), and round_fn8().