Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::stdlib::Blake2s< Builder > Class Template Reference

#include <blake2s.hpp>

Classes

struct  blake2s_state
 

Static Public Member Functions

static byte_array_ct hash (const byte_array_ct &input)
 

Private Types

using field_ct = field_t< Builder >
 
using byte_array_ct = byte_array< Builder >
 

Static Private Member Functions

static void increment_counter (blake2s_state &S, const uint32_t inc)
 
static void compress (blake2s_state &S, byte_array_ct const &in)
 
static void blake2s (blake2s_state &S, byte_array_ct const &in)
 

Static Private Attributes

static constexpr uint32_t blake2s_IV [8]
 
static constexpr uint32_t initial_H [8]
 
static constexpr size_t BLAKE2S_STATE_SIZE = stdlib::blake_util::BLAKE_STATE_SIZE
 
static constexpr uint32_t BLAKE2S_BLOCKBYTES = 64
 

Detailed Description

template<typename Builder>
class bb::stdlib::Blake2s< Builder >

Definition at line 16 of file blake2s.hpp.

Member Typedef Documentation

◆ byte_array_ct

template<typename Builder >
using bb::stdlib::Blake2s< Builder >::byte_array_ct = byte_array<Builder>
private

Definition at line 18 of file blake2s.hpp.

◆ field_ct

template<typename Builder >
using bb::stdlib::Blake2s< Builder >::field_ct = field_t<Builder>
private

Definition at line 17 of file blake2s.hpp.

Member Function Documentation

◆ blake2s()

template<typename Builder >
void bb::stdlib::Blake2s< Builder >::blake2s ( blake2s_state S,
byte_array_ct const &  in 
)
staticprivate

Definition at line 98 of file blake2s.cpp.

◆ compress()

template<typename Builder >
void bb::stdlib::Blake2s< Builder >::compress ( blake2s_state S,
byte_array_ct const &  in 
)
staticprivate

Definition at line 49 of file blake2s.cpp.

◆ hash()

template<typename Builder >
byte_array< Builder > bb::stdlib::Blake2s< Builder >::hash ( const byte_array_ct input)
static

Definition at line 122 of file blake2s.cpp.

◆ increment_counter()

template<typename Builder >
void bb::stdlib::Blake2s< Builder >::increment_counter ( blake2s_state S,
const uint32_t  inc 
)
staticprivate

The blake2s_state consists of the following components: h: A 64-byte chain value denoted decomposed as (h_0, h_1, ..., h_7), each h_i is a 32-bit number. It form the first two rows on the internal state matrix v of the compression function G.

t: It is a counter (t_0 lsb and t_1 msb) used in the initialization of the internal state v.

f: f_0 and f_1 are finalization flags used in the initialization of the internal state v. / 0xfff...ff if the block processed is the last f_0 = | \ 0x000...00 otherwise / 0xfff...ff if the last node is processed in merkle-tree hashing f_1 = | \ 0x000...00 otherwise

Further, the internal state 4x4 matrix used by the compression function is denoted by v. The input data is stored in the 16-word message m.

Definition at line 40 of file blake2s.cpp.

Member Data Documentation

◆ BLAKE2S_BLOCKBYTES

template<typename Builder >
constexpr uint32_t bb::stdlib::Blake2s< Builder >::BLAKE2S_BLOCKBYTES = 64
staticconstexprprivate

Definition at line 28 of file blake2s.hpp.

◆ blake2s_IV

template<typename Builder >
constexpr uint32_t bb::stdlib::Blake2s< Builder >::blake2s_IV[8]
staticconstexprprivate
Initial value:
= { 0x6A09E667UL, 0xBB67AE85UL, 0x3C6EF372UL, 0xA54FF53AUL,
0x510E527FUL, 0x9B05688CUL, 0x1F83D9ABUL, 0x5BE0CD19UL }

Definition at line 20 of file blake2s.hpp.

◆ BLAKE2S_STATE_SIZE

template<typename Builder >
constexpr size_t bb::stdlib::Blake2s< Builder >::BLAKE2S_STATE_SIZE = stdlib::blake_util::BLAKE_STATE_SIZE
staticconstexprprivate

Definition at line 27 of file blake2s.hpp.

◆ initial_H

template<typename Builder >
constexpr uint32_t bb::stdlib::Blake2s< Builder >::initial_H[8]
staticconstexprprivate
Initial value:
= {
0x6b08e647, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19,
}

Definition at line 23 of file blake2s.hpp.


The documentation for this class was generated from the following files: