Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
blake2s.cpp File Reference
#include <cstdint>
#include <cstdio>
#include <cstring>
#include "blake2-impl.hpp"
#include "blake2s.hpp"

Go to the source code of this file.

Namespaces

namespace  bb
 Entry point for Barretenberg command-line interface.
 
namespace  bb::crypto
 

Macros

#define G(r, i, a, b, c, d)
 
#define ROUND(r)
 

Functions

int bb::crypto::blake2s_init_param (blake2s_state *S, const blake2s_param *P)
 
int bb::crypto::blake2s_init (blake2s_state *S, size_t outlen)
 
int bb::crypto::blake2s_update (blake2s_state *S, const void *pin, size_t inlen)
 
int bb::crypto::blake2s_final (blake2s_state *S, void *out, size_t outlen)
 
std::array< uint8_t, BLAKE2S_OUTBYTESbb::crypto::blake2s (std::vector< uint8_t > const &input)
 

Macro Definition Documentation

◆ G

#define G (   r,
  i,
  a,
  b,
  c,
 
)
Value:
do { \
a = a + b + m[blake2s_sigma[r][2 * i + 0]]; \
d = rotr32(d ^ a, 16); \
c = c + d; \
b = rotr32(b ^ c, 12); \
a = a + b + m[blake2s_sigma[r][2 * i + 1]]; \
d = rotr32(d ^ a, 8); \
c = c + d; \
b = rotr32(b ^ c, 7); \
} while (0)
FF a
FF b

Definition at line 116 of file blake2s.cpp.

◆ ROUND

#define ROUND (   r)
Value:
do { \
G(r, 0, v[0], v[4], v[8], v[12]); \
G(r, 1, v[1], v[5], v[9], v[13]); \
G(r, 2, v[2], v[6], v[10], v[14]); \
G(r, 3, v[3], v[7], v[11], v[15]); \
G(r, 4, v[0], v[5], v[10], v[15]); \
G(r, 5, v[1], v[6], v[11], v[12]); \
G(r, 6, v[2], v[7], v[8], v[13]); \
G(r, 7, v[3], v[4], v[9], v[14]); \
} while (0)

Definition at line 128 of file blake2s.cpp.