Kagome
Polkadot Runtime Engine in C++17
blake2b.cpp File Reference
#include "blake2b.h"
Include dependency graph for blake2b.cpp:

Go to the source code of this file.

Namespaces

 kagome::crypto
 

Macros

#define ROTR64(x, y)   (((x) >> (y)) ^ ((x) << (64 - (y))))
 
#define B2B_GET64(p)
 
#define B2B_G(a, b, c, d, x, y)
 

Functions

static void kagome::crypto::blake2b_compress (blake2b_ctx *ctx, int last)
 
int kagome::crypto::blake2b_init (blake2b_ctx *ctx, size_t outlen, const void *key, size_t keylen)
 
void kagome::crypto::blake2b_update (blake2b_ctx *ctx, const void *in, size_t inlen)
 
void kagome::crypto::blake2b_final (blake2b_ctx *ctx, void *out)
 
int kagome::crypto::blake2b (void *out, size_t outlen, const void *key, size_t keylen, const void *in, size_t inlen)
 

Variables

static const uint64_t kagome::crypto::blake2b_iv [8]
 

Macro Definition Documentation

#define B2B_G (   a,
  b,
  c,
  d,
  x,
 
)
Value:
{ \
v[a] = v[a] + v[b] + (x); \
v[d] = ROTR64(v[d] ^ v[a], 32); \
v[c] = v[c] + v[d]; \
v[b] = ROTR64(v[b] ^ v[c], 24); \
v[a] = v[a] + v[b] + (y); \
v[d] = ROTR64(v[d] ^ v[a], 16); \
v[c] = v[c] + v[d]; \
v[b] = ROTR64(v[b] ^ v[c], 63); \
}
#define ROTR64(x, y)
Definition: blake2b.cpp:19

Definition at line 35 of file blake2b.cpp.

#define B2B_GET64 (   p)
Value:
(((uint64_t)((uint8_t *)(p))[0]) ^ (((uint64_t)((uint8_t *)(p))[1]) << 8) \
^ (((uint64_t)((uint8_t *)(p))[2]) << 16) \
^ (((uint64_t)((uint8_t *)(p))[3]) << 24) \
^ (((uint64_t)((uint8_t *)(p))[4]) << 32) \
^ (((uint64_t)((uint8_t *)(p))[5]) << 40) \
^ (((uint64_t)((uint8_t *)(p))[6]) << 48) \
^ (((uint64_t)((uint8_t *)(p))[7]) << 56))

Definition at line 24 of file blake2b.cpp.

#define ROTR64 (   x,
 
)    (((x) >> (y)) ^ ((x) << (64 - (y))))

Definition at line 19 of file blake2b.cpp.