Movatterモバイル変換


[0]ホーム

URL:


LLVM 20.0.0git
Macros |Enumerations |Functions |Variables
blake3_impl.h File Reference
#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 INLINE   staticinline __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
}
 

Functions

staticunsigned int highest_one (uint64_t x)
 
INLINEunsigned int popcnt (uint64_t x)
 
INLINEuint64_t round_down_to_power_of_2 (uint64_t x)
 
INLINEuint32_t counter_low (uint64_t counter)
 
INLINEuint32_t counter_high (uint64_t counter)
 
INLINEuint32_t load32 (const void *src)
 
INLINE void load_key_words (constuint8_t key[BLAKE3_KEY_LEN],uint32_t key_words[8])
 
INLINE void store32 (void *dst,uint32_t w)
 
INLINE void store_cv_words (uint8_t bytes_out[32],uint32_t cv_words[8])
 
LLVM_LIBRARY_VISIBILITY void blake3_compress_in_place (uint32_t cv[8],constuint8_tblock[BLAKE3_BLOCK_LEN],uint8_t block_len,uint64_t counter,uint8_t flags)
 
LLVM_LIBRARY_VISIBILITY void blake3_compress_xof (constuint32_t cv[8],constuint8_tblock[BLAKE3_BLOCK_LEN],uint8_t block_len,uint64_t counter,uint8_t flags,uint8_t out[64])
 
LLVM_LIBRARY_VISIBILITY void blake3_hash_many (constuint8_t *const *inputs, size_t num_inputs, size_tblocks,constuint32_t key[8],uint64_t counter,bool increment_counter,uint8_t flags,uint8_t flags_start,uint8_t flags_end,uint8_t *out)
 
LLVM_LIBRARY_VISIBILITY size_t blake3_simd_degree (void)
 
LLVM_LIBRARY_VISIBILITY void blake3_compress_in_place_portable (uint32_t cv[8],constuint8_tblock[BLAKE3_BLOCK_LEN],uint8_t block_len,uint64_t counter,uint8_t flags)
 
LLVM_LIBRARY_VISIBILITY void blake3_compress_xof_portable (constuint32_t cv[8],constuint8_tblock[BLAKE3_BLOCK_LEN],uint8_t block_len,uint64_t counter,uint8_t flags,uint8_t out[64])
 
LLVM_LIBRARY_VISIBILITY void blake3_hash_many_portable (constuint8_t *const *inputs, size_t num_inputs, size_tblocks,constuint32_t key[8],uint64_t counter,bool increment_counter,uint8_t flags,uint8_t flags_start,uint8_t flags_end,uint8_t *out)
 

Variables

staticconstuint32_t IV [8]
 
staticconstuint8_t MSG_SCHEDULE [7][16]
 

Macro Definition Documentation

◆ BLAKE3_USE_NEON

#define BLAKE3_USE_NEON   0

Definition at line62 of fileblake3_impl.h.

◆ INLINE

#define INLINE   staticinline __attribute__((always_inline))

Definition at line32 of fileblake3_impl.h.

◆ MAX_SIMD_DEGREE

#define MAX_SIMD_DEGREE   1

Definition at line71 of fileblake3_impl.h.

◆ MAX_SIMD_DEGREE_OR_2

#define MAX_SIMD_DEGREE_OR_2   (MAX_SIMD_DEGREE > 2 ?MAX_SIMD_DEGREE : 2)

Definition at line76 of fileblake3_impl.h.

Enumeration Type Documentation

◆ blake3_flags

enumblake3_flags
Enumerator
CHUNK_START 
CHUNK_END 
PARENT 
ROOT 
KEYED_HASH 
DERIVE_KEY_CONTEXT 
DERIVE_KEY_MATERIAL 

Definition at line17 of fileblake3_impl.h.

Function Documentation

◆ blake3_compress_in_place()

LLVM_LIBRARY_VISIBILITY void blake3_compress_in_place(uint32_t cv[8],
constuint8_t block[BLAKE3_BLOCK_LEN],
uint8_t block_len,
uint64_t counter,
uint8_t flags 
)

Definition at line137 of fileblake3_dispatch.c.

