[FFmpeg-devel] [RFC] AES init

Alex Beregszaszi alex
Sun May 13 16:27:38 CEST 2007


Hi,

Current AES tables init looks as follows:

if(!enc_multbl[4][1023]){

While the tables are defined as:

#ifdef CONFIG_SMALL
static uint32_t enc_multbl[1][256];
static uint32_t dec_multbl[1][256];
#else
static uint32_t enc_multbl[4][256];
static uint32_t dec_multbl[4][256];
#endif

That means [4][1023] is pointing to an invalid area in both case.

For my case, this caused AES to malfunction, the AES struct was not
inited (only the key's were there). This happened to me in GCC 4.0.3.

My change is as follows, introducing a bad static variable. Other
solution would be checking for enc_multbl[0][0] ? But than again, this
probably breaks with compilers not zeroing those variables (like VisualC
which sets them to 0xCC). I know some will shout that "broken compilers
are not supported".

--
Alex Beregszaszi

-------------- next part --------------
A non-text attachment was scrubbed...
Name: aes-init.diff
Type: text/x-patch
Size: 426 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20070513/3f6066d9/attachment.bin>



More information about the ffmpeg-devel mailing list