Fabcoin Core  0.16.2
P2P Digital Currency
Macros | Functions
serpentp.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define LT(i, a, b, c, d, e)
 
#define ILT(i, a, b, c, d, e)
 
#define beforeS0(f)   f(0,a,b,c,d,e)
 
#define afterS0(f)   f(1,b,e,c,a,d)
 
#define afterS1(f)   f(2,c,b,a,e,d)
 
#define afterS2(f)   f(3,a,e,b,d,c)
 
#define afterS3(f)   f(4,e,b,d,c,a)
 
#define afterS4(f)   f(5,b,a,e,c,d)
 
#define afterS5(f)   f(6,a,c,b,e,d)
 
#define afterS6(f)   f(7,a,c,d,b,e)
 
#define afterS7(f)   f(8,d,e,b,a,c)
 
#define beforeI7(f)   f(8,a,b,c,d,e)
 
#define afterI7(f)   f(7,d,a,b,e,c)
 
#define afterI6(f)   f(6,a,b,c,e,d)
 
#define afterI5(f)   f(5,b,d,e,c,a)
 
#define afterI4(f)   f(4,b,c,e,a,d)
 
#define afterI3(f)   f(3,a,b,e,c,d)
 
#define afterI2(f)   f(2,b,d,e,c,a)
 
#define afterI1(f)   f(1,a,b,c,e,d)
 
#define afterI0(f)   f(0,a,d,b,e,c)
 
#define S0(i, r0, r1, r2, r3, r4)
 
#define I0(i, r0, r1, r2, r3, r4)
 
#define S1(i, r0, r1, r2, r3, r4)
 
#define I1(i, r0, r1, r2, r3, r4)
 
#define S2(i, r0, r1, r2, r3, r4)
 
#define I2(i, r0, r1, r2, r3, r4)
 
#define S3(i, r0, r1, r2, r3, r4)
 
#define I3(i, r0, r1, r2, r3, r4)
 
#define S4(i, r0, r1, r2, r3, r4)
 
#define I4(i, r0, r1, r2, r3, r4)
 
#define S5(i, r0, r1, r2, r3, r4)
 
#define I5(i, r0, r1, r2, r3, r4)
 
#define S6(i, r0, r1, r2, r3, r4)
 
#define I6(i, r0, r1, r2, r3, r4)
 
#define S7(i, r0, r1, r2, r3, r4)
 
#define I7(i, r0, r1, r2, r3, r4)
 
#define KX(r, a, b, c, d, e)
 
#define LK(r, a, b, c, d, e)
 
#define SK(r, a, b, c, d, e)
 

Functions

void Serpent_KeySchedule (word32 *k, unsigned int rounds, const byte *userKey, size_t keylen)
 

Macro Definition Documentation

#define afterI0 (   f)    f(0,a,d,b,e,c)

Definition at line 46 of file serpentp.h.

#define afterI1 (   f)    f(1,a,b,c,e,d)

Definition at line 45 of file serpentp.h.

#define afterI2 (   f)    f(2,b,d,e,c,a)

Definition at line 44 of file serpentp.h.

#define afterI3 (   f)    f(3,a,b,e,c,d)

Definition at line 43 of file serpentp.h.

#define afterI4 (   f)    f(4,b,c,e,a,d)

Definition at line 42 of file serpentp.h.

#define afterI5 (   f)    f(5,b,d,e,c,a)

Definition at line 41 of file serpentp.h.

#define afterI6 (   f)    f(6,a,b,c,e,d)

Definition at line 40 of file serpentp.h.

#define afterI7 (   f)    f(7,d,a,b,e,c)

Definition at line 39 of file serpentp.h.

#define afterS0 (   f)    f(1,b,e,c,a,d)

Definition at line 28 of file serpentp.h.

#define afterS1 (   f)    f(2,c,b,a,e,d)

Definition at line 29 of file serpentp.h.

#define afterS2 (   f)    f(3,a,e,b,d,c)

Definition at line 30 of file serpentp.h.

#define afterS3 (   f)    f(4,e,b,d,c,a)

Definition at line 31 of file serpentp.h.

#define afterS4 (   f)    f(5,b,a,e,c,d)

Definition at line 32 of file serpentp.h.

#define afterS5 (   f)    f(6,a,c,b,e,d)

Definition at line 33 of file serpentp.h.

