1
mirror of https://github.com/jedisct1/libsodium.git synced 2024-12-19 18:15:18 -07:00
This commit is contained in:
Frank Denis 2019-02-19 22:46:09 +01:00
parent 411ec2de84
commit d287ef763b

View File

@ -35,7 +35,7 @@ blake2b_compress_ref(blake2b_state *S, const uint8_t block[BLAKE2B_BLOCKBYTES])
int i; int i;
for (i = 0; i < 16; ++i) { for (i = 0; i < 16; ++i) {
m[i] = LOAD64_LE(block + i * sizeof(m[i])); m[i] = LOAD64_LE(block + i * sizeof m[i]);
} }
for (i = 0; i < 8; ++i) { for (i = 0; i < 8; ++i) {
v[i] = S->h[i]; v[i] = S->h[i];
@ -48,16 +48,16 @@ blake2b_compress_ref(blake2b_state *S, const uint8_t block[BLAKE2B_BLOCKBYTES])
v[13] = S->t[1] ^ blake2b_IV[5]; v[13] = S->t[1] ^ blake2b_IV[5];
v[14] = S->f[0] ^ blake2b_IV[6]; v[14] = S->f[0] ^ blake2b_IV[6];
v[15] = S->f[1] ^ blake2b_IV[7]; v[15] = S->f[1] ^ blake2b_IV[7];
#define G(r, i, a, b, c, d) \ #define G(r, i, a, b, c, d) \
do { \ do { \
a = a + b + m[blake2b_sigma[r][2 * i + 0]]; \ a += b + m[blake2b_sigma[r][2 * i + 0]]; \
d = ROTR64(d ^ a, 32); \ d = ROTR64(d ^ a, 32); \
c = c + d; \ c += d; \
b = ROTR64(b ^ c, 24); \ b = ROTR64(b ^ c, 24); \
a = a + b + m[blake2b_sigma[r][2 * i + 1]]; \ a += b + m[blake2b_sigma[r][2 * i + 1]]; \
d = ROTR64(d ^ a, 16); \ d = ROTR64(d ^ a, 16); \
c = c + d; \ c += d; \
b = ROTR64(b ^ c, 63); \ b = ROTR64(b ^ c, 63); \
} while (0) } while (0)
#define ROUND(r) \ #define ROUND(r) \
do { \ do { \