LLVM 19.0.0git
Macros | Enumerations | Functions | Variables
blake3_dispatch.c File Reference
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include "blake3_impl.h"

Go to the source code of this file.

Macros

#define MAYBE_UNUSED(x)   (void)((x))
 

Enumerations

enum  cpu_feature {
  SSE2 = 1 << 0 , SSSE3 = 1 << 1 , SSE41 = 1 << 2 , AVX = 1 << 3 ,
  AVX2 = 1 << 4 , AVX512F = 1 << 5 , AVX512VL = 1 << 6 , UNDEFINED = 1 << 30
}
 

Functions

static LLVM_ATTRIBUTE_USED enum cpu_feature get_cpu_features (void)
 
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)
 
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])
 
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)
 
size_t blake3_simd_degree (void)
 

Variables

static enum cpu_feature g_cpu_features = UNDEFINED
 

Macro Definition Documentation

◆ MAYBE_UNUSED

#define MAYBE_UNUSED (   x)    (void)((x))

Definition at line 17 of file blake3_dispatch.c.

Enumeration Type Documentation

◆ cpu_feature

Enumerator
SSE2 
SSSE3 
SSE41 
AVX 
AVX2 
AVX512F 
AVX512VL 
UNDEFINED 

Definition at line 64 of file blake3_dispatch.c.

Function Documentation

◆ blake3_compress_in_place()

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 
)

◆ blake3_compress_xof()

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] 
)

◆ blake3_hash_many()

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 
)

◆ blake3_simd_degree()

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.

◆ get_cpu_features()

static LLVM_ATTRIBUTE_USED enum cpu_feature get_cpu_features ( void  )
static

Variable Documentation

◆ g_cpu_features

enum cpu_feature g_cpu_features = UNDEFINED
static

Definition at line 79 of file blake3_dispatch.c.

Referenced by get_cpu_features().