ReferencesAVX512VL,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, andSSE41.

◆ blake3_compress_in_place_portable()

LLVM_LIBRARY_VISIBILITY void blake3_compress_in_place_portable(uint32_t cv[8],
constuint8_t block[BLAKE3_BLOCK_LEN],
uint8_t block_len,
uint64_t counter,
uint8_t flags 
)

Definition at line84 of fileblake3_portable.c.

Referencesblock, andcompress_pre().

◆ blake3_compress_xof()

LLVM_LIBRARY_VISIBILITY void blake3_compress_xof(constuint32_t cv[8],
constuint8_t block[BLAKE3_BLOCK_LEN],
uint8_t block_len,
uint64_t counter,
uint8_t flags,
uint8_t out[64] 
)

Definition at line166 of fileblake3_dispatch.c.

ReferencesAVX512VL,blake3_compress_xof_avx512,blake3_compress_xof_portable,blake3_compress_xof_sse2,blake3_compress_xof_sse41,block,get_cpu_features(),MAYBE_UNUSED,SSE2, andSSE41.

◆ blake3_compress_xof_portable()

LLVM_LIBRARY_VISIBILITY void blake3_compress_xof_portable(constuint32_t cv[8],
constuint8_t block[BLAKE3_BLOCK_LEN],
uint8_t block_len,
uint64_t counter,
uint8_t flags,
uint8_t out[64] 
)

Definition at line100 of fileblake3_portable.c.

Referencesblock,compress_pre(), andstore32().

◆ blake3_hash_many()

LLVM_LIBRARY_VISIBILITY void blake3_hash_many(constuint8_t *constinputs,
size_t num_inputs,
size_t blocks,
constuint32_t key[8],
uint64_t counter,
bool increment_counter,
uint8_t flags,
uint8_t flags_start,
uint8_t flags_end,
uint8_tout 
)

Definition at line195 of fileblake3_dispatch.c.

ReferencesAVX2,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, andSSE41.

◆ blake3_hash_many_portable()

LLVM_LIBRARY_VISIBILITY void blake3_hash_many_portable(constuint8_t *constinputs,
size_t num_inputs,
size_t blocks,
constuint32_t key[8],
uint64_t counter,
bool increment_counter,
uint8_t flags,
uint8_t flags_start,
uint8_t flags_end,
uint8_tout 
)

Definition at line145 of fileblake3_portable.c.

ReferencesBLAKE3_OUT_LEN,blocks, andhash_one_portable().

◆ blake3_simd_degree()

LLVM_LIBRARY_VISIBILITY size_t blake3_simd_degree(void )

Definition at line248 of fileblake3_dispatch.c.

ReferencesAVX2,AVX512F,AVX512VL,get_cpu_features(),MAYBE_UNUSED,SSE2, andSSE41.

◆ counter_high()

INLINEuint32_t counter_high(uint64_t counter)

Definition at line145 of fileblake3_impl.h.

Referenced bycompress_pre().

◆ counter_low()

INLINEuint32_t counter_low(uint64_t counter)

Definition at line143 of fileblake3_impl.h.

Referenced bycompress_pre().

◆ highest_one()

staticunsigned int highest_one(uint64_t x)
static

Definition at line94 of fileblake3_impl.h.

Referenced byround_down_to_power_of_2().

◆ load32()

INLINEuint32_t load32(const void * src)

Definition at line149 of fileblake3_impl.h.

Referenced bycompress_pre(), andload_key_words().

◆ load_key_words()

INLINE void load_key_words(constuint8_t key[BLAKE3_KEY_LEN],
uint32_t key_words[8] 
)

Definition at line155 of fileblake3_impl.h.

Referencesload32().

Referenced byllvm_blake3_hasher_init_derive_key_raw(), andllvm_blake3_hasher_init_keyed().

◆ popcnt()

INLINEunsigned int popcnt(uint64_t x)

Definition at line124 of fileblake3_impl.h.

Referenced byhasher_merge_cv_stack().

◆ round_down_to_power_of_2()

INLINEuint64_t round_down_to_power_of_2(uint64_t x)

Definition at line139 of fileblake3_impl.h.

Referenceshighest_one().

