OpenZWave Library  1.4.5216
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros | Functions
aescrypt.c File Reference
#include "aesopt.h"
#include "aestab.h"
+ Include dependency graph for aescrypt.c:

Macros

#define aes_xi(x)   aes_ ## x
 
#define si(y, x, k, c)   (s(y,c) = word_in(x, c) ^ (k)[c])
 
#define so(y, x, c)   word_out(y, c, s(x,c))
 
#define locals(y, x)   x[4],y[4]
 
#define l_copy(y, x)
 
#define state_in(y, x, k)   si(y,x,k,0); si(y,x,k,1); si(y,x,k,2); si(y,x,k,3)
 
#define state_out(y, x)   so(y,x,0); so(y,x,1); so(y,x,2); so(y,x,3)
 
#define round(rm, y, x, k)   rm(y,x,k,0); rm(y,x,k,1); rm(y,x,k,2); rm(y,x,k,3)
 
#define fwd_var(x, r, c)
 
#define fwd_rnd(y, x, k, c)   (s(y,c) = (k)[c] ^ four_tables(x,t_use(f,n),fwd_var,rf1,c))
 
#define fwd_lrnd(y, x, k, c)   (s(y,c) = (k)[c] ^ four_tables(x,t_use(f,l),fwd_var,rf1,c))
 
#define inv_var(x, r, c)
 
#define inv_rnd(y, x, k, c)   (s(y,c) = (k)[c] ^ four_tables(x,t_use(i,n),inv_var,rf1,c))
 
#define inv_lrnd(y, x, k, c)   (s(y,c) = (k)[c] ^ four_tables(x,t_use(i,l),inv_var,rf1,c))
 
#define key_ofs   0
 
#define rnd_key(n)   (kp + n * N_COLS)
 

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

#define aes_xi (   x)    aes_ ## x
#define fwd_lrnd (   y,
  x,
  k,
 
)    (s(y,c) = (k)[c] ^ four_tables(x,t_use(f,l),fwd_var,rf1,c))
#define fwd_rnd (   y,
  x,
  k,
 
)    (s(y,c) = (k)[c] ^ four_tables(x,t_use(f,n),fwd_var,rf1,c))
#define fwd_var (   x,
  r,
 
)
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)))
#define s(x, c)
Definition: aesopt.h:483
#define inv_lrnd (   y,
  x,
  k,
 
)    (s(y,c) = (k)[c] ^ four_tables(x,t_use(i,l),inv_var,rf1,c))
#define inv_rnd (   y,
  x,
  k,
 
)    (s(y,c) = (k)[c] ^ four_tables(x,t_use(i,n),inv_var,rf1,c))
#define inv_var (   x,
  r,
 
)
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)))
#define s(x, c)
Definition: aesopt.h:483
#define key_ofs   0
#define l_copy (   y,
 
)
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);
#define s(x, c)
Definition: aesopt.h:483
#define locals (   y,
 
)    x[4],y[4]
#define rnd_key (   n)    (kp + n * N_COLS)
#define round (   rm,
  y,
  x,
 
)    rm(y,x,k,0); rm(y,x,k,1); rm(y,x,k,2); rm(y,x,k,3)
#define si (   y,
  x,
  k,
 
)    (s(y,c) = word_in(x, c) ^ (k)[c])
#define so (   y,
  x,
 
)    word_out(y, c, s(x,c))
#define state_in (   y,
  x,
 
)    si(y,x,k,0); si(y,x,k,1); si(y,x,k,2); si(y,x,k,3)
#define state_out (   y,
 
)    so(y,x,0); so(y,x,1); so(y,x,2); so(y,x,3)

Function Documentation

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