OpenZWave Library  1.4.3254
Macros
aesopt.h File Reference
#include "aes.h"
#include "brg_endian.h"
+ Include dependency graph for aesopt.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ENCRYPTION_IN_C   1
 
#define DECRYPTION_IN_C   2
 
#define ENC_KEYING_IN_C   4
 
#define DEC_KEYING_IN_C   8
 
#define NO_TABLES   0
 
#define ONE_TABLE   1
 
#define FOUR_TABLES   4
 
#define NONE   0
 
#define PARTIAL   1
 
#define FULL   2
 
#define ALGORITHM_BYTE_ORDER   PLATFORM_BYTE_ORDER
 
#define SAFE_IO
 
#define ENC_UNROLL   FULL
 
#define DEC_UNROLL   FULL
 
#define ENC_KS_UNROLL
 
#define DEC_KS_UNROLL
 
#define FF_TABLES
 
#define ARRAYS
 
#define FIXED_TABLES
 
#define to_byte(x)   ((x) & 0xff)
 
#define ENC_ROUND   FOUR_TABLES
 
#define LAST_ENC_ROUND   FOUR_TABLES
 
#define DEC_ROUND   FOUR_TABLES
 
#define LAST_DEC_ROUND   FOUR_TABLES
 
#define KEY_SCHED   FOUR_TABLES
 
#define AES_REV_DKS
 
#define s(x, c)   x[c]
 
#define EFUNCS_IN_C   ( ENCRYPTION_IN_C | ENC_KEYING_IN_C )
 
#define DFUNCS_IN_C   ( DECRYPTION_IN_C | DEC_KEYING_IN_C )
 
#define FUNCS_IN_C   ( EFUNCS_IN_C | DFUNCS_IN_C )
 
#define RC_LENGTH   (5 * (AES_BLOCK_SIZE / 4 - 2))
 
#define brot(x, n)    (((uint32_t)(x) << n) | ((uint32_t)(x) >> (32 - n)))
 
#define aes_sw32(x)   ((brot((x),8) & 0x00ff00ff) | (brot((x),24) & 0xff00ff00))
 
#define word_in(x, c)
 
#define word_out(x, c, v)
 
#define WPOLY   0x011b
 
#define BPOLY   0x1b
 
#define gf_c1   0x80808080
 
#define gf_c2   0x7f7f7f7f
 
#define gf_mulx(x)   ((((x) & gf_c2) << 1) ^ ((((x) & gf_c1) >> 7) * BPOLY))
 
#define FT4_SET
 
#define FL4_SET
 
#define IT4_SET
 
#define IL4_SET
 
#define IM4_SET
 
#define no_table(x, box, vf, rf, c)
 
#define one_table(x, op, tab, vf, rf, c)
 
#define four_tables(x, tab, vf, rf, c)
 
#define vf1(x, r, c)   (x)
 
#define rf1(r, c)    (r)
 
#define rf2(r, c)    ((8+r-c)&3)
 
#define dec_fmvars   uint32_t g2
 
#define fwd_mcol(x)    (g2 = gf_mulx(x), g2 ^ upr((x) ^ g2, 3) ^ upr((x), 2) ^ upr((x), 1))
 
#define inv_mcol(x)    four_tables(x,t_use(i,m),vf1,rf1,0)
 
#define ls_box(x, c)    four_tables(x,t_use(f,l),vf1,rf2,c)
 

Macro Definition Documentation

