Thu Apr 28 2011 16:56:50

Asterisk developer's documentation


aesopt.h File Reference

#include "asterisk/aes.h"
#include "asterisk/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.

Defines

#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 BRG_BIG_ENDIAN   4321
#define BRG_LITTLE_ENDIAN   1234
#define brot(x, n)   (((aes_32t)(x) << n) | ((aes_32t)(x) >> (32 - n)))
#define d_1(t, n, b, v)   extern const t n[256]
#define d_4(t, n, b, v)   extern const t n[4][256]
#define dec_fmvars   aes_32t g2
#define dec_imvars   aes_32t g2, g4, g9
#define DEC_ROUND   FOUR_TABLES
#define DEC_UNROLL   FULL
#define ENC_ROUND   FOUR_TABLES
#define ENC_UNROLL   FULL
#define FF_TABLES
#define FIXED_TABLES
#define four_tables(x, tab, vf, rf, c)
#define FOUR_TABLES   4
#define FULL   2
#define fwd_mcol(x)   (g2 = gf_mulx(x), g2 ^ upr((x) ^ g2, 3) ^ upr((x), 2) ^ upr((x), 1))
#define gf_mulx(x)   ((((x) & m2) << 1) ^ ((((x) & m1) >> 7) * BPOLY))
#define inv_mcol(x)
#define KEY_SCHED   FOUR_TABLES
#define LAST_DEC_ROUND   FOUR_TABLES
#define LAST_ENC_ROUND   FOUR_TABLES
#define ls_box(x, c)   no_table(x,t_use(s,box),vf1,rf2,c)
#define m1   0x80808080
#define m2   0x7f7f7f7f
#define no_table(x, box, vf, rf, c)
#define NO_TABLES   0
#define NONE   0
#define ONE_TABLE   1
#define one_table(x, op, tab, vf, rf, c)
#define PARTIAL   1
#define RC_LENGTH   (5 * (AES_BLOCK_SIZE / 4 - 2))
#define rf1(r, c)   (r)
#define rf2(r, c)   ((8+r-c)&3)
#define s(x, c)   x[c]
#define SAFE_IO
#define t_dec(m, n)   t_##m##n
#define t_set(m, n)   t_##m##n
#define t_use(m, n)   t_##m##n
#define vf1(x, r, c)   (x)
#define word_in(x, c)
#define word_out(x, c, v)
#define WPOLY   0x011b

Functions

const aes_32t t_dec (r, c)[RC_LENGTH]

Define Documentation

#define aes_sw32 (   x)    ((brot((x),8) & 0x00ff00ff) | (brot((x),24) & 0xff00ff00))

Definition at line 250 of file aesopt.h.

#define ALGORITHM_BYTE_ORDER   PLATFORM_BYTE_ORDER

Definition at line 311 of file aesopt.h.

#define ARRAYS

Definition at line 384 of file aesopt.h.

#define BPOLY   0x1b

Definition at line 572 of file aesopt.h.

#define BRG_BIG_ENDIAN   4321

Definition at line 162 of file aesopt.h.

#define BRG_LITTLE_ENDIAN   1234

Definition at line 161 of file aesopt.h.

#define brot (   x,
 
)    (((aes_32t)(x) << n) | ((aes_32t)(x) >> (32 - n)))

Definition at line 249 of file aesopt.h.

#define d_1 (   t,
  n,
  b,
 
)    extern const t n[256]

Definition at line 949 of file aesopt.h.

#define d_4 (   t,
  n,
  b,
 
)    extern const t n[4][256]

Definition at line 950 of file aesopt.h.

#define dec_fmvars   aes_32t g2

Definition at line 692 of file aesopt.h.

#define dec_imvars   aes_32t g2, g4, g9

Definition at line 701 of file aesopt.h.

#define DEC_ROUND   FOUR_TABLES

Definition at line 464 of file aesopt.h.

#define DEC_UNROLL   FULL

