aescrypt.c File Reference
`#include "aesopt.h"`
`#include "aestab.h"`

## 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

## aes_xi

#define aes_xi | ( |  | x | ) | aes_ ## x

## fwd_lrnd

#define fwd_lrnd | ( |  | y,
|  |  | x,
|  |  | k,
|  |  | c
| ) |  | (s(y,c) = (k)[c] ^ four_tables(x,t_use(f,l),fwd_var,rf1,c))

## fwd_rnd

#define fwd_rnd | ( |  | y,
|  |  | x,
|  |  | k,
|  |  | c
| ) |  | (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)))
s
#define s(x, c)
Definition: aesopt.h:483

## inv_lrnd

#define inv_lrnd | ( |  | y,
|  |  | x,
|  |  | k,
|  |  | c
| ) |  | (s(y,c) = (k)[c] ^ four_tables(x,t_use(i,l),inv_var,rf1,c))

## inv_rnd

#define inv_rnd | ( |  | y,
|  |  | x,
|  |  | k,
|  |  | c
| ) |  | (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)))
s
#define s(x, c)
Definition: aesopt.h:483

## 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);
s
#define s(x, c)
Definition: aesopt.h:483

## locals

#define locals | ( |  | y,
|  |  | x
| ) |  | x[4],y[4]

## rnd_key

#define rnd_key | ( |  | n | ) | (kp + n * N_COLS)

## round

#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)

## si

#define si | ( |  | y,
|  |  | x,
|  |  | k,
|  |  | c
| ) |  | (s(y,c) = word_in(x, c) ^ (k)[c])

## so

#define so | ( |  | y,
|  |  | x,
|  |  | c
| ) |  | word_out(y, c, s(x,c))

## state_in

#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)

## state_out

#define state_out | ( |  | y,
|  |  | x
| ) |  | so(y,x,0); so(y,x,1); so(y,x,2); so(y,x,3)

## 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]
| ) |  |