#include <string.h>
#include "crypt/sha2.h"
#include "crypt/brg_endian.h"
Go to the source code of this file.
|
#define | rotl32(x, n) (((x) << n) | ((x) >> (32 - n))) |
|
#define | rotr32(x, n) (((x) >> n) | ((x) << (32 - n))) |
|
#define | bswap_32(x) ((rotr32((x), 24) & 0x00ff00ff) | (rotr32((x), 8) & 0xff00ff00)) |
|
#define | SWAP_BYTES |
|
#define | ch(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) |
|
#define | maj(x, y, z) (((x) & (y)) | ((z) & ((x) ^ (y)))) |
|
#define | vf(n, i) v[(n - i) & 7] |
|
#define | hf(i) |
|
#define | v_cycle(i, j) |
|
#define bswap_32 |
( |
|
x | ) |
((rotr32((x), 24) & 0x00ff00ff) | (rotr32((x), 8) & 0xff00ff00)) |
#define ch |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| ((z) ^ ((x) & ((y) ^ (z)))) |
Value:
g_1(
p[(i + 14) & 15]) +
p[(i + 9) & 15] + g_0(
p[(i + 1) & 15]))
Definition at line 133 of file sha2.c.
#define maj |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| (((x) & (y)) | ((z) & ((x) ^ (y)))) |
#define rotl32 |
( |
|
x, |
|
|
|
n |
|
) |
| (((x) << n) | ((x) >> (32 - n))) |
#define rotr32 |
( |
|
x, |
|
|
|
n |
|
) |
| (((x) >> n) | ((x) << (32 - n))) |
Value:vf(7,i) += (j ?
hf(i) :
p[i]) + k_0[i+j] \
Definition at line 136 of file sha2.c.
#define vf |
( |
|
n, |
|
|
|
i |
|
) |
| v[(n - i) & 7] |