Definition at line 360 of file aesopt.h.

#define ENC_ROUND   FOUR_TABLES

Definition at line 448 of file aesopt.h.

#define ENC_UNROLL   FULL

Definition at line 352 of file aesopt.h.

#define FF_TABLES

Definition at line 373 of file aesopt.h.

#define FIXED_TABLES

Definition at line 411 of file aesopt.h.

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

Definition at line 674 of file aesopt.h.

#define FOUR_TABLES   4

Definition at line 239 of file aesopt.h.

#define FULL   2

Definition at line 242 of file aesopt.h.

#define fwd_mcol (   x)    (g2 = gf_mulx(x), g2 ^ upr((x) ^ g2, 3) ^ upr((x), 2) ^ upr((x), 1))

Definition at line 693 of file aesopt.h.

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

Definition at line 578 of file aesopt.h.

#define inv_mcol (   x)
Value:
(g2 = gf_mulx(x), g4 = gf_mulx(g2), g9 = (x) ^ gf_mulx(g4), g4 ^= g9, \
                        (x) ^ g2 ^ g4 ^ upr(g2 ^ g9, 3) ^ upr(g4, 2) ^ upr(g9, 1))

Definition at line 702 of file aesopt.h.

#define KEY_SCHED   FOUR_TABLES

Definition at line 484 of file aesopt.h.

#define LAST_DEC_ROUND   FOUR_TABLES

Definition at line 472 of file aesopt.h.

#define LAST_ENC_ROUND   FOUR_TABLES

Definition at line 456 of file aesopt.h.

#define ls_box (   x,
 
)    no_table(x,t_use(s,box),vf1,rf2,c)

Definition at line 715 of file aesopt.h.

#define m1   0x80808080

Definition at line 576 of file aesopt.h.

Referenced by add_exten_to_pattern_tree(), sms_process(), and transtime().

#define m2   0x7f7f7f7f

Definition at line 577 of file aesopt.h.

Referenced by add_exten_to_pattern_tree().

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

Definition at line 662 of file aesopt.h.

#define NO_TABLES   0

Definition at line 237 of file aesopt.h.

#define NONE   0

Definition at line 240 of file aesopt.h.

#define ONE_TABLE   1

Definition at line 238 of file aesopt.h.

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

Definition at line 668 of file aesopt.h.

#define PARTIAL   1

Definition at line 241 of file aesopt.h.

#define RC_LENGTH   (5 * (AES_BLOCK_SIZE / 4 - 2))

Definition at line 493 of file aesopt.h.

#define rf1 (   r,
 
)    (r)

Definition at line 681 of file aesopt.h.

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

Definition at line 682 of file aesopt.h.

#define s (   x,
 
)    x[c]

Definition at line 399 of file aesopt.h.

