Fabcoin Core  0.16.2
P2P Digital Currency
Macros
camellia.cpp File Reference
#include "pch.h"
#include "config.h"
#include "camellia.h"
#include "misc.h"
#include "cpu.h"
Include dependency graph for camellia.cpp:

Go to the source code of this file.

Macros

#define SLOW_ROUND(lh, ll, rh, rl, kh, kl)
 
#define ROUND(lh, ll, rh, rl, kh, kl)
 
#define DOUBLE_ROUND(lh, ll, rh, rl, k0, k1, k2, k3)
 
#define EFI(i)   (1-(i))
 
#define CALC_ADDR2(base, i, j)   ((byte *)(base)+8*(i)+4*(j)+((-16*(i))&m))
 
#define CALC_ADDR(base, i)   CALC_ADDR2(base, i, 0)
 
#define PREPARE_KS_ROUNDS
 
#define KS_ROUND_0(i)
 
#define KS_ROUND(i, r, which)
 
#define KS(i, j)   ks[i*4 + EFI(j/2)*2 + EFI(j%2)]
 
#define FL(klh, kll, krh, krl)
 

Macro Definition Documentation

#define CALC_ADDR (   base,
 
)    CALC_ADDR2(base, i, 0)
#define CALC_ADDR2 (   base,
  i,
 
)    ((byte *)(base)+8*(i)+4*(j)+((-16*(i))&m))
#define DOUBLE_ROUND (   lh,
  ll,
  rh,
  rl,
  k0,
  k1,
  k2,
  k3 
)
Value:
ROUND(lh, ll, rh, rl, k0, k1) \
ROUND(rh, rl, lh, ll, k2, k3)
#define k3
Definition: ripemd.cpp:21
#define ROUND(lh, ll, rh, rl, kh, kl)
Definition: camellia.cpp:49
#define k0
Definition: ripemd.cpp:18
#define k2
Definition: ripemd.cpp:20
#define k1
Definition: ripemd.cpp:19

Definition at line 59 of file camellia.cpp.

#define EFI (   i)    (1-(i))

Definition at line 64 of file camellia.cpp.

