#include "blake2s.h"
#include <cstdint>
Go to the source code of this file.
|
static void | kagome::crypto::blake2s_compress (blake2s_ctx_full *ctx, int last) |
|
void | kagome::crypto::blake2s_update (blake2s_ctx *ctx, const void *in, size_t inlen) |
| Update context with incoming bytes. More...
|
|
void | kagome::crypto::blake2s_final (blake2s_ctx *ctx, void *out) |
| Finalize hash calculation. More...
|
|
int | kagome::crypto::blake2s_init (blake2s_ctx *ctx, size_t outlen, const void *key, size_t keylen) |
| Generic blake2s init function. More...
|
|
int | kagome::crypto::blake2s (void *out, size_t outlen, const void *key, size_t keylen, const void *in, size_t inlen) |
| All in one blake2s hashing function. More...
|
|
void | kagome::crypto::blake2s_256_init (blake2s_ctx *ctx) |
| Initialize hash context. More...
|
|
void | kagome::crypto::blake2s_256 (void *out, const void *in, size_t inlen) |
| One-shot convenience function to calculate blake2s_256 hash. More...
|
|
struct kagome::crypto::blake2s_ctx_full |
Definition at line 29 of file blake2s.cpp.
Class Members |
uint8_t |
b[64] |
|
size_t |
c |
|
uint32_t |
h[8] |
|
size_t |
outlen |
|
uint32_t |
t[2] |
|
#define B2S_G |
( |
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d, |
|
|
|
x, |
|
|
|
y |
|
) |
| |
Value:{ \
v[a] = v[a] + v[b] + (x); \
v[d] =
ROTR32(v[d] ^ v[a], 16); \
v[c] = v[c] + v[d]; \
v[b] =
ROTR32(v[b] ^ v[c], 12); \
v[a] = v[a] + v[b] + (y); \
v[d] =
ROTR32(v[d] ^ v[a], 8); \
v[c] = v[c] + v[d]; \
v[b] =
ROTR32(v[b] ^ v[c], 7); \
}
Definition at line 44 of file blake2s.cpp.
Value:(((uint32_t)((uint8_t *)(p))[0]) ^ (((uint32_t)((uint8_t *)(p))[1]) << 8) \
^ (((uint32_t)((uint8_t *)(p))[2]) << 16) \
^ (((uint32_t)((uint8_t *)(p))[3]) << 24))
Definition at line 37 of file blake2s.cpp.
#define ROTR32 |
( |
|
x, |
|
|
|
y |
|
) |
| (((x) >> (y)) ^ ((x) << (32 - (y)))) |