Referenced by __ast_cli_register(), __ast_rtp_reload(), __ast_udptl_reload(), _macro_exec(), accept_thread(), acf_import(), add_sdp(), ael_token_subst(), agent_devicestate(), agent_request(), aji_send_exec(), aji_start_sasl(), aji_status_exec(), app_exec(), append_mailbox(), apply_options(), ast_dsp_digitreset(), ast_dsp_noise(), ast_dsp_silence(), ast_eid_to_str(), ast_filehelper(), ast_gethostbyname(), ast_lock_path_lockfile(), ast_ouraddrfor(), ast_playtones_start(), ast_say_number_full_ka(), ast_sched_del(), ast_sched_wait(), ast_sched_when(), ast_set_default_eid(), ast_skip_nonblanks(), ast_smoother_new(), ast_strip_quoted(), ast_stun_request(), ast_unescape_semicolon(), ast_unlock_path_flock(), ast_unlock_path_lockfile(), ast_uri_decode(), attempt_reconnect(), bc_state2str(), bridge_play_sounds(), build_secret(), CB_ADD_LEN(), check_auth(), check_day(), check_dow(), check_month(), check_tx_freq(), cli_console_dial(), cli_console_mute(), common_exec(), complete_dialplan_add_ignorepat(), complete_dialplan_add_include(), complete_dialplan_remove_extension(), complete_dialplan_remove_include(), complete_peer_helper(), connect_link(), console_dial(), console_mute(), create_client(), dahdi_call(), dahdi_request(), destroy_endpoint(), dundi_answer_entity(), dundi_answer_query(), dundi_eid_to_str_short(), dundi_prop_precache(), dundi_show_precache(), eatwhite(), exec_exec(), expr2_token_subst(), filterL(), filterM(), filterS(), find_closing_quote(), find_gtalk(), fn_wrapper(), forward_message(), function_enum(), function_ilink(), function_remote(), g726_open(), generic_http_callback(), get_csv(), get_filestream(), gtalk_request(), handle_cli_iax2_show_cache(), handle_request(), handle_response_peerpoke(), handle_showmaneventq(), handle_unload(), ibpdfilter(), ibpfilter(), ic706_pltocode(), ifthere(), init_logger_chain(), initreqprep(), is_float(), is_int(), is_prefix(), jb_reset(), jingle_request(), kenwood_pltocode(), launch_netscript(), listener(), mwi_event_cb(), notify_message(), numcpy(), ogg_vorbis_close(), ogg_vorbis_read(), ogg_vorbis_write(), parkandannounce_exec(), parse_args(), parse_config(), parse_moved_contact(), parse_options(), parse_register_contact(), pbx_builtin_execiftime(), pbx_builtin_gotoiftime(), pbx_builtin_importvar(), pbx_builtin_wait(), pbx_builtin_waitexten(), pbx_retrieve_variable(), phase_e_handler(), plc_init(), process_sdp_a_image(), prune_tone_zone(), pvalESwitchesAddSwitch(), pvalIncludesAddInclude(), pvalSwitchesAddSwitch(), pvt_destructor(), queue_set_param(), quit_handler(), rbi_pltocode(), read_samples(), readfile_exec(), real_ctx(), record_exec(), recordthread(), reload_config(), replace_macro_delimiter(), retreive_memory(), rpt(), rpt_do_lstats(), rpt_exec(), rpt_tele_thread(), rtp_socket(), sched_context_destroy(), sched_hash(), send_signaling(), send_sound(), session_do(), setrbi(), setrbi_check(), setrtx(), setrtx_check(), sip_prepare_socket(), skinny_hangup(), skinny_indicate(), skinny_register(), skinny_session(), skinny_set_rtp_peer(), sms_readfile(), store_config(), strlcat(), strlcpy(), strtoq(), threadinfo_locate_cb(), tone_zone_mark(), transmit_fake_auth_response(), transmit_response(), try_firmware(), tryexec_exec(), unistim_answer(), unistim_hangup(), unistim_indicate(), unistim_info(), unistim_register(), unistim_ss(), unload_module(), usb_list_check(), vasprintf(), vmauthenticate(), waitforring_exec(), wav_seek(), and wav_write().

#define SAFE_IO

Definition at line 337 of file aesopt.h.

#define t_dec (   m,
 
)    t_##m##n

Definition at line 764 of file aesopt.h.

#define t_set (   m,
 
)    t_##m##n

Definition at line 765 of file aesopt.h.

#define t_use (   m,
 
)    t_##m##n

Definition at line 766 of file aesopt.h.

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

Definition at line 680 of file aesopt.h.

#define word_in (   x,
 
)
Value:
bytes2word(((aes_08t*)(x)+4*c)[0], ((aes_08t*)(x)+4*c)[1], \
                                   ((aes_08t*)(x)+4*c)[2], ((aes_08t*)(x)+4*c)[3])

Definition at line 552 of file aesopt.h.

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

Definition at line 554 of file aesopt.h.

#define WPOLY   0x011b

Definition at line 571 of file aesopt.h.


Function Documentation

const aes_32t t_dec ( ,
 
)