Project Alice
Loading...
Searching...
No Matches
blake2.c File Reference
#include <stdint.h>
#include <string.h>
#include <stdio.h>
#include "blake2.h"
#include "blake2-impl.h"
Include dependency graph for blake2.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

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

Functions

int blake2b_init_param (blake2b_state *S, const blake2b_param *P)
 
int blake2b_init (blake2b_state *S, size_t outlen)
 
int blake2b_init_key (blake2b_state *S, size_t outlen, const void *key, size_t keylen)
 
int blake2b_update (blake2b_state *S, const void *pin, size_t inlen)
 
int blake2b_final (blake2b_state *S, void *out, size_t outlen)
 
int blake2b (void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen)
 
int blake2 (void *out, size_t outlen, const void *in, size_t inlen, const void *key, size_t keylen)
 

Macro Definition Documentation

◆ G

#define G (   r,
  i,
  a,
  b,
  c,
 
)
Value:
do { \
a = a + b + m[blake2b_sigma[r][2*i+0]]; \
d = rotr64(d ^ a, 32); \
c = c + d; \
b = rotr64(b ^ c, 24); \
a = a + b + m[blake2b_sigma[r][2*i+1]]; \
d = rotr64(d ^ a, 16); \
c = c + d; \
b = rotr64(b ^ c, 63); \
} while(0)

Definition at line 144 of file blake2.c.

◆ 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 156 of file blake2.c.

Function Documentation

◆ blake2()

int blake2 ( void *  out,
size_t  outlen,
const void *  in,
size_t  inlen,
const void *  key,
size_t  keylen 
)

Definition at line 284 of file blake2.c.

Here is the call graph for this function:

◆ blake2b()

int blake2b ( void *  out,
size_t  outlen,
const void *  in,
size_t  inlen,
const void *  key,
size_t  keylen 
)

Definition at line 259 of file blake2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ blake2b_final()

int blake2b_final ( blake2b_state S,
void *  out,
size_t  outlen 
)

Definition at line 235 of file blake2.c.

Here is the caller graph for this function:

◆ blake2b_init()

int blake2b_init ( blake2b_state S,
size_t  outlen 
)

Definition at line 91 of file blake2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ blake2b_init_key()

int blake2b_init_key ( blake2b_state S,
size_t  outlen,
const void *  key,
size_t  keylen 
)

Definition at line 112 of file blake2.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ blake2b_init_param()

int blake2b_init_param ( blake2b_state S,
const blake2b_param P 
)

Definition at line 77 of file blake2.c.

Here is the caller graph for this function:

◆ blake2b_update()

int blake2b_update ( blake2b_state S,
const void *  pin,
size_t  inlen 
)

Definition at line 211 of file blake2.c.

Here is the caller graph for this function: