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

Go to the source code of this file.

Macros

#define MAYBE_CONST   const
 version 3.0 (December 2000) More...
 
#define QUARTER_ROUND(L, T, t, a, b, c, d)
 
#define QUARTER_ROUND_LE(t, a, b, c, d)
 
#define QUARTER_ROUND_LD(t, a, b, c, d)
 
#define QUARTER_ROUND_E(t, a, b, c, d)   QUARTER_ROUND(TL_M, Te, t, a, b, c, d)
 
#define QUARTER_ROUND_D(t, a, b, c, d)   QUARTER_ROUND(TL_M, Td, t, a, b, c, d)
 
#define QUARTER_ROUND_FE(t, a, b, c, d)   QUARTER_ROUND(TL_F, Te, t, d, c, b, a)
 
#define QUARTER_ROUND_FD(t, a, b, c, d)   QUARTER_ROUND(TL_F, Td, t, d, c, b, a)
 
#define TL_F(T, i, x)   rotrFixed(T[x], (3-i)*8)
 
#define TL_M(T, i, x)   T[i*256 + x]
 
#define f2(x)   ((x<<1)^(((x>>7)&1)*0x11b))
 
#define f4(x)   ((x<<2)^(((x>>6)&1)*0x11b)^(((x>>6)&2)*0x11b))
 
#define f8(x)   ((x<<3)^(((x>>5)&1)*0x11b)^(((x>>5)&2)*0x11b)^(((x>>5)&4)*0x11b))
 
#define f3(x)   (f2(x) ^ x)
 
#define f9(x)   (f8(x) ^ x)
 
#define fb(x)   (f8(x) ^ f2(x) ^ x)
 
#define fd(x)   (f8(x) ^ f4(x) ^ x)
 
#define fe(x)   (f8(x) ^ f4(x) ^ f2(x))
 
#define InverseMixColumn(x)   TL_M(Td, 0, Se[GETBYTE(x, 3)]) ^ TL_M(Td, 1, Se[GETBYTE(x, 2)]) ^ TL_M(Td, 2, Se[GETBYTE(x, 1)]) ^ TL_M(Td, 3, Se[GETBYTE(x, 0)])
 

Functions

 CRYPTOPP_ALIGN_DATA (16) static word32 Te[256 *4]
 

Macro Definition Documentation

#define f2 (   x)    ((x<<1)^(((x>>7)&1)*0x11b))

Definition at line 165 of file rijndael.cpp.

#define f3 (   x)    (f2(x) ^ x)

Definition at line 169 of file rijndael.cpp.

#define f4 (   x)    ((x<<2)^(((x>>6)&1)*0x11b)^(((x>>6)&2)*0x11b))

Definition at line 166 of file rijndael.cpp.

#define f8 (   x)    ((x<<3)^(((x>>5)&1)*0x11b)^(((x>>5)&2)*0x11b)^(((x>>5)&4)*0x11b))

Definition at line 167 of file rijndael.cpp.

#define f9 (   x)    (f8(x) ^ x)

Definition at line 170 of file rijndael.cpp.

#define fb (   x)    (f8(x) ^ f2(x) ^ x)

Definition at line 171 of file rijndael.cpp.

#define fd (   x)    (f8(x) ^ f4(x) ^ x)

Definition at line 172 of file rijndael.cpp.

#define fe (   x)    (f8(x) ^ f4(x) ^ f2(x))

Definition at line 173 of file rijndael.cpp.

#define InverseMixColumn (   x)    TL_M(Td, 0, Se[GETBYTE(x, 3)]) ^ TL_M(Td, 1, Se[GETBYTE(x, 2)]) ^ TL_M(Td, 2, Se[GETBYTE(x, 1)]) ^ TL_M(Td, 3, Se[GETBYTE(x, 0)])
#define MAYBE_CONST   const

version 3.0 (December 2000)

Optimised ANSI C code for the Rijndael cipher (now AES)