Referenced byleft_len(), andllvm_blake3_hasher_update().

◆ store32()

INLINE void store32(void * dst,
uint32_t w 
)

Definition at line167 of fileblake3_impl.h.

Referenced byblake3_compress_xof_portable(), andstore_cv_words().

◆ store_cv_words()

INLINE void store_cv_words(uint8_t bytes_out[32],
uint32_t cv_words[8] 
)

Definition at line175 of fileblake3_impl.h.

Referencesstore32().

Referenced byhash_one_portable(), andoutput_chaining_value().

Variable Documentation

◆ IV

constuint32_t IV[8]
static
Initial value:
= {0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL,
0xA54FF53AUL, 0x510E527FUL, 0x9B05688CUL,
0x1F83D9ABUL, 0x5BE0CD19UL}

Definition at line78 of fileblake3_impl.h.

Referenced byaddFullyUnrolledInstructionsToIgnore(),addPHINodeEntriesForMappedBlock(),blake3_hash16_avx512(),blake3_hash4_avx512(),blake3_hash4_sse2(),blake3_hash4_sse41(),blake3_hash8_avx2(),blake3_hash8_avx512(),compress_pre(),llvm::OpenMPIRBuilder::createCanonicalLoop(),llvm::VPRecipeBuilder::createHeaderMask(),llvm::VPBuilder::createScalarIVSteps(),detectShiftUntilZeroIdiom(),llvm::JumpThreadingPass::duplicateCondBranchOnPHIIntoPred(),llvm::VPlan::execute(),llvm::InstCombinerImpl::foldAggregateConstructionIntoAggregateReuse(),getAggregateSize(),getElementIndex(),llvm::DenseMapInfo< PointerIntPair< PointerTy, IntBits, IntType >, void >::getHashValue(),GetInductionVariable(),getTrueOrFalseValue(),insertUniqueBackedgeBlock(),llvm::vputils::isUniformAfterVectorization(),llvm::isUniformLoop(),IsValueFullyAvailableInBlock(),likeBitCastFromVector(),llvm_blake3_hasher_init(),llvm_blake3_hasher_init_derive_key_raw(),LLVMGetIndices(),LLVMGetNumIndices(),preparePlanForEpilogueVectorLoop(),ReduceLoopStrength(),removeRedundantInductionCasts(),llvm::replaceSignedInst(),simplifyInstructionWithOperands(),llvm::SplitBlockAndInsertSimpleForLoop(),llvm::SCCPInstVisitor::trackValueOfGlobalVariable(),llvm::MemorySSAUpdater::updatePhisWhenInsertingUniqueBackedgeBlock(),llvm::slpvectorizer::BoUpSLP::vectorizeTree(),llvm::InstCombinerImpl::visitExtractValueInst(),llvm::InstCombinerImpl::visitPHINode(),llvm::VPDerivedIVRecipe::VPDerivedIVRecipe(), andllvm::VPScalarIVStepsRecipe::VPScalarIVStepsRecipe().

◆ MSG_SCHEDULE

constuint8_t MSG_SCHEDULE[7][16]
static
Initial value:
= {
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15},
{2, 6, 3, 10, 7, 0, 4, 13, 1, 11, 12, 5, 9, 14, 15, 8},
{3, 4, 10, 12, 13, 2, 7, 14, 6, 5, 9, 0, 11, 15, 8, 1},
{10, 7, 12, 9, 14, 3, 13, 15, 4, 0, 11, 2, 5, 8, 1, 6},
{12, 13, 9, 11, 15, 10, 14, 8, 7, 2, 5, 3, 0, 1, 6, 4},
{9, 14, 11, 5, 8, 12, 15, 1, 13, 3, 0, 10, 2, 6, 4, 7},
{11, 15, 5, 0, 1, 9, 8, 6, 14, 10, 2, 12, 3, 4, 7, 13},
}

Definition at line82 of fileblake3_impl.h.

Referenced byround_fn(),round_fn16(),round_fn4(), andround_fn8().


Generated on Sun Jul 20 2025 15:03:11 for LLVM by doxygen 1.9.6
[8]ページ先頭

©2009-2025 Movatter.jp