#define afterS6 (   f)    f(7,a,c,d,b,e)

Definition at line 34 of file serpentp.h.

#define afterS7 (   f)    f(8,d,e,b,a,c)

Definition at line 35 of file serpentp.h.

#define beforeI7 (   f)    f(8,a,b,c,d,e)

Definition at line 38 of file serpentp.h.

#define beforeS0 (   f)    f(0,a,b,c,d,e)

Definition at line 27 of file serpentp.h.

#define I0 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r2 = ~r2; \
r4 = r1; \
r1 |= r0; \
r4 = ~r4; \
r1 ^= r2; \
r2 |= r4; \
r1 ^= r3; \
r0 ^= r4; \
r2 ^= r0; \
r0 &= r3; \
r4 ^= r0; \
r0 |= r1; \
r0 ^= r2; \
r3 ^= r4; \
r2 ^= r1; \
r3 ^= r0; \
r3 ^= r1; \
r2 &= r3; \
r4 ^= r2; \
}
#define r1(i)
#define r2(i)

Definition at line 73 of file serpentp.h.

#define I1 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r4 = r1; \
r1 ^= r3; \
r3 &= r1; \
r4 ^= r2; \
r3 ^= r0; \
r0 |= r1; \
r2 ^= r3; \
r0 ^= r4; \
r0 |= r2; \
r1 ^= r3; \
r0 ^= r1; \
r1 |= r3; \
r1 ^= r0; \
r4 = ~r4; \
r4 ^= r1; \
r1 |= r0; \
r1 ^= r0; \
r1 |= r4; \
r3 ^= r1; \
}
#define r1(i)
#define r2(i)

Definition at line 118 of file serpentp.h.

#define I2 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r2 ^= r3; \
r3 ^= r0; \
r4 = r3; \
r3 &= r2; \
r3 ^= r1; \
r1 |= r2; \
r1 ^= r4; \
r4 &= r3; \
r2 ^= r3; \
r4 &= r0; \
r4 ^= r2; \
r2 &= r1; \
r2 |= r0; \
r3 = ~r3; \
r2 ^= r3; \
r0 ^= r3; \
r0 &= r1; \
r3 ^= r4; \
r3 ^= r0; \
}
#define r1(i)
#define r2(i)

Definition at line 161 of file serpentp.h.

#define I3 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r4 = r2; \
r2 ^= r1; \
r1 &= r2; \
r1 ^= r0; \
r0 &= r4; \
r4 ^= r3; \
r3 |= r1; \
r3 ^= r2; \
r0 ^= r4; \
r2 ^= r0; \
r0 |= r3; \
r0 ^= r1; \
r4 ^= r2; \
r2 &= r3; \
r1 |= r3; \
r1 ^= r2; \
r4 ^= r0; \
r2 ^= r4; \
}
#define r1(i)
#define r2(i)

Definition at line 207 of file serpentp.h.

#define I4 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r4 = r2; \
r2 &= r3; \
r2 ^= r1; \
r1 |= r3; \
r1 &= r0; \
r4 ^= r2; \
r4 ^= r1; \
r1 &= r2; \
r0 = ~r0; \
r3 ^= r4; \
r1 ^= r3; \
r3 &= r0; \
r3 ^= r2; \
r0 ^= r1; \
r2 &= r0; \
r3 ^= r0; \
r2 ^= r4; \
r2 |= r3; \
r3 ^= r0; \
r2 ^= r1; \
}
#define r1(i)
#define r2(i)

Definition at line 253 of file serpentp.h.

#define I5 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r1 = ~r1; \
r4 = r3; \
r2 ^= r1; \
r3 |= r0; \
r3 ^= r2; \
r2 |= r1; \
r2 &= r0; \
r4 ^= r3; \
r2 ^= r4; \
r4 |= r0; \
r4 ^= r1; \
r1 &= r2; \
r1 ^= r3; \
r4 ^= r2; \
r3 &= r4; \
r4 ^= r1; \
r3 ^= r0; \
r3 ^= r4; \
r4 = ~r4; \
}
#define r1(i)
#define r2(i)

Definition at line 300 of file serpentp.h.

