LLVM 19.0.0git
Macros | Functions
blake3_avx2.c File Reference
#include "blake3_impl.h"
#include <immintrin.h>

Go to the source code of this file.

Macros

#define DEGREE   8
 

Functions

INLINE __m256i loadu (const uint8_t src[32])
 
INLINE void storeu (__m256i src, uint8_t dest[16])
 
INLINE __m256i addv (__m256i a, __m256i b)
 
INLINE __m256i xorv (__m256i a, __m256i b)
 
INLINE __m256i set1 (uint32_t x)
 
INLINE __m256i rot16 (__m256i x)
 
INLINE __m256i rot12 (__m256i x)
 
INLINE __m256i rot8 (__m256i x)
 
INLINE __m256i rot7 (__m256i x)
 
INLINE void round_fn (__m256i v[16], __m256i m[16], size_t r)
 
INLINE void transpose_vecs (__m256i vecs[DEGREE])
 
INLINE void transpose_msg_vecs (const uint8_t *const *inputs, size_t block_offset, __m256i out[16])
 
INLINE void load_counters (uint64_t counter, bool increment_counter, __m256i *out_lo, __m256i *out_hi)
 
static void blake3_hash8_avx2 (const uint8_t *const *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)
 
void blake3_hash_many_sse41 (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)
 
void blake3_hash_many_avx2 (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)
 

Macro Definition Documentation

◆ DEGREE

#define DEGREE   8

Definition at line 5 of file blake3_avx2.c.

Function Documentation

◆ addv()

INLINE __m256i addv ( __m256i  a,
__m256i  b 
)

Definition at line 15 of file blake3_avx2.c.

Referenced by round_fn().

◆ blake3_hash8_avx2()

static void blake3_hash8_avx2 ( const uint8_t *const 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 
)
static

◆ blake3_hash_many_avx2()

void blake3_hash_many_avx2 ( 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_hash_many_sse41()

void blake3_hash_many_sse41 ( 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 535 of file blake3_sse41.c.

References blake3_hash4_sse41(), BLAKE3_OUT_LEN, blocks, DEGREE, and hash_one_sse41().

◆ load_counters()

INLINE void load_counters ( uint64_t  counter,
bool  increment_counter,
__m256i *  out_lo,
__m256i *  out_hi 
)

Definition at line 217 of file blake3_avx2.c.

Referenced by blake3_hash8_avx2().

◆ loadu()

INLINE __m256i loadu ( const uint8_t  src[32])

Definition at line 7 of file blake3_avx2.c.

Referenced by transpose_msg_vecs().

◆ rot12()

INLINE __m256i rot12 ( __m256i  x)

Definition at line 28 of file blake3_avx2.c.

Referenced by round_fn().

◆ rot16()

INLINE __m256i rot16 ( __m256i  x)

Definition at line 22 of file blake3_avx2.c.

Referenced by round_fn().

◆ rot7()

INLINE __m256i rot7 ( __m256i  x)

Definition at line 38 of file blake3_avx2.c.

Referenced by round_fn().

◆ rot8()

INLINE __m256i rot8 ( __m256i  x)

Definition at line 32 of file blake3_avx2.c.

Referenced by round_fn().

◆ round_fn()

INLINE void round_fn ( __m256i  v[16],
__m256i  m[16],
size_t  r 
)

Definition at line 42 of file blake3_avx2.c.

References addv(), MSG_SCHEDULE, rot12(), rot16(), rot7(), rot8(), and xorv().

Referenced by blake3_hash8_avx2().

◆ set1()

INLINE __m256i set1 ( uint32_t  x)

Definition at line 20 of file blake3_avx2.c.

Referenced by blake3_hash8_avx2().

◆ storeu()

INLINE void storeu ( __m256i  src,
uint8_t  dest[16] 
)

Definition at line 11 of file blake3_avx2.c.

Referenced by blake3_hash8_avx2().

◆ transpose_msg_vecs()

INLINE void transpose_msg_vecs ( const uint8_t *const inputs,
size_t  block_offset,
__m256i  out[16] 
)

Definition at line 192 of file blake3_avx2.c.

References loadu(), and transpose_vecs().

Referenced by blake3_hash8_avx2().

◆ transpose_vecs()

INLINE void transpose_vecs ( __m256i  vecs[DEGREE])

Definition at line 158 of file blake3_avx2.c.

Referenced by blake3_hash8_avx2(), and transpose_msg_vecs().

◆ xorv()

INLINE __m256i xorv ( __m256i  a,
__m256i  b 
)

Definition at line 18 of file blake3_avx2.c.

Referenced by blake3_hash8_avx2(), and round_fn().