#define FL (   klh,
  kll,
  krh,
  krl 
)
Value:
ll ^= rotlFixed(lh & klh, 1); \
lh ^= (ll | kll); \
rh ^= (rl | krl); \
rl ^= rotlFixed(rh & krh, 1);
T rotlFixed(T x, unsigned int y)
Performs a left rotate.
Definition: misc.h:1263
#define KS (   i,
 
)    ks[i*4 + EFI(j/2)*2 + EFI(j%2)]
#define KS_ROUND (   i,
  r,
  which 
)
Value:
CRYPTOPP_ASSERT(IsAlignedOn(CALC_ADDR(ks32, i+EFI(r<64)),GetAlignmentOf<word64>())); \
CRYPTOPP_ASSERT(IsAlignedOn(CALC_ADDR(ks32, i+EFI(r>64)),GetAlignmentOf<word64>())); \
if (which & (1<<int(r<64))) *(word64*)(void*)CALC_ADDR(ks32, i+EFI(r<64)) = (kwr << (r%64)) | (kwl >> (64 - (r%64))); \
if (which & (1<<int(r>64))) *(word64*)(void*)CALC_ADDR(ks32, i+EFI(r>64)) = (kwl << (r%64)) | (kwr >> (64 - (r%64)))
#define EFI(i)
Definition: camellia.cpp:64
if(a.IndicesBefore(b, len, lenIndices))
Definition: equihash.cpp:243
bool IsAlignedOn(const void *ptr, unsigned int alignment)
Determines whether ptr is aligned to a minimum value.
Definition: misc.h:954
unsigned long long word64
Definition: config.h:240
#define CRYPTOPP_ASSERT(exp)
Definition: trap.h:92
#define CALC_ADDR(base, i)
#define KS_ROUND_0 (   i)
Value:
CRYPTOPP_ASSERT(IsAlignedOn(CALC_ADDR(ks32, i+EFI(0)),GetAlignmentOf<word64>())); \
CRYPTOPP_ASSERT(IsAlignedOn(CALC_ADDR(ks32, i+EFI(1)),GetAlignmentOf<word64>())); \
*(word64*)(void*)CALC_ADDR(ks32, i+EFI(0)) = kwl; \
*(word64*)(void*)CALC_ADDR(ks32, i+EFI(1)) = kwr
#define EFI(i)
Definition: camellia.cpp:64
bool IsAlignedOn(const void *ptr, unsigned int alignment)
Determines whether ptr is aligned to a minimum value.
Definition: misc.h:954
unsigned long long word64
Definition: config.h:240
#define CRYPTOPP_ASSERT(exp)
Definition: trap.h:92
#define CALC_ADDR(base, i)
#define PREPARE_KS_ROUNDS
Value:
kwl = (word64(k0) << 32) | k1; \
kwr = (word64(k2) << 32) | k3
#define k3
Definition: ripemd.cpp:21
#define k0
Definition: ripemd.cpp:18
unsigned long long word64
Definition: config.h:240
#define k2
Definition: ripemd.cpp:20
#define k1
Definition: ripemd.cpp:19
#define ROUND (   lh,
  ll,
  rh,
  rl,
  kh,
  kl 
)
Value:
{ \
word32 th = lh ^ kh; \
word32 tl = ll ^ kl; \
word32 d = SP[0][GETBYTE(tl,0)] ^ SP[1][GETBYTE(tl,3)] ^ SP[2][GETBYTE(tl,2)] ^ SP[3][GETBYTE(tl,1)]; \
word32 u = SP[0][GETBYTE(th,3)] ^ SP[1][GETBYTE(th,2)] ^ SP[2][GETBYTE(th,1)] ^ SP[3][GETBYTE(th,0)]; \
d ^= u; \
rh ^= d; \
rl ^= d; \
rl ^= rotrFixed(u, 8);}
#define GETBYTE(x, y)
Definition: misc.h:610
#define d(i)
Definition: sha.cpp:732
unsigned int word32
Definition: config.h:231
T rotrFixed(T x, unsigned int y)
Performs a right rotate.
Definition: misc.h:1285

Definition at line 49 of file camellia.cpp.

#define SLOW_ROUND (   lh,
  ll,
  rh,
  rl,
  kh,
  kl 
)
Value:
{ \
word32 zr = ll ^ kl; \
word32 zl = lh ^ kh; \
zr= rotlFixed(s1[GETBYTE(zr, 3)], 1) | \
(rotrFixed(s1[GETBYTE(zr, 2)], 1) << 24) | \
(s1[rotlFixed(CRYPTOPP_GET_BYTE_AS_BYTE(zr, 1),1)] << 16) | \
(s1[GETBYTE(zr, 0)] << 8); \
zl= (s1[GETBYTE(zl, 3)] << 24) | \
(rotlFixed(s1[GETBYTE(zl, 2)], 1) << 16) | \
(rotrFixed(s1[GETBYTE(zl, 1)], 1) << 8) | \
zl ^= zr; \
zr = zl ^ rotlFixed(zr, 8); \
zl = zr ^ rotrFixed(zl, 8); \
rh ^= rotlFixed(zr, 16); \
rh ^= zl; \
rl ^= rotlFixed(zl, 8); \
}
T rotlFixed(T x, unsigned int y)
Performs a left rotate.
Definition: misc.h:1263
#define GETBYTE(x, y)
Definition: misc.h:610
#define CRYPTOPP_GET_BYTE_AS_BYTE(x, y)
Definition: misc.h:615
unsigned int word32
Definition: config.h:231
#define s1(x)
Definition: sha256.c:70
T rotrFixed(T x, unsigned int y)
Performs a right rotate.
Definition: misc.h:1285

Definition at line 29 of file camellia.cpp.