#define I6 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r0 ^= r2; \
r4 = r2; \
r2 &= r0; \
r4 ^= r3; \
r2 = ~r2; \
r3 ^= r1; \
r2 ^= r3; \
r4 |= r0; \
r0 ^= r2; \
r3 ^= r4; \
r4 ^= r1; \
r1 &= r3; \
r1 ^= r0; \
r0 ^= r3; \
r0 |= r2; \
r3 ^= r1; \
r4 ^= r0; \
}
#define r1(i)
#define r2(i)

Definition at line 345 of file serpentp.h.

#define I7 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r4 = r2; \
r2 ^= r0; \
r0 &= r3; \
r2 = ~r2; \
r4 |= r3; \
r3 ^= r1; \
r1 |= r0; \
r0 ^= r2; \
r2 &= r4; \
r1 ^= r2; \
r2 ^= r0; \
r0 |= r2; \
r3 &= r4; \
r0 ^= r3; \
r4 ^= r1; \
r3 ^= r4; \
r4 |= r0; \
r3 ^= r2; \
r4 ^= r2; \
}
#define r1(i)
#define r2(i)

Definition at line 390 of file serpentp.h.

#define ILT (   i,
  a,
  b,
  c,
  d,
  e 
)
Value:
{\
c = rotrFixed(c, 22); \
a = rotrFixed(a, 5); \
c ^= d ^ (b << 7); \
a ^= b ^ d; \
b = rotrFixed(b, 1); \
d = rotrFixed(d, 7) ^ c ^ (a << 3); \
b ^= a ^ c; \
c = rotrFixed(c, 3); \
a = rotrFixed(a, 13);}
#define c(i)
#define a(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 15 of file serpentp.h.

#define KX (   r,
  a,
  b,
  c,
  d,
  e 
)
Value:
{\
a ^= k[4 * r + 0]; \
b ^= k[4 * r + 1]; \
c ^= k[4 * r + 2]; \
d ^= k[4 * r + 3];}
#define c(i)
#define a(i)
#define b(i, j)
#define d(i)
Definition: sha.cpp:732

Definition at line 414 of file serpentp.h.

#define LK (   r,
  a,
  b,
  c,
  d,
  e 
)
Value:
{\
a = k[(8-r)*4 + 0]; \
b = k[(8-r)*4 + 1]; \
c = k[(8-r)*4 + 2]; \
d = k[(8-r)*4 + 3];}
#define c(i)
#define a(i)
#define b(i, j)
#define d(i)
Definition: sha.cpp:732

Definition at line 420 of file serpentp.h.

#define LT (   i,
  a,
  b,
  c,
  d,
  e 
)
Value:
{\
a = rotlFixed(a, 13); \
c = rotlFixed(c, 3); \
d = rotlFixed(d ^ c ^ (a << 3), 7); \
b = rotlFixed(b ^ a ^ c, 1); \
a = rotlFixed(a ^ b ^ d, 5); \
c = rotlFixed(c ^ d ^ (b << 7), 22);}
T rotlFixed(T x, unsigned int y)
Performs a left rotate.
Definition: misc.h:1263
#define c(i)
#define a(i)
#define b(i, j)
#define d(i)
Definition: sha.cpp:732

Definition at line 6 of file serpentp.h.

#define S0 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r3 ^= r0; \
r4 = r1; \
r1 &= r3; \
r4 ^= r2; \
r1 ^= r0; \
r0 |= r3; \
r0 ^= r4; \
r4 ^= r3; \
r3 ^= r2; \
r2 |= r1; \
r2 ^= r4; \
r4 = ~r4; \
r4 |= r1; \
r1 ^= r3; \
r1 ^= r4; \
r3 |= r0; \
r1 ^= r3; \
r4 ^= r3; \
}
#define r1(i)
#define r2(i)

Definition at line 51 of file serpentp.h.

#define S1 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r0 = ~r0; \
r2 = ~r2; \
r4 = r0; \
r0 &= r1; \
r2 ^= r0; \
r0 |= r3; \
r3 ^= r2; \
r1 ^= r0; \
r0 ^= r4; \
r4 |= r1; \
r1 ^= r3; \
r2 |= r0; \
r2 &= r4; \
r0 ^= r1; \
r1 &= r2; \
r1 ^= r0; \
r0 &= r2; \
r0 ^= r4; \
}
#define r1(i)
#define r2(i)

Definition at line 96 of file serpentp.h.

