Fabcoin Core  0.16.2
P2P Digital Currency
Macros | Typedefs
twofish.cpp File Reference
#include "pch.h"
#include "twofish.h"
#include "secblock.h"
#include "misc.h"
Include dependency graph for twofish.cpp:

Go to the source code of this file.

Macros

#define Q(a, b, c, d, t)   q[a][GETBYTE(t,0)] ^ (q[b][GETBYTE(t,1)] << 8) ^ (q[c][GETBYTE(t,2)] << 16) ^ (q[d][GETBYTE(t,3)] << 24)
 
#define G1(x)   (m_s[0*256+GETBYTE(x,0)] ^ m_s[1*256+GETBYTE(x,1)] ^ m_s[2*256+GETBYTE(x,2)] ^ m_s[3*256+GETBYTE(x,3)])
 
#define G2(x)   (m_s[0*256+GETBYTE(x,3)] ^ m_s[1*256+GETBYTE(x,0)] ^ m_s[2*256+GETBYTE(x,1)] ^ m_s[3*256+GETBYTE(x,2)])
 
#define ENCROUND(n, a, b, c, d)
 
#define ENCCYCLE(n)
 
#define DECROUND(n, a, b, c, d)
 
#define DECCYCLE(n)
 

Typedefs

typedef BlockGetAndPut< word32, LittleEndianBlock
 

Macro Definition Documentation

#define DECCYCLE (   n)
Value:
DECROUND (2 * (n) + 1, c, d, a, b); \
DECROUND (2 * (n), a, b, c, d)
#define c(i)
#define a(i)
#define b(i, j)
#define DECROUND(n, a, b, c, d)
Definition: twofish.cpp:97
#define d(i)
Definition: sha.cpp:732

Definition at line 105 of file twofish.cpp.

#define DECROUND (   n,
  a,
  b,
  c,
  d 
)
Value:
x = G1 (a); y = G2 (b); \
x += y; y += x; \
(d) ^= y + k[2 * (n) + 1]; \
(d) = rotrFixed(d, 1); \
(c) = rotlFixed(c, 1); \
(c) ^= (x + k[2 * (n)])
#define G2(x)
Definition: twofish.cpp:84
T rotlFixed(T x, unsigned int y)
Performs a left rotate.
Definition: misc.h:1263
#define c(i)
#define G1(x)
Definition: twofish.cpp:83
#define a(i)
#define x(i)
#define b(i, j)
#define d(i)
Definition: sha.cpp:732
T rotrFixed(T x, unsigned int y)
Performs a right rotate.
Definition: misc.h:1285

Definition at line 97 of file twofish.cpp.

#define ENCCYCLE (   n)
Value:
ENCROUND (2 * (n), a, b, c, d); \
ENCROUND (2 * (n) + 1, c, d, a, b)
#define c(i)
#define a(i)
#define ENCROUND(n, a, b, c, d)
Definition: twofish.cpp:86
#define b(i, j)
#define d(i)
Definition: sha.cpp:732

Definition at line 93 of file twofish.cpp.

#define ENCROUND (   n,
  a,
  b,
  c,
  d 
)
Value:
x = G1 (a); y = G2 (b); \
x += y; y += x + k[2 * (n) + 1]; \
(c) ^= x + k[2 * (n)]; \
(c) = rotrFixed(c, 1); \
(d) = rotlFixed(d, 1) ^ y
#define G2(x)
Definition: twofish.cpp:84
T rotlFixed(T x, unsigned int y)
Performs a left rotate.
Definition: misc.h:1263
#define c(i)
#define G1(x)
Definition: twofish.cpp:83
#define a(i)
#define x(i)
#define b(i, j)
#define d(i)
Definition: sha.cpp:732
T rotrFixed(T x, unsigned int y)
Performs a right rotate.
Definition: misc.h:1285

Definition at line 86 of file twofish.cpp.

#define G1 (   x)    (m_s[0*256+GETBYTE(x,0)] ^ m_s[1*256+GETBYTE(x,1)] ^ m_s[2*256+GETBYTE(x,2)] ^ m_s[3*256+GETBYTE(x,3)])

Definition at line 83 of file twofish.cpp.

#define G2 (   x)    (m_s[0*256+GETBYTE(x,3)] ^ m_s[1*256+GETBYTE(x,0)] ^ m_s[2*256+GETBYTE(x,1)] ^ m_s[3*256+GETBYTE(x,2)])

Definition at line 84 of file twofish.cpp.

#define Q (   a,
  b,
  c,
  d,
 
)    q[a][GETBYTE(t,0)] ^ (q[b][GETBYTE(t,1)] << 8) ^ (q[c][GETBYTE(t,2)] << 16) ^ (q[d][GETBYTE(t,3)] << 24)

Typedef Documentation

Definition at line 109 of file twofish.cpp.