#define AES_REV_DKS
#define aes_sw32 (   x)    ((brot((x),8) & 0x00ff00ff) | (brot((x),24) & 0xff00ff00))
#define ALGORITHM_BYTE_ORDER   PLATFORM_BYTE_ORDER
#define ARRAYS
#define BPOLY   0x1b
#define brot (   x,
 
)    (((uint32_t)(x) << n) | ((uint32_t)(x) >> (32 - n)))
#define dec_fmvars   uint32_t g2
#define DEC_KEYING_IN_C   8
#define DEC_KS_UNROLL
#define DEC_ROUND   FOUR_TABLES
#define DEC_UNROLL   FULL
#define DECRYPTION_IN_C   2
#define DFUNCS_IN_C   ( DECRYPTION_IN_C | DEC_KEYING_IN_C )
#define EFUNCS_IN_C   ( ENCRYPTION_IN_C | ENC_KEYING_IN_C )
#define ENC_KEYING_IN_C   4
#define ENC_KS_UNROLL
#define ENC_ROUND   FOUR_TABLES
#define ENC_UNROLL   FULL
#define ENCRYPTION_IN_C   1
#define FF_TABLES
#define FIXED_TABLES
#define FL4_SET
#define FOUR_TABLES   4
#define four_tables (   x,
  tab,
  vf,
  rf,
 
)
Value:
( tab[0][bval(vf(x,0,c),rf(0,c))] \
^ tab[1][bval(vf(x,1,c),rf(1,c))] \
^ tab[2][bval(vf(x,2,c),rf(2,c))] \
^ tab[3][bval(vf(x,3,c),rf(3,c))])
#define FT4_SET
#define FULL   2
#define FUNCS_IN_C   ( EFUNCS_IN_C | DFUNCS_IN_C )
#define fwd_mcol (   x)    (g2 = gf_mulx(x), g2 ^ upr((x) ^ g2, 3) ^ upr((x), 2) ^ upr((x), 1))
#define gf_c1   0x80808080
#define gf_c2   0x7f7f7f7f
#define gf_mulx (   x)    ((((x) & gf_c2) << 1) ^ ((((x) & gf_c1) >> 7) * BPOLY))
#define IL4_SET
#define IM4_SET
#define inv_mcol (   x)    four_tables(x,t_use(i,m),vf1,rf1,0)
#define IT4_SET
#define KEY_SCHED   FOUR_TABLES
#define LAST_DEC_ROUND   FOUR_TABLES
#define LAST_ENC_ROUND   FOUR_TABLES
#define ls_box (   x,
 
)    four_tables(x,t_use(f,l),vf1,rf2,c)
#define no_table (   x,
  box,
  vf,
  rf,
 
)
Value:
bytes2word( \
box[bval(vf(x,0,c),rf(0,c))], \
box[bval(vf(x,1,c),rf(1,c))], \
box[bval(vf(x,2,c),rf(2,c))], \
box[bval(vf(x,3,c),rf(3,c))])
#define NO_TABLES   0
#define NONE   0
#define ONE_TABLE   1
#define one_table (   x,
  op,
  tab,
  vf,
  rf,
 
)
Value:
( tab[bval(vf(x,0,c),rf(0,c))] \
^ op(tab[bval(vf(x,1,c),rf(1,c))],1) \
^ op(tab[bval(vf(x,2,c),rf(2,c))],2) \
^ op(tab[bval(vf(x,3,c),rf(3,c))],3))
#define PARTIAL   1
#define RC_LENGTH   (5 * (AES_BLOCK_SIZE / 4 - 2))
#define rf1 (   r,
 
)    (r)
#define rf2 (   r,
 
)    ((8+r-c)&3)
#define s (   x,
 
)    x[c]
#define SAFE_IO
#define to_byte (   x)    ((x) & 0xff)
#define vf1 (   x,
  r,
 
)    (x)
#define word_in (   x,
 
)
Value:
bytes2word(((const uint8_t*)(x)+4*c)[0], ((const uint8_t*)(x)+4*c)[1], \
((const uint8_t*)(x)+4*c)[2], ((const uint8_t*)(x)+4*c)[3])
#define word_out (   x,
  c,
  v 
)
Value:
{ ((uint8_t*)(x)+4*c)[0] = bval(v,0); ((uint8_t*)(x)+4*c)[1] = bval(v,1); \
((uint8_t*)(x)+4*c)[2] = bval(v,2); ((uint8_t*)(x)+4*c)[3] = bval(v,3); }
#define v(n, i)
Definition: aeskey.c:224
#define WPOLY   0x011b