Mobile API Reference  MicroStrategy 2019
aesopt.h File Reference
#include "aes.h"
#include <stdlib.h>
#include <sys/param.h>

Go to the source code of this file.

Macros

#define AES_LITTLE_ENDIAN   1234 /* byte 0 is least significant (i386) */
 
#define AES_BIG_ENDIAN   4321 /* byte 0 is most significant (mc68k) */
 
#define ENCRYPTION_KEY_SCHEDULE
 
#define DECRYPTION_KEY_SCHEDULE
 
#define ENCRYPTION
 
#define DECRYPTION
 
#define INTERNAL_BYTE_ORDER   PLATFORM_BYTE_ORDER
 
#define SAFE_IO
 
#define ENC_UNROLL   FULL
 
#define DEC_UNROLL   FULL
 
#define FIXED_TABLES
 
#define FF_TABLES
 
#define ARRAYS
 
#define s(x, c)   x[c]
 
#define FAST_VARIABLE
 
#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 NO_TABLES   0 /* DO NOT CHANGE */
 
#define ONE_TABLE   1 /* DO NOT CHANGE */
 
#define FOUR_TABLES   4 /* DO NOT CHANGE */
 
#define NONE   0 /* DO NOT CHANGE */
 
#define PARTIAL   1 /* DO NOT CHANGE */
 
#define FULL   2 /* DO NOT CHANGE */
 
#define RC_LENGTH   5 * AES_BLOCK_SIZE / 4 - (AES_BLOCK_SIZE == 16 ? 10 : 11)
 
#define word_in(x)   bytes2word((x)[0], (x)[1], (x)[2], (x)[3])
 
#define word_out(x, v)
 
#define WPOLY   0x011b
 
#define BPOLY   0x1b
 
#define m1   0x80808080
 
#define m2   0x7f7f7f7f
 
#define FFmulX(x)   ((((x) & m2) << 1) ^ ((((x) & m1) >> 7) * BPOLY))
 
#define FT4_SET
 
#define FL4_SET
 
#define IT4_SET
 
#define IL4_SET
 
#define LS4_SET
 
#define IM4_SET
 
#define prefx   extern const
 
#define nc   (AES_BLOCK_SIZE >> 2)
 
#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)   ((r-c)&3)
 
#define dec_fmvars
 
#define dec_fmvars   aes_32t f1, f2;
 
#define fwd_mcol(x)   (f1 = (x), f2 = FFmulX(f1), f2 ^ upr(f1 ^ f2, 3) ^ upr(f1, 2) ^ upr(f1, 1))
 
#define dec_imvars
 
#define inv_mcol(x)   four_tables(x,im_tab,vf1,rf1,0)
 
#define ls_box(x, c)   four_tables(x,fl_tab,vf1,rf2,c)
 

Variables

prefx aes_32t rcon_tab [29]
 
prefx aes_32t ft_tab [4][256]
 
prefx aes_32t fl_tab [4][256]
 
prefx aes_32t it_tab [4][256]
 
prefx aes_32t il_tab [4][256]
 
prefx aes_32t im_tab [4][256]
 

Macro Definition Documentation

◆ AES_BIG_ENDIAN

#define AES_BIG_ENDIAN   4321 /* byte 0 is most significant (mc68k) */

◆ AES_LITTLE_ENDIAN

#define AES_LITTLE_ENDIAN   1234 /* byte 0 is least significant (i386) */

◆ ARRAYS

#define ARRAYS

◆ BPOLY

#define BPOLY   0x1b

◆ dec_fmvars [1/2]

#define dec_fmvars

◆ dec_fmvars [2/2]

#define dec_fmvars   aes_32t f1, f2;

◆ dec_imvars

#define dec_imvars

◆ DEC_ROUND

#define DEC_ROUND   FOUR_TABLES

◆ DEC_UNROLL

#define DEC_UNROLL   FULL

◆ DECRYPTION

#define DECRYPTION

◆ DECRYPTION_KEY_SCHEDULE

#define DECRYPTION_KEY_SCHEDULE

