Barretenberg
The ZK-SNARK library at the core of Aztec
|
Classes | |
struct | blake3_chunk_state__ |
struct | blake3_hasher__ |
struct | output_t__ |
Typedefs | |
typedef struct blake3_full::output_t__ | output_t |
typedef struct blake3_full::blake3_chunk_state__ | blake3_chunk_state |
typedef struct blake3_full::blake3_hasher__ | blake3_hasher |
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 } |
enum | blake3s_constant { BLAKE3_KEY_LEN = 32 , BLAKE3_OUT_LEN = 32 , BLAKE3_BLOCK_LEN = 64 , BLAKE3_CHUNK_LEN = 1024 , BLAKE3_MAX_DEPTH = 54 } |
enum | mode { HASH_MODE = 0 , KEYED_HASH_MODE = 1 , DERIVE_KEY_MODE = 2 } |
Functions | |
size_t | blake3_simd_degree (void) |
INLINE unsigned int | popcnt (uint64_t x) |
INLINE uint32_t | rotr32 (uint32_t w, uint32_t c) |
INLINE uint64_t | round_down_to_power_of_2 (uint64_t x) |
INLINE uint32_t | counter_low (uint64_t counter) |
INLINE uint32_t | counter_high (uint64_t counter) |
INLINE uint32_t | load32 (const void *src) |
INLINE void | load_key_words (const uint8_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]) |
const char * | blake3_version (void) |
INLINE void | chunk_state_init (blake3_chunk_state *self, const uint32_t key[8], uint8_t flags) |
INLINE void | chunk_state_reset (blake3_chunk_state *self, const uint32_t key[8], uint64_t chunk_counter) |
INLINE size_t | chunk_state_len (const blake3_chunk_state *self) |
INLINE size_t | chunk_state_fill_buf (blake3_chunk_state *self, const uint8_t *input, size_t input_len) |
INLINE uint8_t | chunk_state_maybe_start_flag (const blake3_chunk_state *self) |
INLINE output_t | make_output (const uint32_t input_cv[8], const uint8_t block[BLAKE3_BLOCK_LEN], uint8_t block_len, uint64_t counter, uint8_t flags) |
INLINE void | output_chaining_value (const output_t *self, uint8_t cv[32]) |
INLINE void | output_root_bytes (const output_t *self, uint64_t seek, uint8_t *out, size_t out_len) |
INLINE void | chunk_state_update (blake3_chunk_state *self, const uint8_t *input, size_t input_len) |
INLINE output_t | chunk_state_output (const blake3_chunk_state *self) |
INLINE output_t | parent_output (const uint8_t block[BLAKE3_BLOCK_LEN], const uint32_t key[8], uint8_t flags) |
INLINE size_t | left_len (size_t content_len) |
INLINE size_t | compress_chunks_parallel (const uint8_t *input, size_t input_len, const uint32_t key[8], uint64_t chunk_counter, uint8_t flags, uint8_t *out) |
INLINE size_t | compress_parents_parallel (const uint8_t *child_chaining_values, size_t num_chaining_values, const uint32_t key[8], uint8_t flags, uint8_t *out) |
INLINE void | compress_subtree_to_parent_node (const uint8_t *input, size_t input_len, const uint32_t key[8], uint64_t chunk_counter, uint8_t flags, uint8_t out[2 *BLAKE3_OUT_LEN]) |
INLINE void | hasher_init_base (blake3_hasher *self, const uint32_t key[8], uint8_t flags) |
void | blake3_hasher_init (blake3_hasher *self) |
void | blake3_hasher_init_keyed (blake3_hasher *self, const uint8_t key[BLAKE3_KEY_LEN]) |
void | blake3_hasher_init_derive_key_raw (blake3_hasher *self, const void *context, size_t context_len) |
void | blake3_hasher_init_derive_key (blake3_hasher *self, const char *context) |
INLINE void | hasher_merge_cv_stack (blake3_hasher *self, uint64_t total_len) |
INLINE void | hasher_push_cv (blake3_hasher *self, uint8_t new_cv[BLAKE3_OUT_LEN], uint64_t chunk_counter) |
void | blake3_hasher_update (blake3_hasher *self, const void *input, size_t input_len) |
void | blake3_hasher_finalize (const blake3_hasher *self, uint8_t *out, size_t out_len) |
void | blake3_hasher_finalize_seek (const blake3_hasher *self, uint64_t seek, uint8_t *out, size_t out_len) |
void | g (uint32_t *state, size_t a, size_t b, size_t c, size_t d, uint32_t x, uint32_t y) |
void | round_fn (uint32_t state[16], const uint32_t *msg, size_t round) |
void | compress_pre (uint32_t state[16], const uint32_t cv[8], const uint8_t block[BLAKE3_BLOCK_LEN], uint8_t block_len, uint64_t counter, uint8_t flags) |
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 | blake3s_hash_one (const uint8_t *input, size_t blocks, const uint32_t key[8], uint64_t counter, uint8_t flags, uint8_t flags_start, uint8_t flags_end, uint8_t out[BLAKE3_OUT_LEN]) |
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) |
std::vector< uint8_t > | blake3s (std::vector< uint8_t > const &input, const mode mode_id, const uint8_t key[BLAKE3_KEY_LEN], const char *context) |
void | blak3s_hash_one (const uint8_t *input, size_t blocks, const uint32_t key[8], uint64_t counter, uint8_t flags, uint8_t flags_start, uint8_t flags_end, uint8_t out[BLAKE3_OUT_LEN]) |
typedef struct blake3_full::blake3_chunk_state__ blake3_full::blake3_chunk_state |
typedef struct blake3_full::blake3_hasher__ blake3_full::blake3_hasher |
typedef struct blake3_full::output_t__ blake3_full::output_t |
Enumerator | |
---|---|
CHUNK_START | |
CHUNK_END | |
PARENT | |
ROOT | |
KEYED_HASH | |
DERIVE_KEY_CONTEXT | |
DERIVE_KEY_MATERIAL |
Definition at line 36 of file blake3s.hpp.
Enumerator | |
---|---|
BLAKE3_KEY_LEN | |
BLAKE3_OUT_LEN | |
BLAKE3_BLOCK_LEN | |
BLAKE3_CHUNK_LEN | |
BLAKE3_MAX_DEPTH |
Definition at line 47 of file blake3s.hpp.
enum blake3_full::mode |
Enumerator | |
---|---|
HASH_MODE | |
KEYED_HASH_MODE | |
DERIVE_KEY_MODE |
Definition at line 56 of file blake3s.hpp.
void blake3_full::blak3s_hash_one | ( | const uint8_t * | input, |
size_t | blocks, | ||
const uint32_t | key[8], | ||
uint64_t | counter, | ||
uint8_t | flags, | ||
uint8_t | flags_start, | ||
uint8_t | flags_end, | ||
uint8_t | out[BLAKE3_OUT_LEN] | ||
) |
void blake3_full::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 768 of file blake3s.cpp.
void blake3_full::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 783 of file blake3s.cpp.
void blake3_full::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 838 of file blake3s.cpp.
void blake3_full::blake3_hasher_finalize | ( | const blake3_hasher * | self, |
uint8_t * | out, | ||
size_t | out_len | ||
) |
Definition at line 636 of file blake3s.cpp.
void blake3_full::blake3_hasher_finalize_seek | ( | const blake3_hasher * | self, |
uint64_t | seek, | ||
uint8_t * | out, | ||
size_t | out_len | ||
) |
Definition at line 641 of file blake3s.cpp.
void blake3_full::blake3_hasher_init | ( | blake3_hasher * | self | ) |
Definition at line 437 of file blake3s.cpp.
void blake3_full::blake3_hasher_init_derive_key | ( | blake3_hasher * | self, |
const char * | context | ||
) |
Definition at line 461 of file blake3s.cpp.
void blake3_full::blake3_hasher_init_derive_key_raw | ( | blake3_hasher * | self, |
const void * | context, | ||
size_t | context_len | ||
) |
Definition at line 449 of file blake3s.cpp.
void blake3_full::blake3_hasher_init_keyed | ( | blake3_hasher * | self, |
const uint8_t | key[BLAKE3_KEY_LEN] | ||
) |
Definition at line 442 of file blake3s.cpp.
void blake3_full::blake3_hasher_update | ( | blake3_hasher * | self, |
const void * | input, | ||
size_t | input_len | ||
) |
Definition at line 529 of file blake3s.cpp.
size_t blake3_full::blake3_simd_degree | ( | void | ) |
Definition at line 83 of file blake3-impl.hpp.
const char * blake3_full::blake3_version | ( | void | ) |
Definition at line 35 of file blake3s.cpp.
std::vector< uint8_t > blake3_full::blake3s | ( | std::vector< uint8_t > const & | input, |
const mode | mode_id, | ||
const uint8_t | key[BLAKE3_KEY_LEN], | ||
const char * | context | ||
) |
Definition at line 860 of file blake3s.cpp.
void blake3_full::blake3s_hash_one | ( | const uint8_t * | input, |
size_t | blocks, | ||
const uint32_t | key[8], | ||
uint64_t | counter, | ||
uint8_t | flags, | ||
uint8_t | flags_start, | ||
uint8_t | flags_end, | ||
uint8_t | out[BLAKE3_OUT_LEN] | ||
) |
Definition at line 811 of file blake3s.cpp.
INLINE size_t blake3_full::chunk_state_fill_buf | ( | blake3_chunk_state * | self, |
const uint8_t * | input, | ||
size_t | input_len | ||
) |
Definition at line 72 of file blake3s.cpp.
INLINE void blake3_full::chunk_state_init | ( | blake3_chunk_state * | self, |
const uint32_t | key[8], | ||
uint8_t | flags | ||
) |
Definition at line 40 of file blake3s.cpp.
INLINE size_t blake3_full::chunk_state_len | ( | const blake3_chunk_state * | self | ) |
Definition at line 67 of file blake3s.cpp.
INLINE uint8_t blake3_full::chunk_state_maybe_start_flag | ( | const blake3_chunk_state * | self | ) |
Definition at line 86 of file blake3s.cpp.
INLINE output_t blake3_full::chunk_state_output | ( | const blake3_chunk_state * | self | ) |
Definition at line 197 of file blake3s.cpp.
INLINE void blake3_full::chunk_state_reset | ( | blake3_chunk_state * | self, |
const uint32_t | key[8], | ||
uint64_t | chunk_counter | ||
) |
Definition at line 54 of file blake3s.cpp.
INLINE void blake3_full::chunk_state_update | ( | blake3_chunk_state * | self, |
const uint8_t * | input, | ||
size_t | input_len | ||
) |
Definition at line 164 of file blake3s.cpp.
INLINE size_t blake3_full::compress_chunks_parallel | ( | const uint8_t * | input, |
size_t | input_len, | ||
const uint32_t | key[8], | ||
uint64_t | chunk_counter, | ||
uint8_t | flags, | ||
uint8_t * | out | ||
) |
Definition at line 223 of file blake3s.cpp.
INLINE size_t blake3_full::compress_parents_parallel | ( | const uint8_t * | child_chaining_values, |
size_t | num_chaining_values, | ||
const uint32_t | key[8], | ||
uint8_t | flags, | ||
uint8_t * | out | ||
) |
Definition at line 272 of file blake3s.cpp.
void blake3_full::compress_pre | ( | uint32_t | state[16], |
const uint32_t | cv[8], | ||
const uint8_t | block[BLAKE3_BLOCK_LEN], | ||
uint8_t | block_len, | ||
uint64_t | counter, | ||
uint8_t | flags | ||
) |
Definition at line 717 of file blake3s.cpp.
INLINE void blake3_full::compress_subtree_to_parent_node | ( | const uint8_t * | input, |
size_t | input_len, | ||
const uint32_t | key[8], | ||
uint64_t | chunk_counter, | ||
uint8_t | flags, | ||
uint8_t | out[2 *BLAKE3_OUT_LEN] | ||
) |
Definition at line 397 of file blake3s.cpp.
INLINE uint32_t blake3_full::counter_high | ( | uint64_t | counter | ) |
Definition at line 255 of file blake3-impl.hpp.
INLINE uint32_t blake3_full::counter_low | ( | uint64_t | counter | ) |
Definition at line 250 of file blake3-impl.hpp.
void blake3_full::g | ( | uint32_t * | state, |
size_t | a, | ||
size_t | b, | ||
size_t | c, | ||
size_t | d, | ||
uint32_t | x, | ||
uint32_t | y | ||
) |
Definition at line 687 of file blake3s.cpp.
INLINE void blake3_full::hasher_init_base | ( | blake3_hasher * | self, |
const uint32_t | key[8], | ||
uint8_t | flags | ||
) |
Definition at line 427 of file blake3s.cpp.
INLINE void blake3_full::hasher_merge_cv_stack | ( | blake3_hasher * | self, |
uint64_t | total_len | ||
) |
Definition at line 476 of file blake3s.cpp.
INLINE void blake3_full::hasher_push_cv | ( | blake3_hasher * | self, |
uint8_t | new_cv[BLAKE3_OUT_LEN], | ||
uint64_t | chunk_counter | ||
) |
Definition at line 519 of file blake3s.cpp.
INLINE size_t blake3_full::left_len | ( | size_t | content_len | ) |
Definition at line 211 of file blake3s.cpp.
INLINE uint32_t blake3_full::load32 | ( | const void * | src | ) |
Definition at line 260 of file blake3-impl.hpp.
INLINE void blake3_full::load_key_words | ( | const uint8_t | key[BLAKE3_KEY_LEN], |
uint32_t | key_words[8] | ||
) |
Definition at line 266 of file blake3-impl.hpp.
INLINE output_t blake3_full::make_output | ( | const uint32_t | input_cv[8], |
const uint8_t | block[BLAKE3_BLOCK_LEN], | ||
uint8_t | block_len, | ||
uint64_t | counter, | ||
uint8_t | flags | ||
) |
Definition at line 103 of file blake3s.cpp.
Definition at line 128 of file blake3s.cpp.
INLINE void blake3_full::output_root_bytes | ( | const output_t * | self, |
uint64_t | seek, | ||
uint8_t * | out, | ||
size_t | out_len | ||
) |
Definition at line 138 of file blake3s.cpp.
INLINE output_t blake3_full::parent_output | ( | const uint8_t | block[BLAKE3_BLOCK_LEN], |
const uint32_t | key[8], | ||
uint8_t | flags | ||
) |
Definition at line 203 of file blake3s.cpp.
INLINE unsigned int blake3_full::popcnt | ( | uint64_t | x | ) |
Definition at line 223 of file blake3-impl.hpp.
INLINE uint32_t blake3_full::rotr32 | ( | uint32_t | w, |
uint32_t | c | ||
) |
Definition at line 238 of file blake3-impl.hpp.
INLINE uint64_t blake3_full::round_down_to_power_of_2 | ( | uint64_t | x | ) |
Definition at line 245 of file blake3-impl.hpp.
void blake3_full::round_fn | ( | uint32_t | state[16], |
const uint32_t * | msg, | ||
size_t | round | ||
) |
Definition at line 699 of file blake3s.cpp.
INLINE void blake3_full::store32 | ( | void * | dst, |
uint32_t | w | ||
) |
Definition at line 278 of file blake3-impl.hpp.
INLINE void blake3_full::store_cv_words | ( | uint8_t | bytes_out[32], |
uint32_t | cv_words[8] | ||
) |
Definition at line 287 of file blake3-impl.hpp.