33#define BLAKE3_VERSION_STRING "0.3.7"
58static const uint32_t IV[8] = { 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL,
59 0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL };
61static const uint8_t MSG_SCHEDULE[7][16] = {
62 { 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 },
63 { 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 },
64 { 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 },
65 { 11, 15, 5, 0, 1, 9, 8, 6, 14, 10, 2, 12, 3, 4, 7, 13 },
102void g(uint32_t* state,
size_t a,
size_t b,
size_t c,
size_t d, uint32_t x, uint32_t y);
103void round_fn(uint32_t state[16],
const uint32_t* msg,
size_t round);
106 const uint32_t cv[8],
113 uint32_t cv[8],
const uint8_t block[
BLAKE3_BLOCK_LEN], uint8_t block_len, uint64_t counter, uint8_t flags);
124 const uint32_t
key[8],
134 const uint32_t
key[8],
136 bool increment_counter,
142std::vector<uint8_t>
blake3s(std::vector<uint8_t>
const& input,
145 const char*
context =
nullptr);
StrictMock< MockContext > context
void blake3_hasher_init_derive_key_raw(blake3_hasher *self, const void *context, size_t context_len)
void blake3_hasher_init_keyed(blake3_hasher *self, const uint8_t key[BLAKE3_KEY_LEN])
struct blake3_full::blake3_chunk_state__ blake3_chunk_state
void blake3_hasher_finalize_seek(const blake3_hasher *self, uint64_t seek, uint8_t *out, size_t out_len)
const char * blake3_version(void)
void blake3_hasher_init_derive_key(blake3_hasher *self, const char *context)
void blake3_hasher_update(blake3_hasher *self, const void *input, size_t input_len)
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 round_fn(uint32_t state[16], const uint32_t *msg, size_t round)
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])
struct blake3_full::blake3_hasher__ blake3_hasher
void g(uint32_t *state, size_t a, size_t b, size_t c, size_t d, uint32_t x, uint32_t y)
void blake3_hasher_finalize(const blake3_hasher *self, uint8_t *out, size_t out_len)
void blake3_hasher_init(blake3_hasher *self)
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])
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)
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 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)
uint8_t blocks_compressed
uint8_t buf[BLAKE3_BLOCK_LEN]
uint8_t cv_stack[(BLAKE3_MAX_DEPTH+1) *BLAKE3_OUT_LEN]