OpenZWave Library 1.4.0
Loading...
Searching...
No Matches
aescrypt.c File Reference
#include "aesopt.h"
#include "aestab.h"
Include dependency graph for aescrypt.c:

Macros

#define aes_xi(x)
#define si(y, x, k, c)
#define so(y, x, c)
#define locals(y, x)
#define l_copy(y, x)
#define state_in(y, x, k)
#define state_out(y, x)
#define round(rm, y, x, k)
#define fwd_var(x, r, c)
#define fwd_rnd(y, x, k, c)
#define fwd_lrnd(y, x, k, c)
#define inv_var(x, r, c)
#define inv_rnd(y, x, k, c)
#define inv_lrnd(y, x, k, c)
#define key_ofs   0
#define rnd_key(n)

Functions

AES_RETURN aes_xi encrypt (const unsigned char *in, unsigned char *out, const aes_encrypt_ctx cx[1])
AES_RETURN aes_xi decrypt (const unsigned char *in, unsigned char *out, const aes_decrypt_ctx cx[1])

Macro Definition Documentation

◆ aes_xi

#define aes_xi ( x)
Value:
aes_ ## x

◆ fwd_lrnd

#define fwd_lrnd ( y,
x,
k,
c )
Value:
(s(y,c) = (k)[c] ^ four_tables(x,t_use(f,l),fwd_var,rf1,c))
#define fwd_var(x, r, c)
Definition aescrypt.c:73
#define s(x, c)
Definition aesopt.h:483
#define four_tables(x, tab, vf, rf, c)
Definition aesopt.h:717
#define rf1(r, c)
Definition aesopt.h:724
#define t_use(m, n)
Definition aestab.h:70

◆ fwd_rnd

#define fwd_rnd ( y,
x,
k,
c )
Value:
(s(y,c) = (k)[c] ^ four_tables(x,t_use(f,n),fwd_var,rf1,c))

◆ fwd_var

#define fwd_var ( x,
r,
c )
Value:
( r == 0 ? ( c == 0 ? s(x,0) : c == 1 ? s(x,1) : c == 2 ? s(x,2) : s(x,3))\
: r == 1 ? ( c == 0 ? s(x,1) : c == 1 ? s(x,2) : c == 2 ? s(x,3) : s(x,0))\
: r == 2 ? ( c == 0 ? s(x,2) : c == 1 ? s(x,3) : c == 2 ? s(x,0) : s(x,1))\
: ( c == 0 ? s(x,3) : c == 1 ? s(x,0) : c == 2 ? s(x,1) : s(x,2)))

◆ inv_lrnd

#define inv_lrnd ( y,
x,
k,
c )
Value:
(s(y,c) = (k)[c] ^ four_tables(x,t_use(i,l),inv_var,rf1,c))
#define inv_var(x, r, c)
Definition aescrypt.c:190

◆ inv_rnd

#define inv_rnd ( y,
x,
k,
c )
Value:
(s(y,c) = (k)[c] ^ four_tables(x,t_use(i,n),inv_var,rf1,c))

◆ inv_var

#define inv_var ( x,
r,
c )
Value:
( r == 0 ? ( c == 0 ? s(x,0) : c == 1 ? s(x,1) : c == 2 ? s(x,2) : s(x,3))\
: r == 1 ? ( c == 0 ? s(x,3) : c == 1 ? s(x,0) : c == 2 ? s(x,1) : s(x,2))\
: r == 2 ? ( c == 0 ? s(x,2) : c == 1 ? s(x,3) : c == 2 ? s(x,0) : s(x,1))\
: ( c == 0 ? s(x,1) : c == 1 ? s(x,2) : c == 2 ? s(x,3) : s(x,0)))

◆ key_ofs

#define key_ofs   0

◆ l_copy

#define l_copy ( y,
x )
Value:
s(y,0) = s(x,0); s(y,1) = s(x,1); \
s(y,2) = s(x,2); s(y,3) = s(x,3);

◆ locals

#define locals ( y,
x )
Value:
x[4],y[4]

◆ rnd_key

#define rnd_key ( n)
Value:
(kp + n * N_COLS)
#define N_COLS
Definition aes.h:49

◆ round

#define round ( rm,
y,
x,
k )
Value:
rm(y,x,k,0); rm(y,x,k,1); rm(y,x,k,2); rm(y,x,k,3)

◆ si

#define si ( y,
x,
k,
c )
Value:
(s(y,c) = word_in(x, c) ^ (k)[c])
#define word_in(x, c)
Definition aesopt.h:587

◆ so

#define so ( y,
x,
c )
Value:
word_out(y, c, s(x,c))
#define word_out(x, c, v)
Definition aesopt.h:589

◆ state_in

#define state_in ( y,
x,
k )
Value:
si(y,x,k,0); si(y,x,k,1); si(y,x,k,2); si(y,x,k,3)
#define si(y, x, k, c)
Definition aescrypt.c:36

◆ state_out

#define state_out ( y,
x )
Value:
so(y,x,0); so(y,x,1); so(y,x,2); so(y,x,3)
#define so(y, x, c)
Definition aescrypt.c:37

Function Documentation

◆ decrypt()

AES_RETURN aes_xi decrypt ( const unsigned char * in,
unsigned char * out,
const aes_decrypt_ctx cx[1] )

◆ encrypt()

AES_RETURN aes_xi encrypt ( const unsigned char * in,
unsigned char * out,
const aes_encrypt_ctx cx[1] )