#define S2 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r4 = r0; \
r0 &= r2; \
r0 ^= r3; \
r2 ^= r1; \
r2 ^= r0; \
r3 |= r4; \
r3 ^= r1; \
r4 ^= r2; \
r1 = r3; \
r3 |= r4; \
r3 ^= r0; \
r0 &= r1; \
r4 ^= r0; \
r1 ^= r3; \
r1 ^= r4; \
r4 = ~r4; \
}
#define r1(i)
#define r2(i)

Definition at line 141 of file serpentp.h.

#define S3 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r4 = r0; \
r0 |= r3; \
r3 ^= r1; \
r1 &= r4; \
r4 ^= r2; \
r2 ^= r3; \
r3 &= r0; \
r4 |= r1; \
r3 ^= r4; \
r0 ^= r1; \
r4 &= r0; \
r1 ^= r3; \
r4 ^= r2; \
r1 |= r0; \
r1 ^= r2; \
r0 ^= r3; \
r2 = r1; \
r1 |= r3; \
r1 ^= r0; \
}
#define r1(i)
#define r2(i)

Definition at line 184 of file serpentp.h.

#define S4 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r1 ^= r3; \
r3 = ~r3; \
r2 ^= r3; \
r3 ^= r0; \
r4 = r1; \
r1 &= r3; \
r1 ^= r2; \
r4 ^= r3; \
r0 ^= r4; \
r2 &= r4; \
r2 ^= r0; \
r0 &= r1; \
r3 ^= r0; \
r4 |= r1; \
r4 ^= r0; \
r0 |= r3; \
r0 ^= r2; \
r2 &= r3; \
r0 = ~r0; \
r4 ^= r2; \
}
#define r1(i)
#define r2(i)

Definition at line 229 of file serpentp.h.

#define S5 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r0 ^= r1; \
r1 ^= r3; \
r3 = ~r3; \
r4 = r1; \
r1 &= r0; \
r2 ^= r3; \
r1 ^= r2; \
r2 |= r4; \
r4 ^= r3; \
r3 &= r1; \
r3 ^= r0; \
r4 ^= r1; \
r4 ^= r2; \
r2 ^= r0; \
r0 &= r3; \
r2 = ~r2; \
r0 ^= r4; \
r4 |= r3; \
r2 ^= r4; \
}
#define r1(i)
#define r2(i)

Definition at line 277 of file serpentp.h.

#define S6 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r2 = ~r2; \
r4 = r3; \
r3 &= r0; \
r0 ^= r4; \
r3 ^= r2; \
r2 |= r4; \
r1 ^= r3; \
r2 ^= r0; \
r0 |= r1; \
r2 ^= r1; \
r4 ^= r0; \
r0 |= r3; \
r0 ^= r2; \
r4 ^= r3; \
r4 ^= r0; \
r3 = ~r3; \
r2 &= r4; \
r2 ^= r3; \
}
#define r1(i)
#define r2(i)

Definition at line 323 of file serpentp.h.

#define S7 (   i,
  r0,
  r1,
  r2,
  r3,
  r4 
)
Value:
{ \
r4 = r2; \
r2 &= r1; \
r2 ^= r3; \
r3 &= r1; \
r4 ^= r2; \
r2 ^= r1; \
r1 ^= r0; \
r0 |= r4; \
r0 ^= r2; \
r3 ^= r1; \
r2 ^= r3; \
r3 &= r0; \
r3 ^= r4; \
r4 ^= r2; \
r2 &= r0; \
r4 = ~r4; \
r2 ^= r4; \
r4 &= r0; \
r1 ^= r3; \
r4 ^= r1; \
}
#define r1(i)
#define r2(i)

Definition at line 366 of file serpentp.h.

#define SK (   r,
  a,
  b,
  c,
  d,
  e 
)
Value:
{\
k[(8-r)*4 + 4] = a; \
k[(8-r)*4 + 5] = b; \
k[(8-r)*4 + 6] = c; \
k[(8-r)*4 + 7] = d;}
#define c(i)
#define a(i)
#define b(i, j)
#define d(i)
Definition: sha.cpp:732

Definition at line 426 of file serpentp.h.

Function Documentation

void Serpent_KeySchedule ( word32 k,
unsigned int  rounds,
const byte userKey,
size_t  keylen 
)

Definition at line 13 of file serpent.cpp.

Here is the call graph for this function:

Here is the caller graph for this function: