#include "pch.h"
#include "config.h"
#include "whrlpool.h"
#include "misc.h"
#include "cpu.h"
Go to the source code of this file.
|
#define | R 10 |
|
#define | KSL(op, i, a, b, c, d) |
|
#define | KSH(op, i, a, b, c, d) |
|
#define | TSL(op, i, a, b, c, d) |
|
#define | TSH_OP(op, a, b) |
|
#define | TSH(op, i, a, b, c, d) |
|
#define KSH |
( |
|
op, |
|
|
|
i, |
|
|
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d |
|
) |
| |
Value:t = (
word32)(k[(i+4)%8]>>32);\
t >>= 8;\
w##b = Whirlpool_C[2*256 + (byte)t] ^ (op ? w##b : rotrFixed(w##b, 32));\
if (op==2) k[b] = w##b;\
t >>= 8;\
w##c = Whirlpool_C[1*256 + (byte)t] ^ (op ? w##c : rotrFixed(w##c, 32));\
if (op==2) k[c] = w##c;\
t >>= 8;\
w##d = Whirlpool_C[0*256 + t] ^ (op ? w##d : rotrFixed(w##d, 32));\
if (op==2) k[d] = w##d;\
if(a.IndicesBefore(b, len, lenIndices))
T rotrFixed(T x, unsigned int y)
Performs a right rotate.
#define KSL |
( |
|
op, |
|
|
|
i, |
|
|
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d |
|
) |
| |
Value: w##
a = Whirlpool_C[3*256 + (
byte)t] ^ (op ? w##
a : 0);\
t >>= 8;\
w##
b = Whirlpool_C[2*256 + (
byte)t] ^ (op ? w##
b : 0);\
t >>= 8;\
w##
c = Whirlpool_C[1*256 + (
byte)t] ^ (op ? w##
c : 0);\
t >>= 8;\
w##
d = Whirlpool_C[0*256 + t] ^ (op ? w##
d : 0);
#define TSH |
( |
|
op, |
|
|
|
i, |
|
|
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d |
|
) |
| |
#define TSH_OP |
( |
|
op, |
|
|
|
a, |
|
|
|
b |
|
) |
| |
Value: if (op==3) digest[a] ^= w##a;\
if(a.IndicesBefore(b, len, lenIndices))
T rotrFixed(T x, unsigned int y)
Performs a right rotate.
#define TSL |
( |
|
op, |
|
|
|
i, |
|
|
|
a, |
|
|
|
b, |
|
|
|
c, |
|
|
|
d |
|
) |
| |
Value: w##
a = Whirlpool_C[3*256 + (
byte)t] ^ (op ? w##
a : 0);\
t >>= 8;\
w##
b = Whirlpool_C[2*256 + (
byte)t] ^ (op ? w##
b : 0);\
t >>= 8;\
w##
c = Whirlpool_C[1*256 + (
byte)t] ^ (op ? w##
c : 0);\
t >>= 8;\
w##
d = Whirlpool_C[0*256 + t] ^ (op ? w##
d : 0);