Main Page Modules Namespace List Class Hierarchy Alphabetical List Compound List File List Namespace Members Compound Members File Members Related Pages

# aescrypt.c File Reference

`#include "aesopt.h"`

Include dependency graph for aescrypt.c:

## Defines
#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))
## Functions
int | aes_encrypt (const void *in_blk, void *out_blk, const aes_encrypt_ctx cx)
int | aes_decrypt (const void *in_blk, void *out_blk, const aes_decrypt_ctx cx)

## Define Documentation

#define fwd_lrnd | ( | y,
|  | x,
|  | k,
|  | c |  | ) | (s(y,c) = (k)[c] ^ four_tables(x,t_use(f,l),fwd_var,rf1,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_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)))

#define inv_lrnd | ( | y,
|  | x,
|  | k,
|  | c |  | ) | (s(y,c) = (k)[c] ^ four_tables(x,t_use(i,l),inv_var,rf1,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_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)))

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

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

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

## Function Documentation

int aes_decrypt | ( | const void * | in_blk,
|  | void * | out_blk,
|  | const aes_decrypt_ctx | cx
| ) |

int aes_encrypt | ( | const void * | in_blk,
|  | void * | out_blk,
|  | const aes_encrypt_ctx | cx
| ) |