LLVM 22.0.0git
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 BLAKE3_ATOMICS   0
#define ATOMIC_INT   int
#define ATOMIC_LOAD(x)
#define ATOMIC_STORE(x, y)
#define MAYBE_UNUSED(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_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)
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 ATOMIC_INT g_cpu_features = UNDEFINED

Macro Definition Documentation

◆ ATOMIC_INT

#define ATOMIC_INT   int

Definition at line 42 of file blake3_dispatch.c.

◆ ATOMIC_LOAD

#define ATOMIC_LOAD ( x)
Value:
x

Definition at line 43 of file blake3_dispatch.c.

Referenced by get_cpu_features().

◆ ATOMIC_STORE

#define ATOMIC_STORE ( x,
y )
Value:
x = y

Definition at line 44 of file blake3_dispatch.c.

Referenced by get_cpu_features().

◆ BLAKE3_ATOMICS

#define BLAKE3_ATOMICS   0

Definition at line 29 of file blake3_dispatch.c.

◆ MAYBE_UNUSED

#define MAYBE_UNUSED ( x)

Enumeration Type Documentation

◆ cpu_feature

Enumerator
SSE2 
SSSE3 
SSE41 
AVX 
AVX2 
AVX512F 
AVX512VL 
UNDEFINED 

Definition at line 94 of file blake3_dispatch.c.

Function Documentation

◆ blake3_compress_in_place()

◆ 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 304 of file blake3_dispatch.c.

References AVX2, AVX512F, AVX512VL, get_cpu_features(), MAYBE_UNUSED, SSE2, and SSE41.

◆ blake3_xof_many()

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 )

◆ get_cpu_features()

Variable Documentation

◆ g_cpu_features

ATOMIC_INT g_cpu_features = UNDEFINED
static

Definition at line 109 of file blake3_dispatch.c.

Referenced by get_cpu_features().