◆ ENC_ROUND

#define ENC_ROUND   FOUR_TABLES

◆ ENC_UNROLL

#define ENC_UNROLL   FULL

◆ ENCRYPTION

#define ENCRYPTION

◆ ENCRYPTION_KEY_SCHEDULE

#define ENCRYPTION_KEY_SCHEDULE

◆ FAST_VARIABLE

#define FAST_VARIABLE

◆ FF_TABLES

#define FF_TABLES

◆ FFmulX

#define FFmulX (   x)    ((((x) & m2) << 1) ^ ((((x) & m1) >> 7) * BPOLY))

◆ FIXED_TABLES

#define FIXED_TABLES

◆ FL4_SET

#define FL4_SET

◆ FOUR_TABLES

#define FOUR_TABLES   4 /* DO NOT CHANGE */

◆ four_tables

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

◆ FT4_SET

#define FT4_SET

◆ FULL

#define FULL   2 /* DO NOT CHANGE */

◆ fwd_mcol

#define fwd_mcol (   x)    (f1 = (x), f2 = FFmulX(f1), f2 ^ upr(f1 ^ f2, 3) ^ upr(f1, 2) ^ upr(f1, 1))

◆ IL4_SET

#define IL4_SET

◆ IM4_SET

#define IM4_SET

◆ INTERNAL_BYTE_ORDER

#define INTERNAL_BYTE_ORDER   PLATFORM_BYTE_ORDER

◆ inv_mcol

#define inv_mcol (   x)    four_tables(x,im_tab,vf1,rf1,0)

◆ IT4_SET

#define IT4_SET

◆ KEY_SCHED

#define KEY_SCHED   FOUR_TABLES

◆ LAST_DEC_ROUND

#define LAST_DEC_ROUND   FOUR_TABLES

◆ LAST_ENC_ROUND

#define LAST_ENC_ROUND   FOUR_TABLES

◆ LS4_SET

#define LS4_SET

◆ ls_box

#define ls_box (   x,
 
)    four_tables(x,fl_tab,vf1,rf2,c)

◆ m1

#define m1   0x80808080

◆ m2

#define m2   0x7f7f7f7f

◆ nc

#define nc   (AES_BLOCK_SIZE >> 2)

◆ no_table

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

◆ NO_TABLES

#define NO_TABLES   0 /* DO NOT CHANGE */

◆ NONE

#define NONE   0 /* DO NOT CHANGE */

◆ ONE_TABLE

#define ONE_TABLE   1 /* DO NOT CHANGE */

◆ one_table

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

◆ PARTIAL

#define PARTIAL   1 /* DO NOT CHANGE */

◆ prefx

#define prefx   extern const

◆ RC_LENGTH

#define RC_LENGTH   5 * AES_BLOCK_SIZE / 4 - (AES_BLOCK_SIZE == 16 ? 10 : 11)

◆ rf1

#define rf1 (   r,
 
)    (r)

◆ rf2

#define rf2 (   r,
 
)    ((r-c)&3)

◆ s

#define s (   x,
 
)    x[c]

◆ SAFE_IO

#define SAFE_IO

◆ vf1

#define vf1 (   x,
  r,
 
)    (x)

◆ word_in

#define word_in (   x)    bytes2word((x)[0], (x)[1], (x)[2], (x)[3])

◆ word_out

#define word_out (   x,
 
)
Value:
{ (x)[0] = bval(v,0); (x)[1] = bval(v,1); \
(x)[2] = bval(v,2); (x)[3] = bval(v,3); }

◆ WPOLY

#define WPOLY   0x011b

Variable Documentation

◆ fl_tab

prefx aes_32t fl_tab[4][256]

◆ ft_tab

prefx aes_32t ft_tab[4][256]

◆ il_tab

prefx aes_32t il_tab[4][256]

◆ im_tab

prefx aes_32t im_tab[4][256]

◆ it_tab

prefx aes_32t it_tab[4][256]

◆ rcon_tab

prefx aes_32t rcon_tab[29]