author Vincent Rijmen vince.nosp@m.nt.r.nosp@m.ijmen.nosp@m.@esa.nosp@m.t.kul.nosp@m.euve.nosp@m.n.ac..nosp@m.be author Antoon Bosselaers antoo.nosp@m.n.bo.nosp@m.ssela.nosp@m.ers@.nosp@m.esat..nosp@m.kule.nosp@m.uven..nosp@m.ac.b.nosp@m.e author Paulo Barreto paulo.nosp@m..bar.nosp@m.reto@.nosp@m.terr.nosp@m.a.com.nosp@m..br

This code is hereby placed in the public domain.

THIS SOFTWARE IS PROVIDED BY THE AUTHORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Definition at line 89 of file rijndael.cpp.

#define QUARTER_ROUND (   L,
  T,
  t,
  a,
  b,
  c,
  d 
)
Value:
a ^= L(T, 3, byte(t)); t >>= 8;\
b ^= L(T, 2, byte(t)); t >>= 8;\
c ^= L(T, 1, byte(t)); t >>= 8;\
d ^= L(T, 0, t);
#define T(i, x)
#define c(i)
#define a(i)
#define b(i, j)
uint8_t byte
Definition: Common.h:10
#define d(i)
Definition: sha.cpp:732

Definition at line 113 of file rijndael.cpp.

#define QUARTER_ROUND_D (   t,
  a,
  b,
  c,
  d 
)    QUARTER_ROUND(TL_M, Td, t, a, b, c, d)

Definition at line 140 of file rijndael.cpp.

#define QUARTER_ROUND_E (   t,
  a,
  b,
  c,
  d 
)    QUARTER_ROUND(TL_M, Te, t, a, b, c, d)

Definition at line 139 of file rijndael.cpp.

#define QUARTER_ROUND_FD (   t,
  a,
  b,
  c,
  d 
)    QUARTER_ROUND(TL_F, Td, t, d, c, b, a)

Definition at line 144 of file rijndael.cpp.

#define QUARTER_ROUND_FE (   t,
  a,
  b,
  c,
  d 
)    QUARTER_ROUND(TL_F, Te, t, d, c, b, a)

Definition at line 143 of file rijndael.cpp.

#define QUARTER_ROUND_LD (   t,
  a,
  b,
  c,
  d 
)
Value:
tempBlock[a] = Sd[byte(t)]; t >>= 8;\
tempBlock[b] = Sd[byte(t)]; t >>= 8;\
tempBlock[c] = Sd[byte(t)]; t >>= 8;\
tempBlock[d] = Sd[t];
#define c(i)
#define a(i)
#define b(i, j)
uint8_t byte
Definition: Common.h:10
#define d(i)
Definition: sha.cpp:732

Definition at line 132 of file rijndael.cpp.

#define QUARTER_ROUND_LE (   t,
  a,
  b,
  c,
  d 
)
Value:
tempBlock[a] = ((byte *)(Te+byte(t)))[1]; t >>= 8;\
tempBlock[b] = ((byte *)(Te+byte(t)))[1]; t >>= 8;\
tempBlock[c] = ((byte *)(Te+byte(t)))[1]; t >>= 8;\
tempBlock[d] = ((byte *)(Te+t))[1];
uint8_t byte
Definition: Common.h:57
#define c(i)
#define a(i)
#define b(i, j)
uint8_t byte
Definition: Common.h:10
#define d(i)
Definition: sha.cpp:732

Definition at line 119 of file rijndael.cpp.

#define TL_F (   T,
  i,
  x 
)    rotrFixed(T[x], (3-i)*8)

Definition at line 149 of file rijndael.cpp.

#define TL_M (   T,
  i,
  x 
)    T[i*256 + x]

Definition at line 150 of file rijndael.cpp.

Function Documentation

CRYPTOPP_ALIGN_DATA ( 16  )

Here is the caller graph for this function: